Added legend to compose

This commit is contained in:
M66B
2020-01-12 09:12:20 +01:00
parent 0416b2c97e
commit 6d4f858d01
3 changed files with 36 additions and 0 deletions

View File

@@ -90,6 +90,9 @@ import androidx.constraintlayout.widget.Group;
import androidx.core.content.FileProvider;
import androidx.cursoradapter.widget.SimpleCursorAdapter;
import androidx.documentfile.provider.DocumentFile;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
@@ -1027,6 +1030,9 @@ public class FragmentCompose extends FragmentBase {
case R.id.menu_clear:
StyleHelper.apply(R.id.menu_clear, etBody);
return true;
case R.id.menu_legend:
onMenuLegend();
return true;
case R.id.menu_contact_group:
onMenuContactGroup();
return true;
@@ -1141,6 +1147,21 @@ public class FragmentCompose extends FragmentBase {
bottom_navigation.setLayoutParams(params);
}
private void onMenuLegend() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getParentFragmentManager().popBackStack("legend", FragmentManager.POP_BACK_STACK_INCLUSIVE);
Bundle args = new Bundle();
args.putString("tab", "compose");
Fragment fragment = new FragmentLegend();
fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getParentFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("legend");
fragmentTransaction.commit();
}
private void onMenuContactGroup() {
Bundle args = new Bundle();
args.putLong("working", working);