@Override protected void setTitle() { getSupportActionBar().setTitle(R.string.preview_title); }
@Override protected void onAttach(@NonNull View view) { Log.i(TAG, "Conductor: onAttach() called"); super.onAttach(view); (((ActionBarProvider) getActivity()).getSupportActionBar()).setTitle("Arch Components Lifecycle Demo"); }
@Override public void setTitle(CharSequence title) { mTitle = title; if (getSupportActionBar() != null) { getSupportActionBar().setTitle(mTitle); } }
@Override protected void onAttach(@NonNull View view) { super.onAttach(view); Log.i(TAG, "onAttach() called"); (((ActionBarProvider)getActivity()).getSupportActionBar()).setTitle("RxLifecycle2 Demo"); Observable.interval(1, TimeUnit.SECONDS) .doOnDispose(new Action() { @Override public void run() { Log.i(TAG, "Disposing from onAttach()"); } }) .compose(this.<Long>bindUntilEvent(ControllerEvent.DETACH)) .subscribe(new Consumer<Long>() { @Override public void accept(Long num) { Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num); } }); }
@Override protected void onAttach(@NonNull View view) { super.onAttach(view); Log.i(TAG, "onAttach() called"); (((ActionBarProvider)getActivity()).getSupportActionBar()).setTitle("RxLifecycle Demo"); Observable.interval(1, TimeUnit.SECONDS) .doOnUnsubscribe(new Action0() { @Override public void call() { Log.i(TAG, "Unsubscribing from onAttach()"); } }) .compose(this.<Long>bindUntilEvent(ControllerEvent.DETACH)) .subscribe(new Action1<Long>() { @Override public void call(Long num) { Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num); } }); }
@Override protected void onAttach(@NonNull View view) { super.onAttach(view); Log.i(TAG, "onAttach() called"); (((ActionBarProvider) getActivity()).getSupportActionBar()).setTitle("Autodispose Demo"); Observable.interval(1, TimeUnit.SECONDS) .doOnDispose(new Action() { @Override public void run() { Log.i(TAG, "Disposing from onAttach()"); } }) .as(AutoDispose.<Long>autoDisposable((scopeProvider))) .subscribe(new Consumer<Long>() { @Override public void accept(Long num) { Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num); } }); }
@Override protected void setTitle() { try { String[] title = {""}; if (colIsOpen()) { title = getCol().getDecks().current().getString("name").split("::"); } else { Timber.e("Could not set title in reviewer because collection closed"); } getSupportActionBar().setTitle(title[title.length - 1]); super.setTitle(title[title.length - 1]); } catch (JSONException e) { throw new RuntimeException(e); } getSupportActionBar().setSubtitle(""); }
protected void setTitle() { Controller parentController = getParentController(); while (parentController != null) { if (parentController instanceof BaseController && ((BaseController)parentController).getTitle() != null) { return; } parentController = parentController.getParentController(); } String title = getTitle(); ActionBar actionBar = getActionBar(); if (title != null && actionBar != null) { actionBar.setTitle(title); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample_fragment_dark_toolbar); // Handle Toolbar Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(R.string.drawer_item_fragment_drawer); //ignore the DemoFragment and it's layout it's just to showcase the handle with an keyboard if (savedInstanceState == null) { Fragment f = DrawerFragment.newInstance("Demo"); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, f).commit(); } }
? mOptions.activityTitle : getResources().getString(R.string.crop_image_activity_title); actionBar.setTitle(title); actionBar.setDisplayHomeAsUpEnabled(true);
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample_dark_toolbar); // Handle Toolbar Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(R.string.drawer_item_menu_drawer); //Create the drawer result = new DrawerBuilder() .withActivity(this) .withToolbar(toolbar) .inflateMenu(R.menu.example_menu) .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem instanceof Nameable) { Toast.makeText(MenuDrawerActivity.this, ((Nameable) drawerItem).getName().getText(MenuDrawerActivity.this), Toast.LENGTH_SHORT).show(); } return false; } }).build(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.model_field_editor); Toolbar toolbar = findViewById(R.id.toolbar); mFieldLabelView = findViewById(R.id.note_type_editor_fields); if (toolbar != null) { setSupportActionBar(toolbar); } if (getSupportActionBar() != null) { getSupportActionBar().setTitle(R.string.model_field_editor_title); getSupportActionBar().setSubtitle(getIntent().getStringExtra("title")); } startLoadingCollection(); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); // Handle Toolbar Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(R.string.sample_diff_util); //style our ui new MaterializeBuilder().withActivity(this).build(); //create our FastAdapter which will manage everything fastItemAdapter = new FastItemAdapter<>(); //get our recyclerView and do basic setup RecyclerView rv = findViewById(R.id.rv); rv.setLayoutManager(new LinearLayoutManager(this)); rv.setItemAnimator(new AlphaInAnimator()); rv.setAdapter(fastItemAdapter); //fill with some sample data setData(); //set the back arrow in the toolbar getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(false); //restore selections (this has to be done after the items were added fastItemAdapter.withSavedInstanceState(savedInstanceState); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample_custom_container_dark_toolbar); // Handle Toolbar Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(R.string.drawer_item_custom_container_drawer); //Create the drawer result = new DrawerBuilder(this) //this layout have to contain child layouts .withRootView(R.id.drawer_container) .withToolbar(toolbar) .withDisplayBelowStatusBar(false) .withActionBarDrawerToggleAnimated(true) .addDrawerItems( new PrimaryDrawerItem().withName(R.string.drawer_item_home).withIcon(FontAwesome.Icon.faw_home), new PrimaryDrawerItem().withName(R.string.drawer_item_free_play).withIcon(FontAwesome.Icon.faw_gamepad), new PrimaryDrawerItem().withName(R.string.drawer_item_custom).withIcon(FontAwesome.Icon.faw_eye), new SectionDrawerItem().withName(R.string.drawer_item_section_header), new SecondaryDrawerItem().withName(R.string.drawer_item_settings).withIcon(FontAwesome.Icon.faw_cog), new SecondaryDrawerItem().withName(R.string.drawer_item_help).withIcon(FontAwesome.Icon.faw_question).withEnabled(false), new SecondaryDrawerItem().withName(R.string.drawer_item_open_source).withIcon(FontAwesome.Icon.faw_github), new SecondaryDrawerItem().withName(R.string.drawer_item_contact).withIcon(FontAwesome.Icon.faw_bullhorn) ) .withSavedInstance(savedInstanceState) .build(); }
getSupportActionBar().setTitle(R.string.drawer_item_advanced_drawer);
getSupportActionBar().setTitle(R.string.drawer_item_non_translucent_status_drawer);
getSupportActionBar().setTitle(R.string.drawer_item_persistent_compact_header);
getSupportActionBar().setTitle(R.string.drawer_item_embedded_drawer);
toolbar.setBackgroundColor(Color.BLACK); toolbar.getBackground().setAlpha(90); getSupportActionBar().setTitle(R.string.drawer_item_fullscreen_drawer);
getSupportActionBar().setTitle(R.string.drawer_item_compact_header);