Search in sources :

Example 41 with BarPainter

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

the class PresenceSettings method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing())
        return;
    setContentView(R.layout.activity_with_toolbar_and_container);
    String title = PreferenceSummaryHelperActivity.getPreferenceTitle(getString(R.string.preference_presence));
    Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, title);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, new PresenceSettingsFragment()).commit();
    }
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 42 with BarPainter

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

the class BlockedListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    account = getAccount(getIntent());
    if (account == null) {
        finish();
        return;
    }
    setContentView(R.layout.activity_with_toolbar_and_container);
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.inflateMenu(R.menu.toolbar_block_list);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    RecyclerView recyclerView = new RecyclerView(this);
    ((RelativeLayout) findViewById(R.id.fragment_container)).addView(recyclerView);
    adapter = new BlockedListAdapter(account);
    adapter.setListener(this);
    if (savedInstanceState != null) {
        final ArrayList<String> checkedContacts = savedInstanceState.getStringArrayList(SAVED_CHECKED_CONTACTS);
        if (checkedContacts != null) {
            List<UserJid> checkedJids = new ArrayList<>();
            for (String contactString : checkedContacts) {
                try {
                    checkedJids.add(UserJid.from(contactString));
                } catch (UserJid.UserJidCreateException e) {
                    LogManager.exception(this, e);
                }
            }
            adapter.setCheckedContacts(checkedJids);
        }
    }
    previousSize = -1;
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
}
Also used : RelativeLayout(android.widget.RelativeLayout) ArrayList(java.util.ArrayList) UserJid(com.xabber.android.data.entity.UserJid) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) BlockedListAdapter(com.xabber.android.ui.adapter.BlockedListAdapter) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 43 with BarPainter

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

the class AccountInfoEditorActivity method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    Intent intent = getIntent();
    AccountJid account = getAccount(intent);
    String vCard = intent.getStringExtra(ARG_VCARD);
    if (AccountManager.getInstance().getAccount(account) == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        setResult(RESULT_CANCELED);
        finish();
    }
    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.setTitle(R.string.edit_account_user_info);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    toolbar.inflateMenu(SAVE_MENU);
    toolbar.setOnMenuItemClickListener(this);
    boolean isSaveButtonEnabled = false;
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, AccountInfoEditorFragment.newInstance(account, vCard)).commit();
    } else {
        isSaveButtonEnabled = savedInstanceState.getBoolean(ARGUMENT_SAVE_BUTTON_ENABLED);
    }
    toolbar.getMenu().findItem(R.id.action_save).setEnabled(isSaveButtonEnabled);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
Also used : AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) View(android.view.View) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 44 with BarPainter

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

the class AccountPushActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_push_notifications);
    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_push);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    switchPush = findViewById(R.id.switchPush);
    rlPushSwitch = findViewById(R.id.rlPushSwitch);
    tvPushState = findViewById(R.id.tvPushState);
    rlPushSwitch.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AccountManager.getInstance().setPushEnabled(accountItem, !switchPush.isChecked());
            updateSwitchButton();
        }
    });
}
Also used : AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 45 with BarPainter

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

the class XabberAccountActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTheme(R.style.Theme_LightToolbar);
    setContentView(R.layout.activity_xabber_account_info);
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setOnMenuItemClickListener(this);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.inflateMenu(R.menu.toolbar_xabber_account_info);
    toolbar.setTitleTextColor(getResources().getColor(R.color.black_text));
    barPainter = new BarPainter(this, toolbar);
    progressBar = findViewById(R.id.toolbarProgress);
}
Also used : View(android.view.View) 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