Use dialog fragments for compose actions

This commit is contained in:
M66B 2019-07-01 10:59:38 +02:00
parent 72db63e979
commit b855358169
5 changed files with 599 additions and 458 deletions

View File

@ -135,7 +135,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Log.i("Result class=" + this.getClass().getSimpleName() +
" request=" + requestCode + " result=" + resultCode + " data=" + data);
" request=" + requestCode + " result=" + resultCode);
Log.logExtras(data);
super.onActivityResult(requestCode, resultCode, data);
}

View File

@ -603,13 +603,17 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
}
AdapterFolder(Fragment parentFragment, long account, boolean show_hidden, IFolderSelectedListener listener) {
this(parentFragment.getContext(), parentFragment.getViewLifecycleOwner(), account, show_hidden, listener);
this.parentFragment = parentFragment;
}
AdapterFolder(Context context, LifecycleOwner owner, long account, boolean show_hidden, IFolderSelectedListener listener) {
this.account = account;
this.show_hidden = show_hidden;
this.listener = listener;
this.context = parentFragment.getContext();
this.owner = parentFragment.getViewLifecycleOwner();
this.context = context;
this.owner = owner;
this.inflater = LayoutInflater.from(context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

View File

@ -119,7 +119,8 @@ public class FragmentBase extends Fragment {
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Log.i("Result class=" + this.getClass().getSimpleName() +
" request=" + requestCode + " result=" + resultCode + " data=" + data);
" request=" + requestCode + " result=" + resultCode);
Log.logExtras(data);
super.onActivityResult(requestCode, resultCode, data);
}

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ public class FragmentDialogFolder extends DialogFragment {
long account = args.getLong("account");
AdapterFolder adapter = new AdapterFolder(
FragmentDialogFolder.this,
getContext(), getActivity(),
account, false, new AdapterFolder.IFolderSelectedListener() {
@Override
public void onFolderSelected(TupleFolderEx folder) {