use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class PresenceSettings 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_presence));
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 PresenceSettingsFragment()).commit();
}
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class BlockedListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
account = getAccount(getIntent());
if (account == null) {
finish();
return;
}
setContentView(R.layout.activity_with_toolbar_and_container);
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.inflateMenu(R.menu.toolbar_block_list);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
RecyclerView recyclerView = new RecyclerView(this);
((RelativeLayout) findViewById(R.id.fragment_container)).addView(recyclerView);
adapter = new BlockedListAdapter(account);
adapter.setListener(this);
if (savedInstanceState != null) {
final ArrayList<String> checkedContacts = savedInstanceState.getStringArrayList(SAVED_CHECKED_CONTACTS);
if (checkedContacts != null) {
List<UserJid> checkedJids = new ArrayList<>();
for (String contactString : checkedContacts) {
try {
checkedJids.add(UserJid.from(contactString));
} catch (UserJid.UserJidCreateException e) {
LogManager.exception(this, e);
}
}
adapter.setCheckedContacts(checkedJids);
}
}
previousSize = -1;
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class AccountInfoEditorActivity method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_with_toolbar_and_container);
Intent intent = getIntent();
AccountJid 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);
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class AccountPushActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_push_notifications);
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) 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(R.string.account_push);
barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
switchPush = findViewById(R.id.switchPush);
rlPushSwitch = findViewById(R.id.rlPushSwitch);
tvPushState = findViewById(R.id.tvPushState);
rlPushSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AccountManager.getInstance().setPushEnabled(accountItem, !switchPush.isChecked());
updateSwitchButton();
}
});
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class XabberAccountActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.Theme_LightToolbar);
setContentView(R.layout.activity_xabber_account_info);
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setOnMenuItemClickListener(this);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbar.inflateMenu(R.menu.toolbar_xabber_account_info);
toolbar.setTitleTextColor(getResources().getColor(R.color.black_text));
barPainter = new BarPainter(this, toolbar);
progressBar = findViewById(R.id.toolbarProgress);
}
Aggregations