自己的项目需要做一个图片浏览效果,滑动到当前图片,则放大,其余都缩小。虽然Gallery已经过时了,但是以前一直没有使用过,所以特地尝试一下。后续还打算使用ViewPager,还有RecyclerView实现一把。
先上个效果图
布局代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TestActivity">
<Gallery
android:id="@+id/gallery"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animationDuration="2000"
and