use of email.schaal.ocreader.databinding.ActivityManageFeedsBinding in project ocreader by schaal.
the class ManageFeedsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityManageFeedsBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_manage_feeds);
setSupportActionBar(binding.toolbarLayout.toolbar);
// noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
folderSpinnerAdapter = new FolderSpinnerAdapter(this, getRealm().where(Folder.class).sort(Folder.NAME).findAll());
FeedsAdapter adapter = new FeedsAdapter(getRealm(), this);
binding.feedsRecyclerview.setAdapter(adapter);
binding.feedsRecyclerview.setLayoutManager(new LinearLayoutManager(this));
binding.feedsRecyclerview.addItemDecoration(new DividerItemDecoration(this, R.dimen.divider_inset));
binding.fabAddFeed.setOnClickListener(view -> AddNewFeedDialogFragment.show(ManageFeedsActivity.this, null, false));
if (Intent.ACTION_SEND.equals(getIntent().getAction())) {
Feed feed = new Feed(-1);
feed.setUrl(getIntent().getStringExtra(Intent.EXTRA_TEXT));
AddNewFeedDialogFragment.show(this, feed, true);
}
}
Aggregations