use of com.keylesspalace.tusky.adapter.ReportAdapter 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);
}
Aggregations