From 9fad5003ac30c3e4f9d073e04f4569aeb31779b2 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 12 Jan 2021 19:14:02 +0200 Subject: [PATCH] shuffle some classes under proper packages --- app/src/main/AndroidManifest.xml | 6 +++--- .../mobileledger/{ui/activity => async}/AsyncCrasher.java | 6 +++--- .../net/ktnx/mobileledger/model/MobileLedgerProfile.java | 4 ++-- .../net/ktnx/mobileledger/ui/activity/MainActivity.java | 2 ++ .../NewTransactionActivity.java | 6 ++++-- .../NewTransactionFragment.java | 2 +- .../NewTransactionItemHolder.java | 7 +++---- .../NewTransactionItemsAdapter.java | 2 +- .../NewTransactionModel.java | 2 +- .../ui/{activity => patterns}/PatternsActivity.java | 5 ++--- .../ui/{activity => profiles}/ProfileDetailActivity.java | 7 +++---- .../mobileledger/ui/profiles/ProfileDetailFragment.java | 3 +-- .../ui/profiles/ProfilesRecyclerViewAdapter.java | 3 +-- app/src/main/res/layout/activity_new_transaction.xml | 4 ++-- app/src/main/res/layout/activity_patterns.xml | 4 ++-- app/src/main/res/layout/activity_profile_detail.xml | 8 +++++--- app/src/main/res/layout/fragment_new_transaction.xml | 5 +++-- .../main/res/navigation/new_transaction_navigation.xml | 4 ++-- 18 files changed, 41 insertions(+), 39 deletions(-) rename app/src/main/java/net/ktnx/mobileledger/{ui/activity => async}/AsyncCrasher.java (85%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => new_transaction}/NewTransactionActivity.java (96%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => new_transaction}/NewTransactionFragment.java (99%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => new_transaction}/NewTransactionItemHolder.java (99%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => new_transaction}/NewTransactionItemsAdapter.java (99%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => new_transaction}/NewTransactionModel.java (99%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => patterns}/PatternsActivity.java (92%) rename app/src/main/java/net/ktnx/mobileledger/ui/{activity => profiles}/ProfileDetailActivity.java (96%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a865bf9d..21a7e5ad 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ android:supportsRtl="true" tools:ignore="GoogleAppIndexingWarning"> diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java b/app/src/main/java/net/ktnx/mobileledger/async/AsyncCrasher.java similarity index 85% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java rename to app/src/main/java/net/ktnx/mobileledger/async/AsyncCrasher.java index ce02ff51..0ec9bb27 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/AsyncCrasher.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/AsyncCrasher.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -15,11 +15,11 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.async; import android.os.AsyncTask; -class AsyncCrasher extends AsyncTask { +public class AsyncCrasher extends AsyncTask { @Override protected Void doInBackground(Void... voids) { throw new RuntimeException("Simulated crash"); diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index 21d15d16..0e8c0448 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -32,7 +32,7 @@ import net.ktnx.mobileledger.App; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.async.DbOpQueue; import net.ktnx.mobileledger.json.API; -import net.ktnx.mobileledger.ui.activity.ProfileDetailActivity; +import net.ktnx.mobileledger.ui.profiles.ProfileDetailActivity; import net.ktnx.mobileledger.ui.profiles.ProfileDetailFragment; import net.ktnx.mobileledger.utils.Logger; import net.ktnx.mobileledger.utils.Misc; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index da39640a..3ed89291 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -54,6 +54,8 @@ import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.model.MobileLedgerProfile; import net.ktnx.mobileledger.ui.MainModel; import net.ktnx.mobileledger.ui.account_summary.AccountSummaryFragment; +import net.ktnx.mobileledger.ui.new_transaction.NewTransactionActivity; +import net.ktnx.mobileledger.ui.patterns.PatternsActivity; import net.ktnx.mobileledger.ui.profiles.ProfilesRecyclerViewAdapter; import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment; import net.ktnx.mobileledger.utils.Colors; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java similarity index 96% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java rename to app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java index 74996417..413365db 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.new_transaction; import android.os.Bundle; import android.util.TypedValue; @@ -30,10 +30,12 @@ import androidx.navigation.fragment.NavHostFragment; import net.ktnx.mobileledger.BuildConfig; import net.ktnx.mobileledger.R; +import net.ktnx.mobileledger.async.AsyncCrasher; import net.ktnx.mobileledger.async.SendTransactionTask; import net.ktnx.mobileledger.async.TaskCallback; import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.model.LedgerTransaction; +import net.ktnx.mobileledger.ui.activity.ProfileThemedActivity; import java.util.Objects; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java similarity index 99% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java rename to app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java index d9d844a4..aa44c72f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.new_transaction; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java similarity index 99% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java rename to app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java index 94d85e76..3bf09d27 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.new_transaction; import android.annotation.SuppressLint; import android.graphics.Typeface; @@ -25,7 +25,6 @@ import android.text.TextWatcher; import android.view.Gravity; import android.view.View; import android.view.inputmethod.EditorInfo; -import android.widget.EditText; import android.widget.TextView; import androidx.annotation.ColorInt; @@ -56,7 +55,7 @@ import java.text.ParseException; import java.util.Date; import java.util.Locale; -import static net.ktnx.mobileledger.ui.activity.NewTransactionModel.ItemType; +import static net.ktnx.mobileledger.ui.new_transaction.NewTransactionModel.ItemType; class NewTransactionItemHolder extends RecyclerView.ViewHolder implements DatePickerFragment.DatePickedListener, DescriptionSelectedCallback { @@ -88,7 +87,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder NewTransactionItemsAdapter adapter) { super(b.getRoot()); this.b = b; - new TextViewClearHelper().attachToTextView((EditText) b.comment); + new TextViewClearHelper().attachToTextView(b.comment); b.newTransactionDescription.setNextFocusForwardId(View.NO_ID); b.accountRowAccName.setNextFocusForwardId(View.NO_ID); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemsAdapter.java similarity index 99% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java rename to app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemsAdapter.java index c91d3905..29b4e9aa 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemsAdapter.java @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.new_transaction; import android.annotation.SuppressLint; import android.app.Activity; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java similarity index 99% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java rename to app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index b647eb85..b96b917a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.new_transaction; import androidx.annotation.NonNull; import androidx.lifecycle.LifecycleOwner; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/PatternsActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternsActivity.java similarity index 92% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/PatternsActivity.java rename to app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternsActivity.java index cc057f42..8e57a2e7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/PatternsActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/patterns/PatternsActivity.java @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.patterns; import android.os.Bundle; import android.view.Menu; @@ -28,8 +28,7 @@ import com.google.android.material.snackbar.Snackbar; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.databinding.ActivityPatternsBinding; -import net.ktnx.mobileledger.ui.patterns.PatternsModel; -import net.ktnx.mobileledger.ui.patterns.PatternsRecyclerViewAdapter; +import net.ktnx.mobileledger.ui.activity.CrashReportingActivity; public class PatternsActivity extends CrashReportingActivity { diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java similarity index 96% rename from app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java rename to app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java index 1bc17ec4..8afdefc1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -15,7 +15,7 @@ * along with MoLe. If not, see . */ -package net.ktnx.mobileledger.ui.activity; +package net.ktnx.mobileledger.ui.profiles; import android.os.Bundle; import android.view.Menu; @@ -28,8 +28,7 @@ import androidx.lifecycle.ViewModelProvider; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.model.MobileLedgerProfile; -import net.ktnx.mobileledger.ui.profiles.ProfileDetailFragment; -import net.ktnx.mobileledger.ui.profiles.ProfileDetailModel; +import net.ktnx.mobileledger.ui.activity.CrashReportingActivity; import net.ktnx.mobileledger.utils.Colors; import org.jetbrains.annotations.NotNull; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java index 36e39af2..e531809a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -52,7 +52,6 @@ import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.model.MobileLedgerProfile; import net.ktnx.mobileledger.ui.CurrencySelectorFragment; import net.ktnx.mobileledger.ui.HueRingDialog; -import net.ktnx.mobileledger.ui.activity.ProfileDetailActivity; import net.ktnx.mobileledger.utils.Colors; import net.ktnx.mobileledger.utils.Misc; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java index cef8d8fb..21984333 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -39,7 +39,6 @@ import androidx.recyclerview.widget.RecyclerView; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.model.MobileLedgerProfile; -import net.ktnx.mobileledger.ui.activity.ProfileDetailActivity; import net.ktnx.mobileledger.utils.Colors; import java.lang.ref.WeakReference; diff --git a/app/src/main/res/layout/activity_new_transaction.xml b/app/src/main/res/layout/activity_new_transaction.xml index 706794f9..2461b3be 100644 --- a/app/src/main/res/layout/activity_new_transaction.xml +++ b/app/src/main/res/layout/activity_new_transaction.xml @@ -1,5 +1,5 @@