Search in sources :

Example 11 with BarPainter

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

the class AccountAddActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing())
        return;
    setContentView(R.layout.activity_with_toolbar_and_container);
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, AccountAddFragment.newInstance()).commit();
    }
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.inflateMenu(R.menu.toolbar_add_account);
    toolbar.getMenu().findItem(R.id.action_add_account).setIcon(null);
    toolbar.setOnMenuItemClickListener(this);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
}
Also used : View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 12 with BarPainter

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

the class AccountHistorySettingsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_history_settings);
    AccountJid account = getAccount(getIntent());
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setTitle(R.string.account_chat_history);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.account_history_settings_fragment, AccountHistorySettingsFragment.newInstance(account)).commit();
    }
}
Also used : AccountJid(com.xabber.android.data.entity.AccountJid) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 13 with BarPainter

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

the class AccountListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_list);
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(AccountListActivity.this);
        }
    });
    toolbar.setTitle(R.string.title_reordering_account);
    toolbar.inflateMenu(R.menu.toolbar_account_list);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.account_list_recycler_view);
    tvSummary = (TextView) findViewById(R.id.tvSummary);
    accountListAdapter = new AccountListReorderAdapter(this, this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(accountListAdapter);
    ItemTouchHelper.Callback callback = new SimpleItemTouchHelperCallback(accountListAdapter);
    touchHelper = new ItemTouchHelper(callback);
    touchHelper.attachToRecyclerView(recyclerView);
}
Also used : ItemTouchHelper(androidx.recyclerview.widget.ItemTouchHelper) SimpleItemTouchHelperCallback(com.xabber.android.ui.widget.SimpleItemTouchHelperCallback) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) AccountListReorderAdapter(com.xabber.android.ui.adapter.AccountListReorderAdapter) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 14 with BarPainter

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

the class AccountSettingsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_settings);
    account = getAccount(getIntent());
    accountItem = AccountManager.getInstance().getAccount(this.account);
    if (accountItem == null) {
        LogManager.e(LOG_TAG, "Account item is null " + account);
        finish();
        return;
    }
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setTitle(R.string.account_connection_settings);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.inflateMenu(R.menu.toolbar_account_connection_settings);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.account_settings_fragment, new AccountEditorFragment()).commit();
    }
}
Also used : AccountEditorFragment(com.xabber.android.ui.preferences.AccountEditorFragment) View(android.view.View) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 15 with BarPainter

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

the class AccountSyncActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_synchronization);
    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;
    }
    jid = accountItem.getAccount().getFullJid().asBareJid().toString();
    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_sync);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    btnDeleteSettings = (Button) findViewById(R.id.btnDeleteSettings);
    switchSync = (Switch) findViewById(R.id.switchSync);
    rlSyncSwitch = (RelativeLayout) findViewById(R.id.rlSyncSwitch);
    tvJid = (TextView) findViewById(R.id.tvJid);
    tvStatus = (TextView) findViewById(R.id.tvStatus);
    ivStatus = (ImageView) findViewById(R.id.ivStatus);
    syncStatusView = (LinearLayout) findViewById(R.id.syncStatusView);
    progressBar = (ProgressBar) findViewById(R.id.progressBar);
    rlSyncSwitch.setOnClickListener(this);
    btnDeleteSettings.setOnClickListener(this);
    syncStatusView.setOnClickListener(this);
}
Also used : AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) 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