Search in sources :

Example 16 with ActionBar

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);
    }
}
Also used : Drawable(android.graphics.drawable.Drawable) SelectedStateListDrawable(com.yalantis.ucrop.util.SelectedStateListDrawable) AspectRatioTextView(com.yalantis.ucrop.view.widget.AspectRatioTextView) TextView(android.widget.TextView) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 17 with ActionBar

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());
}
Also used : ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 18 with ActionBar

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);
    }
}
Also used : SettingsActivityBinding(de.danoeh.antennapod.databinding.SettingsActivityBinding) MainPreferencesFragment(de.danoeh.antennapod.fragment.preferences.MainPreferencesFragment) Intent(android.content.Intent) ActionBar(androidx.appcompat.app.ActionBar)

Example 19 with ActionBar

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());
}
Also used : Button(android.widget.Button) SharedPreferences(android.content.SharedPreferences) TextView(android.widget.TextView) Intent(android.content.Intent) ActionBar(androidx.appcompat.app.ActionBar)

Example 20 with ActionBar

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);
}
Also used : ActionBar(androidx.appcompat.app.ActionBar)

Aggregations

ActionBar (androidx.appcompat.app.ActionBar)139 View (android.view.View)30 Toolbar (androidx.appcompat.widget.Toolbar)29 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)26 TextView (android.widget.TextView)18 Intent (android.content.Intent)11 Bundle (android.os.Bundle)11 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)8 SuppressLint (android.annotation.SuppressLint)7 AdapterView (android.widget.AdapterView)7 ImageView (android.widget.ImageView)7 Uri (android.net.Uri)6 DefaultItemDecoration (com.yanzhenjie.recyclerview.widget.DefaultItemDecoration)6 SharedPreferences (android.content.SharedPreferences)5 ListView (android.widget.ListView)5 Spinner (android.widget.Spinner)5 Typeface (com.mta.tehreer.graphics.Typeface)5 File (java.io.File)5 MenuItem (android.view.MenuItem)4 Button (android.widget.Button)4