use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class ContactList method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
if (Intent.ACTION_VIEW.equals(getIntent().getAction()) || Intent.ACTION_SEND.equals(getIntent().getAction()) || Intent.ACTION_SENDTO.equals(getIntent().getAction()) || Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
ActivityManager.getInstance().startNewTask(this);
}
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
setContentView(R.layout.contact_list);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setOnClickListener(this);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.application_title_short, R.string.application_title_short);
drawerLayout.setDrawerListener(drawerToggle);
toolbar.inflateMenu(R.menu.contact_list);
optionsMenu = toolbar.getMenu();
setUpSearchView(optionsMenu);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
toolbar.setTitle(R.string.application_title_full);
if (savedInstanceState != null) {
sendText = savedInstanceState.getString(SAVED_SEND_TEXT);
action = savedInstanceState.getString(SAVED_ACTION);
} else {
getSupportFragmentManager().beginTransaction().add(R.id.container, new ContactListFragment(), CONTACT_LIST_TAG).commit();
sendText = null;
action = getIntent().getAction();
}
getIntent().setAction(null);
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class AccountAdd method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing())
return;
setContentView(R.layout.activity_with_toolbar_and_container);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.fragment_container, AccountAddFragment.newInstance()).commit();
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_clear_white_24dp);
getSupportActionBar().setTitle(null);
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class AccountViewer method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = getIntent();
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;
}
if (intent != null) {
showAccountInfo = intent.getBooleanExtra(INTENT_SHOW_ACCOUNT_INFO, true);
}
if (!accountItem.getFactualStatusMode().isOnline()) {
showAccountInfo = false;
}
setContentView(R.layout.account_viewer);
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.inflateMenu(ACCOUNT_VIEWER_MENU);
toolbar.setOnMenuItemClickListener(this);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(AccountViewer.this);
}
});
barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
bestContact = RosterManager.getInstance().getBestContact(account, Jid.getBareAddress(account));
contactTitleView = findViewById(R.id.contact_title_expanded);
contactTitleView.setBackgroundColor(barPainter.getAccountPainter().getAccountMainColor(account));
statusIcon = findViewById(R.id.status_icon);
statusText = (TextView) findViewById(R.id.status_text);
preferencesFragmentContainer = findViewById(R.id.fragment_container);
vCardFragmentContainer = findViewById(R.id.scrollable_container);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.scrollable_container, ContactVcardViewerFragment.newInstance(account, Jid.getBareAddress(account))).add(R.id.fragment_container, new AccountEditorFragment()).commit();
} else {
showAccountInfo = savedInstanceState.getBoolean(SAVE_SHOW_ACCOUNT_INFO);
}
if (showAccountInfo) {
showAccountInfo();
} else {
showAccountSettings();
}
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class ConferenceAdd method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
setContentView(R.layout.activity_with_toolbar_and_container);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
toolbar.inflateMenu(R.menu.add_conference);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbar.setOnMenuItemClickListener(this);
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
Intent intent = getIntent();
if (savedInstanceState != null) {
account = savedInstanceState.getString(SAVED_ACCOUNT);
room = savedInstanceState.getString(SAVED_ROOM);
} else {
account = getAccount(intent);
room = getUser(intent);
}
barPainter.updateWithAccountName(account);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.fragment_container, ConferenceAddFragment.newInstance(account, room)).commit();
}
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class ContactAdd method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_with_toolbar_and_container);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
setTitle(null);
barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
setSupportActionBar(toolbar);
Intent intent = getIntent();
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, ContactAddFragment.newInstance(getAccount(intent), getUser(intent))).commit();
}
}
Aggregations