use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.
the class AboutActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
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(AboutActivity.this);
}
});
findViewById(R.id.about_github).setOnClickListener(this);
findViewById(R.id.about_twitter).setOnClickListener(this);
findViewById(R.id.about_redsolution).setOnClickListener(this);
findViewById(R.id.about_text_xmpp_protocol).setOnClickListener(this);
((TextView) findViewById(R.id.about_text_developers)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.about_text_translators)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.about_text_license)).setMovementMethod(LinkMovementMethod.getInstance());
CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle(getString(R.string.application_title_short));
((TextView) findViewById(R.id.about_version)).setText(Application.getInstance().getVersionName());
loadBackdrop();
}
use of androidx.appcompat.widget.Toolbar in project Signal-Android by WhisperSystems.
the class ManagePendingAndRequestingMembersActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState, boolean ready) {
super.onCreate(savedInstanceState, ready);
setContentView(R.layout.group_pending_and_requesting_member_activity);
if (savedInstanceState == null) {
GroupId.V2 groupId = GroupId.parseOrThrow(getIntent().getStringExtra(GROUP_ID)).requireV2();
ViewPager2 viewPager = findViewById(R.id.pending_and_requesting_pager);
TabLayout tabLayout = findViewById(R.id.pending_and_requesting_tabs);
viewPager.setAdapter(new ViewPagerAdapter(this, groupId));
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {
switch(position) {
case 0:
tab.setText(R.string.PendingMembersActivity_requests);
break;
case 1:
tab.setText(R.string.PendingMembersActivity_invites);
break;
default:
throw new AssertionError();
}
}).attach();
}
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
requireSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
use of androidx.appcompat.widget.Toolbar in project Signal-Android by WhisperSystems.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(R.string.app_name_short);
setSupportActionBar(toolbar);
imageEditorView = findViewById(R.id.image_editor);
imageEditorView.setUndoRedoStackListener((undoAvailable, redoAvailable) -> {
Log.d("ALAN", String.format("Undo/Redo available: %s, %s", undoAvailable ? "Y" : "N", redoAvailable ? "Y" : "N"));
if (menu == null)
return;
MenuItem undo = menu.findItem(R.id.action_undo);
MenuItem redo = menu.findItem(R.id.action_redo);
if (undo != null)
undo.setVisible(undoAvailable);
if (redo != null)
redo.setVisible(redoAvailable);
});
EditorModel model = null;
if (savedInstanceState != null) {
model = savedInstanceState.getParcelable("MODEL");
Log.d("ALAN", "Restoring instance " + (model != null ? model.hashCode() : 0));
}
if (model == null) {
model = initialModel();
Log.d("ALAN", "New instance created " + model.hashCode());
}
imageEditorView.setModel(model);
imageEditorView.setTapListener(new ImageEditorView.TapListener() {
@Override
public void onEntityDown(@Nullable EditorElement editorElement) {
Log.d("ALAN", "Entity down " + editorElement);
}
@Override
public void onEntitySingleTap(@Nullable EditorElement editorElement) {
Log.d("ALAN", "Entity single tapped " + editorElement);
}
@Override
public void onEntityDoubleTap(@NonNull EditorElement editorElement) {
Log.d("ALAN", "Entity double tapped " + editorElement);
if (editorElement.getRenderer() instanceof MultiLineTextRenderer) {
imageEditorView.startTextEditing(editorElement);
} else {
imageEditorView.deleteElement(editorElement);
}
}
});
}
use of androidx.appcompat.widget.Toolbar in project CircleIndicator by ongakuer.
the class SampleActivity method initToolbar.
private void initToolbar() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(v -> onBackPressed());
}
use of androidx.appcompat.widget.Toolbar in project RxBinding by JakeWharton.
the class RxToolbarTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
toolbar = new Toolbar(this);
toolbar.setNavigationContentDescription(NAVIGATION_CONTENT_DESCRIPTION);
toolbar.setNavigationIcon(android.R.drawable.sym_def_app_icon);
setContentView(toolbar);
}
Aggregations