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