diff options
author | Yaroslav Pronin <proninyaroslav@gmail.com> | 2022-03-06 19:24:05 +0300 |
---|---|---|
committer | Yaroslav Pronin <proninyaroslav@gmail.com> | 2022-03-06 19:24:05 +0300 |
commit | 60184f077e202ee2bf73390fa3c5be0f95224a1f (patch) | |
tree | 750bb4d85b9e3c077890c9ff47f17089aa90fdfb /News-Android-App/src/main/java | |
parent | 7a4f37e5b68d42043e37e6b9945e303155af3e6f (diff) |
Move the create folder dialog opening logic to the parent activity
Signed-off-by: Yaroslav Pronin <proninyaroslav@gmail.com>
Diffstat (limited to 'News-Android-App/src/main/java')
4 files changed, 16 insertions, 14 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/AddFolderDialogFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/AddFolderDialogFragment.java index d210d4f6..73997a8c 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/AddFolderDialogFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/AddFolderDialogFragment.java @@ -6,7 +6,6 @@ import android.content.Context; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -21,7 +20,6 @@ import java.util.Map; import javax.inject.Inject; import de.luhmer.owncloudnewsreader.database.DatabaseConnectionOrm; -import de.luhmer.owncloudnewsreader.database.model.Folder; import de.luhmer.owncloudnewsreader.databinding.FragmentDialogAddFolderBinding; import de.luhmer.owncloudnewsreader.di.ApiProvider; import io.reactivex.android.schedulers.AndroidSchedulers; diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java index 96c393e0..26b45a37 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java @@ -597,6 +597,20 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements } @Override + public void onCreateFolderClicked() { + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + Fragment prev = getSupportFragmentManager().findFragmentByTag("add_folder_dialog"); + if (prev != null) { + ft.remove(prev); + } + ft.addToBackStack(null); + + AddFolderDialogFragment fragment = AddFolderDialogFragment.newInstance(); + fragment.setActivity(this); + fragment.show(ft, "add_folder_dialog"); + } + + @Override public void onChildItemLongClicked(long idFeed) { startDialogFragment(idFeed, false); } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java index 3cb71aad..5954fd6f 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java @@ -38,7 +38,6 @@ import android.widget.ExpandableListView.OnChildClickListener; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; import com.google.android.material.navigation.NavigationView; @@ -130,6 +129,7 @@ public class NewsReaderListFragment extends Fragment implements OnCreateContextM void onChildItemLongClicked(long idFeed); void onTopItemLongClicked(long idFeed, boolean isFolder); void onUserInfoUpdated(OcsUser userInfo); + void onCreateFolderClicked(); } /** @@ -223,16 +223,7 @@ public class NewsReaderListFragment extends Fragment implements OnCreateContextM getActivity().startActivityForResult(intent, NewsReaderListActivity.RESULT_SETTINGS); return true; case R.id.action_add_new_folder: - FragmentTransaction ft = getParentFragmentManager().beginTransaction(); - Fragment prev = getParentFragmentManager().findFragmentByTag("add_folder_dialog"); - if (prev != null) { - ft.remove(prev); - } - ft.addToBackStack(null); - - AddFolderDialogFragment fragment = AddFolderDialogFragment.newInstance(); - fragment.setActivity(getActivity()); - fragment.show(ft, "add_folder_dialog"); + mCallbacks.onCreateFolderClicked(); return true; default: return false; diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/nextcloud/NewsAPI.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/nextcloud/NewsAPI.java index f05a5b3e..346daee2 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/nextcloud/NewsAPI.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/nextcloud/NewsAPI.java @@ -12,7 +12,6 @@ import io.reactivex.Completable; import io.reactivex.Observable; import okhttp3.ResponseBody; import retrofit2.Call; -import retrofit2.Response; import retrofit2.http.Body; import retrofit2.http.DELETE; import retrofit2.http.Field; |