Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into fdroid #128

Merged
merged 32 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
40b33c8
Improvements to surface colors and brightness modification
Mahmud0808 Aug 18, 2024
4cc0011
Start notification service only if conditions met
Mahmud0808 Aug 18, 2024
1522eda
Make permissions scrollable #106
Mahmud0808 Aug 18, 2024
456ef42
Add id for scrollview
Mahmud0808 Aug 18, 2024
ec0c339
Add prompt to disable battery optimization
Mahmud0808 Aug 19, 2024
8b1333a
Fix keyguard circle drawable color
Mahmud0808 Aug 19, 2024
0dead7e
Make notification scrim darker in light mode
Mahmud0808 Aug 19, 2024
98c625d
New Crowdin translations by GitHub Action
crowdin-bot Aug 25, 2024
a9b899b
Merge pull request #121 from Mahmud0808/localization
Mahmud0808 Aug 29, 2024
00e1ec4
New Crowdin translations by GitHub Action
crowdin-bot Sep 8, 2024
686efee
Merge pull request #125 from Mahmud0808/localization
Mahmud0808 Sep 8, 2024
1fc0883
Update .gitignore
Mahmud0808 Sep 17, 2024
c8bde7d
Fix keyguard buttons background color not visible on some custom ROMs
Mahmud0808 Sep 17, 2024
fe69557
Bump AGP & dependencies
Mahmud0808 Sep 17, 2024
40fc25e
Improve a few dynamic colors
Mahmud0808 Sep 17, 2024
cdbf075
Add support for custom secondary and tertiary colors (closes #45)
Mahmud0808 Sep 17, 2024
f9011fb
Fix gboard key colors
Mahmud0808 Sep 17, 2024
d45c562
Add mode-specific theme toggle (closes #108)
Mahmud0808 Sep 18, 2024
5f14cbb
Retain per-app theme list when ColorBlendr service is disabled (fix #66)
Mahmud0808 Sep 18, 2024
372dfa4
Fix handling activity theme change
Mahmud0808 Sep 18, 2024
950eb06
Fix some dynamic colors
Mahmud0808 Sep 18, 2024
5216da5
Add new dynamic colors
Mahmud0808 Sep 18, 2024
c8c45fc
Add pitch black theme for settings services (fix #124)
Mahmud0808 Sep 18, 2024
7306535
Avoid crash when clicking on link if browser unavailable
Mahmud0808 Sep 18, 2024
a7a164e
Make surface container colors lighter
Mahmud0808 Sep 19, 2024
eefb303
Make surfaces more distinguishable from background
Mahmud0808 Sep 19, 2024
fc8f66c
Make pitch black theme surfaces darker
Mahmud0808 Sep 20, 2024
bedde36
New Crowdin translations by GitHub Action
crowdin-bot Sep 20, 2024
67d7827
Merge pull request #127 from Mahmud0808/localization
Mahmud0808 Sep 20, 2024
8147742
Bump targetSdk, AGP & dependencies
Mahmud0808 Sep 20, 2024
b1623f4
Update JDK compiler
Mahmud0808 Sep 20, 2024
440e4e9
Bump version code
Mahmud0808 Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ local.properties
/app/debug/
/app/release/
/*.hprof
/.idea/deploymentTargetDropDown.xml
/.idea/*
/.kotlin/sessions/*.salive
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ android {

defaultConfig {
minSdk = 31
targetSdk = 34
versionCode = 15
versionName = "v1.7"
targetSdk = 35
versionCode = 16
versionName = "v1.8"
}

buildTypes {
Expand Down Expand Up @@ -98,5 +98,6 @@ dependencies {
implementation(libs.recyclerview)
implementation(libs.recyclerview.selection)
implementation(libs.blurView)
implementation(libs.lifecycle.common.jvm)
annotationProcessor(libs.glide.compiler)
}
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<queries>
<intent>
Expand Down Expand Up @@ -57,6 +58,7 @@
</activity>
<activity
android:name=".ui.activities.MainActivity"
android:configChanges="orientation|uiMode"
android:exported="true" />

<receiver
Expand Down
29 changes: 25 additions & 4 deletions app/src/main/java/com/drdisagree/colorblendr/common/Const.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.drdisagree.colorblendr.common

import com.drdisagree.colorblendr.BuildConfig
import com.drdisagree.colorblendr.config.RPrefs
import com.drdisagree.colorblendr.utils.SystemUtil
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import java.util.concurrent.atomic.AtomicInteger
Expand All @@ -19,13 +20,33 @@ object Const {
const val FIRST_RUN: String = "firstRun"
const val THEMING_ENABLED: String = "themingEnabled"
const val MONET_STYLE: String = "customMonetStyle"
const val MONET_ACCENT_SATURATION: String = "monetAccentSaturationValue"
const val MONET_BACKGROUND_SATURATION: String = "monetBackgroundSaturationValue"
const val MONET_BACKGROUND_LIGHTNESS: String = "monetBackgroundLightnessValue"
const val MODE_SPECIFIC_THEMES: String = "modeSpecificThemes"
private val modeSpecificThemes: Boolean
get() = RPrefs.getBoolean(MODE_SPECIFIC_THEMES, false)
val MONET_ACCENT_SATURATION: String
get() = if (!modeSpecificThemes) {
"monetAccentSaturationValue"
} else {
if (SystemUtil.isDarkMode) "monetAccentSaturationValue" else "monetAccentSaturationValueLight"
}
val MONET_BACKGROUND_SATURATION: String
get() = if (!modeSpecificThemes) {
"monetBackgroundSaturationValue"
} else {
if (SystemUtil.isDarkMode) "monetBackgroundSaturationValue" else "monetBackgroundSaturationValueLight"
}
val MONET_BACKGROUND_LIGHTNESS: String
get() = if (!modeSpecificThemes) {
"monetBackgroundLightnessValue"
} else {
if (SystemUtil.isDarkMode) "monetBackgroundLightnessValue" else "monetBackgroundLightnessValueLight"
}
const val MONET_ACCURATE_SHADES: String = "monetAccurateShades"
const val MONET_PITCH_BLACK_THEME: String = "monetPitchBlackTheme"
const val MONET_SEED_COLOR: String = "monetSeedColor"
const val MONET_SEED_COLOR_ENABLED: String = "monetSeedColorEnabled"
const val MONET_SEED_COLOR: String = "monetSeedColor"
const val MONET_SECONDARY_COLOR: String = "monetSecondaryColor"
const val MONET_TERTIARY_COLOR: String = "monetTertiaryColor"
const val MANUAL_OVERRIDE_COLORS: String = "manualOverrideColors"
const val MONET_LAST_UPDATED: String = "monetLastUpdated"
const val MONET_STYLE_ORIGINAL_NAME: String = "monetStyleOriginalName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ class MainActivity : AppCompatActivity() {

if (savedInstanceState == null) {
if (getBoolean(FIRST_RUN, true) || workingMethod == Const.WorkMethod.NULL ||
!intent.getBooleanExtra("success", false)
intent?.getBooleanExtra("success", false) == false
) {
replaceFragment(OnboardingFragment(), false)
} else {
replaceFragment(HomeFragment(), false)
replaceFragment(
HomeFragment().apply {
arguments = Bundle().apply {
putBoolean("success", true)
}
},
false
)
}
}
}
Expand Down Expand Up @@ -89,9 +96,23 @@ class MainActivity : AppCompatActivity() {

override fun onResume() {
super.onResume()
scheduleJob(applicationContext)

if (intent?.getBooleanExtra("success", false) == true) {
scheduleJob(applicationContext)
}
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)

if (newConfig.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES ||
newConfig.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_NO
) {
recreate()
}
}


companion object {
private lateinit var myFragmentManager: FragmentManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class SplashActivity : AppCompatActivity() {
countDownLatch.countDown()
}
} else {
success.set(false)
keepShowing = false
countDownLatch.countDown()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,45 +49,68 @@ class AboutFragment : Fragment() {
)

binding.btnNews.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://t.me/IconifyOfficial")
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://t.me/IconifyOfficial")
)
)
)
} catch (e: Exception) {
e.printStackTrace()
}
}

binding.btnSupport.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://t.me/IconifyDiscussion")
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://t.me/IconifyDiscussion")
)
)
)
} catch (e: Exception) {
e.printStackTrace()
}
}

binding.btnGithub.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/Mahmud0808/ColorBlendr")
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/Mahmud0808/ColorBlendr")
)
)
)
} catch (e: Exception) {
e.printStackTrace()
}
}

binding.developer.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/Mahmud0808")
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/Mahmud0808")
)
)
)
} catch (e: Exception) {
e.printStackTrace()
}
}

binding.buymeacoffee.setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://buymeacoffee.com/drdisagree")
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://buymeacoffee.com/drdisagree")
)
)
)
} catch (e: Exception) {
e.printStackTrace()
}
}

return binding.root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.drdisagree.colorblendr.ui.fragments

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
Expand All @@ -17,8 +16,8 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.drdisagree.colorblendr.R
import com.drdisagree.colorblendr.databinding.FragmentHomeBinding
import com.drdisagree.colorblendr.service.AutoStartService
import com.drdisagree.colorblendr.service.AutoStartService.Companion.isServiceNotRunning
import com.drdisagree.colorblendr.service.RestartBroadcastReceiver.Companion.scheduleJob
import com.drdisagree.colorblendr.utils.AppUtil
import com.drdisagree.colorblendr.utils.AppUtil.hasStoragePermission
import com.drdisagree.colorblendr.utils.AppUtil.openAppSettings
Expand Down Expand Up @@ -56,13 +55,10 @@ class HomeFragment : Fragment() {
Handler(Looper.getMainLooper()).postDelayed({
try {
if (permissionsGranted(requireContext())) {
if (isServiceNotRunning) {
requireContext().startForegroundService(
Intent(
requireContext(),
AutoStartService::class.java
)
)
if (isServiceNotRunning &&
arguments?.getBoolean("success", false) == true
) {
scheduleJob(requireContext())
}
} else {
requestPermissionsLauncher.launch(AppUtil.REQUIRED_PERMISSIONS)
Expand Down Expand Up @@ -170,13 +166,10 @@ class HomeFragment : Fragment() {
return
}

if (isServiceNotRunning) {
requireContext().startForegroundService(
Intent(
requireContext(),
AutoStartService::class.java
)
)
if (isServiceNotRunning &&
arguments?.getBoolean("success", false) == true
) {
scheduleJob(requireContext())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class OnboardingFragment : Fragment() {
adapter.addFragment(OnboardingItem1Fragment())
adapter.addFragment(OnboardingItem2Fragment())
adapter.addFragment(OnboardingItem3Fragment())
adapter.addFragment(OnboardingItem4Fragment())

binding.viewPager.adapter = adapter
binding.viewPager.offscreenPageLimit = adapter.itemCount
Expand Down Expand Up @@ -153,7 +154,14 @@ class OnboardingFragment : Fragment() {
updateFabricatedAppList(requireContext())
putBoolean(FIRST_RUN, false)
saveWorkingMethod(Const.WORKING_METHOD)
MainActivity.replaceFragment(HomeFragment(), true)
MainActivity.replaceFragment(
HomeFragment().apply {
arguments = Bundle().apply {
putBoolean("success", true)
}
},
true
)
} catch (_: Exception) {
}
}
Expand Down
Loading