Search in sources :

Example 96 with ActionBar

use of androidx.appcompat.app.ActionBar in project Timber by naman14.

the class QueueFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_queue, container, false);
    Toolbar toolbar = rootView.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle(R.string.playing_queue);
    recyclerView = rootView.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setItemAnimator(null);
    recyclerView.setEmptyView(getActivity(), rootView.findViewById(R.id.list_empty), "No songs in queue");
    new loadQueueSongs().execute("");
    ((BaseActivity) getActivity()).setMusicStateListenerListener(this);
    return rootView;
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) BaseActivity(com.naman14.timber.activities.BaseActivity) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) BaseRecyclerView(com.naman14.timber.widgets.BaseRecyclerView) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 97 with ActionBar

use of androidx.appcompat.app.ActionBar in project Timber by naman14.

the class AlbumDetailFragment method setupToolbar.

private void setupToolbar() {
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    collapsingToolbarLayout.setTitle(album.title);
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar)

Example 98 with ActionBar

use of androidx.appcompat.app.ActionBar in project uCrop by Yalantis.

the class ResultActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_result);
    Uri uri = getIntent().getData();
    if (uri != null) {
        try {
            UCropView uCropView = findViewById(R.id.ucrop);
            uCropView.getCropImageView().setImageUri(uri, null);
            uCropView.getOverlayView().setShowCropFrame(false);
            uCropView.getOverlayView().setShowCropGrid(false);
            uCropView.getOverlayView().setDimmedColor(Color.TRANSPARENT);
        } catch (Exception e) {
            Log.e(TAG, "setImageUri", e);
            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
        }
    }
    final BitmapFactory.Options options = new BitmapFactory.Options();
    options.inJustDecodeBounds = true;
    BitmapFactory.decodeFile(new File(getIntent().getData().getPath()).getAbsolutePath(), options);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(getString(R.string.format_crop_result_d_d, options.outWidth, options.outHeight));
    }
}
Also used : UCropView(com.yalantis.ucrop.view.UCropView) BitmapFactory(android.graphics.BitmapFactory) Uri(android.net.Uri) File(java.io.File) ActionBar(androidx.appcompat.app.ActionBar)

Example 99 with ActionBar

use of androidx.appcompat.app.ActionBar in project uCrop by Yalantis.

the class SampleActivity method setupAppBar.

/**
 * Configures and styles both status bar and toolbar.
 */
private void setupAppBar() {
    setStatusBarColor(mStatusBarColor);
    toolbar = findViewById(R.id.toolbar);
    // Set all of the Toolbar coloring
    toolbar.setBackgroundColor(mToolbarColor);
    toolbar.setTitleTextColor(mToolbarWidgetColor);
    toolbar.setVisibility(View.VISIBLE);
    final TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
    toolbarTitle.setTextColor(mToolbarWidgetColor);
    toolbarTitle.setText(mToolbarTitle);
    // Color buttons inside the Toolbar
    Drawable stateButtonDrawable = ContextCompat.getDrawable(getBaseContext(), mToolbarCancelDrawable);
    if (stateButtonDrawable != null) {
        stateButtonDrawable.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) TextView(android.widget.TextView) ActionBar(androidx.appcompat.app.ActionBar)

Example 100 with ActionBar

use of androidx.appcompat.app.ActionBar in project AndroidUtilCode by Blankj.

the class CommonActivityTitleView method setTitleBar.

private void setTitleBar() {
    mBaseActivity.setSupportActionBar(baseTitleToolbar);
    ActionBar titleBar = mBaseActivity.getSupportActionBar();
    if (titleBar != null) {
        titleBar.setDisplayHomeAsUpEnabled(true);
        titleBar.setTitle(mTitle);
    }
}
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