use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class ServerInfoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_server_info);
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 = (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(accountItem.getConnection().getXMPPServiceDomain());
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.server_info_recycler_view);
serverInfoAdapter = new ServerInfoAdapter();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(serverInfoAdapter);
progressBar = findViewById(R.id.server_info_progress_bar);
requestServerInfo();
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class StatusEditActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
actionWithItem = null;
setContentView(R.layout.activity_status);
Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, null, R.drawable.ic_clear_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbar.inflateMenu(R.menu.toolbar_set_status);
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelected(item);
}
});
Intent intent = getIntent();
account = StatusEditActivity.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 ConnectionSettings 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_connection));
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 ConnectionSettingsFragment()).commit();
}
}
use of com.xabber.android.ui.color.BarPainter 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 com.xabber.android.ui.color.BarPainter 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();
}
Aggregations