use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.
the class ContactListSettings 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_contacts));
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 ContactListSettingsFragment()).commit();
}
}
use of androidx.appcompat.widget.Toolbar 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();
}
}
use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.
the class PhraseAdder method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, getString(R.string.phrase_add), R.drawable.ic_clear_white_24dp);
toolbar.inflateMenu(R.menu.toolbar_save);
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelected(item);
}
});
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
}
use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.
the class PhraseEditor method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
index = getPhraseIndex(getIntent());
if (index == null) {
finish();
return;
}
Phrase phrase = PhraseManager.getInstance().getPhrase(index);
if (phrase == null) {
finish();
return;
}
setPhrase(phrase);
String title = phrase.getText();
if ("".equals(title))
title = Application.getInstance().getString(R.string.phrase_empty);
Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, title);
toolbar.inflateMenu(R.menu.toolbar_delete);
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelected(item);
}
});
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
}
use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.
the class PrivacySettings 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_privacy));
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 PrivacySettingsFragment()).commit();
}
}
Aggregations