Search in sources :

Example 36 with Adapter

use of android.support.v7.widget.RecyclerView.Adapter in project remusic by aa112901.

the class FolderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.recylerview, container, false);
    // folderInfos = MusicUtils.queryFolder(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView.setLayoutManager(layoutManager);
    mAdapter = new Adapter(null);
    recyclerView.setAdapter(mAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    isAZSort = mPreferences.getFoloerSortOrder().equals(SortOrder.FolderSortOrder.FOLDER_A_Z);
    dialogText = (TextView) view.findViewById(R.id.dialog_text);
    sideBar = (SideBar) view.findViewById(R.id.sidebar);
    sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {

        @Override
        public void onTouchingLetterChanged(String s) {
            dialogText.setText(s);
            sideBar.setView(dialogText);
            Log.e("scrol", "  " + s);
            if (positionMap.get(s) != null) {
                int i = positionMap.get(s);
                Log.e("scrolget", "  " + i);
                ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
            }
        }
    });
    reloadAdapter();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) SideBar(com.wm.remusic.widget.SideBar)

Example 37 with Adapter

use of android.support.v7.widget.RecyclerView.Adapter in project actor-platform by actorapp.

the class BlockedListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fragment_recycler_list, container, false);
    list = (RecyclerView) res.findViewById(R.id.listView);
    list.setLayoutManager(new LinearLayoutManager(getActivity()));
    emptyView = (TextView) res.findViewById(R.id.emptyView);
    emptyView.setText(R.string.blocked_loading);
    res.setBackgroundColor(ActorSDK.sharedActor().style.getBackyardBackgroundColor());
    emptyView.setTextColor(ActorSDK.sharedActor().style.getTextSecondaryColor());
    adapter = new BlockedAdapter(new ArrayList<User>(), new BlockedAdapter.OnBlockedClickListener() {

        @Override
        public void onClick(UserVM u) {
            execute(messenger().unblockUser(u.getId()).then(new Consumer<Void>() {

                @Override
                public void apply(Void aVoid) {
                    checkBlockedList();
                }
            }));
        }
    });
    list.setAdapter(adapter);
    checkBlockedList();
    return res;
}
Also used : UserVM(im.actor.core.viewmodel.UserVM) Consumer(im.actor.runtime.function.Consumer) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Void(im.actor.runtime.actors.messages.Void) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 38 with Adapter

use of android.support.v7.widget.RecyclerView.Adapter in project SuperSLiM by TonicArtos.

the class GridLayoutTests method test_overscrollBeforeStartBeforeEnd.

@Test
public void test_overscrollBeforeStartBeforeEnd() throws Exception {
    final int numItems = 1;
    final int dy = 100;
    RecyclerView.Adapter adapter;
    int[] layoutPadding;
    adapter = new TestAdapterBuilder().addGridSection(numItems, Utils.RV_WIDTH, Utils.RV_HEIGHT, null).build(mActivity);
    layoutPadding = new int[] { 0, 0, 0, 0 };
    Utils.doOverscrollTest(new int[] { 0, -dy }, layoutPadding, true, adapter, mLayoutManager, mRecyclerView);
}
Also used : TestAdapterBuilder(com.tonicartos.superslim.util.TestAdapterBuilder) RecyclerView(android.support.v7.widget.RecyclerView) Test(org.junit.Test)

Example 39 with Adapter

use of android.support.v7.widget.RecyclerView.Adapter in project SuperSLiM by TonicArtos.

the class GridLayoutTests method test_overscrollAtStartAfterEnd.

@Test
public void test_overscrollAtStartAfterEnd() throws Exception {
    final int numItems = 1;
    final int dy = 100;
    RecyclerView.Adapter adapter;
    int[] layoutPadding;
    adapter = new TestAdapterBuilder().addGridSection(numItems, Utils.RV_WIDTH, Utils.RV_HEIGHT + dy, null).build(mActivity);
    layoutPadding = new int[] { 0, 0, 0, 0 };
    Utils.doOverscrollTest(new int[] { 0, 0 }, layoutPadding, false, adapter, mLayoutManager, mRecyclerView);
}
Also used : TestAdapterBuilder(com.tonicartos.superslim.util.TestAdapterBuilder) RecyclerView(android.support.v7.widget.RecyclerView) Test(org.junit.Test)

Example 40 with Adapter

use of android.support.v7.widget.RecyclerView.Adapter in project SuperSLiM by TonicArtos.

the class GridLayoutTests method test_overscrollAfterStartAtEnd.

@Test
public void test_overscrollAfterStartAtEnd() throws Exception {
    final int numItems = 1;
    final int dy = 100;
    RecyclerView.Adapter adapter;
    int[] layoutPadding;
    adapter = new TestAdapterBuilder().addGridSection(numItems, Utils.RV_WIDTH, Utils.RV_HEIGHT - dy, null).build(mActivity);
    layoutPadding = new int[] { 0, 0, 0, 0 };
    Utils.doOverscrollTest(new int[] { 0, dy }, layoutPadding, true, adapter, mLayoutManager, mRecyclerView);
}
Also used : TestAdapterBuilder(com.tonicartos.superslim.util.TestAdapterBuilder) RecyclerView(android.support.v7.widget.RecyclerView) Test(org.junit.Test)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)688 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)612 View (android.view.View)593 TextView (android.widget.TextView)245 ArrayList (java.util.ArrayList)179 Intent (android.content.Intent)148 ImageView (android.widget.ImageView)132 Toolbar (android.support.v7.widget.Toolbar)118 GridLayoutManager (android.support.v7.widget.GridLayoutManager)111 AdapterView (android.widget.AdapterView)109 ViewGroup (android.view.ViewGroup)97 AlertDialog (android.support.v7.app.AlertDialog)91 Bundle (android.os.Bundle)85 ListView (android.widget.ListView)85 BindView (butterknife.BindView)85 Nullable (android.support.annotation.Nullable)78 DialogInterface (android.content.DialogInterface)71 Context (android.content.Context)65 ArrayAdapter (android.widget.ArrayAdapter)65 LayoutInflater (android.view.LayoutInflater)64