use of android.support.v7.widget.DividerItemDecoration in project Tusky by Vavassor.
the class NotificationsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_timeline, container, false);
// Setup the SwipeRefreshLayout.
Context context = getContext();
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(this);
// Setup the RecyclerView.
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(context);
recyclerView.setLayoutManager(layoutManager);
DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
adapter = new NotificationsAdapter(this, this);
recyclerView.setAdapter(adapter);
TabLayout layout = (TabLayout) getActivity().findViewById(R.id.tab_layout);
onTabSelectedListener = new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
jumpToTop();
}
};
layout.addOnTabSelectedListener(onTabSelectedListener);
return rootView;
}
use of android.support.v7.widget.DividerItemDecoration in project Tusky by Vavassor.
the class ViewThreadFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_view_thread, container, false);
Context context = getContext();
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(this);
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
recyclerView.setLayoutManager(layoutManager);
DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
recyclerView.addItemDecoration(new ConversationLineItemDecoration(context, ContextCompat.getDrawable(context, R.drawable.conversation_divider_dark)));
adapter = new ThreadAdapter(this);
recyclerView.setAdapter(adapter);
mastodonApi = null;
thisThreadsStatusId = null;
return rootView;
}
use of android.support.v7.widget.DividerItemDecoration in project Tusky by Vavassor.
the class ReportActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_report);
Intent intent = getIntent();
accountId = intent.getStringExtra("account_id");
String accountUsername = intent.getStringExtra("account_username");
String statusId = intent.getStringExtra("status_id");
String statusContent = intent.getStringExtra("status_content");
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar bar = getSupportActionBar();
if (bar != null) {
String title = String.format(getString(R.string.report_username_format), accountUsername);
bar.setTitle(title);
bar.setDisplayHomeAsUpEnabled(true);
bar.setDisplayShowHomeEnabled(true);
}
anyView = toolbar;
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.report_recycler_view);
recyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
adapter = new ReportAdapter();
recyclerView.setAdapter(adapter);
DividerItemDecoration divider = new DividerItemDecoration(this, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(this, R.attr.report_status_divider_drawable, R.drawable.report_status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
ReportAdapter.ReportStatus reportStatus = new ReportAdapter.ReportStatus(statusId, HtmlUtils.fromHtml(statusContent), true);
adapter.addItem(reportStatus);
comment = (EditText) findViewById(R.id.report_comment);
reportAlreadyInFlight = false;
fetchRecentStatuses(accountId);
}
use of android.support.v7.widget.DividerItemDecoration in project UltimateAndroid by cymcsg.
the class RecyclerViewItemAnimatorActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recycler_view_activity_recycler);
setupSpinner();
mRecyclerView = (RecyclerView) findViewById(R.id.list);
//mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
mAdapter = new SimpleAdapter(this, sCheeseStrings);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.DividerItemDecoration in project RecyclerViewRenderers by Alexrs95.
the class RenderersActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.a_bender);
ButterKnife.inject(this);
recyclerView.setHasFixedSize(false);
recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
recyclerView.setItemAnimator(new DefaultItemAnimator());
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
adapter = new RendererAdapter(createItems(), new RendererBuilder(new Factory()));
recyclerView.setAdapter(adapter);
}
Aggregations