Android开源:ExpandableViewpager - 可以展开缩放的 Viewpager

CorChilders 8年前
   <p>这是很酷一个可以展开,缩小的Viewpager。</p>    <p style="text-align:center"><img src="https://simg.open-open.com/show/77b0d5da1881b0ce7700f6f28ea7a90f.gif"></p>    <h2>使用</h2>    <p>在gradle添加依赖</p>    <pre>  <code class="language-java">allprojects {          repositories {              ...              maven { url 'https://jitpack.io' }          }      }        dependencies {              compile 'com.github.githubwing:ExpandableViewpager:1.0.0'      }</code></pre>    <p>其次将ExpandableViewpager添加到布局。</p>    <p>ExpandViewPager提供了Viewpager常用方法以外。还有几个额外的方法:</p>    <pre>  <code class="language-java">//设置背景布局   mViewpager.setBackgroundView(int resId);     //设置最小高度   mViewpager.setMinHeight(int height);    //设置展开关闭监听器  mViewpager.setOnStateChangedListener(OnStateChangedListener listener);    //展开以及缩小  mViewpager.expand();  mViewpager.collaps();</code></pre>    <h2>License</h2>    <pre>  <code class="language-java">Copyright 2016 androidwing1992    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.</code></pre>    <p> </p>    <p> </p>