use of androidx.appcompat.widget.Toolbar in project xLog by elvishew.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
tagView = (TextView) findViewById(R.id.tag);
tagView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showChangeTagDialog();
}
});
levelView = (Spinner) findViewById(R.id.level);
threadInfo = (CheckedTextView) findViewById(R.id.thread_info);
threadInfo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
threadInfo.toggle();
}
});
stackTraceInfo = (CheckedTextView) findViewById(R.id.stack_trace_info);
stackTraceInfo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
stackTraceInfo.toggle();
setEnabledStateOnViews(stackTraceDepthContainer, stackTraceInfo.isChecked());
}
});
stackTraceDepthContainer = findViewById(R.id.stack_trace_depth_container);
setEnabledStateOnViews(stackTraceDepthContainer, false);
stackTraceDepth = (Spinner) stackTraceDepthContainer.findViewById(R.id.stack_trace_depth);
border = (CheckedTextView) findViewById(R.id.border);
border.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
border.toggle();
}
});
// Setup print button.
findViewById(R.id.print).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
printLog();
}
});
// Setup view printer.
RecyclerView logContainer = (RecyclerView) findViewById(R.id.log_container);
viewPrinter = new RecyclerViewPrinter(logContainer);
// Print welcome message.
XLog.printers(viewPrinter).i("XLog is ready.\nPrint your log now!");
// Check permission.
hasPermission = hasPermission();
if (!hasPermission) {
if (shouldShowRequestPermissionRationale()) {
showPermissionRequestDialog(false);
} else {
requestPermission();
}
}
}
use of androidx.appcompat.widget.Toolbar in project DiscreteScrollView by yarolegovich.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
root = findViewById(R.id.screen);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
findViewById(R.id.preview_shop).setOnClickListener(this);
findViewById(R.id.preview_weather).setOnClickListener(this);
findViewById(R.id.preview_vertical).setOnClickListener(this);
findViewById(R.id.credit_city_icons).setOnClickListener(this);
findViewById(R.id.credit_shop_photos).setOnClickListener(this);
findViewById(R.id.credit_taya).setOnClickListener(this);
}
use of androidx.appcompat.widget.Toolbar 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.widget.Toolbar in project PagerBottomTabStrip by tyzlmjj.
the class HideActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hide);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
PageNavigationView pageBottomTabLayout = findViewById(tab);
mNavigationController = pageBottomTabLayout.material().addItem(R.drawable.ic_restore_teal_24dp, "Recents").addItem(R.drawable.ic_favorite_teal_24dp, "Favorites").addItem(R.drawable.ic_nearby_teal_24dp, "Nearby").build();
ViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new TestViewPagerAdapter(getSupportFragmentManager()));
mNavigationController.setupWithViewPager(viewPager);
}
use of androidx.appcompat.widget.Toolbar in project ETSMobile-Android2 by ApplETS.
the class TodayWidgetConfigureActivity method setUpActionBar.
private void setUpActionBar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.widget_config_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(getString(R.string.widget_configure));
}
Aggregations