use of android.support.v7.widget.RecyclerView.LayoutManager in project CustomViews by AndroidStudy233.
the class FollowScollToolbarAct method initRecyclerView.
private void initRecyclerView() {
layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
NormalRecyclerAdapter adapter = new NormalRecyclerAdapter(this);
recyclerView.setAdapter(adapter);
// 控制FAB点击滑动(这里是滑动到0所以无所谓 但是要是滑动到后面的位置就要这样做)
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (mShouldScroll) {
mShouldScroll = false;
smoothMoveToPosition(recyclerView, mToPosition);
}
}
});
}
use of android.support.v7.widget.RecyclerView.LayoutManager in project android by nextcloud.
the class NotificationsActivity method setupContent.
/**
* sets up the UI elements and loads all activity items.
*/
private void setupContent() {
emptyContentIcon.setImageResource(R.drawable.ic_notification_light_grey);
emptyContentProgressBar.getIndeterminateDrawable().setColorFilter(ThemeUtils.primaryAccentColor(), PorterDuff.Mode.SRC_IN);
setLoadingMessage();
adapter = new NotificationListAdapter(this);
recyclerView.setAdapter(adapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), layoutManager.getOrientation());
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(dividerItemDecoration);
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_view);
if (getResources().getBoolean(R.bool.bottom_toolbar_enabled)) {
bottomNavigationView.setVisibility(View.VISIBLE);
DisplayUtils.setupBottomBar(bottomNavigationView, getResources(), this, -1);
}
fetchAndSetData();
}
use of android.support.v7.widget.RecyclerView.LayoutManager in project collect by opendatakit.
the class AboutActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_layout);
initToolbar();
int[][] items = { { R.drawable.ic_website, R.string.odk_website, R.string.odk_website_summary }, { R.drawable.ic_forum, R.string.odk_forum, R.string.odk_forum_summary }, { R.drawable.ic_share, R.string.tell_your_friends, R.string.tell_your_friends_msg }, { R.drawable.ic_review_rate, R.string.leave_a_review, R.string.leave_a_review_msg }, { R.drawable.ic_stars, R.string.all_open_source_licenses, R.string.all_open_source_licenses_msg } };
RecyclerView recyclerView = findViewById(R.id.recyclerView);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(new AboutListAdapter(items, this, this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
websiteTabHelper = new CustomTabHelper();
forumTabHelper = new CustomTabHelper();
websiteUri = Uri.parse(ODK_WEBSITE);
forumUri = Uri.parse(ODK_FORUM);
}
use of android.support.v7.widget.RecyclerView.LayoutManager in project collect by opendatakit.
the class AppListActivity method setupBottomSheet.
private void setupBottomSheet() {
bottomSheetDialog = new BottomSheetDialog(this, R.style.MaterialDialogSheet);
View sheetView = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);
final SortDialogAdapter adapter = new SortDialogAdapter(this, recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
@Override
public void onItemClicked(SortDialogAdapter.ViewHolder holder, int position) {
holder.updateItemColor(selectedSortingOrder);
performSelectedSearch(position);
bottomSheetDialog.dismiss();
isBottomDialogShown = false;
}
});
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
bottomSheetDialog.setContentView(sheetView);
if (isBottomDialogShown) {
bottomSheetDialog.show();
}
}
use of android.support.v7.widget.RecyclerView.LayoutManager in project collect by opendatakit.
the class AppListFragment method setupBottomSheet.
private void setupBottomSheet() {
bottomSheetDialog = new BottomSheetDialog(getActivity(), R.style.MaterialDialogSheet);
View sheetView = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);
final SortDialogAdapter adapter = new SortDialogAdapter(getActivity(), recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
@Override
public void onItemClicked(SortDialogAdapter.ViewHolder holder, int position) {
holder.updateItemColor(selectedSortingOrder);
performSelectedSearch(position);
bottomSheetDialog.dismiss();
}
});
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
bottomSheetDialog.setContentView(sheetView);
}
Aggregations