diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..94f480de94e1d767531580401cbf13844868e82b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index ee300829817fe191e43e3a3d6959d00ebd750621..7312c41b3c9c7be70d4887620d9df44993bde66b 100755 --- a/.gitignore +++ b/.gitignore @@ -36,16 +36,7 @@ build/ # IntelliJ *iml -.idea/workspace.xml -.idea/libraries -.idea/caches -.idea/navEditor.xml -.idea/tasks.xml -.idea/modules.xml -.idea/assetWizardSettings.xml -.idea/markdown-navigator* -.idea/compiler.xml -.idea/jarRepositories.xml +.idea/ projectFilesBackup/ gradle.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 0b7502afca8ec6499bf01eeb2eb5094205045fd0..0000000000000000000000000000000000000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
- - - - -
-
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123c2b23e069e35ed634d687e17f731cc702..0000000000000000000000000000000000000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba45445dc9f3afa66e6a149914dc39e3df6..0000000000000000000000000000000000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/ktlint.xml b/.idea/inspectionProfiles/ktlint.xml deleted file mode 100644 index ff4779898c68934d6303d2e318c7812f59ee7712..0000000000000000000000000000000000000000 --- a/.idea/inspectionProfiles/ktlint.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 30d5fbc6c8ee164806c145f816d74d0b565a96a9..0000000000000000000000000000000000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 78eb99429f19440fa82e98be13fc4cefebdedd2e..0000000000000000000000000000000000000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 58918f50335428f2efb3af4d621f9f405ed659d4..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460d8b38ac04e3a3224d7c79ef719b1991a9..0000000000000000000000000000000000000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfbbc029bcab630581847471d7f238ec53..0000000000000000000000000000000000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100755 index 25bc981e0929159c201df368a60aef208da5be4b..0000000000000000000000000000000000000000 --- a/app/build.gradle +++ /dev/null @@ -1,184 +0,0 @@ -import foundation.e.blisslauncher.buildsrc.Libs -import foundation.e.blisslauncher.buildsrc.Versions - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-android-extensions' - -// Manifest version information! -def versionMajor = 1 -def versionMinor = 4 -def versionPatch = 2 - -Properties localProps = new Properties() -File localPropsFile = project.rootProject.file('local.properties') -if (localPropsFile.exists()) { - localProps.load(localPropsFile.newDataInputStream()) -} -def appendDebugSuffix = (localProps.getProperty('appendDebugSuffix') ?: "true").toBoolean() -def keyStorePath = localProps.getProperty('keyStorePath') ?: "/keystore/debug.keystore" -def keyStorePassword = localProps.getProperty('keyStorePassword') ?: "android" -def signingKeyAlias = localProps.getProperty('keyAlias') ?: "androiddebugkey" -def signingKeyPassword = localProps.getProperty('keyPassword') ?: "android" - -android { - compileSdkVersion Versions.compile_sdk - defaultConfig { - applicationId "foundation.e.blisslauncher" - minSdkVersion Versions.min_sdk - targetSdkVersion Versions.target_sdk - versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch - versionName "${versionMajor}.${versionMinor}.${versionPatch}" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - - renderscriptTargetApi 28 - renderscriptSupportModeEnabled true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.debug - } - debug { - if (appendDebugSuffix) { - applicationIdSuffix '.debug' - } - signingConfig signingConfigs.debug - } - - applicationVariants.all { variant -> - variant.outputs.all { output -> - outputFileName = "BlissLauncher-${variant.versionName}-${variant.getFlavorName()}-${variant.buildType.name}.apk" - } - } - } - - signingConfigs { - debug { - storeFile file(getRootDir().path + keyStorePath) - storePassword keyStorePassword - keyAlias signingKeyAlias - keyPassword signingKeyPassword - } - } - - flavorDimensions "api" - productFlavors { - apiNougat { - dimension "api" - minSdkVersion 24 - } - apiOreo { - dimension "api" - minSdkVersion 26 - targetSdkVersion 28 - } - apiQ { - dimension "api" - minSdkVersion 29 - targetSdkVersion 29 - } - apiR { - dimension "api" - minSdkVersion 29 - targetSdkVersion 29 - } - apiS { - dimension "api" - minSdkVersion 29 - targetSdkVersion 29 - } - } - - // Always show the result of every unit test, even if it passes. - testOptions.unitTests.all { - testLogging { - events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' - } - } - compileOptions { - targetCompatibility 1.8 - sourceCompatibility 1.8 - } - - lintOptions { - abortOnError false - } - - sourceSets { - apiQ { - java.srcDirs = ['src/apiOreo/java/foundation/e'] - res.srcDirs = ['src/apiOreo/res'] - } - apiR { - java.srcDirs = ['src/apiOreo/java/foundation/e'] - res.srcDirs = ['src/apiOreo/res'] - } - apiS { - java.srcDirs = ['src/apiOreo/java/foundation/e'] - res.srcDirs = ['src/apiOreo/res'] - } - } -} - -dependencies { - implementation 'me.relex:circleindicator:2.1.4' - - apiNougatImplementation 'org.cyanogenmod:platform.sdk:6.0' - apiOreoImplementation files('libs/lineage-sdk-oreo.jar') - apiQImplementation files('libs/lineage-sdk-q.jar') - apiRImplementation files('libs/lineage-sdk-r.jar') - apiSImplementation files('libs/e-ui-sdk-s.jar') - - debugImplementation 'com.amitshekhar.android:debug-db:1.0.4' - - implementation 'org.greenrobot:eventbus:3.1.1' - - // Support Libs - implementation Libs.AndroidX.appcompat - implementation Libs.AndroidX.recyclerview - - // Rx Java and Android - implementation Libs.RxJava.rxAndroid - implementation Libs.RxJava.rxJava - implementation 'com.jakewharton.rxbinding3:rxbinding:3.0.0' - - // Retrofit - implementation Libs.Retrofit.retrofit - implementation Libs.Retrofit.gsonConverter - implementation Libs.Retrofit.retrofit_rxjava_adapter - - // Okhttp - implementation Libs.OkHttp.okhttp - implementation Libs.OkHttp.loggingInterceptor - - // Rx Relay - implementation "com.jakewharton.rxrelay2:rxrelay:2.1.1" - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - - // Blur Library - implementation 'com.hoko:hoko-blur:1.3.4' - - // Room - implementation Libs.AndroidX.Room.runtime - kapt Libs.AndroidX.Room.compiler - - // Apache Commons - implementation Libs.ApacheCommons.commonsLang - - // Unit test dependencies - testImplementation Libs.junit - testImplementation Libs.robolectric - testImplementation "org.mockito:mockito-core:2.19.0" - testImplementation Libs.AndroidX.Test.archCoreTesting - - // Instrumentation tests dependencies - androidTestImplementation Libs.junit - androidTestImplementation Libs.AndroidX.Test.espressoCore - androidTestImplementation Libs.AndroidX.Test.runner - androidTestImplementation Libs.AndroidX.Test.rules - implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..a45e26a132ffeb79b9d1387680cf8bba8d7fe5e5 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,184 @@ +@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") + +import foundation.e.blisslauncher.buildsrc.Versions +import java.util.* + +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.refine) +} + +// Manifest version information +val versionMajor = 1 +val versionMinor = 4 +val versionPatch = 2 + +val localProps = Properties() +val localPropsFile = project.rootProject.file("local.properties") + +if (localPropsFile.exists()) { + localProps.load(localPropsFile.inputStream()) +} + +val appendDebugSuffix = (localProps.getProperty("appendDebugSuffix") ?: "true").toBoolean() +val keyStorePath = localProps.getProperty("keyStorePath") ?: "/keystore/debug.keystore" +val keyStorePassword = localProps.getProperty("keyStorePassword") ?: "android" +val signingKeyAlias = localProps.getProperty("keyAlias") ?: "androiddebugkey" +val signingKeyPassword = localProps.getProperty("keyPassword") ?: "android" + +android { + namespace = "foundation.e.blisslauncher" + compileSdk = Versions.COMPILE_SDK + + defaultConfig { + applicationId = "foundation.e.blisslauncher" + minSdk = Versions.MIN_SDK + targetSdk = Versions.TARGET_SDK + + versionCode = versionMajor * 100_00_00 + versionMinor * 10_00 + versionPatch + versionName = "${versionMajor}.${versionMinor}.${versionPatch}" + + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + renderscriptTargetApi = 28 + renderscriptSupportModeEnabled = true + setProperty("archivesBaseName", "BlissLauncher-v$versionName") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + signingConfig = signingConfigs.getByName("debug") + } + + debug { + if (appendDebugSuffix) { + applicationIdSuffix = ".debug" + } + signingConfig = signingConfigs.getByName("debug") + } + } + + signingConfigs { + getByName("debug") { + storeFile = file(rootDir.path + keyStorePath) + storePassword = keyStorePassword + keyAlias = signingKeyAlias + keyPassword = signingKeyPassword + } + } + + flavorDimensions.add("api") + productFlavors { + create("apiNougat") { + dimension = "api" + minSdk = 24 + } + + create("apiOreo") { + dimension = "api" + minSdk = 26 + targetSdk = 28 + } + + create("apiQ") { + dimension = "api" + minSdk = 29 + targetSdk = 29 + } + + create("apiR") { + dimension = "api" + minSdk = 29 + targetSdk = 29 + } + + create("apiS") { + dimension = "api" + minSdk = 29 + targetSdk = 29 + } + } + + // Always show the result of every unit test, even if it passes. + testOptions.unitTests.all { test -> + test.testLogging { events("passed", "skipped", "failed", "standardOut", "standardError") } + } + + compileOptions { + isCoreLibraryDesugaringEnabled = true + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { jvmTarget = "1.8" } + + buildFeatures { viewBinding = true } + + lint { abortOnError = false } + + sourceSets { + getByName("apiQ") { + java.srcDir("src/apiOreo/java") + res.srcDir("src/apiOreo/res") + } + + getByName("apiR") { + java.srcDir("src/apiOreo/java") + res.srcDir("src/apiOreo/res") + } + + getByName("apiS") { + java.srcDir("src/apiOreo/java") + res.srcDir("src/apiOreo/res") + } + } +} + +dependencies { + "apiNougatImplementation"("org.cyanogenmod:platform.sdk:6.0") + "apiOreoImplementation"(files("libs/lineage-sdk-oreo.jar")) + "apiQImplementation"(files("libs/lineage-sdk-q.jar")) + "apiRImplementation"(files("libs/lineage-sdk-r.jar")) + "apiSImplementation"(files("libs/e-ui-sdk-s.jar")) + + // Support Libs + implementation(libs.androidx.appcompat) + implementation(libs.androidx.recyclerview) + implementation(libs.androidx.localbroadcast) + + // Rx Java and Android + implementation(libs.rx.android) + implementation(libs.rx.binding) + implementation(libs.rx.java) + implementation(libs.rx.relay) + + // Room + implementation(libs.androidx.room.runtime) + kapt(libs.androidx.room.compiler) + + // Retrofit + implementation(libs.retrofit) + implementation(libs.retrofit.gson.converter) + implementation(libs.retrofit.rxjava.adapter) + + // Okhttp + implementation(libs.okhttp) + implementation(libs.okhttp.logging) + + // Misc. + implementation(libs.hoko.blur) + implementation(libs.apache.commons) + implementation(libs.kotlin.stdlib.jdk7) + implementation(libs.greenrobot.eventbus) + implementation(libs.circleindicator) + implementation(libs.restriction.bypass) + debugImplementation(libs.debug.db) + coreLibraryDesugaring(libs.tools.desugar) + + // Testing dependencies + testImplementation(libs.bundles.testing.unit) + testImplementation(libs.bundles.testing.android) +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 58c971f50f690f814e637846e51b7b4f4c844bcd..659879c720e8f008e472e158e660e20df7b6a0ff 100755 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in /home/simple/Android/Sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# directive in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/src/apiNougat/AndroidManifest.xml b/app/src/apiNougat/AndroidManifest.xml index eeec77436cb44f9120d57c7f9d6847115919c1b4..7739a89d5abc5601792b03613d20c639d0c49151 100755 --- a/app/src/apiNougat/AndroidManifest.xml +++ b/app/src/apiNougat/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - \ No newline at end of file + diff --git a/app/src/apiOreo/AndroidManifest.xml b/app/src/apiOreo/AndroidManifest.xml index 8db74c0f64d8ffd5bad8cc7b7cc4774ff948045c..800360dae39921013ac85dfb30963ec24b1773ac 100755 --- a/app/src/apiOreo/AndroidManifest.xml +++ b/app/src/apiOreo/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - \ No newline at end of file + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 775eeffc6da1b751c353b966c9fce15b832bbeef..b63ec53e7ebbd3409da7647e8f8335ece5906797 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> --> - + Iterable.safeForEach(action: (T) -> Unit) { val tmp = ArrayList() tmp.addAll(this) for (element in tmp) action(element) -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurDrawable.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurDrawable.kt index 38caeddb83058f1943e125203dabe3867c28a7ee..52a19e33fd8398eb358742f88b79ab8219f4a52d 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurDrawable.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurDrawable.kt @@ -61,10 +61,11 @@ class BlurDrawable internal constructor(private val blurWallpaperProvider: BlurW setBlurBounds(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat()) fun setBlurBounds(left: Float, top: Float, right: Float, bottom: Float) { - if (blurBounds.left != left || - blurBounds.top != top || - blurBounds.right != right || - blurBounds.bottom != bottom + if ( + blurBounds.left != left || + blurBounds.top != top || + blurBounds.right != right || + blurBounds.bottom != bottom ) { blurBounds.set(left, top, right, bottom) } @@ -81,8 +82,7 @@ class BlurDrawable internal constructor(private val blurWallpaperProvider: BlurW invalidateSelf() } - override fun setColorFilter(colorFilter: ColorFilter?) { - } + override fun setColorFilter(colorFilter: ColorFilter?) {} fun startListening() = blurWallpaperProvider.addListener(this) diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt index e2d4c725181ed8239140c21a282406243dede5e2..295a530bbf026f8c531b40c0b03c8294a88bd3fc 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurViewDelegate.kt @@ -14,10 +14,8 @@ import foundation.e.blisslauncher.R import foundation.e.blisslauncher.core.customviews.HorizontalPager import foundation.e.blisslauncher.core.utils.OffsetParent -class BlurViewDelegate( - private val view: View, - attrs: AttributeSet? = null -) : View.OnAttachStateChangeListener, BlurWallpaperProvider.Listener { +class BlurViewDelegate(private val view: View, attrs: AttributeSet? = null) : + View.OnAttachStateChangeListener, BlurWallpaperProvider.Listener { private val context = view.context private val blurWallpaperProvider by lazy { BlurWallpaperProvider.getInstance(context) } @@ -27,15 +25,13 @@ class BlurViewDelegate( private val blurDrawableCallback by lazy { object : Drawable.Callback { - override fun unscheduleDrawable(who: Drawable, what: Runnable) { - } + override fun unscheduleDrawable(who: Drawable, what: Runnable) {} override fun invalidateDrawable(who: Drawable) { view.post(view::invalidate) } - override fun scheduleDrawable(who: Drawable, what: Runnable, `when`: Long) { - } + override fun scheduleDrawable(who: Drawable, what: Runnable, `when`: Long) {} } } @@ -53,31 +49,35 @@ class BlurViewDelegate( private var parentOffsetY = 0f private val onGlobalLayoutListener = ViewTreeObserver.OnGlobalLayoutListener { updateBounds() } - private val onScrollChangedListener = ViewTreeObserver.OnScrollChangedListener { - isScrolling = true - view.invalidate() - } - private val onOffsetChangeListener = object : OffsetParent.OnOffsetChangeListener { - override fun onOffsetChange() { - computeParentOffset() + private val onScrollChangedListener = + ViewTreeObserver.OnScrollChangedListener { + isScrolling = true + view.invalidate() + } + private val onOffsetChangeListener = + object : OffsetParent.OnOffsetChangeListener { + override fun onOffsetChange() { + computeParentOffset() + } } - } var blurCornerRadius = 0f - val outlineProvider = object : ViewOutlineProvider() { - override fun getOutline(view: View, outline: Outline) { - outline.setRoundRect(0, 0, view.width, view.height, blurCornerRadius) + val outlineProvider = + object : ViewOutlineProvider() { + override fun getOutline(view: View, outline: Outline) { + outline.setRoundRect(0, 0, view.width, view.height, blurCornerRadius) + } } - } var overlayColor: Int = 0 set(value) { field = value overlayPaint.color = value } - private val overlayPaint = Paint(Paint.FILTER_BITMAP_FLAG or Paint.ANTI_ALIAS_FLAG).apply { - blendMode = BlendMode.OVERLAY - } + private val overlayPaint = + Paint(Paint.FILTER_BITMAP_FLAG or Paint.ANTI_ALIAS_FLAG).apply { + blendMode = BlendMode.OVERLAY + } init { createFullBlurDrawable() @@ -85,14 +85,8 @@ class BlurViewDelegate( if (attrs != null) { val a = context.obtainStyledAttributes(attrs, R.styleable.BlurLayout) - blurCornerRadius = a.getDimension( - R.styleable.BlurLayout_blurCornerRadius, - 0f - ) - overlayColor = a.getColor( - R.styleable.BlurLayout_blurOverlayColor, - 0 - ) + blurCornerRadius = a.getDimension(R.styleable.BlurLayout_blurCornerRadius, 0f) + overlayColor = a.getColor(R.styleable.BlurLayout_blurOverlayColor, 0) a.recycle() } } @@ -125,8 +119,10 @@ class BlurViewDelegate( } if (overlayColor != 0) { canvas.drawRect( - view.left.toFloat(), view.top.toFloat(), - view.right.toFloat(), view.bottom.toFloat(), + view.left.toFloat(), + view.top.toFloat(), + view.right.toFloat(), + view.bottom.toFloat(), overlayPaint ) } @@ -134,11 +130,12 @@ class BlurViewDelegate( private fun createFullBlurDrawable() { fullBlurDrawable?.let { if (view.isAttachedToWindow) it.stopListening() } - fullBlurDrawable = blurWallpaperProvider.createBlurDrawable().apply { - callback = blurDrawableCallback - setBounds(view.left, view.top, view.right, view.bottom) - if (view.isAttachedToWindow) startListening() - } + fullBlurDrawable = + blurWallpaperProvider.createBlurDrawable().apply { + callback = blurDrawableCallback + setBounds(view.left, view.top, view.right, view.bottom) + if (view.isAttachedToWindow) startListening() + } } override fun onEnabledChanged() { @@ -163,7 +160,12 @@ class BlurViewDelegate( } val right = left + view.width val bottom = top + view.height - fullBlurDrawable?.setBlurBounds(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat()) + fullBlurDrawable?.setBlurBounds( + left.toFloat(), + top.toFloat(), + right.toFloat(), + bottom.toFloat() + ) view.invalidate() this.offsetParents = offsetParents computeScrollOffset() @@ -199,6 +201,9 @@ class BlurViewDelegate( } private fun updateOffsets() { - fullBlurDrawable?.setOffsets(previousScrollX.toFloat() + parentOffsetX, previousScrollY.toFloat() + parentOffsetY) + fullBlurDrawable?.setOffsets( + previousScrollX.toFloat() + parentOffsetX, + previousScrollY.toFloat() + parentOffsetY + ) } } diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperFilter.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperFilter.kt index 6c1df95761a1b313767de1c972ed2d8526add8e0..b075661a84b41f0388812cd38d38b207014f2392 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperFilter.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperFilter.kt @@ -16,24 +16,26 @@ class BlurWallpaperFilter(private val context: Context) : WallpaperFilter - if (error == null) { - this@BlurWallpaperProvider.wallpapers = result - runOnMainThread(::notifyWallpaperChanged) - wallpaper.recycle() - } else { - if (error is OutOfMemoryError) { - runOnMainThread { - Toast.makeText(context, context.getString(R.string.toast_failed), Toast.LENGTH_LONG).show() - notifyWallpaperChanged() + applyTask = + wallpaperFilter.apply(wallpaper).setCallback { result, error -> + if (error == null) { + this@BlurWallpaperProvider.wallpapers = result + runOnMainThread(::notifyWallpaperChanged) + wallpaper.recycle() + } else { + if (error is OutOfMemoryError) { + runOnMainThread { + Toast.makeText( + context, + context.getString(R.string.toast_failed), + Toast.LENGTH_LONG + ) + .show() + notifyWallpaperChanged() + } } + wallpaper.recycle() } - wallpaper.recycle() } - } applyTask = null if (updatePending) { updatePending = false @@ -146,11 +151,7 @@ class BlurWallpaperProvider(val context: Context) { private fun applyVibrancy(wallpaper: Bitmap?): Bitmap { val width = wallpaper!!.width val height = wallpaper.height - val bitmap = Bitmap.createBitmap( - width, - height, - Bitmap.Config.ARGB_8888 - ) + val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) val canvas = Canvas() canvas.setBitmap(bitmap) val colorMatrix = ColorMatrix() @@ -163,8 +164,7 @@ class BlurWallpaperProvider(val context: Context) { } private fun scaleAndCropToScreenSize(wallpaper: Bitmap): Bitmap { - val wm = - context.getSystemService(Context.WINDOW_SERVICE) as WindowManager + val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager val display = wm.defaultDisplay display.getRealMetrics(displayMetrics) val width = displayMetrics.widthPixels @@ -175,12 +175,9 @@ class BlurWallpaperProvider(val context: Context) { if (upscaleFactor <= 0) { return wallpaper } - val scaledWidth = - max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() - val scaledHeight = - max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() - val scaledWallpaper = - Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) + val scaledWidth = max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() + val scaledHeight = max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() + val scaledWallpaper = Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) val navigationBarHeight = 0 /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) { @@ -190,17 +187,12 @@ class BlurWallpaperProvider(val context: Context) { } }*/ val y: Int - y = if (scaledWallpaper.height > height) { - (scaledWallpaper.height - height) / 2 - } else 0 - - return Bitmap.createBitmap( - scaledWallpaper, - 0, - y, - width, - height - navigationBarHeight - ) + y = + if (scaledWallpaper.height > height) { + (scaledWallpaper.height - height) / 2 + } else 0 + + return Bitmap.createBitmap(scaledWallpaper, 0, y, width, height - navigationBarHeight) } fun addListener(listener: Listener) { @@ -231,7 +223,9 @@ class BlurWallpaperProvider(val context: Context) { }*/ companion object : - SingletonHolder(ensureOnMainThread(useApplicationContext(::BlurWallpaperProvider))) { + SingletonHolder( + ensureOnMainThread(useApplicationContext(::BlurWallpaperProvider)) + ) { var isEnabled: Boolean = false private var sEnabledFlag: Int = 0 diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/ShaderBlurDrawable.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/ShaderBlurDrawable.kt index 27d906d196e5f6c8003e903bb8443aad7340dccb..fc38be1f99d593bd903b56505d68dbdb88881f0d 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/ShaderBlurDrawable.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/ShaderBlurDrawable.kt @@ -12,7 +12,8 @@ import android.graphics.Shader import android.graphics.drawable.Drawable import foundation.e.blisslauncher.core.DeviceProfile -class ShaderBlurDrawable internal constructor(private val blurWallpaperProvider: BlurWallpaperProvider) : +class ShaderBlurDrawable +internal constructor(private val blurWallpaperProvider: BlurWallpaperProvider) : Drawable(), BlurWallpaperProvider.Listener { private var blurAlpha = 255 @@ -50,12 +51,13 @@ class ShaderBlurDrawable internal constructor(private val blurWallpaperProvider: blurBitmap = blurWallpaperProvider.placeholder } blurBitmap = - if (blurBitmap!!.height >= blurBounds.bottom && - blurBitmap!!.width >= blurBounds.right + if ( + blurBitmap!!.height >= blurBounds.bottom && blurBitmap!!.width >= blurBounds.right ) { Bitmap.createBitmap( blurBitmap!!, - blurBounds.left.toInt(), blurBounds.top.toInt(), + blurBounds.left.toInt(), + blurBounds.top.toInt(), blurBounds.right.toInt() - blurBounds.left.toInt(), blurBounds.bottom.toInt() - blurBounds.top.toInt() ) @@ -63,19 +65,21 @@ class ShaderBlurDrawable internal constructor(private val blurWallpaperProvider: blurBitmap } - //setupBlurPath() + // setupBlurPath() - //canvas.translate(0f, -1500f) + // canvas.translate(0f, -1500f) if (noRadius) { canvas.drawRect( - 0f, 0f, - blurBounds.right - blurBounds.left, blurBounds.bottom - blurBounds.top, + 0f, + 0f, + blurBounds.right - blurBounds.left, + blurBounds.bottom - blurBounds.top, blurPaint ) } else { canvas.drawPath(DeviceProfile.path, blurPaint) } - //canvas.translate(0f, 1500f) + // canvas.translate(0f, 1500f) } override fun setAlpha(alpha: Int) { @@ -104,10 +108,11 @@ class ShaderBlurDrawable internal constructor(private val blurWallpaperProvider: setBlurBounds(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat()) fun setBlurBounds(left: Float, top: Float, right: Float, bottom: Float) { - if (blurBounds.left != left || - blurBounds.top != top || - blurBounds.right != right || - blurBounds.bottom != bottom + if ( + blurBounds.left != left || + blurBounds.top != top || + blurBounds.right != right || + blurBounds.bottom != bottom ) { blurBounds.set(left, top, right, bottom) blurPathValid = false @@ -120,10 +125,9 @@ class ShaderBlurDrawable internal constructor(private val blurWallpaperProvider: invalidateSelf() } - override fun setColorFilter(colorFilter: ColorFilter?) { - } + override fun setColorFilter(colorFilter: ColorFilter?) {} fun startListening() = blurWallpaperProvider.addListener(this) fun stopListening() = blurWallpaperProvider.removeListener(this) -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/blur/WallpaperFilter.kt b/app/src/main/java/foundation/e/blisslauncher/core/blur/WallpaperFilter.kt index 07fd3db646a95c3e11c38696f39b50793fd487c3..ebd04151d834db46abd76b3b379ec1e192625d17 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/blur/WallpaperFilter.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/blur/WallpaperFilter.kt @@ -54,4 +54,4 @@ interface WallpaperFilter { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurBackgroundView.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurBackgroundView.kt index 7774143e138872b82710f0f101e8f8dd7fecdcd7..9e09c6351b80a375cd2f4f6443c4a9eee4fa746c 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurBackgroundView.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurBackgroundView.kt @@ -10,8 +10,8 @@ import foundation.e.blisslauncher.core.blur.BlurWallpaperProvider import foundation.e.blisslauncher.core.blur.ShaderBlurDrawable import foundation.e.blisslauncher.core.runOnMainThread -class BlurBackgroundView(context: Context, attrs: AttributeSet?) : View(context, attrs), Insettable, - BlurWallpaperProvider.Listener { +class BlurBackgroundView(context: Context, attrs: AttributeSet?) : + View(context, attrs), Insettable, BlurWallpaperProvider.Listener { private val blurWallpaperProvider by lazy { BlurWallpaperProvider.getInstance(context) } @@ -20,15 +20,13 @@ class BlurBackgroundView(context: Context, attrs: AttributeSet?) : View(context, private val blurDrawableCallback by lazy { object : Drawable.Callback { - override fun unscheduleDrawable(who: Drawable, what: Runnable) { - } + override fun unscheduleDrawable(who: Drawable, what: Runnable) {} override fun invalidateDrawable(who: Drawable) { runOnMainThread { invalidate() } } - override fun scheduleDrawable(who: Drawable, what: Runnable, `when`: Long) { - } + override fun scheduleDrawable(who: Drawable, what: Runnable, `when`: Long) {} } } @@ -66,7 +64,8 @@ class BlurBackgroundView(context: Context, attrs: AttributeSet?) : View(context, private fun createFullBlurDrawable() { fullBlurDrawable?.let { if (isAttachedToWindow) it.stopListening() } - fullBlurDrawable = blurWallpaperProvider.createDrawable().apply { + fullBlurDrawable = + blurWallpaperProvider.createDrawable().apply { callback = blurDrawableCallback setBounds(left, top, right, bottom) if (isAttachedToWindow) startListening() diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurLayout.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurLayout.kt index ca66de1bf6a42f94fa55019bf4dcd80923bdcc77..9a64ecf1ce9c63f23da5024dd591e6208bdd36b5 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurLayout.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/BlurLayout.kt @@ -6,10 +6,8 @@ import android.util.AttributeSet import android.widget.FrameLayout import foundation.e.blisslauncher.core.blur.BlurViewDelegate -open class BlurLayout @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null -) : FrameLayout(context, attrs) { +open class BlurLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : + FrameLayout(context, attrs) { private val delegate = BlurViewDelegate(this, attrs) diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/DockGridLayout.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/DockGridLayout.kt index 6a6d6549c30653a7e98527fa9085a26bd6108889..b823e183368b4b0dc422f5d8d402ef580de0b639 100755 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/DockGridLayout.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/DockGridLayout.kt @@ -9,11 +9,10 @@ import foundation.e.blisslauncher.BlissLauncher import foundation.e.blisslauncher.core.blur.BlurViewDelegate import foundation.e.blisslauncher.core.utils.OffsetParent -class DockGridLayout @JvmOverloads constructor( - private val mContext: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : GridLayout(mContext, attrs, defStyleAttr), Insettable, OffsetParent { +class DockGridLayout +@JvmOverloads +constructor(private val mContext: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : + GridLayout(mContext, attrs, defStyleAttr), Insettable, OffsetParent { private val offsetParentDelegate = OffsetParent.OffsetParentDelegate() @@ -35,12 +34,13 @@ class DockGridLayout @JvmOverloads constructor( override fun setInsets(insets: Rect) { val deviceProfile = BlissLauncher.getApplication(mContext).deviceProfile - val lp = - layoutParams as InsettableRelativeLayout.LayoutParams + val lp = layoutParams as InsettableRelativeLayout.LayoutParams lp.height = deviceProfile.hotseatCellHeightPx + insets.bottom setPadding( - deviceProfile.iconDrawablePaddingPx / 2, 0, - deviceProfile.iconDrawablePaddingPx / 2, insets.bottom + deviceProfile.iconDrawablePaddingPx / 2, + 0, + deviceProfile.iconDrawablePaddingPx / 2, + insets.bottom ) layoutParams = lp } diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/SwipeSearchContainer.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/SwipeSearchContainer.kt index 5c9654746dab4fbc92a0d6c17f85eb59cbe5e4bc..4ab6c9a0adafb8bfce7c179a063012670f6dc824 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/SwipeSearchContainer.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/SwipeSearchContainer.kt @@ -5,10 +5,10 @@ import android.util.AttributeSet import android.widget.FrameLayout import foundation.e.blisslauncher.core.utils.OffsetParent -class SwipeSearchContainer @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null -) : FrameLayout(context, attrs), OffsetParent { +class SwipeSearchContainer +@JvmOverloads +constructor(context: Context, attrs: AttributeSet? = null) : + FrameLayout(context, attrs), OffsetParent { private val offsetParentDelegate = OffsetParent.OffsetParentDelegate() diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicator.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicator.kt index d75d0800112b731871d64206554ccbcac8f585d6..0b3146254fbbbeeaefa1a86c41aeea94b532ca11 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicator.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicator.kt @@ -1,10 +1,8 @@ package foundation.e.blisslauncher.core.customviews.pageindicators -/** - * Base class for a page indicator. - */ +/** Base class for a page indicator. */ interface PageIndicator { fun setScroll(currentScroll: Int, totalScroll: Int) fun setActiveMarker(activePage: Int) fun setMarkersCount(numMarkers: Int) -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicatorDots.kt b/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicatorDots.kt index eb032fcb0039ae4f011cedeba8d4f0be7326bb6c..fb74eb46ab9b75f989bedda886c84f01bac452e4 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicatorDots.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/customviews/pageindicators/PageIndicatorDots.kt @@ -20,8 +20,8 @@ import foundation.e.blisslauncher.R import kotlin.math.abs /** - * [PageIndicator] which shows dots per page. The active page is shown with the current - * accent color. + * [PageIndicator] which shows dots per page. The active page is shown with the current accent + * color. */ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : View(context, attrs, defStyleAttr), PageIndicator { @@ -33,13 +33,10 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I private var mNumPages = 0 private var mActivePage = 0 /** - * The current position of the active dot including the animation progress. - * For ex: - * 0.0 => Active dot is at position 0 - * 0.33 => Active dot is at position 0 and is moving towards 1 - * 0.50 => Active dot is at position [0, 1] - * 0.77 => Active dot has left position 0 and is collapsing towards position 1 - * 1.0 => Active dot is at position 1 + * The current position of the active dot including the animation progress. For ex: 0.0 => + * Active dot is at position 0 0.33 => Active dot is at position 0 and is moving towards 1 0.50 + * => Active dot is at position [0, 1] 0.77 => Active dot has left position 0 and is collapsing + * towards position 1 1.0 => Active dot is at position 1 */ private var mCurrentPosition = 0f private var mFinalPosition = 0f @@ -60,13 +57,17 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I val pageToLeft = currentScroll / scrollPerPage val pageToLeftScroll = pageToLeft * scrollPerPage val pageToRightScroll = pageToLeftScroll + scrollPerPage - val scrollThreshold = - SHIFT_THRESHOLD * scrollPerPage + val scrollThreshold = SHIFT_THRESHOLD * scrollPerPage when { - currentScroll < pageToLeftScroll + scrollThreshold -> { // scroll is within the left page's threshold + currentScroll < + pageToLeftScroll + + scrollThreshold -> { // scroll is within the left page's threshold animateToPosition(pageToLeft.toFloat()) } - currentScroll > pageToRightScroll - scrollThreshold -> { // scroll is far enough from left page to go to the right page + currentScroll > + pageToRightScroll - + scrollThreshold -> { // scroll is far enough from left page to go to the + // right page animateToPosition(pageToLeft + 1.toFloat()) } else -> { // scroll is between left and right page @@ -83,15 +84,13 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I } if (mAnimator == null && mCurrentPosition.compareTo(mFinalPosition) != 0) { val positionForThisAnim = - if (mCurrentPosition > mFinalPosition) mCurrentPosition - SHIFT_PER_ANIMATION else mCurrentPosition + SHIFT_PER_ANIMATION - mAnimator = ObjectAnimator.ofFloat( - this, - CURRENT_POSITION, - positionForThisAnim - ).apply { - addListener(AnimationCycleListener()) - duration = ANIMATION_DURATION - } + if (mCurrentPosition > mFinalPosition) mCurrentPosition - SHIFT_PER_ANIMATION + else mCurrentPosition + SHIFT_PER_ANIMATION + mAnimator = + ObjectAnimator.ofFloat(this, CURRENT_POSITION, positionForThisAnim).apply { + addListener(AnimationCycleListener()) + duration = ANIMATION_DURATION + } mAnimator?.start() } } @@ -106,8 +105,8 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I } /** - * Sets up up the page indicator to play the entry animation. - * [.playEntryAnimation] must be called after this. + * Sets up up the page indicator to play the entry animation. [.playEntryAnimation] must be + * called after this. */ fun prepareEntryAnimation() { mEntryAnimationRadiusFactors = FloatArray(mNumPages) @@ -121,15 +120,12 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I invalidate() return } - val interpolator: Interpolator = - OvershootInterpolator(ENTER_ANIMATION_OVERSHOOT_TENSION) + val interpolator: Interpolator = OvershootInterpolator(ENTER_ANIMATION_OVERSHOOT_TENSION) val animSet = AnimatorSet() for (i in 0 until count) { - val anim = ValueAnimator.ofFloat(0f, 1f) - .setDuration(ENTER_ANIMATION_DURATION.toLong()) + val anim = ValueAnimator.ofFloat(0f, 1f).setDuration(ENTER_ANIMATION_DURATION.toLong()) anim!!.addUpdateListener { animation -> - mEntryAnimationRadiusFactors!![i] = - (animation!!.animatedValue as Float) + mEntryAnimationRadiusFactors!![i] = (animation!!.animatedValue as Float) invalidate() } anim.interpolator = interpolator @@ -137,13 +133,15 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I ENTER_ANIMATION_START_DELAY + ENTER_ANIMATION_STAGGERED_DELAY * i.toLong() animSet.play(anim) } - animSet.addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator?) { - mEntryAnimationRadiusFactors = null - invalidateOutline() - invalidate() + animSet.addListener( + object : AnimatorListenerAdapter() { + override fun onAnimationEnd(animation: Animator?) { + mEntryAnimationRadiusFactors = null + invalidateOutline() + invalidate() + } } - }) + ) animSet.start() } @@ -163,13 +161,13 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I heightMeasureSpec: Int ) { // Add extra spacing of mDotRadius on all sides so that entry animation could be run. val width = - if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) MeasureSpec.getSize( - widthMeasureSpec - ) else ((mNumPages * 3 + 2) * mDotRadius).toInt() + if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) + MeasureSpec.getSize(widthMeasureSpec) + else ((mNumPages * 3 + 2) * mDotRadius).toInt() val height = - if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY) MeasureSpec.getSize( - heightMeasureSpec - ) else (4 * mDotRadius).toInt() + if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY) + MeasureSpec.getSize(heightMeasureSpec) + else (4 * mDotRadius).toInt() setMeasuredDimension(width, height) } @@ -215,8 +213,7 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I sTempRect!!.top = height * 0.5f - mDotRadius sTempRect.bottom = height * 0.5f + mDotRadius sTempRect.left = startX + startCircle * circleGap - sTempRect.right = - sTempRect.left + diameter + sTempRect.right = sTempRect.left + diameter if (delta < SHIFT_PER_ANIMATION) { // dot is capturing the right circle. sTempRect.right += delta * circleGap * 2 } else { // Dot is leaving the left circle. @@ -226,10 +223,8 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I } if (mIsRtl) { val rectWidth = sTempRect.width() - sTempRect.right = - width - sTempRect.left - sTempRect.left = - sTempRect.right - rectWidth + sTempRect.right = width - sTempRect.left + sTempRect.left = sTempRect.right - rectWidth } return sTempRect } @@ -249,9 +244,7 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I } } - /** - * Listener for keep running the animation until the final state is reached. - */ + /** Listener for keep running the animation until the final state is reached. */ private inner class AnimationCycleListener : AnimatorListenerAdapter() { private var mCancelled = false override fun onAnimationCancel(animation: Animator?) { @@ -277,9 +270,7 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I private const val ENTER_ANIMATION_OVERSHOOT_TENSION = 4.9f private val sTempRect: RectF? = RectF() private val CURRENT_POSITION: Property = - object : Property( - Float::class.java, "current_position" - ) { + object : Property(Float::class.java, "current_position") { override fun get(obj: PageIndicatorDots): Float { return obj.mCurrentPosition } @@ -298,6 +289,6 @@ class PageIndicatorDots(context: Context?, attrs: AttributeSet?, defStyleAttr: I outlineProvider = MyOutlineProver() mActiveColor = resources.getColor(R.color.dot_on_color) mInActiveColor = resources.getColor(R.color.dot_on_color) - //mIsRtl = Utilities.isRtl(getResources()) + // mIsRtl = Utilities.isRtl(getResources()) } -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/utils/DepthManager.kt b/app/src/main/java/foundation/e/blisslauncher/core/utils/DepthManager.kt index a1849328536da6fd75016d89b053240c6385c2dd..55eef0900c31771cdd0ff88acaceb434ac976087 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/utils/DepthManager.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/utils/DepthManager.kt @@ -8,18 +8,21 @@ import foundation.e.blisslauncher.features.launcher.LauncherActivity class DepthManager(private val launcher: LauncherActivity) { private val wallpaperManager = launcher.getSystemService(WallpaperManager::class.java)!! - private val setWallpaperZoomOut = WallpaperManager::class.java.getMethod( - "setWallpaperZoomOut", IBinder::class.java, Float::class.java) + private val setWallpaperZoomOut = + WallpaperManager::class + .java + .getMethod("setWallpaperZoomOut", IBinder::class.java, Float::class.java) init { - launcher.rootView.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener { - override fun onViewAttachedToWindow(v: View) { - updateDepth() - } + launcher.rootView.addOnAttachStateChangeListener( + object : View.OnAttachStateChangeListener { + override fun onViewAttachedToWindow(v: View) { + updateDepth() + } - override fun onViewDetachedFromWindow(v: View) { + override fun onViewDetachedFromWindow(v: View) {} } - }) + ) } fun updateDepth() { diff --git a/app/src/main/java/foundation/e/blisslauncher/core/utils/SingletonHolder.kt b/app/src/main/java/foundation/e/blisslauncher/core/utils/SingletonHolder.kt index 7e58554df7dc5e03e016c7f1dd0b0ba383a50607..e6c6b3713afee1e56141fc07998f63cd32313d11 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/utils/SingletonHolder.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/utils/SingletonHolder.kt @@ -8,8 +8,7 @@ import java.util.concurrent.ExecutionException open class SingletonHolder(creator: (A) -> T) { private var creator: ((A) -> T)? = creator - @Volatile - private var instance: T? = null + @Volatile private var instance: T? = null open fun getInstance(arg: A): T { val i = instance @@ -48,6 +47,7 @@ fun ensureOnMainThread(creator: (A) -> T): (A) -> T { } } } + fun useApplicationContext(creator: (Context) -> T): (Context) -> T { return { it -> creator(it.applicationContext) } -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperColorsCompat.kt b/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperColorsCompat.kt index 98430cc69d4855089a223c079423c7425907ab88..76c37b8070e5c9916550e1bcdc783dbe9ab3541a 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperColorsCompat.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperColorsCompat.kt @@ -17,23 +17,15 @@ package foundation.e.blisslauncher.core.wallpaper import androidx.annotation.IntDef -data class WallpaperColorsCompat( - val primaryColor: Int, - @ColorsHints val colorHints: Int -) { +data class WallpaperColorsCompat(val primaryColor: Int, @ColorsHints val colorHints: Int) { companion object { const val HINT_SUPPORTS_DARK_TEXT = 0x1 const val HINT_SUPPORTS_DARK_THEME = 0x2 - @IntDef( - value = [HINT_SUPPORTS_DARK_TEXT, HINT_SUPPORTS_DARK_THEME], - flag = true - ) - @Retention( - AnnotationRetention.SOURCE - ) + @IntDef(value = [HINT_SUPPORTS_DARK_TEXT, HINT_SUPPORTS_DARK_THEME], flag = true) + @Retention(AnnotationRetention.SOURCE) annotation class ColorsHints } } diff --git a/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperManagerCompat.kt b/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperManagerCompat.kt index c0b588ab1f64aaee1043e02e81d08bfb582a5661..4ccb598e062f5e33918620694287b8a6a2b497b3 100644 --- a/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperManagerCompat.kt +++ b/app/src/main/java/foundation/e/blisslauncher/core/wallpaper/WallpaperManagerCompat.kt @@ -37,8 +37,10 @@ class WallpaperManagerCompat(val context: Context) { var wallpaperColors: WallpaperColorsCompat? = null private set - val colorHints get() = wallpaperColors?.colorHints ?: 0 - val supportsDarkTheme get() = (colorHints and HINT_SUPPORTS_DARK_THEME) != 0 + val colorHints + get() = wallpaperColors?.colorHints ?: 0 + val supportsDarkTheme + get() = (colorHints and HINT_SUPPORTS_DARK_THEME) != 0 private var wcColorHintsMethod: Method? = null @@ -85,9 +87,7 @@ class WallpaperManagerCompat(val context: Context) { } private fun notifyChange() { - listeners.toTypedArray().forEach { - it.onColorsChanged() - } + listeners.toTypedArray().forEach { it.onColorsChanged() } } interface OnColorsChangedListener { @@ -95,5 +95,7 @@ class WallpaperManagerCompat(val context: Context) { } companion object : - SingletonHolder(ensureOnMainThread(useApplicationContext(::WallpaperManagerCompat))) + SingletonHolder( + ensureOnMainThread(useApplicationContext(::WallpaperManagerCompat)) + ) } diff --git a/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java b/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java index 30ff2d7505835081e2cd21efb7b215968b152449..3115be87704286d8d33b54989d733b77311e8acf 100755 --- a/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +++ b/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java @@ -1480,8 +1480,7 @@ public class LauncherActivity extends AppCompatActivity implements findViewById(R.id.edit_widgets_button).setOnClickListener( view -> startActivity(new Intent(this, WidgetsActivity.class))); - if (WeatherUtils.isWeatherServiceAvailable( - this)) { + if (WeatherUtils.isWeatherServiceAvailable(this)) { startService(new Intent(this, WeatherSourceListenerService.class)); startService(new Intent(this, DeviceStatusService.class)); } diff --git a/app/src/main/java/foundation/e/blisslauncher/features/widgets/DefaultWidgets.kt b/app/src/main/java/foundation/e/blisslauncher/features/widgets/DefaultWidgets.kt index 62d66603b42f4b09792d758e347c42a647b5f5a3..a4048cc7a06ca5e0d3d65dd10841a29206e103b4 100644 --- a/app/src/main/java/foundation/e/blisslauncher/features/widgets/DefaultWidgets.kt +++ b/app/src/main/java/foundation/e/blisslauncher/features/widgets/DefaultWidgets.kt @@ -4,8 +4,10 @@ import android.content.ComponentName import foundation.e.blisslauncher.features.weather.WeatherAppWidgetProvider object DefaultWidgets { - val ecloudWidget = ComponentName("foundation.e.drive", "foundation.e.drive.widgets.EDriveWidget") - val privacyWidget = ComponentName("foundation.e.advancedprivacy", "foundation.e.privacycentralapp.Widget") + val ecloudWidget = + ComponentName("foundation.e.drive", "foundation.e.drive.widgets.EDriveWidget") + val privacyWidget = + ComponentName("foundation.e.advancedprivacy", "foundation.e.privacycentralapp.Widget") val weatherWidget = WeatherAppWidgetProvider.COMPONENT_NAME val widgets = setOf(ecloudWidget, privacyWidget) diff --git a/app/src/main/res/anim/enter.xml b/app/src/main/res/anim/enter.xml index 31024e220c050e839c063a510fb3b124662d3484..a59dcf51afbf8ef530514d2f30f153fe414ef11a 100755 --- a/app/src/main/res/anim/enter.xml +++ b/app/src/main/res/anim/enter.xml @@ -3,4 +3,4 @@ android:duration="@android:integer/config_longAnimTime" android:fromXDelta="100%p" android:toXDelta="0%p"> - \ No newline at end of file + diff --git a/app/src/main/res/anim/leave.xml b/app/src/main/res/anim/leave.xml index 06668d78c1e55e0eeb9773b53812e8448ae6b689..32a6f4a7c6a40aaae7a5c155c4880c8430b71347 100755 --- a/app/src/main/res/anim/leave.xml +++ b/app/src/main/res/anim/leave.xml @@ -3,4 +3,4 @@ android:duration="@android:integer/config_longAnimTime" android:fromXDelta="0%p" android:toXDelta="-100%p"> - \ No newline at end of file + diff --git a/app/src/main/res/anim/wobble.xml b/app/src/main/res/anim/wobble.xml index 4dbe1718ecfab6022b44b3f7e037c27c2758f9c3..dbe93d9894bfdb52026c6bedd4170232ab9708eb 100755 --- a/app/src/main/res/anim/wobble.xml +++ b/app/src/main/res/anim/wobble.xml @@ -6,4 +6,4 @@ android:pivotY="50%" android:repeatCount="infinite" android:repeatMode="reverse" - android:toDegrees="2" /> \ No newline at end of file + android:toDegrees="2" /> diff --git a/app/src/main/res/anim/wobble_reverse.xml b/app/src/main/res/anim/wobble_reverse.xml index 92330781bd73f3b1e883fbe2a5c7ad317be184cd..e3bf3c23a34c87546755021920e6e776502fdaa1 100755 --- a/app/src/main/res/anim/wobble_reverse.xml +++ b/app/src/main/res/anim/wobble_reverse.xml @@ -6,4 +6,4 @@ android:pivotY="50%" android:repeatCount="infinite" android:repeatMode="reverse" - android:toDegrees="-2" /> \ No newline at end of file + android:toDegrees="-2" /> diff --git a/app/src/main/res/drawable/btn_background_add_widget_rounded.xml b/app/src/main/res/drawable/btn_background_add_widget_rounded.xml index ec8ad249b750de1712414d177a41f19999732b6c..7b6fd83c88e7a2944ffefeda4f6b9c7b8616eba7 100644 --- a/app/src/main/res/drawable/btn_background_add_widget_rounded.xml +++ b/app/src/main/res/drawable/btn_background_add_widget_rounded.xml @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/btn_rounded_corner.xml b/app/src/main/res/drawable/btn_rounded_corner.xml index f7fcbf4ff752d87766c6129b7f5da102f4f8d5ac..010eb10ff8f0b2c90ade75f90310051750a27bee 100644 --- a/app/src/main/res/drawable/btn_rounded_corner.xml +++ b/app/src/main/res/drawable/btn_rounded_corner.xml @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/dot_off.xml b/app/src/main/res/drawable/dot_off.xml index 442bf74197330bb5bff44f41184e7afbe761ef14..dcc40c21437af4e0b895c1000583aef20da8bf31 100755 --- a/app/src/main/res/drawable/dot_off.xml +++ b/app/src/main/res/drawable/dot_off.xml @@ -4,4 +4,4 @@ android:innerRadius="0dp" android:thickness="6dp"> - \ No newline at end of file + diff --git a/app/src/main/res/drawable/dot_on.xml b/app/src/main/res/drawable/dot_on.xml index b82015e30e48e3ee5e2abd667657728b05ceaee7..f20cf38fd723f4c2403300b693f33447b76f95a0 100755 --- a/app/src/main/res/drawable/dot_on.xml +++ b/app/src/main/res/drawable/dot_on.xml @@ -4,4 +4,4 @@ android:innerRadius="0dp" android:thickness="6dp"> - \ No newline at end of file + diff --git a/app/src/main/res/drawable/folder_title_text_cursor.xml b/app/src/main/res/drawable/folder_title_text_cursor.xml index cd74bcd239c842247aa140b6aec9edaeb5236b79..dc9df35ea53e204f06a7d4a34950cf394f59da73 100644 --- a/app/src/main/res/drawable/folder_title_text_cursor.xml +++ b/app/src/main/res/drawable/folder_title_text_cursor.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/folder_window.xml b/app/src/main/res/drawable/folder_window.xml index a6e5b64f1a502bd92ef50382a886cbbee53e6a99..475540dd9db2012cd536af7a9a0a0dafc2d683fe 100755 --- a/app/src/main/res/drawable/folder_window.xml +++ b/app/src/main/res/drawable/folder_window.xml @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/gap.xml b/app/src/main/res/drawable/gap.xml index d081f3a245386cb3ba218a508a0625a9b632c581..996b6fde6e760fd2ebed18f21430eac76c956a79 100755 --- a/app/src/main/res/drawable/gap.xml +++ b/app/src/main/res/drawable/gap.xml @@ -4,4 +4,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/item_suggestion_background.xml b/app/src/main/res/drawable/item_suggestion_background.xml index 9239afef1fd6d7cd90edee34f0e8ecec86d02193..aa1c2581a95e0c738ff97f5504e7291f4e3b7de8 100755 --- a/app/src/main/res/drawable/item_suggestion_background.xml +++ b/app/src/main/res/drawable/item_suggestion_background.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/item_widget_bottom_round_corner.xml b/app/src/main/res/drawable/item_widget_bottom_round_corner.xml index dd3694e790db95e85722d940ad93679ed9832164..03c5c147c7d1147deccf601e33f667401ee417ad 100755 --- a/app/src/main/res/drawable/item_widget_bottom_round_corner.xml +++ b/app/src/main/res/drawable/item_widget_bottom_round_corner.xml @@ -6,4 +6,4 @@ android:topRightRadius="0dp" android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp"/> - \ No newline at end of file + diff --git a/app/src/main/res/drawable/item_widget_top_round_corner.xml b/app/src/main/res/drawable/item_widget_top_round_corner.xml index 41b1b578ae94c6e793efa0ff21a52135672428e5..bb76445d41cf56c26ed44a74bef6faf7c891c6bc 100755 --- a/app/src/main/res/drawable/item_widget_top_round_corner.xml +++ b/app/src/main/res/drawable/item_widget_top_round_corner.xml @@ -6,4 +6,4 @@ android:bottomRightRadius="0dp" android:topLeftRadius="12dp" android:topRightRadius="12dp"/> - \ No newline at end of file + diff --git a/app/src/main/res/drawable/search_widget.xml b/app/src/main/res/drawable/search_widget.xml index 48c355e3e23ae22ca206e73690d78952dcabbdfb..46562502c41cb6295298e906715bc30f5dd48526 100755 --- a/app/src/main/res/drawable/search_widget.xml +++ b/app/src/main/res/drawable/search_widget.xml @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/widget_resize_frame.xml b/app/src/main/res/drawable/widget_resize_frame.xml index ee3b9e82f115581b6518f16d058f44f844005173..de9910081a34133af1bdb037f46fddaf9447e475 100644 --- a/app/src/main/res/drawable/widget_resize_frame.xml +++ b/app/src/main/res/drawable/widget_resize_frame.xml @@ -4,4 +4,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/widget_resize_thumb_handle.xml b/app/src/main/res/drawable/widget_resize_thumb_handle.xml index f72d24e4d70a45d287a0d71e252fc90a12c59fd6..d863565c93037af5794069d50bab3bdc7eaea055 100644 --- a/app/src/main/res/drawable/widget_resize_thumb_handle.xml +++ b/app/src/main/res/drawable/widget_resize_thumb_handle.xml @@ -130,4 +130,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6be9af4983ef74d89521907cda880571f9979075..2b31b02c327830fd92756ab72baac08b86aff9e8 100755 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -112,4 +112,4 @@ android:indeterminateTint="?workspaceTextColor" android:visibility="gone" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/activity_widget_picker.xml b/app/src/main/res/layout/activity_widget_picker.xml index ae816672f5e3beab21f7846eaa66b5b544d04dce..f614b8a25d82891e862ec9ba2636433aa8ca797d 100644 --- a/app/src/main/res/layout/activity_widget_picker.xml +++ b/app/src/main/res/layout/activity_widget_picker.xml @@ -2,4 +2,4 @@ \ No newline at end of file + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/app_view.xml b/app/src/main/res/layout/app_view.xml index f58d542a2363bbde0b7e6b53e1da52d129fa81ef..e277efde933829086931a9920c6f0123696560f0 100755 --- a/app/src/main/res/layout/app_view.xml +++ b/app/src/main/res/layout/app_view.xml @@ -55,4 +55,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/calendar_icon.xml b/app/src/main/res/layout/calendar_icon.xml index 3e34eabd19796ff04656219791808f84f9883055..92203c03cc075d9cdfb25e6bab5ee0aa6f85c315 100755 --- a/app/src/main/res/layout/calendar_icon.xml +++ b/app/src/main/res/layout/calendar_icon.xml @@ -27,4 +27,4 @@ android:gravity="center_horizontal" android:textColor="#000" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_added_widget.xml b/app/src/main/res/layout/item_added_widget.xml index 9bbac8acbfdc31e6af52f44bb6bba42bc8934f65..72eba2a8e62fecba95fa6595ce4a267ea047f50f 100644 --- a/app/src/main/res/layout/item_added_widget.xml +++ b/app/src/main/res/layout/item_added_widget.xml @@ -32,4 +32,4 @@ android:layout_alignParentEnd="true" android:padding="6dp" android:src="@drawable/ic_add_widget_green_24dp" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_all_widget.xml b/app/src/main/res/layout/item_all_widget.xml index d48de2203d3c4d57f31424a9f2b7dd312ada4047..b61d77c0d9acbc00b653bf149e8ca25bcb2e4ba5 100644 --- a/app/src/main/res/layout/item_all_widget.xml +++ b/app/src/main/res/layout/item_all_widget.xml @@ -23,4 +23,4 @@ android:layout_marginRight="16dp" android:layout_toEndOf="@+id/widget_icon" android:textColor="#000" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_weather_forecast.xml b/app/src/main/res/layout/item_weather_forecast.xml index d9649759ff33fce01aa01078fc18fb0b07b05790..ca4ec955a315bd43fc27b3f93c835ddc55265084 100644 --- a/app/src/main/res/layout/item_weather_forecast.xml +++ b/app/src/main/res/layout/item_weather_forecast.xml @@ -36,4 +36,4 @@ android:textAppearance="?android:attr/textAppearanceSmallInverse" android:textColor="?widgetPrimaryTextColor" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/layout_used_apps.xml b/app/src/main/res/layout/layout_used_apps.xml index 0f215c84ef26d5efb2fdc043e31d23abfb6d10a8..8240d99ecf34ad344e3d2b11ae4b3a3caf39ff4d 100755 --- a/app/src/main/res/layout/layout_used_apps.xml +++ b/app/src/main/res/layout/layout_used_apps.xml @@ -37,4 +37,4 @@ android:textColor="?workspaceTextColor" android:textSize="16sp" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/layout_widget_host_container.xml b/app/src/main/res/layout/layout_widget_host_container.xml index 4ba5f8056b0cf72297ca068e0dc34fe82c5eb5c3..2e86796fa8d82ee8c0f08d0a08cfa4e9baf3fec3 100644 --- a/app/src/main/res/layout/layout_widget_host_container.xml +++ b/app/src/main/res/layout/layout_widget_host_container.xml @@ -24,4 +24,4 @@ android:layout_gravity="center_horizontal|bottom" android:src="@drawable/widget_resize_thumb_handle" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/widgets_page.xml b/app/src/main/res/layout/widgets_page.xml index d894ac4a836eec03cdfa89f159aff72bdad42485..34f5daa0bf4f99917994ad6701403df64298478d 100755 --- a/app/src/main/res/layout/widgets_page.xml +++ b/app/src/main/res/layout/widgets_page.xml @@ -108,4 +108,4 @@ android:text="Max" android:textColor="@color/white" /> - \ No newline at end of file + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ce5e497f9c8c51e8a5aab92d207f0c426a18b86a..699d8ae2192642dcb031cea4b3ed57e1b35c6ce1 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -143,4 +143,4 @@ Benutzerdefinierten Standort in den Einstellungen von Wetter festlegen. Berechtigung nicht erteilt Karten - \ No newline at end of file + diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c720f8c9f40b748e488fbdb23c307b8a22e3afb2..8f6542c590767b26a386bb71afb99c7d53e14f5e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -133,4 +133,4 @@ Mostrar al minimizar Seleccione esta opción para alternar entre los iconos estándar (Color) y los alternativos (Blanco) Mapas - \ No newline at end of file + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 3a0e95eeed1c76e1d9aba4100f710e67b57cec68..1251ae7dd02825c2e88f300b90d56df804d41857 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -142,4 +142,4 @@ Autorisation refusée Le widget n\'est pas redimensionnable Cartes - \ No newline at end of file + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1035559d7d059f0dabd3bbd26825e5ee9fd2b84a..c49219ebc08778eeeb95ef7c6967178436c4f3f7 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -143,4 +143,4 @@ Imposta una posizione predefinita nelle impostazioni meteo. Autorizzazione rifiutata Il widget non è riscalabile - \ No newline at end of file + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index a6b3daec9354f9ae75cdf8d94a67446c6227dd96..3ea04e700dfa8c15ab64cac383b89bb7458bfdc0 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index a6b3daec9354f9ae75cdf8d94a67446c6227dd96..3ea04e700dfa8c15ab64cac383b89bb7458bfdc0 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + diff --git a/app/src/main/res/values-v26/bools.xml b/app/src/main/res/values-v26/bools.xml index 3eabcb40f9b61267c19a83220858240f19e27d0c..7cb264dac1a12687d1a0841de100ad420f56576e 100644 --- a/app/src/main/res/values-v26/bools.xml +++ b/app/src/main/res/values-v26/bools.xml @@ -1,4 +1,4 @@ false - \ No newline at end of file + diff --git a/app/src/main/res/values/bools.xml b/app/src/main/res/values/bools.xml index e8eb8f791b2d02e77757dfa1a0f7ec0ec8f822b6..8b4b500578a932237a29c755d83586674e3de779 100644 --- a/app/src/main/res/values/bools.xml +++ b/app/src/main/res/values/bools.xml @@ -1,4 +1,4 @@ true - \ No newline at end of file + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 54be3054abe82f9fbb44d095f5a790cfcc3fc847..47cef0b373cec9d3f3390c5d0551ea4051d54fbb 100755 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -13,4 +13,4 @@ @dimen/dp_12 @dimen/dp_8 200dp - \ No newline at end of file + diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml index add7ded4710f1534c1f7164622d029a6bb867246..dcd5b3fe479d7c6e21f34773ae42500b2666fa9b 100755 --- a/app/src/main/res/values/ids.xml +++ b/app/src/main/res/values/ids.xml @@ -5,4 +5,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/values/row_column_count.xml b/app/src/main/res/values/row_column_count.xml index abb1d6ed54d91394acb10b68f10e3a075fa6914e..3c9a25348481e41c49260a80c47d004c95a46474 100755 --- a/app/src/main/res/values/row_column_count.xml +++ b/app/src/main/res/values/row_column_count.xml @@ -1,4 +1,4 @@ 4 - \ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0692a3442370adf862fa2e2e6575a4b029b60cb4..1c0e249228784f6a51a9aaef747d20e86d5ea425 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -177,4 +177,4 @@ Dock is already full No more room in page Maps - \ No newline at end of file + diff --git a/build-logic/.gitignore b/build-logic/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..72e330e39b613a805ab7b2606db09b520356012f --- /dev/null +++ b/build-logic/.gitignore @@ -0,0 +1,3 @@ +.gradle/* +build/* +**/build/* \ No newline at end of file diff --git a/build-logic/kotlin-plugins/build.gradle.kts b/build-logic/kotlin-plugins/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..6b0fd869f7c9934646c9e27a604ae6fcbbd3c7f1 --- /dev/null +++ b/build-logic/kotlin-plugins/build.gradle.kts @@ -0,0 +1,27 @@ +@file:Suppress("UnstableApiUsage", "DSL_SCOPE_VIOLATION") + +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { `kotlin-dsl` } + +dependencies { implementation(libs.build.spotless) } + +afterEvaluate { + tasks.withType().configureEach { + sourceCompatibility = JavaVersion.VERSION_1_8.toString() + targetCompatibility = JavaVersion.VERSION_1_8.toString() + } + + tasks.withType().configureEach { + kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } + } +} + +gradlePlugin { + plugins { + register("spotless") { + id = "foundation.e.blisslauncher.spotless" + implementationClass = "foundation.e.blisslauncher.gradle.SpotlessPlugin" + } + } +} diff --git a/build-logic/kotlin-plugins/src/main/kotlin/foundation/e/blisslauncher/gradle/SpotlessPlugin.kt b/build-logic/kotlin-plugins/src/main/kotlin/foundation/e/blisslauncher/gradle/SpotlessPlugin.kt new file mode 100644 index 0000000000000000000000000000000000000000..3f694da53887fe2d1f9108f1c072ca1b36162400 --- /dev/null +++ b/build-logic/kotlin-plugins/src/main/kotlin/foundation/e/blisslauncher/gradle/SpotlessPlugin.kt @@ -0,0 +1,44 @@ +package foundation.e.blisslauncher.gradle + +import com.diffplug.gradle.spotless.SpotlessExtension +import com.diffplug.gradle.spotless.SpotlessPlugin +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.getByType + +@Suppress("Unused") +class SpotlessPlugin : Plugin { + + override fun apply(project: Project) { + project.pluginManager.apply(SpotlessPlugin::class) + project.extensions.getByType().run { + java { + target("**/*.java") + removeUnusedImports() + } + + kotlin { + ktfmt().kotlinlangStyle() + target("**/*.kt") + targetExclude("**/build/") + trimTrailingWhitespace() + endWithNewline() + } + + kotlinGradle { + ktfmt().kotlinlangStyle() + target("**/*.gradle.kts") + targetExclude("**/build/") + } + + format("xml") { + target("**/*.xml") + targetExclude("**/build/", ".idea/") + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + } + } + } +} diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..26334040ad5511d6bd5a47eccbb1f2b0615dbe62 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,23 @@ +@file:Suppress("UnstableApiUsage") + +rootProject.name = "build-logic" + +enableFeaturePreview("VERSION_CATALOGS") + +pluginManagement { + repositories { + mavenCentral() + google() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } } + } +} + +include("kotlin-plugins") diff --git a/build.gradle b/build.gradle deleted file mode 100755 index b1fe21614e0b1326554198e9ef52ed0aca8cb3ce..0000000000000000000000000000000000000000 --- a/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -import foundation.e.blisslauncher.buildsrc.Libs - -buildscript { - ext.kotlin_version = '1.3.61' - repositories { - google() - jcenter() - maven { - url 'https://maven.fabric.io/public' - } - } - dependencies { - classpath Libs.androidGradlePlugin - - classpath Libs.Kotlin.gradlePlugin - classpath Libs.Kotlin.extensions - - classpath Libs.Google.fabricPlugin - classpath Libs.Google.gmsGoogleServices - - } -} - -plugins { - id "com.diffplug.gradle.spotless" version "3.14.0" - id 'com.github.ben-manes.versions' version "0.25.0" -} - -allprojects { - repositories { - google() - jcenter() - maven { url 'https://jitpack.io' } - mavenCentral() - } -} - -subprojects { - apply plugin: 'com.diffplug.gradle.spotless' - spotless { - java { - target '**/*.java' - removeUnusedImports() // removes any unused imports - } - kotlin { - target "**/*.kt" - ktlint() - } - kotlinGradle { - // same as kotlin, but for .gradle.kts files (defaults to '*.gradle.kts') - target '*.gradle.kts', 'additionalScripts/*.gradle.kts' - ktlint() - } - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..726e3478e127efe98b49dbc91b9988ba4001e8fd --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,15 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") + +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.kotlin.kapt) apply false + alias(libs.plugins.google.services) apply false + alias(libs.plugins.refine) apply false + alias(libs.plugins.benmanes.versions) apply false + id("foundation.e.blisslauncher.spotless") +} + +val clean by tasks.existing(Delete::class) { delete(rootProject.buildDir) } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 445e21f767b47d0d6d4198770c581bb9d0ea0083..90df4cd752b84d913df381aea83640166d9250fd 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,7 +1,3 @@ -repositories { - jcenter() -} +repositories { mavenCentral() } -plugins { - `kotlin-dsl` -} \ No newline at end of file +plugins { `kotlin-dsl` } diff --git a/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Dependencies.kt b/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Dependencies.kt deleted file mode 100644 index 17beb3676be088dc4c8845385d562ab24f3a3376..0000000000000000000000000000000000000000 --- a/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Dependencies.kt +++ /dev/null @@ -1,131 +0,0 @@ -package foundation.e.blisslauncher.buildsrc - -object Versions { - const val compile_sdk = 31 - const val min_sdk = 24 - const val target_sdk = 29 - const val android_gradle_plugin = "3.5.0" - const val kotlin = "1.3.41" - const val timber = "4.7.1" - const val junit = "4.12" - const val robolectric = "4.3" - const val mockK = "1.9.3" - const val firebase_core = "17.1.0" - const val crashlytics = "2.10.1" - const val google_services = "4.3.0" - const val fabric = "1.31.0" - const val okhttp = "4.1.0" - const val retrofit = "2.6.1" - const val dagger = "2.24" - const val rxjava = "2.2.11" - const val rxandroid = "2.1.1" - const val rxkotlin = "2.4.0" - const val ktlint = "0.34.2" -} - -object Libs { - const val androidGradlePlugin = "com.android.tools.build:gradle:${Versions.android_gradle_plugin}" - - const val timber = "com.jakewharton.timber:timber:${Versions.timber}" - - const val junit = "junit:junit:${Versions.junit}" - const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}" - const val mockK = "io.mockk:mockk:${Versions.mockK}" - - object ApacheCommons { - const val commonsLang = "org.apache.commons:commons-lang3:3.12.0" - } - - object Google { - const val firebaseCore = "com.google.firebase:firebase-core:${Versions.firebase_core}" - const val crashlytics = "com.crashlytics.sdk.android:crashlytics:${Versions.crashlytics}" - const val gmsGoogleServices = "com.google.gms:google-services:${Versions.google_services}" - const val fabricPlugin = "io.fabric.tools:gradle:${Versions.fabric}" - } - - object Kotlin { - const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}" - const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}" - const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" - const val extensions = "org.jetbrains.kotlin:kotlin-android-extensions:${Versions.kotlin}" - } - - object AndroidX { - const val appcompat = "androidx.appcompat:appcompat:1.4.1" - const val collection = "androidx.collection:collection-ktx:1.1.0" - const val palette = "androidx.palette:palette:1.0.0" - const val recyclerview = "androidx.recyclerview:recyclerview:1.1.0-beta03" - - object Navigation { - private const val version = "2.2.0-alpha01" - const val fragment = "androidx.navigation:navigation-fragment-ktx:$version" - const val ui = "androidx.navigation:navigation-ui-ktx:$version" - const val safeArgs = "androidx.navigation:navigation-safe-args-gradle-plugin:$version" - } - - object Fragment { - private const val version = "1.2.0-alpha02" - const val fragment = "androidx.fragment:fragment:$version" - const val fragmentKtx = "androidx.fragment:fragment-ktx:$version" - } - - object Test { - private const val version = "1.2.0" - const val core = "androidx.test:core:$version" - const val runner = "androidx.test:runner:$version" - const val rules = "androidx.test:rules:$version" - - const val espressoCore = "androidx.test.espresso:espresso-core:3.2.0" - const val espressoContrib = "androidx.test.espresso:espresso-contrib:3.2.0" - const val espressoIntents = "androidx.test.espresso:espresso-intents:3.2.0" - const val archCoreTesting = "androidx.arch.core:core-testing:2.0.1" - - } - - const val preference = "androidx.preference:preference:1.1.0-rc01" - - const val constraintlayout = "androidx.constraintlayout:constraintlayout:2.0.0-beta2" - - const val coreKtx = "androidx.core:core-ktx:1.2.0-alpha03" - - object Lifecycle { - private const val version = "2.2.0-alpha03" - const val extensions = "androidx.lifecycle:lifecycle-extensions:$version" - const val compiler = "androidx.lifecycle:lifecycle-compiler:$version" - const val viewmodel = "androidx.lifecycle:lifecycle-viewmodel-ktx:$version" - } - - object Room { - private const val version = "2.2.0-beta01" - const val common = "androidx.room:room-common:$version" - const val runtime = "androidx.room:room-runtime:$version" - const val compiler = "androidx.room:room-compiler:$version" - const val ktx = "androidx.room:room-ktx:$version" - const val testing = "androidx.room:room-testing:$version" - } - } - - object RxJava { - const val rxJava = "io.reactivex.rxjava2:rxjava:${Versions.rxjava}" - const val rxAndroid = "io.reactivex.rxjava2:rxandroid:${Versions.rxandroid}" - const val rxKotlin = "io.reactivex.rxjava2:rxkotlin:${Versions.rxkotlin}" - } - - object Dagger { - const val dagger = "com.google.dagger:dagger:${Versions.dagger}" - const val androidSupport = "com.google.dagger:dagger-android-support:${Versions.dagger}" - const val compiler = "com.google.dagger:dagger-compiler:${Versions.dagger}" - const val androidProcessor = "com.google.dagger:dagger-android-processor:${Versions.dagger}" - } - - object Retrofit { - const val retrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}" - const val retrofit_rxjava_adapter = "com.squareup.retrofit2:adapter-rxjava2:${Versions.retrofit}" - const val gsonConverter = "com.squareup.retrofit2:converter-gson:${Versions.retrofit}" - } - - object OkHttp { - const val okhttp = "com.squareup.okhttp3:okhttp:${Versions.okhttp}" - const val loggingInterceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.okhttp}" - } -} \ No newline at end of file diff --git a/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Versions.kt b/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Versions.kt new file mode 100644 index 0000000000000000000000000000000000000000..2e9305a3c5a578eab52fdd7ab7e8bb581cd9786b --- /dev/null +++ b/buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Versions.kt @@ -0,0 +1,7 @@ +package foundation.e.blisslauncher.buildsrc + +object Versions { + const val COMPILE_SDK = 31 + const val MIN_SDK = 24 + const val TARGET_SDK = 29 +} diff --git a/data/build.gradle b/data/build.gradle deleted file mode 100644 index 2e3d8bef1a129ba62261e72536de0005069fd18a..0000000000000000000000000000000000000000 --- a/data/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -import foundation.e.blisslauncher.buildsrc.Libs -import foundation.e.blisslauncher.buildsrc.Versions - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' - -android { - compileSdkVersion Versions.compile_sdk - defaultConfig { - minSdkVersion Versions.min_sdk - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - testOptions { - unitTests { - includeAndroidResources = true - - all { - minHeapSize = "64m" - maxHeapSize = "128m" - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation Libs.Kotlin.stdlib - implementation Libs.AndroidX.appcompat - implementation Libs.AndroidX.coreKtx - - implementation Libs.AndroidX.Room.runtime - kapt Libs.AndroidX.Room.compiler - - kapt Libs.Dagger.compiler - - testImplementation Libs.junit - testImplementation Libs.robolectric - testImplementation Libs.mockK -} diff --git a/data/build.gradle.kts b/data/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..a033c6bae2d157cfd701b513eee1b061a3de92ea --- /dev/null +++ b/data/build.gradle.kts @@ -0,0 +1,52 @@ +@file:Suppress("UnstableApiUsage", "DSL_SCOPE_VIOLATION") + +import foundation.e.blisslauncher.buildsrc.Versions + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.kapt) +} + +android { + namespace = "foundation.e.blisslauncher.data" + compileSdk = Versions.COMPILE_SDK + + defaultConfig { + minSdk = Versions.MIN_SDK + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + testOptions { + unitTests { + isIncludeAndroidResources = true + all { + it.minHeapSize = "64m" + it.maxHeapSize = "128m" + } + } + } +} + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + implementation(libs.kotlin.stdlib.jdk8) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.core.ktx) + + implementation(libs.androidx.room.runtime) + kapt(libs.androidx.room.compiler) + + kapt(libs.dagger.compiler) + + testImplementation(libs.junit) + testImplementation(libs.robolectric) + testImplementation(libs.mockk) +} diff --git a/data/proguard-rules.pro b/data/proguard-rules.pro index f1b424510da51fd82143bc74a0a801ae5a1e2fcd..2f9dc5a47edc8241c18c1374b3f1fcf6396a829d 100644 --- a/data/proguard-rules.pro +++ b/data/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/data/src/main/AndroidManifest.xml b/data/src/main/AndroidManifest.xml index 3cc832571af20a6f6ede1c748d0b555781cdd2b7..cc947c56799598205b8fb518f3ba95843c1bab71 100644 --- a/data/src/main/AndroidManifest.xml +++ b/data/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/data/src/test/java/foundation/e/blisslauncher/data/ExampleUnitTest.kt b/data/src/test/java/foundation/e/blisslauncher/data/ExampleUnitTest.kt index 1ed56b7767ccab8a8a712e68cf1a5c82dbdb4bde..eb7c58612d315b9b04063db8811d2035a1879ce2 100644 --- a/data/src/test/java/foundation/e/blisslauncher/data/ExampleUnitTest.kt +++ b/data/src/test/java/foundation/e/blisslauncher/data/ExampleUnitTest.kt @@ -1,8 +1,7 @@ package foundation.e.blisslauncher.data -import org.junit.Test - import org.junit.Assert +import org.junit.Test /** * Example local unit test, which will execute on the development machine (host). diff --git a/domain/build.gradle b/domain/build.gradle deleted file mode 100644 index dcca293e86e96225fcd3f89989e9c55b37b87f1c..0000000000000000000000000000000000000000 --- a/domain/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -import foundation.e.blisslauncher.buildsrc.Libs -import foundation.e.blisslauncher.buildsrc.Versions - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' - -android { - compileSdkVersion Versions.compile_sdk - - defaultConfig { - minSdkVersion Versions.min_sdk - targetSdkVersion Versions.target_sdk - } - - compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 - } -} - -dependencies { - implementation Libs.Kotlin.stdlib - - kapt Libs.Dagger.compiler - - implementation Libs.RxJava.rxKotlin - implementation Libs.timber - testImplementation Libs.junit -} diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..421e841d87dc62ed363adacf4524e7871a0a6809 --- /dev/null +++ b/domain/build.gradle.kts @@ -0,0 +1,33 @@ +@file:Suppress("UnstableApiUsage", "DSL_SCOPE_VIOLATION") + +import foundation.e.blisslauncher.buildsrc.Versions + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.kapt) +} + +android { + namespace = "foundation.e.blisslauncher.domain" + compileSdk = Versions.COMPILE_SDK + + defaultConfig { + minSdk = Versions.MIN_SDK + targetSdk = Versions.TARGET_SDK + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation(libs.kotlin.stdlib.jdk8) + kapt(libs.dagger.compiler) + + implementation(libs.rx.kotlin) + implementation(libs.timber) + testImplementation(libs.junit) +} diff --git a/domain/proguard-rules.pro b/domain/proguard-rules.pro index f1b424510da51fd82143bc74a0a801ae5a1e2fcd..2f9dc5a47edc8241c18c1374b3f1fcf6396a829d 100644 --- a/domain/proguard-rules.pro +++ b/domain/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/domain/src/main/AndroidManifest.xml b/domain/src/main/AndroidManifest.xml index d405b99707fe0a2d3175c38de27168575c2ba815..cc947c56799598205b8fb518f3ba95843c1bab71 100644 --- a/domain/src/main/AndroidManifest.xml +++ b/domain/src/main/AndroidManifest.xml @@ -1 +1 @@ - \ No newline at end of file + diff --git a/domain/src/main/java/foundation/e/blisslauncher/domain/executors/PostExecutionThread.kt b/domain/src/main/java/foundation/e/blisslauncher/domain/executors/PostExecutionThread.kt index ba8ed2ca00f0cd30c86908b522b3adf42eedacdd..3a80de7b12ccf3c908da3ed340b7937b2924116a 100644 --- a/domain/src/main/java/foundation/e/blisslauncher/domain/executors/PostExecutionThread.kt +++ b/domain/src/main/java/foundation/e/blisslauncher/domain/executors/PostExecutionThread.kt @@ -4,4 +4,4 @@ import io.reactivex.Scheduler interface PostExecutionThread { val scheduler: Scheduler -} \ No newline at end of file +} diff --git a/domain/src/main/java/foundation/e/blisslauncher/domain/executors/ThreadExecutor.kt b/domain/src/main/java/foundation/e/blisslauncher/domain/executors/ThreadExecutor.kt index f2b27ad31beacca6d30360477de737e9baa5f98a..8c42d0692381c2e0695a7fae8b9b8e20ad28fcf3 100644 --- a/domain/src/main/java/foundation/e/blisslauncher/domain/executors/ThreadExecutor.kt +++ b/domain/src/main/java/foundation/e/blisslauncher/domain/executors/ThreadExecutor.kt @@ -2,4 +2,4 @@ package foundation.e.blisslauncher.domain.executors import java.util.concurrent.Executor -interface ThreadExecutor : Executor \ No newline at end of file +interface ThreadExecutor : Executor diff --git a/domain/src/main/java/foundation/e/blisslauncher/domain/interactors/Interactor.kt b/domain/src/main/java/foundation/e/blisslauncher/domain/interactors/Interactor.kt index 144ad143f1e9ea9003559ac72ca3be03011eae04..341a3d9784104af58af91dc5a82943cac6b673d7 100644 --- a/domain/src/main/java/foundation/e/blisslauncher/domain/interactors/Interactor.kt +++ b/domain/src/main/java/foundation/e/blisslauncher/domain/interactors/Interactor.kt @@ -22,7 +22,8 @@ abstract class FlowableInteractor : Interactor

, Disposable { protected abstract fun buildObservable(params: P? = null): Flowable operator fun invoke(params: P, onNext: (next: T) -> Unit = {}, onComplete: () -> Unit = {}) { - disposables += this.buildObservable(params) + disposables += + this.buildObservable(params) .subscribeOn(Schedulers.from(threadExecutor)) .observeOn(postExecutionThread.scheduler) .subscribe(onNext, Timber::w, onComplete) @@ -40,7 +41,8 @@ abstract class CompletableInteractor : Interactor

, Disposable { protected abstract fun buildObservable(params: P? = null): Completable operator fun invoke(params: P, onComplete: () -> Unit = {}) { - disposables += this.buildObservable(params) + disposables += + this.buildObservable(params) .subscribeOn(Schedulers.from(threadExecutor)) .observeOn(postExecutionThread.scheduler) .subscribe(onComplete, Timber::w) @@ -49,4 +51,4 @@ abstract class CompletableInteractor : Interactor

, Disposable { override fun dispose() = disposables.dispose() override fun isDisposed(): Boolean = disposables.isDisposed -} \ No newline at end of file +} diff --git a/domain/src/test/java/foundation/e/blisslauncher/domain/ExampleUnitTest.kt b/domain/src/test/java/foundation/e/blisslauncher/domain/ExampleUnitTest.kt index 7c5a7b55e68f9443f2d8e80a4d187df12feeb94d..16b020231987a7d0dc64e208efd2838bd06a38d7 100644 --- a/domain/src/test/java/foundation/e/blisslauncher/domain/ExampleUnitTest.kt +++ b/domain/src/test/java/foundation/e/blisslauncher/domain/ExampleUnitTest.kt @@ -1,8 +1,7 @@ package foundation.e.blisslauncher.domain -import org.junit.Test - import org.junit.Assert.assertEquals +import org.junit.Test /** * Example local unit test, which will execute on the development machine (host). diff --git a/gradle.properties b/gradle.properties index 4b862715dc7d100816ac4837adabc43b5687ee0f..a9492dd99030e142d334def087e4b69efbb8aebc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,10 +15,6 @@ org.gradle.parallel=true org.gradle.configureondemand=true org.gradle.caching=true -# Enable D8 desugar / R8 -android.enableD8.desugaring=true -android.enableR8=true - # AndroidX android.useAndroidX=true android.enableJetifier=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000000000000000000000000000000000..0c239eca934963bb99885b6cadadd5c3eb929cb5 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,76 @@ +[versions] +agp = "7.3.0" +axCore = "1.2.0-alpha03" +axAppcompat = "1.4.1" +axTest = "1.2.0" +dagger = "2.24" +kotlin = "1.7.10" +okhttp = "4.1.0" +refine = "3.1.1" +retrofit = "2.6.1" +room = "2.2.0-beta01" +spotless = "6.11.0" + +[libraries] +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "axCore" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "axAppcompat" } +androidx-recyclerview = "androidx.recyclerview:recyclerview:1.1.0-beta03" +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "axTest" } +androidx-test-rules = { module = "androidx.test:rules", version.ref = "axTest" } +androidx-localbroadcast = "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0" +apache-commons = "org.apache.commons:commons-lang3:3.12.0" + +build-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" } + +dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" } +dagger-android-processor = { module = "com.google.dagger:dagger-android-processor", version.ref = "dagger" } + +greenrobot-eventbus = "org.greenrobot:eventbus:3.1.1" +hoko-blur = "com.hoko:hoko-blur:1.3.4" + +kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" } +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } + +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } + +refine-annotation = { module = "dev.rikka.tools.refine:annotation", version.ref = "refine" } +refine-annotation-processor = { module = "dev.rikka.tools.refine:annotation-processor", version.ref = "refine" } +refine-runtime = { module = "dev.rikka.tools.refine:runtime", version.ref = "refine" } + +retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +retrofit-rxjava-adapter = { module = "com.squareup.retrofit2:adapter-rxjava2", version.ref = "retrofit" } +retrofit-gson-converter = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } + +rx-android = "io.reactivex.rxjava2:rxandroid:2.1.1" +rx-binding = "com.jakewharton.rxbinding3:rxbinding:3.0.0" +rx-java = "io.reactivex.rxjava2:rxjava:2.2.11" +rx-kotlin = "io.reactivex.rxjava2:rxkotlin:2.4.0" +rx-relay = "com.jakewharton.rxrelay2:rxrelay:2.1.1" + +arch-core = "androidx.arch.core:core-testing:2.0.1" +debug-db = "com.amitshekhar.android:debug-db:1.0.4" +circleindicator = "me.relex:circleindicator:2.1.4" +espresso-core = "androidx.test.espresso:espresso-core:3.2.0" +junit = "junit:junit:4.12" +mockk = "io.mockk:mockk:1.9.3" +mockito-core = "org.mockito:mockito-core:2.19.0" +robolectric = "org.robolectric:robolectric:4.3" +tools-desugar = "com.android.tools:desugar_jdk_libs:1.1.5" +timber = "com.jakewharton.timber:timber:4.7.1" +restriction-bypass = "com.github.ChickenHook:RestrictionBypass:2.2" + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +android-library = { id = "com.android.library", version.ref = "agp" } +benmanes-versions = "com.github.ben-manes.versions:0.25.0" +google-services = "com.google.gms.google-services:4.3.0" +refine = { id = "dev.rikka.tools.refine", version.ref = "refine" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } + +[bundles] +testing-unit = ["arch-core", "junit", "robolectric", "mockito-core"] +testing-android = ["junit", "espresso-core", "androidx-test-runner", "androidx-test-rules"] \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fd7090066b6d91bcf4344445eacb2453dd111696..418b2159cb8e85d6ae71ed5a021abf588ee40da3 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip diff --git a/settings.gradle b/settings.gradle deleted file mode 100755 index e70334ca2e10a41e1aa63b764f3f9d4b645171e5..0000000000000000000000000000000000000000 --- a/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -include ':app' -include ':data' -include ':domain' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..1bbbd5c60436dac9395d20148429118e82664674 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,31 @@ +@file:Suppress("UnstableApiUsage", "JcenterRepositoryObsolete") + +pluginManagement { + repositories { + includeBuild("build-logic") + gradlePluginPortal() + google() + maven("https://maven.fabric.io/public") + mavenCentral() + jcenter() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + maven("https://maven.fabric.io/public") + mavenCentral() + jcenter() + maven("https://jitpack.io") + } +} + +enableFeaturePreview("VERSION_CATALOGS") + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +include(":app", ":data", ":domain") + +rootProject.name = "blisslauncher"