Skip to content

Commit

Permalink
Update Kuper to v 2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed Dec 5, 2021
1 parent ba3119c commit e722746
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 25 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

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

<!-- TODO: Do NOT remove the intent-filter tags -->
<intent-filter>
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/kotlin/dev/jahir/kuper/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ class MainActivity : KuperActivity() {

override fun defaultTheme(): Int = R.style.MyApp_Default
override fun amoledTheme(): Int = R.style.MyApp_Default_Amoled
}

override fun defaultMaterialYouTheme(): Int = R.style.MyApp_Default_MaterialYou
override fun amoledMaterialYouTheme(): Int = R.style.MyApp_Default_Amoled_MaterialYou
}
50 changes: 50 additions & 0 deletions app/src/main/res/values-v31/m3_colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Light Theme Colors -->
<color name="m3_primary">@android:color/system_neutral1_10</color>
<color name="m3_primaryDark">@android:color/system_neutral1_10</color>
<color name="m3_onPrimary">@android:color/system_neutral1_900</color>

<color name="m3_accent">@android:color/system_accent1_500</color>
<color name="m3_onAccent">@android:color/system_accent1_0</color>

<color name="m3_surface">@android:color/system_neutral2_50</color>
<color name="m3_onSurface">@android:color/system_neutral2_900</color>
<color name="m3_onSurfaceVariant">@android:color/system_neutral2_700</color>

<color name="m3_background">@android:color/system_neutral1_10</color>
<color name="m3_onBackground">@android:color/system_neutral1_900</color>

<color name="m3_snackbarBackgroundColor">@android:color/system_neutral2_800</color>
<color name="m3_snackbarTextColor">@android:color/system_neutral2_50</color>
<color name="m3_snackbarButtonColor">@android:color/system_accent1_200</color>

<color name="m3_bottomNavActiveIndicator">@android:color/system_neutral2_100</color>

<!-- Dark Theme Colors -->
<color name="m3_darkThemePrimary">@android:color/system_neutral1_900</color>
<color name="m3_darkThemePrimaryDark">@android:color/system_neutral1_900</color>
<color name="m3_darkThemeOnPrimary">@android:color/system_neutral1_100</color>

<color name="m3_darkThemeAccent">@android:color/system_accent1_200</color>
<color name="m3_darkThemeOnAccent">@android:color/system_accent1_800</color>

<color name="m3_darkThemeSurface">@android:color/system_neutral2_800</color>
<color name="m3_darkThemeOnSurface">@android:color/system_neutral2_50</color>
<color name="m3_darkThemeOnSurfaceVariant">@android:color/system_neutral2_100</color>

<color name="m3_darkThemeBackground">@android:color/system_neutral1_900</color>
<color name="m3_darkThemeOnBackground">@android:color/system_neutral1_100</color>

<color name="m3_darkThemeSnackbarBackgroundColor">@android:color/system_neutral2_50</color>
<color name="m3_darkThemeSnackbarTextColor">@android:color/system_neutral2_900</color>
<color name="m3_darkThemeSnackbarButtonColor">@android:color/system_accent1_500</color>

<color name="m3_darkThemeBottomNavActiveIndicator">@android:color/system_neutral2_700</color>

<!-- Amoled Theme Colors -->
<color name="m3_amoledThemeAccent">@android:color/system_accent1_200</color>
<color name="m3_amoledThemeSnackbarButtonColor">@android:color/system_accent1_500</color>

<color name="m3_amoledThemeBottomNavActiveIndicator">@color/m3_darkThemeBottomNavActiveIndicator</color>
</resources>
29 changes: 29 additions & 0 deletions app/src/main/res/values/m3_shape_styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Learn more about Shape Theming and what you can do at:
https://material.io/develop/android/theming/shape/
Important: do NOT change the style names, just the attributes/properties
-->

<style name="ShapeAppearance.Frames.SmallComponent.MaterialYou" parent="ShapeAppearance.Material3.SmallComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/small_components_corner_size</item>
</style>

<style name="ShapeAppearance.Frames.MediumComponent.MaterialYou" parent="ShapeAppearance.Material3.MediumComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/medium_components_corner_size</item>
</style>

<style name="ShapeAppearance.Frames.LargeComponent.MaterialYou" parent="ShapeAppearance.Material3.LargeComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/large_components_corner_size</item>
</style>

<style name="ShapeAppearance.Frames.CardView.MaterialYou" parent="ShapeAppearance.Frames.MediumComponent.MaterialYou">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/cards_corner_size</item>
</style>

</resources>
32 changes: 32 additions & 0 deletions app/src/main/res/values/m3_styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Don't change the parent style -->
<style name="MyApp.Default.MaterialYou" parent="Frames.Default.MaterialYou">
<item name="bottomNavigationStyle">@style/MyApp.BottomNavigationView.MaterialYou</item>
<item name="customFontBold">@font/manrope_bold_fam</item>
<item name="customFontNormal">@font/manrope_normal_fam</item>
</style>

<!-- Don't change the parent style -->
<style name="MyApp.Default.Amoled.MaterialYou" parent="Frames.Default.Amoled.MaterialYou">
<item name="bottomNavigationStyle">@style/MyApp.BottomNavigationView.MaterialYou</item>
<item name="customFontBold">@font/manrope_bold_fam</item>
<item name="customFontNormal">@font/manrope_normal_fam</item>
</style>

<!-- Don't change the parent style -->
<style name="MyApp.BottomNavigationView.MaterialYou" parent="Widget.Frames.BottomNavigationView.MaterialYou">
<!--
Switch bottom navigation labels visibility style
You can use any of there:
- auto
- labeled
- unlabeled
- selected
Learn more: https://developer.android.com/reference/com/google/android/material/bottomnavigation/LabelVisibilityMode
-->
<item name="labelVisibilityMode">auto</item>
</style>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
You can change the parent to any of these:
- Frames.SplashScreen
- Frames.SplashScreen.Amoled
- Frames.SplashScreen.MaterialYou
- Frames.SplashScreen.Amoled.MaterialYou
-->
<style name="MyApp.SplashScreen" parent="Frames.SplashScreen">
<item name="customFontBold">@font/manrope_bold_fam</item>
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Kuper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

object Kuper {
const val appId = "dev.jahir.kuper.app"
const val version = 234
const val versionName = "2.3.4"
const val version = 235
const val versionName = "2.3.5"
}
14 changes: 7 additions & 7 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

object Versions {
// Plugins
const val gradle = "7.0.0"
const val kotlin = "1.5.21"
const val gradle = "7.0.3"
const val kotlin = "1.5.31"
const val sonatype = "1.1.0"

// OneSignal
const val oneSignalPlugin = "0.13.4"
const val oneSignal = "4.4.2"
const val oneSignalPlugin = "0.14.0"
const val oneSignal = "4.6.3"

// App
const val minSdk = 21
const val targetSdk = 30
const val targetSdk = 31
const val buildTools = "30.0.2"

// Frames
const val frames = "3.4.4"
const val frames = "3.4.5"

// Kustom API
const val kustomApi = "6369c37"

// Lifecycle Runtime KTX
const val lifecycleRuntimeKtx = "2.3.1"
const val lifecycleRuntimeKtx = "2.4.0"
}
4 changes: 3 additions & 1 deletion library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<activity
android:name="dev.jahir.frames.ui.activities.SettingsActivity"
android:exported="false" />
android:exported="false"
tools:replace="android:exported" />

<activity
android:name="dev.jahir.frames.ui.activities.MuzeiSettingsActivity"
Expand All @@ -27,6 +28,7 @@

<activity
android:name=".ui.activities.KuperSettingsActivity"
android:exported="true"
android:label="@string/settings">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.jahir.kuper.ui.adapters

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.view.ViewGroup
Expand All @@ -15,16 +16,17 @@ import dev.jahir.kuper.ui.viewholders.ComponentViewHolder
class ComponentsAdapter(private val onClick: (Component) -> Unit) :
SectionedRecyclerViewAdapter<SectionedViewHolder>() {

var components = ArrayList<Component>()
var components = listOf<Component>()
@SuppressLint("NotifyDataSetChanged")
set(value) {
field.clear()
field.addAll(value)
field = value
notifyDataSetChanged()
}

private val sectionTitles = ArrayList<String>()

internal var wallpaper: Drawable? = null
@SuppressLint("NotifyDataSetChanged")
set(value) {
field = value
notifyDataSetChanged()
Expand Down Expand Up @@ -100,4 +102,4 @@ class ComponentsAdapter(private val onClick: (Component) -> Unit) :

override fun getSectionCount(): Int = 5
override fun onBindFooterViewHolder(holder: SectionedViewHolder?, section: Int) {}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.jahir.kuper.ui.adapters

import android.annotation.SuppressLint
import android.view.ViewGroup
import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter
import com.afollestad.sectionedrecyclerview.SectionedViewHolder
Expand All @@ -13,10 +14,10 @@ import dev.jahir.kuper.ui.viewholders.RequiredAppViewHolder
class RequiredAppsAdapter(private val onClick: (RequiredApp) -> Unit) :
SectionedRecyclerViewAdapter<SectionedViewHolder>() {

var apps: ArrayList<RequiredApp> = ArrayList()
var apps: List<RequiredApp> = emptyList()
@SuppressLint("NotifyDataSetChanged")
set(value) {
field.clear()
field.addAll(value)
field = value
notifyDataSetChanged()
}

Expand Down Expand Up @@ -69,4 +70,4 @@ class RequiredAppsAdapter(private val onClick: (RequiredApp) -> Unit) :

override fun getSectionCount(): Int = 2
override fun onBindFooterViewHolder(holder: SectionedViewHolder?, section: Int) {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ class ComponentsFragment : BaseFramesFragment<Component>() {
contxt.openLink(PLAY_STORE_LINK_PREFIX + itemPkg)
}
}
} ?: {
} ?: run {
if (component.type == Component.Type.KOMPONENT) {
activity?.mdDialog {
setTitle(R.string.komponents)
setMessage(R.string.open_komponents)
setPositiveButton(android.R.string.ok) { _, _ -> }
}?.show()
}
}()
}
}
}

Expand All @@ -165,7 +165,7 @@ class ComponentsFragment : BaseFramesFragment<Component>() {
): ArrayList<Component> =
ArrayList(originalItems.filter { it.name.lower().contains(filter.lower()) })

override fun updateItemsInAdapter(items: ArrayList<Component>) {
override fun updateItemsInAdapter(items: List<Component>) {
componentsAdapter.components = items
recyclerView?.loading = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SetupFragment : BaseFramesFragment<RequiredApp>() {
filter: String
): ArrayList<RequiredApp> = originalItems

override fun updateItemsInAdapter(items: ArrayList<RequiredApp>) {
override fun updateItemsInAdapter(items: List<RequiredApp>) {
requiredAppsAdapter.apps = items
}

Expand All @@ -53,4 +53,4 @@ class SetupFragment : BaseFramesFragment<RequiredApp>() {
fun create(requiredApps: ArrayList<RequiredApp> = ArrayList()): SetupFragment =
SetupFragment().apply { updateItemsInAdapter(requiredApps) }
}
}
}

0 comments on commit e722746

Please sign in to comment.