use of android.support.v7.widget.Toolbar in project HotFix by dodola.
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);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
}
use of android.support.v7.widget.Toolbar in project MovieGuide by esoxjem.
the class MoviesListingActivity method setToolbar.
private void setToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(R.string.movie_guide);
getSupportActionBar().setDisplayShowTitleEnabled(true);
}
}
use of android.support.v7.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 android.support.v7.widget.Toolbar in project MyDiary by erttyy8821.
the class DirectoryPickerFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = super.onCreateView(inflater, container, savedInstanceState);
//Set toolbar
Toolbar toolbar = (Toolbar) rootView.findViewById(com.nononsenseapps.filepicker.R.id.nnf_picker_toolbar);
toolbar.setBackgroundColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));
//set RecyclerView
recyclerView.setBackgroundColor(Color.WHITE);
//set Button
((Button) rootView.findViewById(com.nononsenseapps.filepicker.R.id.nnf_button_cancel)).setText(getResources().getString(R.string.dialog_button_cancel));
((Button) rootView.findViewById(com.nononsenseapps.filepicker.R.id.nnf_button_ok)).setText(getResources().getString(R.string.dialog_button_ok));
return rootView;
}
use of android.support.v7.widget.Toolbar in project LolliPin by OrangeGangsters.
the class LockedCompatActivity method initView.
private void initView() {
Toolbar toolbar = (Toolbar) findViewById(R.id.id_toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle("Title");
toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
toolbar.setSubtitle("SubTitle");
toolbar.setSubtitleTextColor(getResources().getColor(android.R.color.white));
toolbar.setLogo(R.drawable.ic_launcher);
toolbar.setNavigationIcon(R.drawable.ic_menu_white_36dp);
}
Aggregations