Method | Result |
---|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.NonNull; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import java.util.ArrayList; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onBackPressed() { | |
if (getChildFragmentManager().popBackStackImmediate()) { | |
BaseDialogFragment bdf = (BaseDialogFragment) getChildFragmentManager().getFragments() | |
.get(getChildFragmentManager().getFragments().size() — 1); | |
String title = getString(R.string.account_info); | |
if (bdf == null && getChildFragmentManager().findFragmentByTag(getString(R.string.order_history)) != null && getChildFragmentManager().findFragmentByTag(getString(R.string.order_history)).isVisible()) { | |
title = getString(R.string.order_history); | |
} | |
if (bdf != null) { | |
title = getNewTitle(bdf.getTitle()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Blablabla | |
/** | |
* Loads and switches to a new fragment. | |
* If a fragment with {@code tag} has already been loaded and was detached from the container, | |
* this method will detach the current fragment and reattach the fragment back again, instead | |
* of creating a new instance of the target fragment. | |
* | |
* @param cls {@code Class} of the new fragment | |
* @param tag a tag to identify a fragment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Dialog; | |
import android.support.v4.app.DialogFragment; | |
/** | |
* Base dialog fragment. | |
* @param <Listener> listener type. | |
*/ | |
public abstract class BaseDialogFragment<Listener> extends DialogFragment { |