Giter Site home page Giter Site logo

msoftware / slidingcard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mxn21/slidingcard

0.0 2.0 0.0 9.69 MB

Sliding cards with pretty gallery effects.

Home Page: http://android-arsenal.com/details/1/2355

License: Apache License 2.0

Java 100.00%

slidingcard's Introduction

SlidingCard Android Arsenal

Showcase

Sliding cards with pretty gallery effects. 漂亮的卡片滑动翻页特效。

1.5版本更新 2015.8.12

解决了滑动过快导致最后一张加载没有显示的bug。 加入了一个全局变量 public static boolean sScrolling = false ;来记录全局滑动状态, 在滑动过程中去掉其他卡片的监听,滑动之后再加入监听。

1.4版本更新 2015.8.9

优化滑动动画流畅性,图片可以根据手势旋转。

1.3版本更新 2015.8.5

支持自定义多张照片.可支持任意张照片,但是一次只会显示最前面的三张,随着滑动翻页,依次向后加载,加载完毕后循环从第一张加载。

1.2版本更新 2015.8.5

修复了左滑和右滑图片出现BUG的问题.

1.1版本更新 2015.7.18

解决了锯齿问题。

在SlidingCard的dispatchDraw方法中加入以下代码:

        PaintFlagsDrawFilter pfd = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint
        				.FILTER_BITMAP_FLAG);
        		canvas.setDrawFilter(pfd);

同时加入自定义控件SmoothImageView代替ImageView。在初始化时关闭view级别硬件加速(3.0以后版本有效)。 由于硬件加速并不支持所有的2D图形绘制操作,因此对于自定义的View和绘制调用来说,会造成影响。 对于这个问题,通常是对那些不可见的元素进行了异常或错误的像素渲染。为了避免这种问题,需要关闭硬件加速。

 if(android.os.Build.VERSION.SDK_INT>=11)
        {
            setLayerType(LAYER_TYPE_SOFTWARE, null);
        }

以上两个步骤缺一不可。

1.0版本更新 2015.6.29

支持三张照片展示,手势滑动等。

需要改进的地方:

1、抗锯齿(做了基本优化,还需改进)

2、支持自定义多张照片

3、滑动动画流畅性需要优化

4、同时左滑和右滑会有bug

5、滑动过快导致最后一张加载没有显示

6、内存优化

License

Copyright 2015 soul.mxn

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

slidingcard's People

Contributors

mxn21 avatar

Watchers

Michael jentsch avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.