帮酷LOGO
  • 显示原文与译文双语对照的内容
文章标签:控制  Controls  bea  viewpager  Viewpage  Swipe  VIEW  
A different beautiful ViewPager, with quick swipe controls

  • 源代码名称:HollyViewPager
  • 源代码网址:http://www.github.com/florent37/HollyViewPager
  • HollyViewPager源代码文档
  • HollyViewPager源代码下载
  • Git URL:
    git://www.github.com/florent37/HollyViewPager.git
  • Git Clone代码到本地:
    git clone http://www.github.com/florent37/HollyViewPager
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/florent37/HollyViewPager
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
  • HollyViewPager

    Android Arsenal

    Android app on Google Play

    screen

    screen

    Android app on Google Play用法

    在布局中添加 HollyViewPager

    <com.github.florent37.hollyviewpager.HollyViewPager
     android:id="@+id/hollyViewPager"android:layout_width="match_parent"android:layout_height="match_parent"app:hvp_headerHeight="150dp"/>
    HollyViewPager hollyViewPager = findViewById(R.id.hollyViewPager);
    hollyViewPager.setAdapter(...);
    hollyViewPager.setConfigurator(newHollyViewPagerConfigurator() {
     @OverridepublicfloatgetHeightPercentForPage(intpage) {
     returnPERCENT;
     }
     });

    如果页面应该包含一个recyclerview或者一个 ObservableScrollView

    RecyclerView
    HollyViewPagerBus.registerRecyclerView(getActivity(), recyclerView);

    适配器

    protectedstaticfinalintTYPE_HEADER=0;
     protectedstaticfinalintTYPE_CELL=1;
     @Overridepublicint getItemViewType(int position) {
     switch (position){
     case0:returnTYPE_HEADER;
     default:returnTYPE_CELL;
     }
     }
     @OverridepublicRecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
     View view;
     switch (type){
     caseTYPE_HEADER:newRecyclerView.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.hvp_header_placeholder,viewGroup,false)) {};
     break;
     default:...YOUR_VIEW...break;
     }
     }
    ScrollView
    HollyViewPagerBus.registerScrollView(getActivity(), scrollView);
    <com.github.ksoichiro.android.observablescrollview.ObservableScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/scrollView"android:layout_width="match_parent"android:layout_height="match_parent"android:scrollbars="none">
     <LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical">
     <includelayout="@layout/hvp_header_placeholder"/>
    . . . YOUR CONTENT.. .
    下载

    Buy Me a Coffee at ko-fi.com

    在模块Download

    compile 'com.github.florent37:hollyviewpager:1.0.1'compile 'com.github.ksoichiro:android-observablescrollview:1.5.2'
    Credits

    作者:Florent Champigny http://www.florentchampigny.com/

    Android app on Google PlayFollow me on Google+Follow me on TwitterFollow me on LinkedIn

    许可证

    Copyright 2015 florent37, Inc.
    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.


    文章标签:控制  VIEW  bea  Controls  Swipe  viewpager  Viewpage  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语