Search in sources :

Example 1 with Key

use of com.xabber.android.data.notification.custom_notification.Key in project xabber-android by redsolution.

the class CustomNotifySettings method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    account = EntityIntentBuilder.getAccount(getIntent());
    user = EntityIntentBuilder.getUser(getIntent());
    group = getIntent().getStringExtra(GROUP_KEY);
    phraseID = getIntent().getLongExtra(PHRASE_ID_KEY, -1);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setTitle(getTitle());
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(CustomNotifySettings.this);
        }
    });
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    if (savedInstanceState == null) {
        Key key = Key.createKey(account, user, group, phraseID);
        if (key == null)
            finish();
        getFragmentManager().beginTransaction().add(R.id.fragment_container, CustomNotifSettingsFragment.createInstance(this, key)).commit();
    }
}
Also used : View(android.view.View) Key(com.xabber.android.data.notification.custom_notification.Key) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

View (android.view.View)1 Toolbar (androidx.appcompat.widget.Toolbar)1 Key (com.xabber.android.data.notification.custom_notification.Key)1 BarPainter (com.xabber.android.ui.color.BarPainter)1