From 748ea2ba1e041bd9f08759c0e314187e757e75e0 Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Thu, 31 Dec 2020 15:01:51 -0300 Subject: [PATCH] Extract code to other modules --- about/.gitignore | 1 + about/build.gradle | 70 +++++ about/consumer-rules.pro | 0 about/proguard-rules.pro | 21 ++ about/src/main/AndroidManifest.xml | 24 ++ .../lucasnlm/antimine/about/AboutActivity.kt | 14 +- .../antimine/about/viewmodel/AboutEvent.kt | 1 - .../antimine/about/viewmodel/AboutState.kt | 0 .../about/viewmodel/AboutViewModel.kt | 2 +- .../about/views/info/AboutInfoFragment.kt | 17 +- .../about/views/licenses/LicensesAdapter.kt | 2 +- .../about/views/licenses/LicensesFragment.kt | 2 +- .../views/translators/TranslatorsAdapter.kt | 2 +- .../views/translators/TranslatorsFragment.kt | 2 +- .../lucasnlm/antimine/text/TextActivity.kt | 4 +- .../antimine/text/models/TextState.kt | 0 .../antimine/text/viewmodel/TextEvent.kt | 0 .../antimine/text/viewmodel/TextViewModel.kt | 0 .../src/main/res/drawable/title.xml | 0 .../src/main/res/layout/activity_empty.xml | 4 +- .../src/main/res/layout/activity_text.xml | 0 .../main/res/layout/fragment_about_info.xml | 12 - .../src/main/res/layout/fragment_licenses.xml | 0 .../main/res/layout/fragment_translators.xml | 0 .../src/main/res/layout/view_third_party.xml | 0 .../src/main/res/layout/view_translator.xml | 0 .../src/main/res/raw/android_sdk.txt | 0 .../src/main/res/raw/apache2.txt | 0 {common => about}/src/main/res/raw/sounds.txt | 0 app/build.gradle | 5 +- app/src/main/AndroidManifest.xml | 17 -- .../dev/lucasnlm/antimine/GameActivity.kt | 12 +- .../dev/lucasnlm/antimine/MainApplication.kt | 2 +- .../antimine/cloud/CloudSaveManager.kt | 2 +- .../antimine/control/ControlDialogFragment.kt | 2 +- .../antimine/control/models/ControlDetails.kt | 2 +- .../control/viewmodel/ControlEvent.kt | 2 +- .../control/viewmodel/ControlState.kt | 2 +- .../control/viewmodel/ControlViewModel.kt | 4 +- .../custom/CustomLevelDialogFragment.kt | 4 +- .../custom/viewmodel/CreateGameViewModel.kt | 2 +- .../antimine/custom/viewmodel/CustomEvent.kt | 2 +- .../gameover/EndGameDialogFragment.kt | 4 +- .../antimine/history/HistoryActivity.kt | 2 +- .../history/viewmodel/HistoryViewModel.kt | 2 +- .../preferences/PreferencesActivity.kt | 3 +- .../lucasnlm/antimine/share/ShareManager.kt | 4 +- .../splash/viewmodel/SplashViewModel.kt | 4 +- .../lucasnlm/antimine/stats/StatsActivity.kt | 6 +- .../antimine/stats/view/StatsAdapter.kt | 2 +- .../stats/viewmodel/StatsViewModel.kt | 4 +- .../lucasnlm/antimine/support/IapHandler.kt | 2 +- .../support/SupportAppDialogFragment.kt | 2 +- .../lucasnlm/antimine/theme/ThemeActivity.kt | 4 +- .../antimine/theme/view/ThemeAdapter.kt | 2 +- .../antimine/theme/viewmodel/ThemeEvent.kt | 2 +- .../antimine/theme/viewmodel/ThemeState.kt | 2 +- .../theme/viewmodel/ThemeViewModel.kt | 8 +- .../tutorial/view/TutorialAreaAdapter.kt | 4 +- .../tutorial/view/TutorialLevelFragment.kt | 2 +- .../tutorial/viewmodel/TutorialViewModel.kt | 8 +- app/src/main/res/values/themes.xml | 10 + .../antimine/control/ControlViewModelTest.kt | 5 +- .../custom/CreateGameViewModelTest.kt | 7 +- .../lucasnlm/antimine/di/TestCommonModule.kt | 12 +- .../antimine/history/HistoryViewModelTest.kt | 2 +- .../mocks/FixedMinefieldRepository.kt | 7 +- .../mocks/MockPreferencesRepository.kt | 6 +- .../stats/viewmodel/StatsViewModelTest.kt | 10 +- .../antimine/theme/ThemeViewModelTest.kt | 16 +- build.gradle | 2 +- common/build.gradle | 2 + .../view/common/level/view/AreaScreenshot.kt | 2 +- .../antimine/common/level/GameController.kt | 6 +- .../database/converters/MinefieldConverter.kt | 8 +- .../common/level/database/models/Save.kt | 2 +- .../common/level/logic/MinefieldCreator.kt | 2 +- .../level/repository/DimensionRepository.kt | 2 +- .../level/repository/MinefieldRepository.kt | 4 +- .../common/level/repository/TipRepository.kt | 2 +- .../antimine/common/level/view/AreaAdapter.kt | 4 +- .../antimine/common/level/view/AreaPainter.kt | 2 +- .../antimine/common/level/view/AreaView.kt | 2 +- .../common/level/view/CommonLevelFragment.kt | 4 +- .../common/level/viewmodel/GameViewModel.kt | 12 +- .../level/widget/FixedGridLayoutManager.kt | 18 -- .../core/analytics/models/Analytics.kt | 2 +- .../lucasnlm/antimine/core/di/CommonModule.kt | 23 +- .../converters/MinefieldConverterTest.kt | 2 +- .../level/di/FixedMinefieldRepository.kt | 4 +- .../common/level/logic/FlagAssistantTest.kt | 20 +- .../common/level/logic/GameControllerTest.kt | 5 +- .../level/logic/MinefieldCreatorTest.kt | 2 +- .../level/logic/MinefieldFactoryTest.kt | 4 +- .../level/logic/MinefieldHandlerTest.kt | 2 +- .../repository/MinefieldRepositoryTest.kt | 4 +- .../level/solver/BruteForceSolverTest.kt | 2 +- .../solver/LimitedBruteForceSolverTest.kt | 2 +- .../preferences/PreferencesRepositoryTest.kt | 18 +- .../themes/repository/ThemeRepositoryTest.kt | 2 +- core/.gitignore | 1 + core/build.gradle | 55 ++++ core/consumer-rules.pro | 0 core/proguard-rules.pro | 21 ++ core/src/main/AndroidManifest.xml | 5 + .../core/viewmodel/IntentViewModel.kt | 0 .../core/viewmodel/StatelessViewModel.kt | 0 preferences/.gitignore | 1 + preferences/build.gradle | 40 +++ preferences/consumer-rules.pro | 0 preferences/proguard-rules.pro | 21 ++ preferences/src/main/AndroidManifest.xml | 2 + .../preferences/IPreferencesManager.kt | 2 +- .../preferences/IPreferencesRepository.kt | 6 +- .../preferences/PreferencesManager.kt | 2 +- .../preferences/PreferencesRepository.kt | 6 +- .../preferences/models}/GameControl.kt | 2 +- .../antimine/preferences}/models/Minefield.kt | 2 +- settings.gradle | 4 + ui/.gitignore | 1 + ui/build.gradle | 63 ++++ ui/consumer-rules.pro | 0 ui/proguard-rules.pro | 21 ++ ui/src/main/AndroidManifest.xml | 5 + .../lucasnlm/antimine/ui}/ThematicActivity.kt | 8 +- .../lucasnlm/antimine/ui}/model/AppTheme.kt | 2 +- .../antimine/ui}/model/AreaPalette.kt | 2 +- .../dev/lucasnlm/antimine/ui}/model/Assets.kt | 2 +- .../ui}/repository/ThemeRepository.kt | 12 +- .../antimine/ui}/repository/Themes.kt | 10 +- {common => ui}/src/main/res/drawable/flag.xml | 0 .../src/main/res/drawable/flag_black.xml | 0 {common => ui}/src/main/res/drawable/mine.xml | 0 .../src/main/res/drawable/mine_exploded.xml | 0 .../main/res/drawable/mine_exploded_red.xml | 0 .../main/res/drawable/mine_exploded_white.xml | 0 .../src/main/res/drawable/mine_low.xml | 0 .../src/main/res/drawable/mine_pink.xml | 0 .../main/res/drawable/mine_pink_exploded.xml | 0 .../src/main/res/drawable/mine_revealed.xml | 0 .../main/res/drawable/mine_revealed_black.xml | 0 .../main/res/drawable/mine_revealed_white.xml | 0 .../src/main/res/drawable/mine_white.xml | 0 .../src/main/res/drawable/question.xml | 0 .../src/main/res/drawable/question_black.xml | 0 .../src/main/res/drawable/red_flag.xml | 0 ui/src/main/res/values-night/colors.xml | 26 ++ ui/src/main/res/values/colors.xml | 35 +++ ui/src/main/res/values/themes.xml | 286 ++++++++++++++++++ 149 files changed, 929 insertions(+), 258 deletions(-) create mode 100644 about/.gitignore create mode 100644 about/build.gradle create mode 100644 about/consumer-rules.pro create mode 100644 about/proguard-rules.pro create mode 100644 about/src/main/AndroidManifest.xml rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt (76%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt (89%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutState.kt (100%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt (98%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt (73%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt (97%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt (97%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt (96%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt (97%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt (95%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/text/models/TextState.kt (100%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextEvent.kt (100%) rename {app => about}/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextViewModel.kt (100%) rename {common => about}/src/main/res/drawable/title.xml (100%) rename {app => about}/src/main/res/layout/activity_empty.xml (59%) rename {app => about}/src/main/res/layout/activity_text.xml (100%) rename {app => about}/src/main/res/layout/fragment_about_info.xml (90%) rename {app => about}/src/main/res/layout/fragment_licenses.xml (100%) rename {app => about}/src/main/res/layout/fragment_translators.xml (100%) rename {app => about}/src/main/res/layout/view_third_party.xml (100%) rename {app => about}/src/main/res/layout/view_translator.xml (100%) rename {common => about}/src/main/res/raw/android_sdk.txt (100%) rename {common => about}/src/main/res/raw/apache2.txt (100%) rename {common => about}/src/main/res/raw/sounds.txt (100%) create mode 100644 app/src/main/res/values/themes.xml create mode 100644 core/.gitignore create mode 100644 core/build.gradle create mode 100644 core/consumer-rules.pro create mode 100644 core/proguard-rules.pro create mode 100644 core/src/main/AndroidManifest.xml rename {common => core}/src/main/java/dev/lucasnlm/antimine/core/viewmodel/IntentViewModel.kt (100%) rename {common => core}/src/main/java/dev/lucasnlm/antimine/core/viewmodel/StatelessViewModel.kt (100%) create mode 100644 preferences/.gitignore create mode 100644 preferences/build.gradle create mode 100644 preferences/consumer-rules.pro create mode 100644 preferences/proguard-rules.pro create mode 100644 preferences/src/main/AndroidManifest.xml rename {common/src/main/java/dev/lucasnlm/antimine/core => preferences/src/main/java/dev/lucasnlm/antimine}/preferences/IPreferencesManager.kt (86%) rename {common/src/main/java/dev/lucasnlm/antimine/core => preferences/src/main/java/dev/lucasnlm/antimine}/preferences/IPreferencesRepository.kt (92%) rename {common/src/main/java/dev/lucasnlm/antimine/core => preferences/src/main/java/dev/lucasnlm/antimine}/preferences/PreferencesManager.kt (94%) rename {common/src/main/java/dev/lucasnlm/antimine/core => preferences/src/main/java/dev/lucasnlm/antimine}/preferences/PreferencesRepository.kt (98%) rename {common/src/main/java/dev/lucasnlm/antimine/core/control => preferences/src/main/java/dev/lucasnlm/antimine/preferences/models}/GameControl.kt (98%) rename {common/src/main/java/dev/lucasnlm/antimine/common/level => preferences/src/main/java/dev/lucasnlm/antimine/preferences}/models/Minefield.kt (63%) create mode 100644 ui/.gitignore create mode 100644 ui/build.gradle create mode 100644 ui/consumer-rules.pro create mode 100644 ui/proguard-rules.pro create mode 100644 ui/src/main/AndroidManifest.xml rename {app/src/main/java/dev/lucasnlm/antimine => ui/src/main/java/dev/lucasnlm/antimine/ui}/ThematicActivity.kt (78%) rename {common/src/main/java/dev/lucasnlm/antimine/core/themes => ui/src/main/java/dev/lucasnlm/antimine/ui}/model/AppTheme.kt (80%) rename {common/src/main/java/dev/lucasnlm/antimine/core/themes => ui/src/main/java/dev/lucasnlm/antimine/ui}/model/AreaPalette.kt (92%) rename {common/src/main/java/dev/lucasnlm/antimine/core/themes => ui/src/main/java/dev/lucasnlm/antimine/ui}/model/Assets.kt (88%) rename {common/src/main/java/dev/lucasnlm/antimine/core/themes => ui/src/main/java/dev/lucasnlm/antimine/ui}/repository/ThemeRepository.kt (90%) rename {common/src/main/java/dev/lucasnlm/antimine/core/themes => ui/src/main/java/dev/lucasnlm/antimine/ui}/repository/Themes.kt (98%) rename {common => ui}/src/main/res/drawable/flag.xml (100%) rename {common => ui}/src/main/res/drawable/flag_black.xml (100%) rename {common => ui}/src/main/res/drawable/mine.xml (100%) rename {common => ui}/src/main/res/drawable/mine_exploded.xml (100%) rename {common => ui}/src/main/res/drawable/mine_exploded_red.xml (100%) rename {common => ui}/src/main/res/drawable/mine_exploded_white.xml (100%) rename {common => ui}/src/main/res/drawable/mine_low.xml (100%) rename {common => ui}/src/main/res/drawable/mine_pink.xml (100%) rename {common => ui}/src/main/res/drawable/mine_pink_exploded.xml (100%) rename {common => ui}/src/main/res/drawable/mine_revealed.xml (100%) rename {common => ui}/src/main/res/drawable/mine_revealed_black.xml (100%) rename {common => ui}/src/main/res/drawable/mine_revealed_white.xml (100%) rename {common => ui}/src/main/res/drawable/mine_white.xml (100%) rename {common => ui}/src/main/res/drawable/question.xml (100%) rename {common => ui}/src/main/res/drawable/question_black.xml (100%) rename {common => ui}/src/main/res/drawable/red_flag.xml (100%) create mode 100644 ui/src/main/res/values-night/colors.xml create mode 100644 ui/src/main/res/values/colors.xml create mode 100644 ui/src/main/res/values/themes.xml diff --git a/about/.gitignore b/about/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/about/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/about/build.gradle b/about/build.gradle new file mode 100644 index 00000000..1c3b4c05 --- /dev/null +++ b/about/build.gradle @@ -0,0 +1,70 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-android-extensions' +} + +android { + compileSdkVersion 30 + + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + implementation project(':core') + implementation project(':i18n') + implementation project(':preferences') + implementation project(':ui') + + // AndroidX + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.activity:activity-ktx:1.1.0' + implementation 'androidx.fragment:fragment-ktx:1.2.5' + + // RecyclerView + implementation 'androidx.recyclerview:recyclerview:1.2.0-beta01' + + // Constraint + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + + // Lifecycle + api 'android.arch.lifecycle:extensions:1.1.1' + implementation 'android.arch.lifecycle:viewmodel:1.1.1' + + // Koin + implementation 'org.koin:koin-android:2.2.1' + implementation 'org.koin:koin-androidx-viewmodel:2.2.1' + testImplementation 'org.koin:koin-test:2.2.1' + + // Coroutines + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1' + testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2' + + // Kotlin Lib + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10' +} \ No newline at end of file diff --git a/about/consumer-rules.pro b/about/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/about/proguard-rules.pro b/about/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/about/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/about/src/main/AndroidManifest.xml b/about/src/main/AndroidManifest.xml new file mode 100644 index 00000000..79276af4 --- /dev/null +++ b/about/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt b/about/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt similarity index 76% rename from app/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt index eab647d2..f0e1a3b8 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/AboutActivity.kt @@ -4,14 +4,12 @@ import android.os.Bundle import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction import androidx.lifecycle.lifecycleScope -import dev.lucasnlm.antimine.R -import dev.lucasnlm.antimine.ThematicActivity +import dev.lucasnlm.antimine.ui.ThematicActivity import dev.lucasnlm.antimine.about.viewmodel.AboutEvent import dev.lucasnlm.antimine.about.viewmodel.AboutViewModel import dev.lucasnlm.antimine.about.views.info.AboutInfoFragment import dev.lucasnlm.antimine.about.views.licenses.LicensesFragment import dev.lucasnlm.antimine.about.views.translators.TranslatorsFragment -import dev.lucasnlm.antimine.support.SupportAppDialogFragment import kotlinx.coroutines.flow.collect import org.koin.androidx.viewmodel.ext.android.viewModel @@ -26,9 +24,6 @@ class AboutActivity : ThematicActivity(R.layout.activity_empty) { lifecycleScope.launchWhenCreated { aboutViewModel.observeEvent().collect { event -> when (event) { - AboutEvent.SupportUs -> { - showSupportAppDialog() - } AboutEvent.ThirdPartyLicenses -> { replaceFragment(LicensesFragment(), LicensesFragment.TAG) } @@ -50,11 +45,4 @@ class AboutActivity : ThematicActivity(R.layout.activity_empty) { replace(R.id.content, fragment) }.commitAllowingStateLoss() } - - private fun showSupportAppDialog() { - if (supportFragmentManager.findFragmentByTag(SupportAppDialogFragment.TAG) == null) { - SupportAppDialogFragment.newRequestSupportDialog(applicationContext) - .show(supportFragmentManager, SupportAppDialogFragment.TAG) - } - } } diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt b/about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt similarity index 89% rename from app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt index a5f6e822..9682806e 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutEvent.kt @@ -1,7 +1,6 @@ package dev.lucasnlm.antimine.about.viewmodel enum class AboutEvent { - SupportUs, ThirdPartyLicenses, SourceCode, Translators, diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutState.kt b/about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutState.kt similarity index 100% rename from app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutState.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutState.kt diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt b/about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt similarity index 98% rename from app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt index 93e1dcda..18d2ed90 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/viewmodel/AboutViewModel.kt @@ -3,7 +3,7 @@ package dev.lucasnlm.antimine.about.viewmodel import android.content.Context import android.content.Intent import android.net.Uri -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.core.viewmodel.IntentViewModel class AboutViewModel( diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt b/about/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt similarity index 73% rename from app/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt index 542718f3..e88fa491 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/views/info/AboutInfoFragment.kt @@ -5,20 +5,15 @@ import android.os.Bundle import android.view.View import androidx.core.view.isVisible import androidx.fragment.app.Fragment -import dev.lucasnlm.antimine.BuildConfig -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.BuildConfig +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.about.viewmodel.AboutEvent import dev.lucasnlm.antimine.about.viewmodel.AboutViewModel -import dev.lucasnlm.antimine.core.preferences.IPreferencesRepository -import dev.lucasnlm.external.IBillingManager import kotlinx.android.synthetic.main.fragment_about_info.* -import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.sharedViewModel class AboutInfoFragment : Fragment(R.layout.fragment_about_info) { private val aboutViewModel: AboutViewModel by sharedViewModel() - private val preferencesRepository: IPreferencesRepository by inject() - private val billingManager: IBillingManager by inject() override fun onResume() { super.onResume() @@ -40,14 +35,6 @@ class AboutInfoFragment : Fragment(R.layout.fragment_about_info) { } } - if (preferencesRepository.isPremiumEnabled() && billingManager.isEnabled()) { - supportUs.visibility = View.GONE - } else { - supportUs.setOnClickListener { - aboutViewModel.sendEvent(AboutEvent.SupportUs) - } - } - thirdsParties.setOnClickListener { aboutViewModel.sendEvent(AboutEvent.ThirdPartyLicenses) } diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt b/about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt similarity index 97% rename from app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt index 9ad5690d..c383d65e 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesAdapter.kt @@ -5,7 +5,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.text.TextActivity import dev.lucasnlm.antimine.about.viewmodel.License diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt b/about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt similarity index 97% rename from app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt index e4ec4833..c3c83266 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/views/licenses/LicensesFragment.kt @@ -6,7 +6,7 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.about.viewmodel.AboutViewModel import kotlinx.android.synthetic.main.fragment_licenses.* import kotlinx.coroutines.flow.collect diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt b/about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt similarity index 96% rename from app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt index 2d061f69..3c40bcdb 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsAdapter.kt @@ -3,7 +3,7 @@ package dev.lucasnlm.antimine.about.views.translators import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.about.viewmodel.TranslationInfo class TranslatorsAdapter( diff --git a/app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt b/about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt similarity index 97% rename from app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt rename to about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt index 9bdffd83..a8c072cb 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/about/views/translators/TranslatorsFragment.kt @@ -8,7 +8,7 @@ import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.about.viewmodel.AboutViewModel import kotlinx.android.synthetic.main.fragment_translators.* import kotlinx.android.synthetic.main.view_translator.view.* diff --git a/app/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt b/about/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt similarity index 95% rename from app/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt rename to about/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt index 929f1c55..e6738441 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt +++ b/about/src/main/java/dev/lucasnlm/antimine/text/TextActivity.kt @@ -6,10 +6,10 @@ import android.os.Bundle import android.view.View import androidx.annotation.RawRes import androidx.lifecycle.lifecycleScope -import dev.lucasnlm.antimine.R -import dev.lucasnlm.antimine.ThematicActivity +import dev.lucasnlm.antimine.about.R import dev.lucasnlm.antimine.text.viewmodel.TextEvent import dev.lucasnlm.antimine.text.viewmodel.TextViewModel +import dev.lucasnlm.antimine.ui.ThematicActivity import kotlinx.android.synthetic.main.activity_text.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collect diff --git a/app/src/main/java/dev/lucasnlm/antimine/text/models/TextState.kt b/about/src/main/java/dev/lucasnlm/antimine/text/models/TextState.kt similarity index 100% rename from app/src/main/java/dev/lucasnlm/antimine/text/models/TextState.kt rename to about/src/main/java/dev/lucasnlm/antimine/text/models/TextState.kt diff --git a/app/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextEvent.kt b/about/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextEvent.kt similarity index 100% rename from app/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextEvent.kt rename to about/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextEvent.kt diff --git a/app/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextViewModel.kt b/about/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextViewModel.kt similarity index 100% rename from app/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextViewModel.kt rename to about/src/main/java/dev/lucasnlm/antimine/text/viewmodel/TextViewModel.kt diff --git a/common/src/main/res/drawable/title.xml b/about/src/main/res/drawable/title.xml similarity index 100% rename from common/src/main/res/drawable/title.xml rename to about/src/main/res/drawable/title.xml diff --git a/app/src/main/res/layout/activity_empty.xml b/about/src/main/res/layout/activity_empty.xml similarity index 59% rename from app/src/main/res/layout/activity_empty.xml rename to about/src/main/res/layout/activity_empty.xml index ee650463..ae0b0e44 100644 --- a/app/src/main/res/layout/activity_empty.xml +++ b/about/src/main/res/layout/activity_empty.xml @@ -1,8 +1,6 @@ + android:fitsSystemWindows="true" /> diff --git a/app/src/main/res/layout/activity_text.xml b/about/src/main/res/layout/activity_text.xml similarity index 100% rename from app/src/main/res/layout/activity_text.xml rename to about/src/main/res/layout/activity_text.xml diff --git a/app/src/main/res/layout/fragment_about_info.xml b/about/src/main/res/layout/fragment_about_info.xml similarity index 90% rename from app/src/main/res/layout/fragment_about_info.xml rename to about/src/main/res/layout/fragment_about_info.xml index 1f3b54a6..b95ae2d8 100644 --- a/app/src/main/res/layout/fragment_about_info.xml +++ b/about/src/main/res/layout/fragment_about_info.xml @@ -66,18 +66,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/version_layout"> -