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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations