Search in sources :

Example 26 with Toolbar

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();
        }
    });
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Example 27 with Toolbar

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);
    }
}
Also used : Toolbar(android.support.v7.widget.Toolbar)

Example 28 with Toolbar

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();
        }
    }
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) CheckedTextView(android.widget.CheckedTextView) Toolbar(android.support.v7.widget.Toolbar)

Example 29 with Toolbar

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;
}
Also used : Button(android.widget.Button) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Example 30 with Toolbar

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);
}
Also used : Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)442 View (android.view.View)316 ActionBar (android.support.v7.app.ActionBar)155 TextView (android.widget.TextView)149 RecyclerView (android.support.v7.widget.RecyclerView)120 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)112 ImageView (android.widget.ImageView)77 Intent (android.content.Intent)65 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)49 ArrayList (java.util.ArrayList)46 AdapterView (android.widget.AdapterView)38 AppCompatActivity (android.support.v7.app.AppCompatActivity)35 NavigationView (android.support.design.widget.NavigationView)34 FloatingActionButton (android.support.design.widget.FloatingActionButton)29 ViewPager (android.support.v4.view.ViewPager)29 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)28 BindView (butterknife.BindView)28 MenuItem (android.view.MenuItem)24 ViewGroup (android.view.ViewGroup)24 Handler (android.os.Handler)23