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


Java Items.add方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: createItems

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
private List<?> createItems() {
    Items items = new Items();
    for (int i = index; i < index + 20; i++) {
        TextItem textItem = new TextItem("world no." + i);
        items.add(textItem);
    }
    index += items.size();
    return items;
}
 
开发者ID:yangjiantao,项目名称:AndroidUiKit,代码行数:10,代码来源:TestRefreshViewActivity.java

示例5: onItemsCreated

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
protected void onItemsCreated(@NonNull Items items) {
    items.add(new Category("介绍"));
    items.add(new Card(getString(R.string.card_content)));

    items.add(new Category("Developers"));
    items.add(new Contributor(R.mipmap.avatar_plusend, "plusend", "Android Developer",
        "https://github.com/plusend"));

    items.add(new Category("Open Source Licenses"));
    items.add(new License("MultiType", "drakeet", License.APACHE_2,
        "https://github.com/drakeet/MultiType"));
    items.add(new License("about-page", "drakeet", License.APACHE_2,
        "https://github.com/drakeet/about-page"));
    items.add(new License("butterknife", "JakeWharton", License.APACHE_2,
        "https://github.com/JakeWharton/butterknife"));
    items.add(
        new License("gson", "google", License.APACHE_2, "https://github.com/google/gson"));
    items.add(new License("glide", "bumptech", License.APACHE_2,
        "https://github.com/bumptech/glide"));
    items.add(new License("retrofit", "square", License.APACHE_2,
        "https://github.com/square/retrofit"));
    items.add(new License("eventbus", "greenrobot", License.APACHE_2,
        "https://github.com/greenrobot/EventBus"));
    items.add(new License("PhotoView", "chrisbanes", License.APACHE_2,
        "https://github.com/chrisbanes/PhotoView"));
    items.add(new License("BGASwipeBackLayout-Android", "bingoogolapple", License.APACHE_2,
        "https://github.com/bingoogolapple/BGASwipeBackLayout-Android"));
    items.add(new License("StatusBarUtil", "laobie", License.APACHE_2,
        "https://github.com/laobie/StatusBarUtil"));
}
 
开发者ID:plusend,项目名称:DiyCode,代码行数:31,代码来源:AboutActivity.java

示例6: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(List<?> list) {
    Items newItems = new Items();
    newItems.add(WendaContentHeaderBean);
    newItems.addAll(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:12,代码来源:WendaContentFragment.java

示例7: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(List<?> list) {
    Items newItems = new Items(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    recyclerView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:11,代码来源:WendaDetailFragment.java

示例8: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(List<?> list) {
    Items newItems = new Items(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    recyclerView.stopScroll();
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:11,代码来源:WendaArticleView.java

示例9: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(final List<?> list) {
    Items newItems = new Items();
    newItems.add(jokeCommentHeaderBean);
    newItems.addAll(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    recyclerView.stopScroll();
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:13,代码来源:JokeCommentFragment.java

示例10: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(final List<?> list) {
    Items newItems = new Items(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    recyclerView.stopScroll();
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:11,代码来源:NewsCommentFragment.java

示例11: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(final List<?> list) {
    Items newItems = new Items(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    /**
     * https://medium.com/@hanru.yeh/recyclerview-and-appbarlayout-behavior-changed-in-v26-0-x-d9eb4de78fc0
     * support libraries v26 增加了 RV 惯性滑动,当 root layout 使用了 AppBarLayout Behavior 就会自动生效
     * 因此需要手动停止滑动
     */
    recyclerView.stopScroll();
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:16,代码来源:NewsArticleView.java

示例12: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(List<?> list) {
    Items newItems = new Items();
    newItems.add(dataBean);
    newItems.addAll(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(oldItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
    recyclerView.stopScroll();
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:13,代码来源:MediaArticleFragment.java

示例13: onSetAdapter

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
public void onSetAdapter(final List<?> list) {
    Items newItems = new Items();
    newItems.add(dataBean);
    newItems.addAll(list);
    newItems.add(new LoadingBean());
    DiffCallback.create(newItems, newItems, adapter);
    oldItems.clear();
    oldItems.addAll(newItems);
    canLoadMore = true;
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:12,代码来源:VideoContentActivity.java

示例14: checkLoadMoreItem

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
private void checkLoadMoreItem(Items tempItems) {
    //有数据就表示已添加
    if (getItemCount() <= 0) {
        tempItems.add(loadMoreItem);
    }
}
 
开发者ID:yangjiantao,项目名称:AndroidUiKit,代码行数:7,代码来源:MultiTypeLoadMoreAdapter.java

示例15: onItemsCreated

import me.drakeet.multitype.Items; //导入方法依赖的package包/类
@Override
protected void onItemsCreated(@NonNull Items items) {
    if (!event.getDescription().equals("")) {
        items.add(new Card(null, event.getDescription(), null));
        items.add(new Line());
    }
    if (!event.getLocation().equals("")) {
        //items.add(new Category("Location"));

        SimpleDateFormat sdf1 = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
        SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yy \t\t HH:mm");
        SimpleDateFormat sdf3 = new SimpleDateFormat("HH:mm");
        try {
            Date startTime = sdf1.parse(event.getStartTime());
            Date endTime = sdf1.parse(event.getEndTime());
            items.add(new Contact(R.drawable.ic_map, event.getLocation(), sdf2.format(startTime)
                    + " - " + sdf3.format(endTime)));
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }

        items.add(new Line());
    }
    if (!event.getRules().equals("")) {
        //items.add(new Category("Rules"));
        items.add(new Card("Info / Rules", event.getRules(), null));
        items.add(new Line());
    }
    /*if (!event.getInfo().equals("")) {
        //items.add(new Category("Info"));
        items.add(new Card("Info", event.getInfo(), null));
        items.add(new Line());
    }*/
    if (!event.getContact1().equals("")) {
        //items.add(new Category("Contact"));
        items.add(new Contact(R.drawable.ic_call, event.getContact1().split(":")[0],
                event.getContact1().split(":")[1]));
    }
    if (!event.getContact2().equals("")) {
        items.add(new Contact(R.drawable.ic_call, event.getContact2().split(":")[0],
                event.getContact2().split(":")[1]));
    }
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:44,代码来源:EventDetailActivity.java


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