Search in sources :

Example 1 with BookmarkAdapter

use of com.xabber.android.ui.adapter.BookmarkAdapter in project xabber-android by redsolution.

the class BookmarksActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bokmarks);
    final Intent intent = getIntent();
    AccountJid account = getAccount(intent);
    if (account == null) {
        finish();
        return;
    }
    accountItem = AccountManager.getInstance().getAccount(account);
    if (accountItem == null) {
        Application.getInstance().onError(R.string.NO_SUCH_ACCOUNT);
        finish();
        return;
    }
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.setTitle(R.string.account_bookmarks);
    toolbar.inflateMenu(R.menu.toolbar_bookmark_list);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.server_info_recycler_view);
    bookmarksAdapter = new BookmarkAdapter(this);
    bookmarksAdapter.setListener(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(bookmarksAdapter);
    progressBar = findViewById(R.id.server_info_progress_bar);
    tvNotSupport = (TextView) findViewById(R.id.tvNotSupport);
    requestBookmarks(false);
}
Also used : BookmarkAdapter(com.xabber.android.ui.adapter.BookmarkAdapter) AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

Intent (android.content.Intent)1 View (android.view.View)1 TextView (android.widget.TextView)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 AccountJid (com.xabber.android.data.entity.AccountJid)1 BookmarkAdapter (com.xabber.android.ui.adapter.BookmarkAdapter)1 BarPainter (com.xabber.android.ui.color.BarPainter)1