Skip to content

Commit

Permalink
Build85
Browse files Browse the repository at this point in the history
  - Fixed contrast issue on chips in dark mode
  • Loading branch information
Hamza417 committed Jul 5, 2023
1 parent 6dfc131 commit e5dc620
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
applicationId "app.simple.inure"
minSdkVersion 23
targetSdkVersion 34
versionCode 84
versionName "build84"
versionCode 85
versionName "build85"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
6 changes: 5 additions & 1 deletion app/src/main/assets/html/changelogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>Change Logs</h1>
<br>

<sub>(Current Version)</sub>
<h2>Build84</h2>
<h2>Build85</h2>

<!-- Write change logs here -->

Expand Down Expand Up @@ -50,6 +50,7 @@ <h4>Bug Fixes</h4>
<li>Fixed ENOENT error in <b>App Info</b> panel.</li>
<li>Fixed some issues with <b>Battery Optimization</b> panel.</li>
<li>Fixed some issues with <i>Uninstalled</i> filter.</li>
<li>Fixed contrast issue on chips in dark mode.</li>
</ul>

<h4>Improvements</h4>
Expand All @@ -73,6 +74,9 @@ <h4>Removed</h4>

<br>
<br>
<p>
Build84 was skipped.
</p>
<div class="wrap-collapsible">
<input class="toggle" id="build_83" type="checkbox">
<label class="lbl-toggle" for="build_83">Build83 (Quick Fix)</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app.simple.inure.activities.association
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import app.simple.inure.R
import app.simple.inure.constants.BundleConstants
import app.simple.inure.extensions.activities.BaseActivity
Expand Down Expand Up @@ -40,17 +39,4 @@ class ApkInstallerActivity : BaseActivity() {
}
}
}

private fun clearInstallerCache() {
kotlin.runCatching {
if (File(applicationContext.cacheDir.path + "/installer_cache/").deleteRecursively()) {
Log.d(javaClass.name, "Installer cache cleared")
}
}
}

override fun onDestroy() {
super.onDestroy()
clearInstallerCache()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.documentfile.provider.DocumentFile
import androidx.lifecycle.lifecycleScope
import app.simple.inure.R
import app.simple.inure.apk.utils.PackageData.getInstallerDir
import app.simple.inure.apk.utils.PackageData.getOtherCacheDir
import app.simple.inure.apk.utils.PackageUtils
import app.simple.inure.apk.utils.PackageUtils.getPackageArchiveInfo
import app.simple.inure.extensions.activities.BaseActivity
Expand Down Expand Up @@ -41,7 +42,7 @@ class AppDetailsActivity : BaseActivity() {
}

val name = DocumentFile.fromSingleUri(applicationContext, uri)!!.name
val sourceFile = applicationContext.getInstallerDir(name!!)
val sourceFile = applicationContext.getOtherCacheDir(name!!)
var packageInfo: PackageInfo? = null

contentResolver.openInputStream(uri)!!.use {
Expand Down Expand Up @@ -103,6 +104,7 @@ class AppDetailsActivity : BaseActivity() {
.commit()
}
}.getOrElse {
it.printStackTrace()
kotlin.runCatching {
withContext(Dispatchers.Main) {
hideLoader()
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/app/simple/inure/apk/utils/PackageData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ object PackageData {
return File(cacheDir.path + "/installer_cache/" + name)
}

fun Context.getOtherCacheDir(name: String): File {
if (File(cacheDir.path + "/other_cache/").exists() &&
File(cacheDir.path + "/other_cache/").isFile) {
File(cacheDir.path + "/other_cache/").delete()
}
File(cacheDir.path + "/other_cache/").mkdir()
return File(cacheDir.path + "/other_cache/" + name)
}

fun Context.getInstallerDir(name: String, dirName: String): File {
if (File(cacheDir.path + "/installer_cache/" + dirName + "/").exists() &&
File(cacheDir.path + "/installer_cache/" + dirName + "/").isFile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void init() {

}},
new int[] {
AppearancePreferences.INSTANCE.getAccentColorLight(),
AppearancePreferences.INSTANCE.getAccentColorLight(getContext()),
ThemeManager.INSTANCE.getTheme().getViewGroupTheme().getViewerBackground()
}
));
Expand All @@ -61,7 +61,7 @@ private void init() {
.build());

ViewUtils.INSTANCE.addShadow(this);
setRippleColor(ColorStateList.valueOf(AppearancePreferences.INSTANCE.getAccentColorLight()));
setRippleColor(ColorStateList.valueOf(AppearancePreferences.INSTANCE.getAccentColorLight(getContext())));

if (!DevelopmentPreferences.INSTANCE.get(DevelopmentPreferences.removeStrokeFromChips)) {
setChipStrokeColor(ColorStateList.valueOf(AppearancePreferences.INSTANCE.getAccentColor()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package app.simple.inure.preferences

import android.content.Context
import android.os.Build
import androidx.annotation.ColorInt
import androidx.annotation.RequiresApi
import app.simple.inure.constants.ThemeConstants
import app.simple.inure.preferences.SharedPreferences.getSharedPreferences
import app.simple.inure.themes.manager.ThemeUtils
import app.simple.inure.util.ColorUtils
import app.simple.inure.util.TypeFace

Expand Down Expand Up @@ -58,8 +60,12 @@ object AppearancePreferences {

@Suppress("unused")
@ColorInt
fun getAccentColorLight(): Int {
return ColorUtils.lightenColor(getSharedPreferences().getInt(accentColor, 0), 0.25F)
fun getAccentColorLight(context: Context): Int {
return if (ThemeUtils.isNightMode(context.resources)) {
getSharedPreferences().getInt(accentColorLight, ColorUtils.darkenColor(getAccentColor(), 0.2F))
} else {
getSharedPreferences().getInt(accentColorLight, ColorUtils.lightenColor(getAccentColor(), 0.4F))
}
}

// ---------------------------------------------------------------------------------------------------------- //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class InstallerViewModel(application: Application, private val uri: Uri?, val fi
}

private fun extractFiles() {
clearInstallerCache()
PackageData.makePackageFolder(applicationContext())

if (file != null && file.exists()) {
Expand Down Expand Up @@ -335,6 +336,14 @@ class InstallerViewModel(application: Application, private val uri: Uri?, val fi
packageManagerInstall()
}

private fun clearInstallerCache() {
kotlin.runCatching {
if (File(applicationContext().cacheDir.path + "/installer_cache/").deleteRecursively()) {
Log.d(javaClass.name, "Installer cache cleared")
}
}
}

private fun installCommand(): String {
// Check if greater than nougat
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/85.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Fixed plenty of issues
- Major UI changes and improvements

For full list of changes, see the changelogs in the app.

0 comments on commit e5dc620

Please sign in to comment.