Search in sources :

Example 1 with FolderSpinnerAdapter

use of email.schaal.ocreader.view.FolderSpinnerAdapter 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);
    }
}
Also used : FeedsAdapter(email.schaal.ocreader.view.FeedsAdapter) ActivityManageFeedsBinding(email.schaal.ocreader.databinding.ActivityManageFeedsBinding) FolderSpinnerAdapter(email.schaal.ocreader.view.FolderSpinnerAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(email.schaal.ocreader.view.DividerItemDecoration) Feed(email.schaal.ocreader.database.model.Feed)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 Feed (email.schaal.ocreader.database.model.Feed)1 ActivityManageFeedsBinding (email.schaal.ocreader.databinding.ActivityManageFeedsBinding)1 DividerItemDecoration (email.schaal.ocreader.view.DividerItemDecoration)1 FeedsAdapter (email.schaal.ocreader.view.FeedsAdapter)1 FolderSpinnerAdapter (email.schaal.ocreader.view.FolderSpinnerAdapter)1