Update QuickActionsWidget.java

This commit is contained in:
vshcherb 2020-05-14 15:59:22 +02:00 committed by GitHub
parent 377a892cf2
commit 96db2c1aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -250,15 +250,15 @@ public class QuickActionsWidget extends LinearLayout {
view.setOnLongClickListener(new OnLongClickListener() { view.setOnLongClickListener(new OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
FragmentManager fm = ((AppCompatActivity) getContext()).getSupportFragmentManager(); FragmentManager fm = ((AppCompatActivity) getContext()).getSupportFragmentManager();
if (action instanceof NewAction) { if (action instanceof NewAction) {
fm.beginTransaction() fm.beginTransaction()
.add(R.id.fragmentContainer, new QuickActionListFragment(), QuickActionListFragment.TAG) .add(R.id.fragmentContainer, new QuickActionListFragment(), QuickActionListFragment.TAG)
.addToBackStack(QuickActionListFragment.TAG).commitAllowingStateLoss(); .addToBackStack(QuickActionListFragment.TAG).commitAllowingStateLoss();
} else { } else {
CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.id); CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.id);
dialog.show(fm, AddQuickActionDialog.TAG); dialog.show(fm, AddQuickActionDialog.TAG);
} }
return true; return true;
} }
}); });