Search in sources :

Example 76 with DialogFragment

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;
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) RateDialogFragment(com.battlelancer.seriesguide.ui.dialogs.RateDialogFragment) MovieCheckInDialogFragment(com.battlelancer.seriesguide.ui.dialogs.MovieCheckInDialogFragment) LanguageChoiceDialogFragment(com.battlelancer.seriesguide.ui.dialogs.LanguageChoiceDialogFragment) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) NestedScrollView(android.support.v4.widget.NestedScrollView)

Example 77 with DialogFragment

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");
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) RateDialogFragment(com.battlelancer.seriesguide.ui.dialogs.RateDialogFragment) ManageListsDialogFragment(com.battlelancer.seriesguide.ui.dialogs.ManageListsDialogFragment) LanguageChoiceDialogFragment(com.battlelancer.seriesguide.ui.dialogs.LanguageChoiceDialogFragment)

Example 78 with DialogFragment

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");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) Fragment(android.support.v4.app.Fragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 79 with DialogFragment

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");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 80 with DialogFragment

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);
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AddFragment(com.battlelancer.seriesguide.ui.AddFragment) Fragment(android.support.v4.app.Fragment)

Aggregations

DialogFragment (android.support.v4.app.DialogFragment)85 Fragment (android.support.v4.app.Fragment)31 FragmentTransaction (android.support.v4.app.FragmentTransaction)24 Bundle (android.os.Bundle)10 FragmentManager (android.support.v4.app.FragmentManager)9 View (android.view.View)8 SherlockDialogFragment (com.actionbarsherlock.app.SherlockDialogFragment)8 TextView (android.widget.TextView)7 AlertDialog (android.app.AlertDialog)5 DialogInterface (android.content.DialogInterface)4 OnClickListener (android.content.DialogInterface.OnClickListener)4 Intent (android.content.Intent)4 ListFragment (android.support.v4.app.ListFragment)4 AppCompatDialogFragment (android.support.v7.app.AppCompatDialogFragment)4 OnClickListener (android.view.View.OnClickListener)4 Button (android.widget.Button)4 ItemPinnedMessageDialogFragment (com.h6ah4i.android.example.advrecyclerview.common.fragment.ItemPinnedMessageDialogFragment)4 ProgressDialogFragment (com.wada811.android.dialogfragments.material.ProgressDialogFragment)4 Dialog (android.app.Dialog)3 ProgressDialogFragment (com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)3