use of android.support.v4.app.Fragment in project android-advancedrecyclerview by h6ah4i.
the class ExpandableDraggableSwipeableExampleActivity method onItemUndoActionClicked.
private void onItemUndoActionClicked() {
final Fragment fragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_LIST_VIEW);
final long result = getDataProvider().undoLastRemoval();
if (result == RecyclerViewExpandableItemManager.NO_EXPANDABLE_POSITION) {
return;
}
final int groupPosition = RecyclerViewExpandableItemManager.getPackedPositionGroup(result);
final int childPosition = RecyclerViewExpandableItemManager.getPackedPositionChild(result);
if (childPosition == RecyclerView.NO_POSITION) {
// group item
((ExpandableDraggableSwipeableExampleFragment) fragment).notifyGroupItemRestored(groupPosition);
} else {
// child item
((ExpandableDraggableSwipeableExampleFragment) fragment).notifyChildItemRestored(groupPosition, childPosition);
}
}
use of android.support.v4.app.Fragment in project android-advancedrecyclerview by h6ah4i.
the class DraggableSwipeableExampleActivity method onNotifyItemPinnedDialogDismissed.
// implements ItemPinnedMessageDialogFragment.EventListener
@Override
public void onNotifyItemPinnedDialogDismissed(int itemPosition, boolean ok) {
final Fragment fragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_LIST_VIEW);
getDataProvider().getItem(itemPosition).setPinned(ok);
((DraggableSwipeableExampleFragment) fragment).notifyItemChanged(itemPosition);
}
use of android.support.v4.app.Fragment in project qualitymatters by artem-zinnatullin.
the class MainActivityViewModifier method modify.
@NonNull
@Override
public <T extends View> T modify(@NonNull T view) {
// Basically, what we do here is adding a Developer Setting Fragment to a DrawerLayout!
DrawerLayout drawerLayout = (DrawerLayout) view.findViewById(R.id.main_drawer_layout);
DrawerLayout.LayoutParams layoutParams = new DrawerLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
layoutParams.gravity = Gravity.END;
drawerLayout.addView(LayoutInflater.from(view.getContext()).inflate(R.layout.developer_settings_view, drawerLayout, false), layoutParams);
return view;
}
use of android.support.v4.app.Fragment in project android-styled-dialogs by avast.
the class BaseDialogFragment method getDialogListeners.
/**
* Utility method for acquiring all listeners of some type for current instance of DialogFragment
*
* @param listenerInterface Interface of the desired listeners
* @return Unmodifiable list of listeners
* @since 2.1.0
*/
@SuppressWarnings("unchecked")
protected <T> List<T> getDialogListeners(Class<T> listenerInterface) {
final Fragment targetFragment = getTargetFragment();
List<T> listeners = new ArrayList<T>(2);
if (targetFragment != null && listenerInterface.isAssignableFrom(targetFragment.getClass())) {
listeners.add((T) targetFragment);
}
if (getActivity() != null && listenerInterface.isAssignableFrom(getActivity().getClass())) {
listeners.add((T) getActivity());
}
return Collections.unmodifiableList(listeners);
}
use of android.support.v4.app.Fragment in project FirebaseUI-Android by firebase.
the class IdpSignInContainer method signIn.
public static void signIn(FragmentActivity activity, FlowParameters parameters, User user) {
FragmentManager fm = activity.getSupportFragmentManager();
Fragment fragment = fm.findFragmentByTag(TAG);
if (!(fragment instanceof IdpSignInContainer)) {
IdpSignInContainer result = new IdpSignInContainer();
Bundle bundle = FragmentHelper.getFlowParamsBundle(parameters);
bundle.putParcelable(ExtraConstants.EXTRA_USER, user);
result.setArguments(bundle);
try {
fm.beginTransaction().add(result, TAG).disallowAddToBackStack().commit();
} catch (IllegalStateException e) {
Log.e(TAG, "Cannot add fragment", e);
}
}
}
Aggregations