Skip to content

Commit

Permalink
Merge pull request #137 from KieronQuinn/release/2.6
Browse files Browse the repository at this point in the history
2.6
  • Loading branch information
KieronQuinn authored Dec 13, 2023
2 parents 3751170 + 09a7dc5 commit c634462
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
id 'com.google.android.gms.oss-licenses-plugin'
}

def tagName = '2.5'
def tagCode = 250
def tagName = '2.6'
def tagCode = 260

def getKeystoreProperties() {
def properties = new Properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import com.kieronquinn.app.pixellaunchermods.repositories.RootServiceRepository
import com.kieronquinn.app.pixellaunchermods.repositories.SettingsRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.stateIn

abstract class MainActivityViewModel: ViewModel() {

Expand Down Expand Up @@ -51,6 +56,7 @@ class MainActivityViewModelImpl(
settingsRepository.shouldLaunchService.set(false)
return@combine State.NoPixelLauncher
}
settingsRepository.shouldLaunchService.set(true)
State.Loaded
}.stateIn(viewModelScope, SharingStarted.Eagerly, State.Loading)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ import com.kieronquinn.app.pixellaunchermods.repositories.IconLoaderRepository
import com.kieronquinn.app.pixellaunchermods.repositories.RemoteAppsRepository
import com.kieronquinn.app.pixellaunchermods.ui.screens.iconpicker.BasePickerViewModel
import com.kieronquinn.app.pixellaunchermods.utils.extensions.TAP_DEBOUNCE
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch

abstract class LegacyThemedIconPickerViewModel(
Expand Down Expand Up @@ -102,11 +111,12 @@ class LegacyThemedIconPickerViewModelImpl(
private fun setupClickListener() {
viewModelScope.launch {
itemClickBus.debounce(TAP_DEBOUNCE).collect {
val resourceName = iconLoaderRepository.getLegacyThemedIconName(it)
val lawnicons = lawnicons.filterNotNull().first()
val icon = if(lawnicons){
val resourceName = iconLoaderRepository.getLawniconName(it)
IconPickerResult.Lawnicon(it.resourceId, resourceName)
}else{
val resourceName = iconLoaderRepository.getLegacyThemedIconName(it)
IconPickerResult.LegacyThemedIcon(it.resourceId, resourceName)
}
onIconSelected(icon)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kieronquinn.app.pixellaunchermods.ui.screens.tweaks.overlay

import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
Expand Down Expand Up @@ -52,10 +53,15 @@ class OverlayTweaksFragment: BoundFragment<FragmentSettingsTweaksOverlayBinding>
BaseSettingsViewModel.SettingsItem.Switch(
icon = R.drawable.ic_tweaks_wallpaper_scrim,
titleRes = R.string.tweaks_overlay_wallpaper_scrim,
contentRes = R.string.tweaks_overlay_wallpaper_scrim_content,
contentRes = if(Build.VERSION.SDK_INT >= 34) {
R.string.tweaks_overlay_wallpaper_scrim_content_disabled
}else{
R.string.tweaks_overlay_wallpaper_scrim_content
},
setting = FakePixelLauncherModsSetting(
viewModel.wallpaperScrim, viewModel::onWallpaperScrimChanged
)
),
isEnabled = { Build.VERSION.SDK_INT < 34 }
),
BaseSettingsViewModel.SettingsItem.Switch(
icon = R.drawable.ic_tweaks_wallpaper_region_colours,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kieronquinn.app.pixellaunchermods.ui.screens.tweaks.overlay

import android.net.Uri
import android.os.Build
import androidx.activity.result.ActivityResultLauncher
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down Expand Up @@ -59,7 +60,8 @@ class OverlayTweaksViewModelImpl(
)

private val disableWallpaperScrim = MutableStateFlow(
settingsRepository.disableWallpaperScrim.getSyncOrNull()
settingsRepository.disableWallpaperScrim.getSyncOrNull() ?: false
&& Build.VERSION.SDK_INT < 34
)

private val disableWallpaperRegionColours = MutableStateFlow(
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
<string name="tweaks_overlay_background_transparency_content"><b>Note: Lower values may reduce readability</b>. Background may still be blurred, depending on your device.</string>
<string name="tweaks_overlay_wallpaper_scrim">Disable Wallpaper Scrim</string>
<string name="tweaks_overlay_wallpaper_scrim_content">Disable the dark scrim at the top of the screen on the wallpaper, intended to provide text contrast for the status bar</string>
<string name="tweaks_overlay_wallpaper_scrim_content_disabled">This option is not compatible with your device</string>
<string name="tweaks_overlay_wallpaper_region_colours">Disable Wallpaper Region Widget Colours</string>
<string name="tweaks_overlay_wallpaper_region_colours_content">Disable colours of Material You widgets changing based on the colour of the wallpaper behind them (the system colours will be used instead)</string>
<string name="tweaks_overlay_disable_smartspace">Hide At a Glance</string>
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ task clean(type: Delete) {

task cleanOverlay(type: Delete, dependsOn: ordered(':overlay:clean')) {
//Delete the previously built APK to start fresh
delete 'overlay/module/system/product/overlay/PixelLauncherModsOverlay/PixelLauncherModsOverlay.apk'
delete 'overlay/module/system/product/overlay/PixelLauncherModsOverlay.apk'
}

/**
Expand All @@ -51,7 +51,7 @@ task assembleGradleDaemon(type: Exec) {
task buildAndCopyOverlay(type: Copy, dependsOn: ordered(':assembleGradleDaemon')) {
//Copy built APK into module folder
from "overlay/build/outputs/apk/release/overlay-release.apk"
into "overlay/module/system/product/overlay/PixelLauncherModsOverlay"
into "overlay/module/system/product/overlay"
rename("overlay-release.apk", "PixelLauncherModsOverlay.apk")
}

Expand Down
2 changes: 1 addition & 1 deletion overlay/module/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ ui_print "Reboot your device to activate the hide apps"
ui_print "option in Pixel Launcher Mods."
ui_print ""
ui_print "You must keep this module installed for hide"
ui_print "apps to work."
ui_print "apps and overlay tweaks to work."
ui_print ""
4 changes: 2 additions & 2 deletions overlay/module/module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=PixelLauncherModsOverlay
name=Pixel Launcher Mods Overlay
version=1.0
versionCode=1
version=1.1
versionCode=11
author=Kieron Quinn / Quinny899
description=Installs overlay required to hide apps and replace widgets from the Pixel Launcher. Configure settings in the Pixel Launcher Mods app.

0 comments on commit c634462

Please sign in to comment.