From 51cfe52ba89e781629d57aaad38189f2bc2629db Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 22 Apr 2024 15:53:49 +0200 Subject: [PATCH] Avoid unused private fields Signed-off-by: Andy Scherzinger --- .../it/niedermann/owncloud/notes/about/AboutActivity.java | 1 - .../niedermann/owncloud/notes/edit/EditNoteActivity.java | 7 +------ .../notes/edit/category/CategoryDialogFragment.java | 1 - .../owncloud/notes/edit/title/EditTitleDialogFragment.java | 1 - .../it/niedermann/owncloud/notes/main/MainActivity.java | 3 --- .../niedermann/owncloud/notes/main/items/ItemAdapter.java | 1 - 6 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java index b84024bd..5f5c64f9 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java @@ -26,7 +26,6 @@ import it.niedermann.owncloud.notes.databinding.ActivityAboutBinding; public class AboutActivity extends LockedActivity { private ActivityAboutBinding binding; - private final static int POS_CREDITS = 0; private final static int POS_CONTRIB = 1; private final static int POS_LICENSE = 2; private final static int TOTAL_COUNT = 3; diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java index 097fa14a..cb59994e 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java @@ -21,7 +21,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import androidx.lifecycle.ViewModelProvider; import androidx.preference.PreferenceManager; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; @@ -41,7 +40,6 @@ import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.accountpicker.AccountPickerListener; import it.niedermann.owncloud.notes.branding.BrandingUtil; import it.niedermann.owncloud.notes.databinding.ActivityEditBinding; -import it.niedermann.owncloud.notes.edit.category.CategoryViewModel; import it.niedermann.owncloud.notes.main.MainActivity; import it.niedermann.owncloud.notes.persistence.NotesRepository; import it.niedermann.owncloud.notes.persistence.entity.Account; @@ -63,7 +61,6 @@ public class EditNoteActivity extends LockedActivity implements BaseNoteFragment public static final String PARAM_CONTENT = "content"; public static final String PARAM_FAVORITE = "favorite"; - private CategoryViewModel categoryViewModel; private ActivityEditBinding binding; private BaseNoteFragment fragment; @@ -91,9 +88,7 @@ public class EditNoteActivity extends LockedActivity implements BaseNoteFragment getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } }); - - - categoryViewModel = new ViewModelProvider(this).get(CategoryViewModel.class); + binding = ActivityEditBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/category/CategoryDialogFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/category/CategoryDialogFragment.java index 5976aea3..500a5bcf 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/category/CategoryDialogFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/category/CategoryDialogFragment.java @@ -38,7 +38,6 @@ import it.niedermann.owncloud.notes.shared.util.KeyboardUtils; */ public class CategoryDialogFragment extends BrandedDialogFragment { - private static final String TAG = CategoryDialogFragment.class.getSimpleName(); private static final String STATE_CATEGORY = "category"; private CategoryViewModel viewModel; diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/title/EditTitleDialogFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/title/EditTitleDialogFragment.java index 860e81c2..55b3bddb 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/title/EditTitleDialogFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/title/EditTitleDialogFragment.java @@ -25,7 +25,6 @@ import it.niedermann.owncloud.notes.shared.util.KeyboardUtils; public class EditTitleDialogFragment extends BrandedDialogFragment { - private static final String TAG = EditTitleDialogFragment.class.getSimpleName(); static final String PARAM_OLD_TITLE = "old_title"; private DialogEditTitleBinding binding; diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java index 5374c882..2e1e809d 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java @@ -81,7 +81,6 @@ import it.niedermann.owncloud.notes.databinding.ActivityNotesListViewBinding; import it.niedermann.owncloud.notes.databinding.DrawerLayoutBinding; import it.niedermann.owncloud.notes.edit.EditNoteActivity; import it.niedermann.owncloud.notes.edit.category.CategoryDialogFragment; -import it.niedermann.owncloud.notes.edit.category.CategoryViewModel; import it.niedermann.owncloud.notes.exception.ExceptionDialogFragment; import it.niedermann.owncloud.notes.exception.IntendedOfflineException; import it.niedermann.owncloud.notes.importaccount.ImportAccountActivity; @@ -114,7 +113,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A protected final ExecutorService executor = Executors.newCachedThreadPool(); protected MainViewModel mainViewModel; - private CategoryViewModel categoryViewModel; private boolean gridView = true; @@ -150,7 +148,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A super.onCreate(savedInstanceState); mainViewModel = new ViewModelProvider(this).get(MainViewModel.class); - categoryViewModel = new ViewModelProvider(this).get(CategoryViewModel.class); CapabilitiesWorker.update(this); binding = DrawerLayoutBinding.inflate(getLayoutInflater()); activityBinding = ActivityNotesListViewBinding.bind(binding.activityNotesListView.getRoot()); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java index 028f10aa..40d94174 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java @@ -45,7 +45,6 @@ import it.niedermann.owncloud.notes.shared.model.NoteClickListener; public class ItemAdapter extends RecyclerView.Adapter implements Branded { - private static final String TAG = ItemAdapter.class.getSimpleName(); public static final int TYPE_SECTION = 0; public static final int TYPE_NOTE_WITH_EXCERPT = 1;