Search in sources :

Example 21 with Toolbar

use of android.support.v7.widget.Toolbar in project SmartTabLayout by ogaclejapan.

the class DemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    Demo demo = getDemo();
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle(demo.titleResId);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    ViewGroup tab = (ViewGroup) findViewById(R.id.tab);
    tab.addView(LayoutInflater.from(this).inflate(demo.layoutResId, tab, false));
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);
    demo.setup(viewPagerTab);
    FragmentPagerItems pages = new FragmentPagerItems(this);
    for (int titleResId : demo.tabs()) {
        pages.add(FragmentPagerItem.of(getString(titleResId), DemoFragment.class));
    }
    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(getSupportFragmentManager(), pages);
    viewPager.setAdapter(adapter);
    viewPagerTab.setViewPager(viewPager);
}
Also used : FragmentPagerItems(com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems) ViewGroup(android.view.ViewGroup) ViewPager(android.support.v4.view.ViewPager) FragmentPagerItemAdapter(com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter) Toolbar(android.support.v7.widget.Toolbar) SmartTabLayout(com.ogaclejapan.smarttablayout.SmartTabLayout)

Example 22 with Toolbar

use of android.support.v7.widget.Toolbar in project ShowcaseView by amlcurran.

the class ActionItemsSampleActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_action_items);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    try {
        ViewTarget navigationButtonViewTarget = ViewTargets.navigationButtonViewTarget(toolbar);
        new ShowcaseView.Builder(this).withMaterialShowcase().setTarget(navigationButtonViewTarget).setStyle(R.style.CustomShowcaseTheme2).setContentText("Here's how to highlight items on a toolbar").build().show();
    } catch (ViewTargets.MissingViewException e) {
        e.printStackTrace();
    }
}
Also used : ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) Toolbar(android.support.v7.widget.Toolbar)

Example 23 with Toolbar

use of android.support.v7.widget.Toolbar in project ListenerMusicPlayer by hefuyicoder.

the class SettingActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle(R.string.settings);
    PreferenceFragment fragment = new SettingFragment();
    FragmentManager fragmentManager = getFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.fragment_container, fragment).commit();
}
Also used : FragmentManager(android.app.FragmentManager) SettingFragment(io.hefuyi.listener.ui.fragment.SettingFragment) PreferenceFragment(android.preference.PreferenceFragment) Toolbar(android.support.v7.widget.Toolbar)

Example 24 with Toolbar

use of android.support.v7.widget.Toolbar in project ListenerMusicPlayer by hefuyicoder.

the class ArtistDetailFragment method setupToolbar.

private void setupToolbar() {
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    collapsingToolbarLayout.setTitle(artistName);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) ActionBar(android.support.v7.app.ActionBar)

Example 25 with Toolbar

use of android.support.v7.widget.Toolbar in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistDetailFragment method setupToolbar.

private void setupToolbar() {
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    collapsingToolbarLayout.setTitle(playlistName);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) ActionBar(android.support.v7.app.ActionBar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)495 View (android.view.View)357 ActionBar (android.support.v7.app.ActionBar)178 TextView (android.widget.TextView)167 RecyclerView (android.support.v7.widget.RecyclerView)133 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)123 ImageView (android.widget.ImageView)84 Intent (android.content.Intent)75 ArrayList (java.util.ArrayList)56 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)55 BindView (butterknife.BindView)45 AppCompatActivity (android.support.v7.app.AppCompatActivity)41 AdapterView (android.widget.AdapterView)41 NavigationView (android.support.design.widget.NavigationView)39 BarPainter (com.xabber.android.ui.color.BarPainter)36 MenuItem (android.view.MenuItem)35 FloatingActionButton (android.support.design.widget.FloatingActionButton)31 ViewPager (android.support.v4.view.ViewPager)31 ViewGroup (android.view.ViewGroup)31 Bundle (android.os.Bundle)29