Java Code Examples for android.support.v7.app.ActionBar.setSubtitle()
The following are Jave code examples for showing how to use
setSubtitle() of the
android.support.v7.app.ActionBar
class.
You can vote up the examples you like. Your votes will be used in our system to get
more good examples.
+ Save this method
Example 1
Project: Phoenix-for-VK File: CreatePollFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (nonNull(actionBar)) { actionBar.setTitle(R.string.new_poll); actionBar.setSubtitle(null); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(true) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 2
Project: Phoenix-for-VK File: AudiosFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); Settings.get().ui().notifyPlaceResumed(Place.AUDIOS); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.music); actionBar.setSubtitle(null); } if (getActivity() instanceof OnSectionResumeCallback) { ((OnSectionResumeCallback) getActivity()).onSectionResume(NavigationFragment.SECTION_ITEM_AUDIOS); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(false) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 3
Project: Phoenix-for-VK File: CreatePhotoAlbumFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.create_album); actionBar.setSubtitle(null); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(true) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 4
Project: Phoenix-for-VK File: ChatUsersFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.chat_users); actionBar.setSubtitle(null); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(false) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 5
Project: Phoenix-for-VK File: NotificationPreferencesFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.settings); actionBar.setSubtitle(R.string.notif_setting_title); } if (getActivity() instanceof OnSectionResumeCallback) { ((OnSectionResumeCallback) getActivity()).onSectionResume(NavigationFragment.SECTION_ITEM_SETTINGS); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(false) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 6
Project: Phoenix-for-VK File: FeedbackFragment.java View Source Code | 6 votes |
@Override public void onResume() { super.onResume(); Settings.get().ui().notifyPlaceResumed(Place.NOTIFICATIONS); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.drawer_feedback); actionBar.setSubtitle(null); } if (getActivity() instanceof OnSectionResumeCallback) { ((OnSectionResumeCallback) getActivity()).onSectionResume(NavigationFragment.SECTION_ITEM_FEEDBACK); } new ActivityFeatures.Builder() .begin() .setBlockNavigationDrawer(false) .setStatusBarColored(true) .build() .apply(getActivity()); }
Example 7
Project: BuddyBook File: DetailActivityFragment.java View Source Code | 5 votes |
private void loadToolbar(final Book book) { if (getActivity() != null) { ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(book.getVolumeInfo().getTitle()); actionBar.setSubtitle(book.getVolumeInfo().getAuthors() != null ? book.getVolumeInfo().getAuthors().get(0) : ""); } } }
Example 8
Project: ultrasonic File: SubsonicTabActivity.java View Source Code | 5 votes |
protected void setActionBarSubtitle(int id) { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setSubtitle(id); } }
Example 9
Project: Nird2 File: BlogFragment.java View Source Code | 5 votes |
private void setToolbarSubTitle(int total, int online) { ActionBar actionBar = ((BriarActivity) getActivity()).getSupportActionBar(); if (actionBar != null) { actionBar.setSubtitle( getString(R.string.shared_with, total, online)); } }
Example 10
Project: content-farm-blocker-android File: BaseActivity.java View Source Code | 5 votes |
protected ActionBar initActionBar(ActionBar ab, int titleId, int subtitleId) { if (ab != null) { ab.setElevation(100); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); ab.setTitle(titleId); if (subtitleId != 0) { ab.setSubtitle(subtitleId); } } return ab; }
Example 11
Project: Phoenix-for-VK File: DualTabPhotosFragment.java View Source Code | 5 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (nonNull(actionBar)) { actionBar.setTitle(R.string.photos); actionBar.setSubtitle(null); } }
Example 12
Project: Phoenix-for-VK File: PollFragment.java View Source Code | 5 votes |
@Override public void displayCreationTime(long unixtime) { ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if(nonNull(actionBar)){ String formattedDate = new SimpleDateFormat("dd.MM.yyyy HH:mm", Locale.getDefault()) .format(new Date(unixtime * 1000)); actionBar.setSubtitle(formattedDate); } }
Example 13
Project: Bigbang File: CopyActivity.java View Source Code | 5 votes |
private void adjustActionBar(boolean showTitle, boolean hadSelection) { menu.setGroupVisible(R.id.copy_actions, hadSelection); if(isFullScreen) { if(hadSelection) { exitFab.show(); copyFab.show(); exitFullScreenFab.show(); } else { exitFab.show(); copyFab.hide(); exitFullScreenFab.show(); } } ActionBar actionBar = getSupportActionBar(); if(actionBar != null) { if(showTitle) { actionBar.setTitle(R.string.copy_title); actionBar.setSubtitle(R.string.copy_subtitle); actionBar.setHomeAsUpIndicator(R.mipmap.ic_close_white_24dp); return; } actionBar.setTitle((CharSequence)null); actionBar.setSubtitle((CharSequence)null); actionBar.setHomeAsUpIndicator(R.mipmap.ic_arrow_back_white_24dp); } }
Example 14
Project: Phoenix-for-VK File: AccountsFragment.java View Source Code | 5 votes |
@Override public void onResume() { super.onResume(); ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(null); actionBar.setSubtitle(null); } }
Example 15
Project: TurboChat File: MessageActivity.java View Source Code | 5 votes |
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_root); ButterKnife.bind(this); setSupportActionBar(toolbar); final ActionBar supportActionBar = getSupportActionBar(); final Team team = getIntent().getExtras().getParcelable(ARG_TEAM); supportActionBar.setTitle(team.getName()); supportActionBar.setSubtitle(getString(R.string.messages_subtitle)); supportActionBar.setDisplayHomeAsUpEnabled(true); inflateFragment(team); }
Example 16
Project: Phoenix-for-VK File: PhotoPagerFragment.java View Source Code | 5 votes |
@Override public void setToolbarSubtitle(String subtitle) { ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (nonNull(actionBar)) { actionBar.setSubtitle(subtitle); } }
Example 17
Project: Phoenix-for-VK File: DocPreviewFragment.java View Source Code | 5 votes |
private void resolveActionBar() { if (!isAdded()) return; ActionBar actionBar = ActivityUtils.supportToolbarFor(this); if (actionBar != null) { actionBar.setTitle(R.string.attachment_document); actionBar.setSubtitle(document == null ? null : document.getTitle()); } }
Example 18
Project: Phoenix-for-VK File: ActivityUtils.java View Source Code | 4 votes |
public static void setToolbarSubtitle(Fragment fragment, String title){ ActionBar actionBar = supportToolbarFor(fragment); if(Objects.nonNull(actionBar)){ actionBar.setSubtitle(title); } }
Example 19
Project: Phoenix-for-VK File: ActivityUtils.java View Source Code | 4 votes |
public static void setToolbarSubtitle(Fragment fragment, @StringRes int res){ ActionBar actionBar = supportToolbarFor(fragment); if(Objects.nonNull(actionBar)){ actionBar.setSubtitle(res); } }
Example 20
Project: ANNO1404-Warenrechner-App File: MaterialDetailFragment.java View Source Code | 4 votes |
@Override protected void onViewCreated(View parent) { getGameActivity().component().inject(this); gameActivity.setSupportActionBar(toolbar); final ActionBar actionBar = gameActivity.getSupportActionBar(); setHasOptionsMenu(true); chain = gson.fromJson(getArguments().getString(GameActivity.BUNDLE_CHAIN_KEY), ProductionChain.class); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(game.getName()); actionBar.setSubtitle(gameActivity.getString(R.string.production_chain_title, chain.getBuilding().getProduces().getName(getContext()))); } registerLifecycle(adapter); chainsRV.setLayoutManager(new LinearLayoutManager(gameActivity)); chainsRV.setItemAnimator(new DefaultItemAnimator()); chainsRV.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); adapter.init(chain); chainsRV.setAdapter(adapter); final ImageView imageView = (ImageView) animPlaceholder.findViewById(R.id.itemChainsImage); imageView.setImageDrawable(chain.getBuilding().getProduces().getDrawable(getContext())); final TextView chainsText = (TextView) animPlaceholder.findViewById(R.id.itemChainsText); chainsText.setText(chain.getBuilding().getProduces().getName(getContext())); final NumberPicker numberPicker = (NumberPicker) animPlaceholder.findViewById(R.id.itemChainsNumberPicker); numberPicker.setValue(chain.getChains()); final TextView tpmText = (TextView) animPlaceholder.findViewById(R.id.tpm); tpmText.setText( getContext().getString(R.string.tpm, chain.getBuilding().getTonsPerMin() * chain.getChains()) ); ViewCompat.setTransitionName(animPlaceholder, chain.getBuilding().name()); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { animPlaceholder.setVisibility(View.GONE); chainsRV.setAlpha(1f); } }