use of androidx.appcompat.app.ActionBar in project uCrop by Yalantis.
the class UCropActivity method setupAppBar.
/**
* Configures and styles both status bar and toolbar.
*/
private void setupAppBar() {
setStatusBarColor(mStatusBarColor);
final Toolbar toolbar = findViewById(R.id.toolbar);
// Set all of the Toolbar coloring
toolbar.setBackgroundColor(mToolbarColor);
toolbar.setTitleTextColor(mToolbarWidgetColor);
final TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
toolbarTitle.setTextColor(mToolbarWidgetColor);
toolbarTitle.setText(mToolbarTitle);
// Color buttons inside the Toolbar
Drawable stateButtonDrawable = ContextCompat.getDrawable(this, mToolbarCancelDrawable).mutate();
stateButtonDrawable.setColorFilter(mToolbarWidgetColor, PorterDuff.Mode.SRC_ATOP);
toolbar.setNavigationIcon(stateButtonDrawable);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
}
}
use of androidx.appcompat.app.ActionBar in project ETSMobile-Android2 by ApplETS.
the class MoodleAssignmentsActivity method setUpTitleBar.
private void setUpTitleBar() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(getString(R.string.moodle_assignments_title));
actionBar.setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(v -> onBackPressed());
}
use of androidx.appcompat.app.ActionBar in project AntennaPod by AntennaPod.
the class PreferenceActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(UserPreferences.getTheme());
super.onCreate(savedInstanceState);
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
final SettingsActivityBinding binding = SettingsActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG) == null) {
getSupportFragmentManager().beginTransaction().replace(R.id.settingsContainer, new MainPreferencesFragment(), FRAGMENT_TAG).commit();
}
Intent intent = getIntent();
if (intent.getBooleanExtra(OPEN_AUTO_DOWNLOAD_SETTINGS, false)) {
openScreen(R.xml.preferences_autodownload);
}
}
use of androidx.appcompat.app.ActionBar in project Conversations by siacs.
the class TosActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (getResources().getBoolean(R.bool.portrait_only)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tos);
setSupportActionBar(findViewById(R.id.toolbar));
final ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayHomeAsUpEnabled(false);
}
final Button agreeButton = findViewById(R.id.agree);
final TextView welcomeText = findViewById(R.id.welcome_text);
agreeButton.setOnClickListener(v -> {
final Intent intent = new Intent(this, EnterPhoneNumberActivity.class);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
preferences.edit().putBoolean("tos", true).apply();
addInviteUri(intent);
startActivity(intent);
finish();
});
welcomeText.setText(Html.fromHtml(getString(R.string.welcome_text_quicksy)));
welcomeText.setMovementMethod(LinkMovementMethod.getInstance());
}
use of androidx.appcompat.app.ActionBar in project Conversations by siacs.
the class StartConversationActivity method configureHomeButton.
private void configureHomeButton() {
final ActionBar actionBar = getSupportActionBar();
if (actionBar == null) {
return;
}
boolean openConversations = !createdByViewIntent && !xmppConnectionService.isConversationsListEmpty(null);
actionBar.setDisplayHomeAsUpEnabled(openConversations);
actionBar.setDisplayHomeAsUpEnabled(openConversations);
}
Aggregations