use of com.xabber.android.ui.color.BarPainter 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();
}
}
use of com.xabber.android.ui.color.BarPainter 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 com.xabber.android.ui.color.BarPainter 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 com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class StatusEditor method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
actionWithItem = null;
setContentView(R.layout.status_editor);
Toolbar toolbar = (Toolbar) findViewById(R.id.top_toolbar);
toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
setTitle(null);
setSupportActionBar(toolbar);
Intent intent = getIntent();
account = StatusEditor.getAccount(intent);
BarPainter barPainter = new BarPainter(this, toolbar);
if (account != null) {
barPainter.updateWithAccountName(account);
} else {
barPainter.setDefaultColor();
}
ListView listView = getListView();
listView.setOnItemClickListener(this);
registerForContextMenu(listView);
adapter = new StatusEditorAdapter(this);
View footerView = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.status_history_footer, null, false);
footerView.findViewById(R.id.clear_status_history_button).setOnClickListener(this);
listView.addFooterView(footerView);
setListAdapter(adapter);
statusTextView = (EditText) findViewById(R.id.status_text);
statusModeView = (Spinner) findViewById(R.id.status_icon);
statusModeView.setAdapter(new StatusModeAdapter(this));
savedStatusesTextView = findViewById(R.id.saved_statuses_textview);
StatusMode statusMode;
String statusText;
if (savedInstanceState == null) {
if (account == null) {
statusMode = SettingsManager.statusMode();
statusText = SettingsManager.statusText();
} else {
AccountItem accountItem = AccountManager.getInstance().getAccount(account);
if (accountItem == null) {
Application.getInstance().onError(R.string.NO_SUCH_ACCOUNT);
finish();
return;
}
statusMode = accountItem.getFactualStatusMode();
statusText = accountItem.getStatusText();
}
} else {
statusMode = StatusMode.valueOf(savedInstanceState.getString(SAVED_MODE));
statusText = savedInstanceState.getString(SAVED_TEXT);
}
showStatus(statusMode, statusText);
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class AccountInfoEditor method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_with_toolbar_and_container);
Intent intent = getIntent();
String 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);
}
Aggregations