use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.
the class MovieDetailsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_movie, container, false);
unbinder = ButterKnife.bind(this, view);
progressBar.setVisibility(View.VISIBLE);
textViewMovieGenresLabel.setVisibility(View.GONE);
// important action buttons
containerMovieButtons.setVisibility(View.GONE);
containerRatings.setVisibility(View.GONE);
// language button
buttonMovieLanguage.setVisibility(View.GONE);
Utils.setVectorCompoundDrawable(getActivity().getTheme(), buttonMovieLanguage, R.attr.drawableLanguage);
CheatSheet.setup(buttonMovieLanguage, R.string.pref_language);
buttonMovieLanguage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DialogFragment dialog = LanguageChoiceDialogFragment.newInstance(currentLanguageIndex);
dialog.show(getFragmentManager(), "dialog-language");
}
});
// comments button
buttonMovieComments.setVisibility(View.GONE);
Utils.setVectorCompoundDrawable(getActivity().getTheme(), buttonMovieComments, R.attr.drawableComments);
// cast and crew
setCastVisibility(false);
setCrewVisibility(false);
return view;
}
use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.
the class ShowFragment method displayLanguageSettings.
private void displayLanguageSettings() {
DialogFragment dialog = LanguageChoiceDialogFragment.newInstance(getShowTvdbId(), selectedLanguageIndex);
dialog.show(getFragmentManager(), "dialog-language");
}
use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.
the class ListManageDialogFragment method show.
/**
* Display a dialog which allows to edit the title of this list or remove it.
*/
public static void show(String listId, FragmentManager fm) {
// DialogFragment.show() will take care of adding the fragment
// in a transaction. We also want to remove any currently showing
// dialog, so make our own transaction and take care of that here.
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag("listmanagedialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = ListManageDialogFragment.newInstance(listId);
newFragment.show(ft, "listmanagedialog");
}
use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.
the class ManageListsDialogFragment method showListsDialog.
/**
* Display a dialog which asks if the user wants to add the given show to one or more lists.
*
* @param itemTvdbId TVDb id of the item to add
* @param itemType type of the item to add (show, season or episode)
*/
public static void showListsDialog(int itemTvdbId, @SeriesGuideContract.ListItemTypes int itemType, FragmentManager fm) {
if (fm == null) {
return;
}
// DialogFragment.show() will take care of adding the fragment
// in a transaction. We also want to remove any currently showing
// dialog, so make our own transaction and take care of that here.
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag("listsdialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = ManageListsDialogFragment.newInstance(itemTvdbId, itemType);
newFragment.show(ft, "listsdialog");
}
use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.
the class AddShowDialogFragment method showAddDialog.
/**
* Display a {@link com.battlelancer.seriesguide.ui.dialogs.AddShowDialogFragment} for the given
* show.
*/
public static void showAddDialog(SearchResult show, FragmentManager fm) {
// DialogFragment.show() will take care of adding the fragment
// in a transaction. We also want to remove any currently showing
// dialog, so make our own transaction and take care of that here.
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = AddShowDialogFragment.newInstance(show);
newFragment.show(ft, TAG);
}
Aggregations