use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class ConferenceAddActivity 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.toolbar_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.getParcelable(SAVED_ACCOUNT);
room = (EntityBareJid) savedInstanceState.getSerializable(SAVED_ROOM);
} else {
account = getAccount(intent);
room = getUser(intent).getJid().asEntityBareJidIfPossible();
}
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 ConferenceSelectActivity 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_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(ConferenceSelectActivity.this);
}
});
toolbar.setTitle(getString(R.string.muc_choose_conference));
barPainter = new BarPainter(this, toolbar);
barPainter.setDefaultColor();
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.fragment_container, new ConferenceSelectFragment()).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 ActiveSessionsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_active_sessions);
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_active_sessions);
barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
progressBar = findViewById(R.id.progressBar);
contentView = findViewById(R.id.contentView);
tvActiveSessions = findViewById(R.id.tvActiveSessions);
terminateAll = findViewById(R.id.llTerminateAll);
terminateAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showTerminateAllSessionsDialog();
}
});
// other sessions
RecyclerView recyclerView = findViewById(R.id.rvSessions);
adapter = new SessionAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
recyclerView.setNestedScrollingEnabled(false);
// current session
tvCurrentClient = findViewById(R.id.tvClient);
tvCurrentDevice = findViewById(R.id.tvDevice);
tvCurrentIPAddress = findViewById(R.id.tvIPAddress);
tvCurrentDate = findViewById(R.id.tvDate);
updateData();
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class BookmarksActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bokmarks);
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_bookmarks);
toolbar.inflateMenu(R.menu.toolbar_bookmark_list);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.server_info_recycler_view);
bookmarksAdapter = new BookmarkAdapter(this);
bookmarksAdapter.setListener(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(bookmarksAdapter);
progressBar = findViewById(R.id.server_info_progress_bar);
tvNotSupport = (TextView) findViewById(R.id.tvNotSupport);
requestBookmarks(false);
}
use of com.xabber.android.ui.color.BarPainter in project xabber-android by redsolution.
the class OccupantListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
account = getAccount(getIntent());
room = getUser(getIntent()).getJid().asEntityBareJidIfPossible();
if (account == null || room == null || !MUCManager.getInstance().hasRoom(account, room)) {
Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
finish();
return;
}
setContentView(R.layout.list);
final 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) {
NavUtils.navigateUpFromSameTask(OccupantListActivity.this);
}
});
toolbar.setTitle(room);
BarPainter barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
listAdapter = new OccupantListAdapter(this, account, room);
setListAdapter(listAdapter);
getListView().setOnItemClickListener(this);
}
Aggregations