Search in sources :

Example 16 with BarPainter

use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.

the class ConferenceAddActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.activity_with_toolbar_and_container);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
    toolbar.inflateMenu(R.menu.toolbar_add_conference);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.setOnMenuItemClickListener(this);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    Intent intent = getIntent();
    if (savedInstanceState != null) {
        account = savedInstanceState.getParcelable(SAVED_ACCOUNT);
        room = (EntityBareJid) savedInstanceState.getSerializable(SAVED_ROOM);
    } else {
        account = getAccount(intent);
        room = getUser(intent).getJid().asEntityBareJidIfPossible();
    }
    barPainter.updateWithAccountName(account);
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, ConferenceAddFragment.newInstance(account, room)).commit();
    }
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
Also used : Intent(android.content.Intent) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 17 with BarPainter

use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.

the class ConferenceSelectActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    Toolbar 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) {
            NavUtils.navigateUpFromSameTask(ConferenceSelectActivity.this);
        }
    });
    toolbar.setTitle(getString(R.string.muc_choose_conference));
    barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, new ConferenceSelectFragment()).commit();
    }
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
Also used : ConferenceSelectFragment(com.xabber.android.ui.fragment.ConferenceSelectFragment) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 18 with BarPainter

use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.

the class ActiveSessionsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_active_sessions);
    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_active_sessions);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    progressBar = findViewById(R.id.progressBar);
    contentView = findViewById(R.id.contentView);
    tvActiveSessions = findViewById(R.id.tvActiveSessions);
    terminateAll = findViewById(R.id.llTerminateAll);
    terminateAll.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showTerminateAllSessionsDialog();
        }
    });
    // other sessions
    RecyclerView recyclerView = findViewById(R.id.rvSessions);
    adapter = new SessionAdapter(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
    recyclerView.setNestedScrollingEnabled(false);
    // current session
    tvCurrentClient = findViewById(R.id.tvClient);
    tvCurrentDevice = findViewById(R.id.tvDevice);
    tvCurrentIPAddress = findViewById(R.id.tvIPAddress);
    tvCurrentDate = findViewById(R.id.tvDate);
    updateData();
}
Also used : AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 19 with BarPainter

use of com.xabber.android.ui.color.BarPainter 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)

Example 20 with BarPainter

use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.

the class OccupantListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    account = getAccount(getIntent());
    room = getUser(getIntent()).getJid().asEntityBareJidIfPossible();
    if (account == null || room == null || !MUCManager.getInstance().hasRoom(account, room)) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
        return;
    }
    setContentView(R.layout.list);
    final Toolbar 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) {
            NavUtils.navigateUpFromSameTask(OccupantListActivity.this);
        }
    });
    toolbar.setTitle(room);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    listAdapter = new OccupantListAdapter(this, account, room);
    setListAdapter(listAdapter);
    getListView().setOnItemClickListener(this);
}
Also used : OccupantListAdapter(com.xabber.android.ui.adapter.OccupantListAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

BarPainter (com.xabber.android.ui.color.BarPainter)48 View (android.view.View)26 Toolbar (androidx.appcompat.widget.Toolbar)26 Intent (android.content.Intent)15 Toolbar (android.support.v7.widget.Toolbar)8 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)8 TextView (android.widget.TextView)7 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 AccountJid (com.xabber.android.data.entity.AccountJid)7 MenuItem (android.view.MenuItem)5 AdapterView (android.widget.AdapterView)4 Bundle (android.os.Bundle)2 LayoutInflater (android.view.LayoutInflater)2 ListView (android.widget.ListView)2 AccountItem (com.xabber.android.data.account.AccountItem)2 StatusMode (com.xabber.android.data.account.StatusMode)2 UserJid (com.xabber.android.data.entity.UserJid)2 OccupantListAdapter (com.xabber.android.ui.adapter.OccupantListAdapter)2 ServerInfoAdapter (com.xabber.android.ui.adapter.ServerInfoAdapter)2 StatusEditorAdapter (com.xabber.android.ui.adapter.StatusEditorAdapter)2