Skip to content

Commit

Permalink
Merge pull request #302 from jahirfiquitiva/update
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed Feb 27, 2023
2 parents 6ea5e47 + 0021801 commit dd166e7
Show file tree
Hide file tree
Showing 44 changed files with 231 additions and 229 deletions.
23 changes: 3 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
// TODO: Remove comment marks to enable
/*
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath Plugins.oneSignal
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
*/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
Expand Down Expand Up @@ -97,12 +80,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}
}

Expand Down
13 changes: 4 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
<application
android:name=".MyApplication"
android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
Expand All @@ -19,8 +21,8 @@

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:exported="true">
android:exported="true"
android:label="@string/app_name">

<!-- TODO: Do NOT remove the intent-filter tags -->
<intent-filter>
Expand Down Expand Up @@ -253,13 +255,6 @@
android:value="dev.jahir.kuper.ui.activities.KuperMuzeiSettingsActivity" />
</provider>

<!-- TODO: Remove comment marks to enable Zooper
<provider
android:name=".ZooperProvider"
android:authorities="${applicationId}.zwprovider"
tools:ignore="ExportedContentProvider"/>
-->

<!-- TODO: Remove comment marks to enable Kustom Skins
* Remove intent-filter action lines according to your needs.
* If you're not going to provide one of the options, remove its respective line.
Expand Down
Binary file removed app/src/main/assets/iconsets/Minimal Weather.zip
Binary file not shown.
Binary file removed app/src/main/assets/templates/Fimbo Analog Clock.zw
Binary file not shown.
Binary file removed app/src/main/assets/templates/Fimbo Calendar.zw
Binary file not shown.
Binary file removed app/src/main/assets/templates/Fimbo Digital Clock.zw
Binary file not shown.
Binary file removed app/src/main/assets/templates/Fimbo Weather.zw
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/assets/templates/FimboSimpleBar.zw
Binary file not shown.
Binary file removed app/src/main/assets/templates/FimboWeatherTime.zw
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler
import dev.jahir.frames.extensions.context.color
import dev.jahir.frames.extensions.context.drawable
import dev.jahir.frames.extensions.context.preferences
import dev.jahir.frames.extensions.context.hasNotificationsPermission
class NotificationServiceExtension : OSRemoteNotificationReceivedHandler {
override fun remoteNotificationReceived(
context: Context,
notificationReceivedEvent: OSNotificationReceivedEvent
) {
if(!context.preferences.notificationsEnabled) {
if(!context.preferences.notificationsEnabled || !context.hasNotificationsPermission) {
notificationReceivedEvent.complete(null)
return
}
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/kotlin/dev/jahir/blueprint/app/ZooperProvider.kt

This file was deleted.

20 changes: 1 addition & 19 deletions app/src/main/res/values/kuper_setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,9 @@
<!-- Set to 'true' if your app requires Kolorette. 'false' otherwise. -->
<bool name="kolorette_required">false</bool>

<!-- ZOOPER EXCLUSIVE CONFIGS -->

<!-- These texts are shown in Zooper -->
<string name="zooper_pack_name">@string/app_name</string>
<string name="zooper_pack_desc">Cool widgets.</string>
<string name="zooper_pack_author">Your name</string>

<!-- If set to 0, the user will not be allowed to save the templates you provide -->
<integer name="zooper_pack_allowsave">1</integer>

<!-- This is the icon that will be shown in Zooper -->
<drawable name="zooper_pack_icon">@mipmap/ic_launcher</drawable>

<!-- Set to 'true' if your app requires Media Utils. 'false' otherwise. -->
<bool name="media_utils_required">false</bool>

<!-- KUSTOM EXCLUSIVE CONFIGS -->

<!-- Name of the skin to be shown inside the Kustom app -->
<string name="kustom_pack_title">@string/app_name</string>

<!-- A brief description of the pack contents -->
<string name="kustom_pack_description">Cool Kustom komponents, wallpapers and widgets.</string>
</resources>
</resources>
3 changes: 2 additions & 1 deletion app/src/main/res/values/supported_launchers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<item>lawnchair</item>
<item>lineageos</item>
<item>lucid</item>
<item>moto</item>
<item>niagara</item>
<item>nova</item>
<item>oneplus</item>
Expand All @@ -25,4 +26,4 @@
<item>square</item>
<item>tsf</item>
</string-array>
</resources>
</resources>
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Blueprint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

object Blueprint {
const val appId = "dev.jahir.blueprint.app"
const val version = 230
const val versionName = "2.3.0"
const val version = 234
const val versionName = "2.3.4"
}
4 changes: 0 additions & 4 deletions buildSrc/src/main/java/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ object Plugins {
// Kotlin
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"

// OneSignal
const val oneSignal =
"gradle.plugin.com.onesignal:onesignal-gradle-plugin:${Versions.oneSignalPlugin}"

// Sonatype
const val sonatype =
"io.github.gradle-nexus:publish-plugin:${Versions.sonatype}"
Expand Down
15 changes: 7 additions & 8 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

object Versions {
// Plugins
const val gradle = "7.2.1"
const val kotlin = "1.7.0"
const val gradle = "7.4.1"
const val kotlin = "1.8.0"
const val sonatype = "1.1.0"
const val ksp = "$kotlin-1.0.6"
const val ksp = "$kotlin-1.0.9"

// OneSignal
const val oneSignalPlugin = "0.14.0"
const val oneSignal = "4.8.1"
const val oneSignal = "4.8.4"

// App
const val minSdk = 21
const val targetSdk = 32
const val buildTools = "32.0.0"
const val targetSdk = 33
const val buildTools = "33.0.2"

// Kuper
const val kuper = "2.4.0"
const val kuper = "2.4.4"

// Adaptive Icons
const val adaptiveIcons = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jul 24 22:47:34 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
7 changes: 4 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.devtools.ksp'

android {
namespace 'dev.jahir.blueprint'
compileSdkVersion Versions.targetSdk
buildToolsVersion Versions.buildTools

Expand Down Expand Up @@ -64,12 +65,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}
}

Expand Down
10 changes: 10 additions & 0 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

<application
android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="true"
android:largeHeap="true"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
Expand Down Expand Up @@ -57,6 +59,14 @@
</application>

<queries>
<package android:name="org.kustom.widget" />
<package android:name="org.kustom.widget.pro" />
<package android:name="org.kustom.wallpaper" />
<package android:name="org.kustom.wallpaper.pro" />
<package android:name="org.kustom.lockscreen" />
<package android:name="org.kustom.lockscreen.pro" />
<package android:name="com.arun.themeutil.kolorette" />

<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ class BlueprintPreferences(context: Context) : Preferences(context) {
get() = prefs.getInt(ICON_SHAPE, 0)
set(value) = prefsEditor.putInt(ICON_SHAPE, value).apply()

var iconsRequestConsentAccepted: Boolean
get() = prefs.getBoolean(ICONS_REQUEST_CONSENT_ACCEPTED, false)
set(value) = prefsEditor.putBoolean(ICONS_REQUEST_CONSENT_ACCEPTED, value).apply()

companion object {
private const val KEY_SAVED_TIME_MILLIS = "saved_time_millis"
private const val MAX_APPS = "apps_to_request"
private const val ICON_SHAPE = "icon_shape"
private const val ICONS_REQUEST_CONSENT_ACCEPTED = "icons_request_consent_accepted"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ data class WallpapersCounter(override val count: Int = 0) :

data class KustomCounter(override val count: Int = 0) :
Counter(R.string.templates, R.drawable.ic_kustom, count)

data class ZooperCounter(override val count: Int = 0) :
Counter(R.string.templates, R.drawable.ic_zooper, count)
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ data class Icon(val name: String, @DrawableRes val resId: Int) : Parcelable, Com
parcelIn.readInt()
)

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(name)
dest?.writeInt(resId)
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(name)
dest.writeInt(resId)
}

override fun describeContents(): Int = 0
Expand All @@ -24,4 +24,4 @@ data class Icon(val name: String, @DrawableRes val resId: Int) : Parcelable, Com
@JvmField
val CREATOR: Parcelable.Creator<Icon> = createParcel { Icon(it) }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ data class IconsCategory(
ArrayList<Icon>().apply { parcelIn.readTypedList(this, Icon.CREATOR) }
)

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(title)
dest?.writeTypedList(icons)
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(title)
dest.writeTypedList(icons)
}

override fun describeContents(): Int = 0
Expand Down Expand Up @@ -54,4 +54,4 @@ data class IconsCategory(
val subList = icons.subList(0, maxSize)
return ArrayList(if (shuffle) subList.shuffled() else subList)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ enum class Launcher(
"ch.deletescape.lawnchair.plah",
"ch.deletescape.lawnchair",
"ch.deletescape.lawnchair.ci",
"ch.deletescape.lawnchair.dev"
"ch.deletescape.lawnchair.dev",
"app.lawnchair"
),
R.drawable.ic_lawnchair
),
Expand All @@ -63,11 +64,13 @@ enum class Launcher(
R.drawable.ic_lineageos_theme_engine
),
LUCID("lucid", "Lucid Launcher", arrayOf("com.powerpoint45.launcher"), R.drawable.ic_lucid),
MOTO("moto", "Moto Launcher", arrayOf(
"com.motorola.launcher3",
"com.motorola.personalize",
"com.motorola.moto.overlay.personalizelauncher",
), R.drawable.ic_moto),
MOTO(
"moto", "Moto Launcher", arrayOf(
"com.motorola.launcher3",
"com.motorola.personalize",
"com.motorola.moto.overlay.personalizelauncher",
), R.drawable.ic_moto
),
NIAGARA("niagara", "Niagara Launcher", arrayOf("bitpit.launcher"), R.drawable.ic_niagara),
NOVA("nova", "Nova Launcher", arrayOf("com.teslacoilsw.launcher"), R.drawable.ic_nova),
ONEPLUS("oneplus", "OnePlus Launcher", arrayOf("net.oneplus.launcher"), R.drawable.ic_oneplus),
Expand Down Expand Up @@ -119,4 +122,4 @@ enum class Launcher(
return ArrayList(pairs)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
data class RequestManagerResponse(val status: String? = null, val message: String? = null) : Parcelable
data class RequestManagerResponse(val status: String? = null, val message: String? = null) :
Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,14 @@ import android.content.Intent
import android.util.Log

interface RequestCallback {
fun onRequestRunning() {
Log.d("Blueprint", "Request in progress!")
}

fun onRequestStarted() {
Log.d("Blueprint", "Request started!")
}

fun onRequestUploadFinished(success: Boolean) {
Log.d("Blueprint", "Request finished! - Success? $success")
}

fun onRequestEmpty() {
Log.w("Blueprint", "Nothing to request")
}
fun onRequestRunning() {}
fun onRequestStarted() {}
fun onRequestUploadFinished(success: Boolean) {}
fun onRequestEmpty() {}
fun onRequestEmailIntent(intent: Intent?) {}

fun onRequestError(reason: String? = null, e: Throwable? = null) {
Log.e("Blueprint", "Request ERROR")
e?.printStackTrace()
}

fun onRequestLimited(state: RequestState, building: Boolean = false) {
Expand All @@ -30,8 +20,4 @@ interface RequestCallback {
"Request limited (${state.state.name})! Apps left: ${state.requestsLeft} - Time left: ${state.timeLeft}"
)
}

fun onRequestEmailIntent(intent: Intent?) {
Log.d("Blueprint", "Should send request via email!")
}
}
}
Loading

0 comments on commit dd166e7

Please sign in to comment.