• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SectionedRecyclerViewAdapter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_pager_schedules, container, false);
    if (day.getSchedules().isEmpty()) return view;

    SectionedRecyclerViewAdapter sectionAdapter = new SectionedRecyclerViewAdapter();

    for (Map.Entry<String, List<Class>> entry : day.getSchedules().entrySet())
        sectionAdapter.addSection(new ClassSection(entry.getKey(), new ArrayList<>(entry.getValue())));

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:linklux,项目名称:android-schedules,代码行数:17,代码来源:DayViewPagerFragment.java


示例2: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_session, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();


    for(char alphabet = 'A'; alphabet <= 'Z';alphabet++) {
        List<String> contacts = getContactsWithLetter(alphabet);

        if (contacts.size() > 0) {
            sectionAdapter.addSection(new ContactsSection(String.valueOf(alphabet), contacts));
        }
    }

    //RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    //recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    //recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:fllodrab,项目名称:MeasureAppS,代码行数:23,代码来源:Session.java


示例3: showSessionLastSession

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
private void showSessionLastSession(Intent intent) throws JSONException {
    JSONObject jsonNotes = new JSONObject(intent.getStringExtra("notes"));

    // Create an instance of SectionedRecyclerViewAdapter
    SectionedRecyclerViewAdapter sectionAdapter = new SectionedRecyclerViewAdapter();

    //EXAMPLE
    List<String> messages = Arrays.asList(jsonNotes.getString("rankingTitle"), jsonNotes.getString("app1"), jsonNotes.getString("app2"), jsonNotes.getString("app3"), jsonNotes.getString("app4"));

    // Create your sections with the list of data you got from your API
    MySection data1Section = new MySection("Última Comparación", messages);

    // Add your Sections
    sectionAdapter.addSection(data1Section);

    // Set up your RecyclerView with the SectionedRecyclerViewAdapter
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.sessionList);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);
}
 
开发者ID:fllodrab,项目名称:MeasureAppS,代码行数:21,代码来源:MainActivity.java


示例4: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex2, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();

    sectionAdapter.addSection(new NewsSection(NewsSection.WORLD));
    sectionAdapter.addSection(new NewsSection(NewsSection.BUSINESS));
    sectionAdapter.addSection(new NewsSection(NewsSection.TECHNOLOGY));
    sectionAdapter.addSection(new NewsSection(NewsSection.SPORTS));

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:19,代码来源:Example2Fragment.java


示例5: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex7, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();

    for(char alphabet = 'A'; alphabet <= 'Z';alphabet++) {
        List<String> contacts = getContactsWithLetter(alphabet);

        if (contacts.size() > 0) {
            ContactsSection contactsSection = new ContactsSection(String.valueOf(alphabet), contacts);
            sectionAdapter.addSection(contactsSection);
        }
    }

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:23,代码来源:Example7Fragment.java


示例6: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex1, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();


    for(char alphabet = 'A'; alphabet <= 'Z';alphabet++) {
        List<String> contacts = getContactsWithLetter(alphabet);

        if (contacts.size() > 0) {
            sectionAdapter.addSection(new ContactsSection(String.valueOf(alphabet), contacts));
        }
    }

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:23,代码来源:Example1Fragment.java


示例7: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex4, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();


    for(char alphabet = 'A'; alphabet <= 'Z';alphabet++) {
        List<String> contacts = getContactsWithLetter(alphabet);

        if (contacts.size() > 0) {
            sectionAdapter.addSection(new ExpandableContactsSection(String.valueOf(alphabet), contacts));
        }
    }

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:23,代码来源:Example4Fragment.java


示例8: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_pager_schedules, container, false);
    if (mClasses.isEmpty()) return view;

    SectionedRecyclerViewAdapter sectionAdapter = new SectionedRecyclerViewAdapter();
    List<Class> classes = new ArrayList<>();

    Date dateLimit = DateUtil.getWeekStart(mClasses.get(0).getTimeStart(), displayWeeks);
    String curDay = DateUtil.getScheduleDay(mClasses.get(0).getTimeStart());

    int i = 0;
    while (i < mClasses.size() - 1 && mClasses.get(i).getTimeStart().before(dateLimit)) {
        Class cls = mClasses.get(i);
        String day = DateUtil.getScheduleDay(cls.getTimeStart());

        if (!day.equals(curDay)) {
            sectionAdapter.addSection(new ClassSection(curDay, new ArrayList<>(classes)));
            classes.clear();

            curDay = day;
        }

        classes.add(cls);
        i++;
    }

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:linklux,项目名称:android-schedules,代码行数:34,代码来源:ScheduleViewPagerFragment.java


示例9: onCreate

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstance){
    super.onCreate(savedInstance);
    setHasOptionsMenu(true);
    setRetainInstance(true);
    ((App)getActivity().getApplication()).getComponent().inject(this);
    adapter = new SectionedRecyclerViewAdapter();
    task = new Task();

    taskList = calenderPresenter.getNormalTasks();
    Log.d(TAG, "Reading from database");

    int numberOfDaysPref = preferences.getDaysSection();

    todayCalender = Calendar.getInstance();
    taskCalender = Calendar.getInstance();

    int currentDay = todayCalender.get(Calendar.DAY_OF_WEEK);
    switch (numberOfDaysPref){
        case 0:
            daysSectionValue = 3;
            break;
        case 1:
            daysSectionValue = 5;
            break;
        case 2:
            daysSectionValue = 7;
            break;
    }
    getTaskList = new GetTaskList(numberOfDaysPref, taskList);
    populateDayStrings();
}
 
开发者ID:aumarbello,项目名称:Tasks,代码行数:33,代码来源:TaskListFragment.java


示例10: HeaderRecyclerViewSection

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
HeaderRecyclerViewSection(Activity activity, String title, String[] mUrls, SectionedRecyclerViewAdapter sectionedRecyclerViewAdapter, int gridNumber) {
    super(R.layout.header_layout, R.layout.media_item);

    this.title = title;
    this.mUrls = mUrls;
    this.activity = activity;
    this.sectionedRecyclerViewAdapter = sectionedRecyclerViewAdapter;
    this.gridNumber = gridNumber;
}
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:10,代码来源:HeaderRecyclerViewSection.java


示例11: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex3, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();

    NewsSection worldNews = new NewsSection(NewsSection.WORLD);
    NewsSection bizNews = new NewsSection(NewsSection.BUSINESS);
    NewsSection techNews = new NewsSection(NewsSection.TECHNOLOGY);
    NewsSection sportsNews = new NewsSection(NewsSection.SPORTS);

    sectionAdapter.addSection(worldNews);
    sectionAdapter.addSection(bizNews);
    sectionAdapter.addSection(techNews);
    sectionAdapter.addSection(sportsNews);

    loadNews(worldNews);
    loadNews(bizNews);
    loadNews(techNews);
    loadNews(sportsNews);

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:29,代码来源:Example3Fragment.java


示例12: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex6, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();

    sectionAdapter.addSection(new ExpandableMovieSection(getString(R.string.top_rated_movies_topic), getTopRatedMoviesList()));
    sectionAdapter.addSection(new ExpandableMovieSection(getString(R.string.most_popular_movies_topic), getMostPopularMoviesList()));

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);

    GridLayoutManager glm = new GridLayoutManager(getContext(), 2);
    glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            switch(sectionAdapter.getSectionItemViewType(position)) {
                case SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER:
                    return 2;
                default:
                    return 1;
            }
        }
    });
    recyclerView.setLayoutManager(glm);
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:30,代码来源:Example6Fragment.java


示例13: onCreateView

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_ex5, container, false);

    sectionAdapter = new SectionedRecyclerViewAdapter();

    sectionAdapter.addSection(new MovieSection(getString(R.string.top_rated_movies_topic), getTopRatedMoviesList()));
    sectionAdapter.addSection(new MovieSection(getString(R.string.most_popular_movies_topic), getMostPopularMoviesList()));

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);

    GridLayoutManager glm = new GridLayoutManager(getContext(), 2);
    glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            switch(sectionAdapter.getSectionItemViewType(position)) {
                case SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER:
                    return 2;
                default:
                    return 1;
            }
        }
    });
    recyclerView.setLayoutManager(glm);
    recyclerView.setAdapter(sectionAdapter);

    return view;
}
 
开发者ID:luizgrp,项目名称:SectionedRecyclerViewAdapter,代码行数:30,代码来源:Example5Fragment.java


示例14: initializeList

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
private void initializeList() {
    Context context = getActivity();

    RecyclerView recyclerView = getRecyclerView();
    if (recyclerView == null) return;

    // Layout manager
    recyclerView.setLayoutManager(new LinearLayoutManager(context));

    // Adapter
    final SectionedRecyclerViewAdapter adapter = new SectionedRecyclerViewAdapter();
    // load data
    loadData(adapter);

    recyclerView.setAdapter(adapter);

    // Separator
    recyclerView.addItemDecoration(new DividerItemDecoration(context, LinearLayoutManager.VERTICAL));

    // Behaviours. List click listener.
    recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(getContext(), new RecyclerItemClickListener.OnItemClickListener() {
        @Override
        public void onItemClick(View view, int position) {
            Currency currency = getCurrencyAtPosition(position);
            int id = currency.getCurrencyId();
            String name = currency.getName();
            EventBus.getDefault().post(new ListItemClickedEvent(id, name, view));
        }
    }));
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:31,代码来源:CurrencyRecyclerListFragment.java


示例15: loadData

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
private void loadData(SectionedRecyclerViewAdapter adapter) {
        CurrencyService service = new CurrencyService(getActivity());

        adapter.removeAllSections();

//        List<Currency> currencies = new ArrayList<>();
        //for (Currency currency : service.getUsedCurrencies()) currencies.put(currency.getCode(), currency);
        adapter.addSection(new CurrencySection(getString(R.string.active_currencies), service.getUsedCurrencies()));

//        currencies = new ArrayList<>();
//        for (Currency currency : service.getUnusedCurrencies()) currencies.put(currency.getCode(), currency);
        adapter.addSection(new CurrencySection(getString(R.string.inactive_currencies), service.getUnusedCurrencies()));

    }
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:15,代码来源:CurrencyRecyclerListFragment.java


示例16: populateGallery

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
private populateGallery(Activity activity, RecyclerView recyclerView, SectionedRecyclerViewAdapter sectionedRecyclerViewAdapter) {
    this.activity = activity;
    this.recyclerView = recyclerView;
    this.sectionedRecyclerViewAdapter = sectionedRecyclerViewAdapter;
}
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:6,代码来源:AsyncLoadGallery.java


示例17: getAdapter

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
private SectionedRecyclerViewAdapter getAdapter() {
    return (SectionedRecyclerViewAdapter) getRecyclerView().getAdapter();
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:4,代码来源:CurrencyRecyclerListFragment.java


示例18: setupAlbums

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
static void setupAlbums(final Activity activity, String[] veryPaths, RecyclerView recyclerView, final SectionedRecyclerViewAdapter sectionedRecyclerViewAdapter) {

        for (String path : veryPaths) {

            String[] mediaUrls = MediaFromAlbums.listMedia(path);

            if (mediaUrls.length != 0) {

                final int gridNumber = Preferences.resolveGrid(activity);

                GridLayoutManager glm = new GridLayoutManager(activity, gridNumber);
                glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
                    @Override
                    public int getSpanSize(int position) {
                        switch (sectionedRecyclerViewAdapter.getSectionItemViewType(position)) {
                            case SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER:
                                return gridNumber;
                            default:
                                return 1;
                        }
                    }
                });

                recyclerView.setLayoutManager(glm);

                HeaderRecyclerViewSection headerRecyclerViewSection = new HeaderRecyclerViewSection(activity, path, mediaUrls, sectionedRecyclerViewAdapter, gridNumber);

                sectionedRecyclerViewAdapter.addSection(headerRecyclerViewSection);

            }

        }

    }
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:35,代码来源:AlbumsUtils.java


示例19: execute

import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter; //导入依赖的package包/类
public static void execute(Activity activity, RecyclerView recyclerView, SectionedRecyclerViewAdapter sectionedRecyclerViewAdapter) {

        new populateGallery(activity, recyclerView, sectionedRecyclerViewAdapter).execute();
    }
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:5,代码来源:AsyncLoadGallery.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpFSKerberosAuthenticator类代码示例发布时间:2022-05-22
下一篇:
Java ResourceMappings类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap