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;
}
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);
}
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));
}
}
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);
}
}
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);
}
}
Aggregations