mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Simplification, dialog fragment for quick setup
This commit is contained in:
@@ -21,8 +21,6 @@ package eu.faircode.email;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -30,18 +28,15 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.app.Activity.RESULT_CANCELED;
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
public class FragmentDialogFolder extends DialogFragment {
|
||||
public class FragmentDialogFolder extends DialogFragmentEx {
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
@@ -76,8 +71,7 @@ public class FragmentDialogFolder extends DialogFragment {
|
||||
folders = new ArrayList<>();
|
||||
|
||||
long account = args.getLong("account");
|
||||
AdapterFolder adapter = new AdapterFolder(
|
||||
getContext(), getActivity(),
|
||||
AdapterFolder adapter = new AdapterFolder(getContext(), getActivity(),
|
||||
account, false, new AdapterFolder.IFolderSelectedListener() {
|
||||
@Override
|
||||
public void onFolderSelected(TupleFolderEx folder) {
|
||||
@@ -108,21 +102,6 @@ public class FragmentDialogFolder extends DialogFragment {
|
||||
return new AlertDialog.Builder(getContext())
|
||||
.setTitle(title)
|
||||
.setView(dview)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
sendResult(RESULT_CANCELED);
|
||||
}
|
||||
})
|
||||
.create();
|
||||
}
|
||||
|
||||
private void sendResult(int result) {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target != null) {
|
||||
Intent data = new Intent();
|
||||
data.putExtra("args", getArguments());
|
||||
target.onActivityResult(getTargetRequestCode(), result, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user