当前位置: 首页>>代码示例>>Java>>正文


Java Items类代码示例

本文整理汇总了Java中me.drakeet.multitype.Items的典型用法代码示例。如果您正苦于以下问题:Java Items类的具体用法?Java Items怎么用?Java Items使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Items类属于me.drakeet.multitype包,在下文中一共展示了Items类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initRecyclerView

import me.drakeet.multitype.Items; //导入依赖的package包/类
private void initRecyclerView(final View view) {
    mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    mAdapter = new MultiTypeAdapter();
    mAdapter.register(HomeTopPager.class, new HomeTopPagerBinder());
    mAdapter.register(LongButton.class, new LongButtonBinder(getActivity()));
    mAdapter.register(Line.class, new GreyLineBinder());
    mAdapter.register(GreyArea.class, new GreyAreaBinder());
    mAdapter.register(Banner.class, new BannerBinder(getActivity()));
    mAdapter.register(TextHeader.class, new TextHeaderBinder(TextHeaderBinder.FLAG_HOME));
    mAdapter.register(HomeItem.class, new HomeItemBinder(getActivity()));
    mAdapter.register(HomeItemCollection.class, new HomeItemCollectionBinder(getActivity()));

    mItems = new Items();
    mAdapter.setItems(mItems);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:18,代码来源:HomeFragment.java

示例2: initRecyclerView

import me.drakeet.multitype.Items; //导入依赖的package包/类
private void initRecyclerView(View view) {
    mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    mAdapter = new MultiTypeAdapter();
    mAdapter.register(HomeItem.class, new HomeItemBinder(getActivity()));
    mAdapter.register(FoundCategoryDetailCollection.class, new FoundCategoryDetailCollectionBinder(getChildFragmentManager(), getActivity()));
    mAdapter.register(Line.class, new GreyLineBinder());
    mAdapter.register(GreyArea.class, new GreyAreaBinder());
    mAdapter.register(TextHeader.class, new TextHeaderBinder(TextHeaderBinder.FLAG_FOUND));
    mAdapter.register(EndArea.class, new EndAreaBinder(EndAreaBinder.FLAG_TEXT_COLOR_BLACK));
    mAdapter.register(AuthorCollectionItem.class, new AuthorCollectionItemBinder(getActivity()));

    mItems = new Items();
    mAdapter.setItems(mItems);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:17,代码来源:CategoryViewPagerFragment.java

示例3: initRecyclerView

import me.drakeet.multitype.Items; //导入依赖的package包/类
private void initRecyclerView() {
    mAdapter = new MultiTypeAdapter();
    mAdapter.register(Banner.class, new FoundBannerBinder());
    mAdapter.register(TextHeader.class, new TextHeaderBinder(TextHeaderBinder.FLAG_FOUND));
    mAdapter.register(HomeItem.class, new HomeItemBinder(getActivity()));
    mAdapter.register(GreyArea.class, new GreyAreaBinder());
    mAdapter.register(CollectionItem.class, new SquareCardCollectionBinder(getActivity()));
    mAdapter.register(Line.class, new GreyLineBinder());
    mAdapter.register(FoundCategorySubjectItem.class, new FoundCategorySubjectItemBinder(getChildFragmentManager(), getActivity()));
    mAdapter.register(FoundCategoryItem.class, new FoundCategoryItemBinder(getActivity()));
    mAdapter.register(EndArea.class, new EndAreaBinder(EndAreaBinder.FLAG_TEXT_COLOR_BLACK));
    mAdapter.register(LeftAlignTextHeader.class, new LeftAlignTextHeaderBinder());
    mAdapter.register(AuthorCard.class, new AuthorCardBinder(getActivity()));
    mAdapter.register(AuthorCollectionItem.class, new AuthorCollectionItemBinder(getActivity()));

    mItems = new Items();
    mAdapter.setItems(mItems);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:21,代码来源:FoundViewPagerFragment.java

示例4: initRecyclerView

import me.drakeet.multitype.Items; //导入依赖的package包/类
private void initRecyclerView(View view) {
    mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    mAdapter = new MultiTypeAdapter();
    mAdapter.register(Line.class, new GreyLineBinder());
    mAdapter.register(GreyArea.class, new GreyAreaBinder());
    mAdapter.register(TextHeader.class, new TextHeaderBinder(TextHeaderBinder.FLAG_FOUND));
    mAdapter.register(EndArea.class, new EndAreaBinder(EndAreaBinder.FLAG_TEXT_COLOR_BLACK));
    mAdapter.register(FoundCategoryDetailCollection.class, new FoundCategoryDetailCollectionBinder(getChildFragmentManager(), getActivity()));
    mAdapter.register(AuthorCollectionItem.class, new AuthorCollectionItemBinder(getActivity()));
    mAdapter.register(MovieDetailRelateItem.class, new MovieDetailRelateItemBinder(getActivity(), MovieDetailRelateItemBinder.FLAG_BLACK_WORD_COLOR));

    mItems = new Items();
    mAdapter.setItems(mItems);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:17,代码来源:AuthorViewPagerFragment.java

示例5: onCreate

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_movie_detail);
    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();
    mData = bundle.getParcelable("DATA");
    mItems = new Items();
    mBackgroundImageView = (ImageView) findViewById(R.id.background);
    mPlayer = (StandardGSYVideoPlayer) findViewById(R.id.video_view);
    mRecyclerView = (RecyclerView) findViewById(R.id.movie_recycler_view);
    mRelatedDatas = RetrofitFactory.getRetrofit().createApi(RelateListApi.class);

    initVideoPlayer();
    initRecycler();
    loadData();
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:18,代码来源:MovieDetailActivity.java

示例6: pareData

import me.drakeet.multitype.Items; //导入依赖的package包/类
/**
 * Group the data by time
 */
private Items pareData(List<Android> androids) {
    String time1 = AppUtils.timeString(androids.get(0).time);//存储第一条数据的时间
    if (!time1.equals(time2))//当第二页数据传过来时,第一页最后一个数据的时间和第二页第一条数据的时间不相等时
        items.add(new Category(time1));//add 时间,说明当前页的第一条数据的时间可以作为一个新的Header
    for (int i = 0; i < androids.size(); i++) {
        items.add(androids.get(i));//add 内容
        if (i < androids.size() - 1)
            time2 = AppUtils.timeString(androids.get(i + 1).time);
        if (!time1.equals(time2)) {
            items.add(new Category(time2));
            time1 = time2;
        }
    }
    return items;
}
 
开发者ID:Shuanghua,项目名称:LikeGank,代码行数:19,代码来源:AndroidPresenter.java

示例7: pareData

import me.drakeet.multitype.Items; //导入依赖的package包/类
/**
 * Group the data by time
 */
private Items pareData(List<IOS> ioss) {
    String time1 = AppUtils.timeString(ioss.get(0).time);//存储第一条数据的时间
    if (!time1.equals(time2))//当第二页数据传过来时,第一页最后一个数据的时间和第二页第一条数据的时间不相等时
        items.add(new Category(time1));//add 时间,说明当前页的第一条数据的时间可以作为一个新的Header
    for (int i = 0; i < ioss.size(); i++) {
        items.add(ioss.get(i));//add 内容
        if (i < ioss.size() - 1)
            time2 = AppUtils.timeString(ioss.get(i + 1).time);
        if (!time1.equals(time2)) {
            items.add(new Category(time2));
            time1 = time2;
        }
    }
    return items;
}
 
开发者ID:Shuanghua,项目名称:LikeGank,代码行数:19,代码来源:IOSPresenter.java

示例8: onSetAdapter

import me.drakeet.multitype.Items; //导入依赖的package包/类
public void onSetAdapter(final List<PostsListBean> list) {
    Items newItems = new Items(list);
    newItems.add(new FooterBean());

    DiffCallback.create(mOldItems, newItems, mAdapter);
    mOldItems.clear();
    mOldItems.addAll(newItems);

    mCanloadmore = true;

    mRecyclerView.addOnScrollListener(new OnLoadMoreListener() {
        @Override
        public void onLoadMore() {
            if (mCanloadmore) {
                mCanloadmore = false;
                mModel.loadMore();
            }
        }
    });
}
 
开发者ID:iMeiji,项目名称:Daily,代码行数:21,代码来源:PostsListView.java

示例9: addData

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
public void addData(MultiTypeAdapter adapter, List<Card> cards) {
    Items items = items();
    for (int index = 0; index < cards.size(); index++) {
        final Card card = cards.get(index);
        if (card.type.equals(MUSIC)) {
            items.add(new Music(card, index, adapter, cards, showPlus()));
        } else if (card.type.equals(VIDEO)) {
            items.add(new Video(card, index, adapter, cards, showPlus()));
        } else if (card.type.equals(WEB)) {
            items.add(new Web(card, index, adapter, cards, showPlus()));
        } else if (card.type.equals(COVER_WEB)) {
            items.add(new Web(card, index, adapter, cards, showPlus()));
        } else if (card.type.equals(PICTURE)) {
            items.add(new Picture(card, index, adapter, cards, showPlus()));
        }
    }
    if (cards.size() > 0) {
        items.add(new Footer());
    } else {
        items.add(new EmptyChannel());
    }
    adapter.notifyDataSetChanged();
}
 
开发者ID:oxoooo,项目名称:excited-android,代码行数:25,代码来源:DataObserver.java

示例10: onShowNoMore

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
public void onShowNoMore() {
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if (oldItems.size() > 0) {
                Items newItems = new Items(oldItems);
                newItems.remove(newItems.size() - 1);
                newItems.add(new LoadingEndBean());
                adapter.setItems(newItems);
                adapter.notifyDataSetChanged();
            } else if (oldItems.size() == 0) {
                oldItems.add(new LoadingEndBean());
                adapter.setItems(oldItems);
                adapter.notifyDataSetChanged();
            }
            canLoadMore = false;
        }
    });
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:21,代码来源:BaseListFragment.java

示例11: onShowNoMore

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
public void onShowNoMore() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if (oldItems.size() > 1) {
                Items newItems = new Items(oldItems);
                newItems.remove(newItems.size() - 1);
                newItems.add(new LoadingEndBean());
                adapter.setItems(newItems);
                adapter.notifyDataSetChanged();
            } else if (oldItems.size() == 0) {
                oldItems.add(new LoadingEndBean());
                adapter.setItems(oldItems);
                adapter.notifyDataSetChanged();
            }
            canLoadMore = false;
        }
    });
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:21,代码来源:VideoContentActivity.java

示例12: onCreate

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    items = new Items();
    adapter = new MultiTypeAdapter(items);
    refreshDelegate = new SwipeRefreshDelegate(this);
    loadMoreDelegate = new LoadMoreDelegate(this);
    loadingCount = new AtomicInteger(0);
}
 
开发者ID:drakeet,项目名称:rebase-android,代码行数:10,代码来源:ListBaseFragment.java

示例13: onItemsCreated

import me.drakeet.multitype.Items; //导入依赖的package包/类
@SuppressWarnings("SpellCheckingInspection")
@Override
protected void onItemsCreated(@NonNull Items items) {
    share = getString(R.string.share);
    // @formatter:off

    items.add(new Category("Developers"));
    items.add(new Contributor(R.drawable.avatar_drakeet, "drakeet", "客户端开发、服务端开发和设计师"));
    items.add(new Line());

    items.add(new Category("关于日常..."));
    items.add(new Card(getString(R.string.card_app), share));
    items.add(new Line());

    items.add(new Category("关于 Rebase..."));
    items.add(new Card(getString(R.string.card_story), share));
    items.add(new Line());

    items.add(new Category("Open Source Licenses"));
    items.add(new License("MultiType", "drakeet", License.APACHE_2, github("drakeet/MultiType")));
    items.add(new License("about-page", "drakeet", License.APACHE_2, github("drakeet/about-page")));
    items.add(new License("NumberProgressbar", "daimajia", License.MIT, github("daimajia/NumberProgressBar")));
    items.add(new License("RxJava", "RxJava Contributors", License.APACHE_2, github("ReactiveX/RxJava")));
    items.add(new License("retrofit", "Square Inc", License.APACHE_2, github("square/retrofit")));
    items.add(new License("okhttp", "Square Inc", License.APACHE_2, github("square/okhttp")));
    items.add(new License("gson", "Google Inc", License.APACHE_2, github("google/gson")));
    items.add(new License("android support libs", "AOSP", License.APACHE_2, "https://source.android.com/"));
    items.add(new License("butterknife", "Jake Wharton", License.APACHE_2, github("JakeWharton/butterknife")));
    items.add(new License("glide", "Sam Judd", "BSD, part MIT and Apache 2.0", github("bumptech/glide")));
    items.add(new License("RxAndroid", "RxAndroid authors", License.APACHE_2, github("ReactiveX/RxAndroid")));
    items.add(new License("objectify", "ionull", "All Rights Reserved", github("ionull/objectify")));
    items.add(new License("CircleImageView", "Henning Dodenhof", License.APACHE_2, github("hdodenhof/CircleImageView")));
    items.add(new License("prettytime", "ocpsoft", License.APACHE_2, github("ocpsoft/prettytime")));
    items.add(new License("RxLifecycle", "Trello", License.APACHE_2, github("trello/RxLifecycle")));
    items.add(new License("android-lite-orm", "litesuits", License.APACHE_2, github("litesuits/android-lite-orm")));

    // @formatter:on
}
 
开发者ID:drakeet,项目名称:rebase-android,代码行数:39,代码来源:AboutActivity.java

示例14: onPostExecute

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
protected void onPostExecute (List<RegisteredApplication> list) {
    int start = mAdapter.getItemCount();
    Items items = new Items(mAdapter.getItems());
    items.addAll(list);
    mAdapter.setItems(items);
    mAdapter.notifyItemRangeInserted(start, list.size());
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:9,代码来源:RegisteredApplicationFragment.java

示例15: onPostExecute

import me.drakeet.multitype.Items; //导入依赖的package包/类
@Override
protected void onPostExecute (List<Event> list) {
    int start = mAdapter.getItemCount();
    Items items = new Items(mAdapter.getItems());
    items.addAll(list);
    mAdapter.setItems(items);
    mAdapter.notifyItemRangeInserted(start, list.size());
    mLoadPage = mTargetPage;
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:10,代码来源:EventFragment.java


注:本文中的me.drakeet.multitype.Items类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。