Search in sources :

Example 1 with BarPainter

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

the class ContactList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    if (Intent.ACTION_VIEW.equals(getIntent().getAction()) || Intent.ACTION_SEND.equals(getIntent().getAction()) || Intent.ACTION_SENDTO.equals(getIntent().getAction()) || Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
        ActivityManager.getInstance().startNewTask(this);
    }
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.contact_list);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setOnClickListener(this);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.application_title_short, R.string.application_title_short);
    drawerLayout.setDrawerListener(drawerToggle);
    toolbar.inflateMenu(R.menu.contact_list);
    optionsMenu = toolbar.getMenu();
    setUpSearchView(optionsMenu);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    toolbar.setTitle(R.string.application_title_full);
    if (savedInstanceState != null) {
        sendText = savedInstanceState.getString(SAVED_SEND_TEXT);
        action = savedInstanceState.getString(SAVED_ACTION);
    } else {
        getSupportFragmentManager().beginTransaction().add(R.id.container, new ContactListFragment(), CONTACT_LIST_TAG).commit();
        sendText = null;
        action = getIntent().getAction();
    }
    getIntent().setAction(null);
}
Also used : ContactListFragment(com.xabber.android.ui.fragment.ContactListFragment) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) Toolbar(android.support.v7.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 2 with BarPainter

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

the class AccountAdd 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);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_clear_white_24dp);
    getSupportActionBar().setTitle(null);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
}
Also used : Toolbar(android.support.v7.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 3 with BarPainter

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

the class AccountViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Intent intent = getIntent();
    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;
    }
    if (intent != null) {
        showAccountInfo = intent.getBooleanExtra(INTENT_SHOW_ACCOUNT_INFO, true);
    }
    if (!accountItem.getFactualStatusMode().isOnline()) {
        showAccountInfo = false;
    }
    setContentView(R.layout.account_viewer);
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.inflateMenu(ACCOUNT_VIEWER_MENU);
    toolbar.setOnMenuItemClickListener(this);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(AccountViewer.this);
        }
    });
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    bestContact = RosterManager.getInstance().getBestContact(account, Jid.getBareAddress(account));
    contactTitleView = findViewById(R.id.contact_title_expanded);
    contactTitleView.setBackgroundColor(barPainter.getAccountPainter().getAccountMainColor(account));
    statusIcon = findViewById(R.id.status_icon);
    statusText = (TextView) findViewById(R.id.status_text);
    preferencesFragmentContainer = findViewById(R.id.fragment_container);
    vCardFragmentContainer = findViewById(R.id.scrollable_container);
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.scrollable_container, ContactVcardViewerFragment.newInstance(account, Jid.getBareAddress(account))).add(R.id.fragment_container, new AccountEditorFragment()).commit();
    } else {
        showAccountInfo = savedInstanceState.getBoolean(SAVE_SHOW_ACCOUNT_INFO);
    }
    if (showAccountInfo) {
        showAccountInfo();
    } else {
        showAccountSettings();
    }
}
Also used : AccountEditorFragment(com.xabber.android.ui.preferences.AccountEditorFragment) Intent(android.content.Intent) View(android.view.View) TextView(android.widget.TextView) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 4 with BarPainter

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

the class ConferenceAdd 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.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.getString(SAVED_ACCOUNT);
        room = savedInstanceState.getString(SAVED_ROOM);
    } else {
        account = getAccount(intent);
        room = getUser(intent);
    }
    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(android.support.v7.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 5 with BarPainter

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

the class ContactAdd 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_clear_white_24dp);
    setTitle(null);
    barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    setSupportActionBar(toolbar);
    Intent intent = getIntent();
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, ContactAddFragment.newInstance(getAccount(intent), getUser(intent))).commit();
    }
}
Also used : Intent(android.content.Intent) Toolbar(android.support.v7.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