summaryrefslogtreecommitdiff
path: root/src/com/android
diff options
context:
space:
mode:
authorCatherine Liang <cathliang@google.com>2022-10-04 20:50:32 +0000
committerCatherine Liang <cathliang@google.com>2022-10-10 21:49:53 +0000
commit2351412212f6469b25d9bbfa2a59de39cac36404 (patch)
tree540d82c7eb4c450cc599165840556d461e70789e /src/com/android
parent7a45d741b3025184b7a6c71b9a14f4446a17210e (diff)
downloadThemePicker-2351412212f6469b25d9bbfa2a59de39cac36404.tar.gz
Format ThemePicker .kt files
1. kt-format existing .kt files with $ANDROID_BUILD_TOP/external/ktfmt/ktfmt.py <filepath> 2. Remove the exclusion of the files in ktfmt_includes.txt Bug: 245751447 Test: Manual Change-Id: Iad6e3ac101b59b521f535d72bdfe42a774bd7eaf
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/customization/model/color/ColorProvider.kt233
-rw-r--r--src/com/android/customization/model/color/ColorUtils.kt22
-rw-r--r--src/com/android/customization/module/SysUiStatsLogger.kt96
-rw-r--r--src/com/android/customization/picker/clock/ClockSectionView.kt4
4 files changed, 190 insertions, 165 deletions
diff --git a/src/com/android/customization/model/color/ColorProvider.kt b/src/com/android/customization/model/color/ColorProvider.kt
index 5d6aefce..814a963f 100644
--- a/src/com/android/customization/model/color/ColorProvider.kt
+++ b/src/com/android/customization/model/color/ColorProvider.kt
@@ -19,7 +19,6 @@ import android.app.WallpaperColors
import android.content.Context
import android.content.res.ColorStateList
import android.content.res.Resources
-import android.text.TextUtils
import androidx.annotation.ColorInt
import androidx.core.graphics.ColorUtils.setAlphaComponent
import androidx.lifecycle.LifecycleOwner
@@ -29,8 +28,8 @@ import com.android.customization.model.ResourceConstants.COLOR_BUNDLES_ARRAY_NAM
import com.android.customization.model.ResourceConstants.COLOR_BUNDLE_MAIN_COLOR_PREFIX
import com.android.customization.model.ResourceConstants.COLOR_BUNDLE_NAME_PREFIX
import com.android.customization.model.ResourceConstants.COLOR_BUNDLE_STYLE_PREFIX
-import com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SYSTEM_PALETTE
import com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_COLOR
+import com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SYSTEM_PALETTE
import com.android.customization.model.ResourcesApkProvider
import com.android.customization.model.color.ColorOptionsProvider.COLOR_SOURCE_HOME
import com.android.customization.model.color.ColorOptionsProvider.COLOR_SOURCE_LOCK
@@ -39,19 +38,18 @@ import com.android.systemui.monet.ColorScheme
import com.android.systemui.monet.Style
import com.android.wallpaper.compat.WallpaperManagerCompat
import com.android.wallpaper.module.InjectorProvider
+import java.util.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
-import java.util.*
/**
- * Default implementation of {@link ColorOptionsProvider} that reads preset colors from
- * a stub APK.
+ * Default implementation of {@link ColorOptionsProvider} that reads preset colors from a stub APK.
*/
class ColorProvider(context: Context, stubPackageName: String) :
- ResourcesApkProvider(context, stubPackageName), ColorOptionsProvider {
+ ResourcesApkProvider(context, stubPackageName), ColorOptionsProvider {
companion object {
const val themeStyleEnabled = true
@@ -64,36 +62,41 @@ class ColorProvider(context: Context, stubPackageName: String) :
private val monetEnabled = ColorUtils.isMonetEnabled(context)
// TODO(b/202145216): Use style method to fetch the list of style.
- private var styleList = if (themeStyleEnabled) arrayOf(
- Style.TONAL_SPOT, Style.SPRITZ, Style.VIBRANT, Style.EXPRESSIVE
- ) else arrayOf(Style.TONAL_SPOT)
+ private var styleList =
+ if (themeStyleEnabled)
+ arrayOf(Style.TONAL_SPOT, Style.SPRITZ, Style.VIBRANT, Style.EXPRESSIVE)
+ else arrayOf(Style.TONAL_SPOT)
- private val scope = if (mContext is LifecycleOwner) {
- mContext.lifecycleScope
- } else {
- CoroutineScope(Dispatchers.Default + SupervisorJob())
- }
+ private val scope =
+ if (mContext is LifecycleOwner) {
+ mContext.lifecycleScope
+ } else {
+ CoroutineScope(Dispatchers.Default + SupervisorJob())
+ }
private var colorsAvailable = true
private var colorBundles: List<ColorOption>? = null
private var homeWallpaperColors: WallpaperColors? = null
private var lockWallpaperColors: WallpaperColors? = null
-
override fun isAvailable(): Boolean {
return monetEnabled && super.isAvailable() && colorsAvailable
}
- override fun fetch(callback: OptionsFetchedListener<ColorOption>?, reload: Boolean,
- homeWallpaperColors: WallpaperColors?,
- lockWallpaperColors: WallpaperColors?) {
- val wallpaperColorsChanged = this.homeWallpaperColors != homeWallpaperColors
- || this.lockWallpaperColors != lockWallpaperColors
+ override fun fetch(
+ callback: OptionsFetchedListener<ColorOption>?,
+ reload: Boolean,
+ homeWallpaperColors: WallpaperColors?,
+ lockWallpaperColors: WallpaperColors?
+ ) {
+ val wallpaperColorsChanged =
+ this.homeWallpaperColors != homeWallpaperColors ||
+ this.lockWallpaperColors != lockWallpaperColors
if (wallpaperColorsChanged) {
this.homeWallpaperColors = homeWallpaperColors
this.lockWallpaperColors = lockWallpaperColors
}
- if(colorBundles == null || reload || wallpaperColorsChanged) {
+ if (colorBundles == null || reload || wallpaperColorsChanged) {
scope.launch {
try {
if (colorBundles == null || reload) {
@@ -119,46 +122,56 @@ class ColorProvider(context: Context, stubPackageName: String) :
// is the most recently set wallpaper
val manager = InjectorProvider.getInjector().getWallpaperManagerCompat(mContext)
return manager.getWallpaperId(WallpaperManagerCompat.FLAG_LOCK) >
- manager.getWallpaperId(WallpaperManagerCompat.FLAG_SYSTEM)
+ manager.getWallpaperId(WallpaperManagerCompat.FLAG_SYSTEM)
}
- private fun loadSeedColors(homeWallpaperColors: WallpaperColors?,
- lockWallpaperColors: WallpaperColors?) {
+ private fun loadSeedColors(
+ homeWallpaperColors: WallpaperColors?,
+ lockWallpaperColors: WallpaperColors?
+ ) {
if (homeWallpaperColors == null) return
val bundles: MutableList<ColorOption> = ArrayList()
- val colorsPerSource = if (lockWallpaperColors == null) {
- MAX_SEED_COLORS
- } else {
- MAX_SEED_COLORS / 2
- }
+ val colorsPerSource =
+ if (lockWallpaperColors == null) {
+ MAX_SEED_COLORS
+ } else {
+ MAX_SEED_COLORS / 2
+ }
if (lockWallpaperColors != null) {
val shouldLockColorsGoFirst = isLockScreenWallpaperLastApplied()
// First half of the colors
buildColorSeeds(
- if (shouldLockColorsGoFirst) lockWallpaperColors else homeWallpaperColors,
- colorsPerSource,
- if (shouldLockColorsGoFirst) COLOR_SOURCE_LOCK else COLOR_SOURCE_HOME,
- true,
- bundles)
+ if (shouldLockColorsGoFirst) lockWallpaperColors else homeWallpaperColors,
+ colorsPerSource,
+ if (shouldLockColorsGoFirst) COLOR_SOURCE_LOCK else COLOR_SOURCE_HOME,
+ true,
+ bundles
+ )
// Second half of the colors
buildColorSeeds(
- if (shouldLockColorsGoFirst) homeWallpaperColors else lockWallpaperColors,
- MAX_SEED_COLORS - bundles.size / styleSize,
- if (shouldLockColorsGoFirst) COLOR_SOURCE_HOME else COLOR_SOURCE_LOCK,
- false,
- bundles)
+ if (shouldLockColorsGoFirst) homeWallpaperColors else lockWallpaperColors,
+ MAX_SEED_COLORS - bundles.size / styleSize,
+ if (shouldLockColorsGoFirst) COLOR_SOURCE_HOME else COLOR_SOURCE_LOCK,
+ false,
+ bundles
+ )
} else {
buildColorSeeds(homeWallpaperColors, colorsPerSource, COLOR_SOURCE_HOME, true, bundles)
}
- bundles.addAll(colorBundles?.filterNot{it is ColorSeedOption} ?: emptyList())
+ bundles.addAll(colorBundles?.filterNot { it is ColorSeedOption } ?: emptyList())
colorBundles = bundles
}
- private fun buildColorSeeds(wallpaperColors: WallpaperColors, maxColors: Int, source: String,
- containsDefault: Boolean, bundles: MutableList<ColorOption>) {
+ private fun buildColorSeeds(
+ wallpaperColors: WallpaperColors,
+ maxColors: Int,
+ source: String,
+ containsDefault: Boolean,
+ bundles: MutableList<ColorOption>
+ ) {
val seedColors = ColorScheme.getSeedColors(wallpaperColors)
val defaultSeed = seedColors.first()
buildBundle(defaultSeed, 0, containsDefault, source, bundles)
@@ -167,19 +180,27 @@ class ColorProvider(context: Context, stubPackageName: String) :
}
}
- private fun buildBundle(colorInt: Int, i: Int, isDefault: Boolean, source: String,
- bundles: MutableList<ColorOption>) {
+ private fun buildBundle(
+ colorInt: Int,
+ i: Int,
+ isDefault: Boolean,
+ source: String,
+ bundles: MutableList<ColorOption>
+ ) {
// TODO(b/202145216): Measure time cost in the loop.
for (style in styleList) {
val builder = ColorSeedOption.Builder()
val lightColorScheme = ColorScheme(colorInt, /* darkTheme= */ false, style)
val darkColorScheme = ColorScheme(colorInt, /* darkTheme= */ true, style)
- builder.setLightColors(lightColorScheme.getLightColorPreview())
+ builder
+ .setLightColors(lightColorScheme.getLightColorPreview())
.setDarkColors(darkColorScheme.getDarkColorPreview())
- .addOverlayPackage(OVERLAY_CATEGORY_SYSTEM_PALETTE,
+ .addOverlayPackage(
+ OVERLAY_CATEGORY_SYSTEM_PALETTE,
if (isDefault) "" else toColorString(colorInt)
)
- .addOverlayPackage(OVERLAY_CATEGORY_COLOR,
+ .addOverlayPackage(
+ OVERLAY_CATEGORY_COLOR,
if (isDefault) "" else toColorString(colorInt)
)
.setSource(source)
@@ -194,87 +215,87 @@ class ColorProvider(context: Context, stubPackageName: String) :
}
/**
- * Returns the colors for the light theme version of the preview of a ColorScheme
- * based on this order:
- * |-------|
- * | 0 | 1 |
- * |---+---|
- * | 2 | 3 |
- * |-------|
+ * Returns the colors for the light theme version of the preview of a ColorScheme based on this
+ * order: |-------| | 0 | 1 | |---+---| | 2 | 3 | |-------|
*/
@ColorInt
private fun ColorScheme.getLightColorPreview(): IntArray {
- return intArrayOf(setAlphaComponent(this.accent1[2], ALPHA_MASK),
- setAlphaComponent(this.accent1[2], ALPHA_MASK),
- ColorStateList.valueOf(this.accent3[6]).withLStar(85f).colors[0],
- setAlphaComponent(this.accent1[6], ALPHA_MASK))
+ return intArrayOf(
+ setAlphaComponent(this.accent1[2], ALPHA_MASK),
+ setAlphaComponent(this.accent1[2], ALPHA_MASK),
+ ColorStateList.valueOf(this.accent3[6]).withLStar(85f).colors[0],
+ setAlphaComponent(this.accent1[6], ALPHA_MASK)
+ )
}
/**
- * Returns the color for the dark theme version of the preview of a ColorScheme
- * based on this order:
- * |-------|
- * | 0 | 1 |
- * |---+---|
- * | 2 | 3 |
- * |-------|
+ * Returns the color for the dark theme version of the preview of a ColorScheme based on this
+ * order: |-------| | 0 | 1 | |---+---| | 2 | 3 | |-------|
*/
@ColorInt
private fun ColorScheme.getDarkColorPreview(): IntArray {
- return intArrayOf(setAlphaComponent(this.accent1[2], ALPHA_MASK),
- setAlphaComponent(this.accent1[2], ALPHA_MASK),
- ColorStateList.valueOf(this.accent3[6]).withLStar(85f).colors[0],
- setAlphaComponent(this.accent1[6], ALPHA_MASK))
+ return intArrayOf(
+ setAlphaComponent(this.accent1[2], ALPHA_MASK),
+ setAlphaComponent(this.accent1[2], ALPHA_MASK),
+ ColorStateList.valueOf(this.accent3[6]).withLStar(85f).colors[0],
+ setAlphaComponent(this.accent1[6], ALPHA_MASK)
+ )
}
private fun ColorScheme.getPresetColorPreview(seed: Int): IntArray {
- return when(this.style) {
+ return when (this.style) {
Style.FRUIT_SALAD -> intArrayOf(seed, this.accent1[2])
Style.TONAL_SPOT -> intArrayOf(this.accentColor, this.accentColor)
else -> intArrayOf(this.accent1[2], this.accent1[2])
}
}
- private suspend fun loadPreset() = withContext(Dispatchers.IO) {
- val extractor = ColorBundlePreviewExtractor(mContext)
- val bundles: MutableList<ColorOption> = ArrayList()
+ private suspend fun loadPreset() =
+ withContext(Dispatchers.IO) {
+ val extractor = ColorBundlePreviewExtractor(mContext)
+ val bundles: MutableList<ColorOption> = ArrayList()
- val bundleNames = getItemsFromStub(COLOR_BUNDLES_ARRAY_NAME)
- // Color option index value starts from 1.
- var index = 1
- val maxPresetColors = if (themeStyleEnabled) bundleNames.size else MAX_PRESET_COLORS
- for (bundleName in bundleNames.take(maxPresetColors)) {
- val builder = ColorBundle.Builder()
- builder.title = getItemStringFromStub(COLOR_BUNDLE_NAME_PREFIX, bundleName)
- builder.setIndex(index)
- val colorFromStub = getItemColorFromStub(COLOR_BUNDLE_MAIN_COLOR_PREFIX, bundleName)
- extractor.addPrimaryColor(builder, colorFromStub)
- extractor.addSecondaryColor(builder, colorFromStub)
- if (themeStyleEnabled) {
- val styleName = try {
- getItemStringFromStub(COLOR_BUNDLE_STYLE_PREFIX, bundleName)
- } catch (e: Resources.NotFoundException) {
- null
- }
- extractor.addColorStyle(builder, styleName)
- val style = try {
- if (styleName != null) Style.valueOf(styleName) else Style.TONAL_SPOT
- } catch (e: IllegalArgumentException) {
- Style.TONAL_SPOT
+ val bundleNames = getItemsFromStub(COLOR_BUNDLES_ARRAY_NAME)
+ // Color option index value starts from 1.
+ var index = 1
+ val maxPresetColors = if (themeStyleEnabled) bundleNames.size else MAX_PRESET_COLORS
+ for (bundleName in bundleNames.take(maxPresetColors)) {
+ val builder = ColorBundle.Builder()
+ builder.title = getItemStringFromStub(COLOR_BUNDLE_NAME_PREFIX, bundleName)
+ builder.setIndex(index)
+ val colorFromStub = getItemColorFromStub(COLOR_BUNDLE_MAIN_COLOR_PREFIX, bundleName)
+ extractor.addPrimaryColor(builder, colorFromStub)
+ extractor.addSecondaryColor(builder, colorFromStub)
+ if (themeStyleEnabled) {
+ val styleName =
+ try {
+ getItemStringFromStub(COLOR_BUNDLE_STYLE_PREFIX, bundleName)
+ } catch (e: Resources.NotFoundException) {
+ null
+ }
+ extractor.addColorStyle(builder, styleName)
+ val style =
+ try {
+ if (styleName != null) Style.valueOf(styleName) else Style.TONAL_SPOT
+ } catch (e: IllegalArgumentException) {
+ Style.TONAL_SPOT
+ }
+
+ val darkColors =
+ ColorScheme(colorFromStub, true, style).getPresetColorPreview(colorFromStub)
+ val lightColors =
+ ColorScheme(colorFromStub, false, style)
+ .getPresetColorPreview(colorFromStub)
+ builder.setColorPrimaryDark(darkColors[0]).setColorSecondaryDark(darkColors[1])
+ builder
+ .setColorPrimaryLight(lightColors[0])
+ .setColorSecondaryLight(lightColors[1])
}
- val darkColors = ColorScheme(colorFromStub, true, style)
- .getPresetColorPreview(colorFromStub)
- val lightColors = ColorScheme(colorFromStub, false, style)
- .getPresetColorPreview(colorFromStub)
- builder.setColorPrimaryDark(darkColors[0]).setColorSecondaryDark(darkColors[1])
- builder.setColorPrimaryLight(lightColors[0]).setColorSecondaryLight(lightColors[1])
+ bundles.add(builder.build(mContext))
+ index++
}
- bundles.add(builder.build(mContext))
- index++
+ colorBundles = bundles
}
-
- colorBundles = bundles
- }
}
diff --git a/src/com/android/customization/model/color/ColorUtils.kt b/src/com/android/customization/model/color/ColorUtils.kt
index f07ff319..9d925e13 100644
--- a/src/com/android/customization/model/color/ColorUtils.kt
+++ b/src/com/android/customization/model/color/ColorUtils.kt
@@ -22,18 +22,14 @@ import android.os.SystemProperties
import android.util.Log
import androidx.annotation.ColorInt
-/**
- * Utility to wrap Monet's color extraction
- */
+/** Utility to wrap Monet's color extraction */
object ColorUtils {
private const val TAG = "ColorUtils"
private const val MONET_FLAG = "flag_monet"
private var sSysuiRes: Resources? = null
private var sFlagId = 0
- /**
- * Returns true if color extraction is enabled in systemui.
- */
+ /** Returns true if color extraction is enabled in systemui. */
@JvmStatic
fun isMonetEnabled(context: Context): Boolean {
var monetEnabled = SystemProperties.getBoolean("persist.systemui.flag_monet", false)
@@ -41,8 +37,11 @@ object ColorUtils {
if (sSysuiRes == null) {
try {
val pm = context.packageManager
- val sysUIInfo = pm.getApplicationInfo("com.android.systemui",
- PackageManager.GET_META_DATA or PackageManager.MATCH_SYSTEM_ONLY)
+ val sysUIInfo =
+ pm.getApplicationInfo(
+ "com.android.systemui",
+ PackageManager.GET_META_DATA or PackageManager.MATCH_SYSTEM_ONLY
+ )
if (sysUIInfo != null) {
sSysuiRes = pm.getResourcesForApplication(sysUIInfo)
}
@@ -51,8 +50,9 @@ object ColorUtils {
}
}
if (sFlagId == 0) {
- sFlagId = if (sSysuiRes == null) 0 else sSysuiRes!!.getIdentifier(
- MONET_FLAG, "bool", "com.android.systemui")
+ sFlagId =
+ if (sSysuiRes == null) 0
+ else sSysuiRes!!.getIdentifier(MONET_FLAG, "bool", "com.android.systemui")
}
if (sFlagId > 0) {
monetEnabled = sSysuiRes!!.getBoolean(sFlagId)
@@ -65,4 +65,4 @@ object ColorUtils {
fun toColorString(@ColorInt color: Int): String {
return String.format("%06X", 0xFFFFFF and color)
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/customization/module/SysUiStatsLogger.kt b/src/com/android/customization/module/SysUiStatsLogger.kt
index eb3bcc04..9887b52b 100644
--- a/src/com/android/customization/module/SysUiStatsLogger.kt
+++ b/src/com/android/customization/module/SysUiStatsLogger.kt
@@ -19,9 +19,7 @@ import android.stats.style.StyleEnums
import com.android.systemui.shared.system.SysUiStatsLog
import com.android.systemui.shared.system.SysUiStatsLog.STYLE_UI_CHANGED
-/**
- * The builder for [SysUiStatsLog].
- */
+/** The builder for [SysUiStatsLog]. */
class SysUiStatsLogger {
private var atom = STYLE_UI_CHANGED
@@ -46,67 +44,73 @@ class SysUiStatsLogger {
private var appLaunchCount = 0
private var colorVariant = 0
- fun setAction(action: Int) =
- apply { this.action = action }
+ fun setAction(action: Int) = apply { this.action = action }
- fun setColorPackageHash(color_package_hash: Int) =
- apply { this.colorPackageHash = color_package_hash }
+ fun setColorPackageHash(color_package_hash: Int) = apply {
+ this.colorPackageHash = color_package_hash
+ }
- fun setFontPackageHash(font_package_hash: Int) =
- apply { this.fontPackageHash = font_package_hash }
+ fun setFontPackageHash(font_package_hash: Int) = apply {
+ this.fontPackageHash = font_package_hash
+ }
- fun setShapePackageHash(shape_package_hash: Int) =
- apply { this.shapePackageHash = shape_package_hash }
+ fun setShapePackageHash(shape_package_hash: Int) = apply {
+ this.shapePackageHash = shape_package_hash
+ }
- fun setClockPackageHash(clock_package_hash: Int) =
- apply { this.clockPackageHash = clock_package_hash }
+ fun setClockPackageHash(clock_package_hash: Int) = apply {
+ this.clockPackageHash = clock_package_hash
+ }
- fun setLauncherGrid(launcher_grid: Int) =
- apply { this.launcherGrid = launcher_grid }
+ fun setLauncherGrid(launcher_grid: Int) = apply { this.launcherGrid = launcher_grid }
- fun setWallpaperCategoryHash(wallpaper_category_hash: Int) =
- apply { this.wallpaperCategoryHash = wallpaper_category_hash }
+ fun setWallpaperCategoryHash(wallpaper_category_hash: Int) = apply {
+ this.wallpaperCategoryHash = wallpaper_category_hash
+ }
- fun setWallpaperIdHash(wallpaper_id_hash: Int) =
- apply { this.wallpaperIdHash = wallpaper_id_hash }
+ fun setWallpaperIdHash(wallpaper_id_hash: Int) = apply {
+ this.wallpaperIdHash = wallpaper_id_hash
+ }
- fun setColorPreference(color_preference: Int) =
- apply { this.colorPreference = color_preference }
+ fun setColorPreference(color_preference: Int) = apply {
+ this.colorPreference = color_preference
+ }
- fun setLocationPreference(location_preference: Int) =
- apply { this.locationPreference = location_preference }
+ fun setLocationPreference(location_preference: Int) = apply {
+ this.locationPreference = location_preference
+ }
- fun setDatePreference(date_preference: Int) =
- apply { this.datePreference = date_preference }
+ fun setDatePreference(date_preference: Int) = apply { this.datePreference = date_preference }
- fun setLaunchedPreference(launched_preference: Int) =
- apply { this.launchedPreference = launched_preference }
+ fun setLaunchedPreference(launched_preference: Int) = apply {
+ this.launchedPreference = launched_preference
+ }
- fun setEffectPreference(effect_preference: Int) =
- apply { this.effectPreference = effect_preference }
+ fun setEffectPreference(effect_preference: Int) = apply {
+ this.effectPreference = effect_preference
+ }
- fun setEffectIdHash(effect_id_hash: Int) =
- apply { this.effectIdHash = effect_id_hash }
+ fun setEffectIdHash(effect_id_hash: Int) = apply { this.effectIdHash = effect_id_hash }
- fun setLockWallpaperCategoryHash(lock_wallpaper_category_hash: Int) =
- apply { this.lockWallpaperCategoryHash = lock_wallpaper_category_hash }
+ fun setLockWallpaperCategoryHash(lock_wallpaper_category_hash: Int) = apply {
+ this.lockWallpaperCategoryHash = lock_wallpaper_category_hash
+ }
- fun setLockWallpaperIdHash(lock_wallpaper_id_hash: Int) =
- apply { this.lockWallpaperIdHash = lock_wallpaper_id_hash }
+ fun setLockWallpaperIdHash(lock_wallpaper_id_hash: Int) = apply {
+ this.lockWallpaperIdHash = lock_wallpaper_id_hash
+ }
- fun setFirstLaunchDateSinceSetup(first_launch_date_since_setup: Int) =
- apply { this.firstLaunchDateSinceSetup = first_launch_date_since_setup }
+ fun setFirstLaunchDateSinceSetup(first_launch_date_since_setup: Int) = apply {
+ this.firstLaunchDateSinceSetup = first_launch_date_since_setup
+ }
- fun setFirstWallpaperApplyDateSinceSetup(first_wallpaper_apply_date_since_setup: Int) =
- apply {
- this.firstWallpaperApplyDateSinceSetup = first_wallpaper_apply_date_since_setup
- }
+ fun setFirstWallpaperApplyDateSinceSetup(first_wallpaper_apply_date_since_setup: Int) = apply {
+ this.firstWallpaperApplyDateSinceSetup = first_wallpaper_apply_date_since_setup
+ }
- fun setAppLaunchCount(app_launch_count: Int) =
- apply { this.appLaunchCount = app_launch_count }
+ fun setAppLaunchCount(app_launch_count: Int) = apply { this.appLaunchCount = app_launch_count }
- fun setColorVariant(color_variant: Int) =
- apply { this.colorVariant = color_variant }
+ fun setColorVariant(color_variant: Int) = apply { this.colorVariant = color_variant }
fun log() {
SysUiStatsLog.write(
@@ -133,4 +137,4 @@ class SysUiStatsLogger {
colorVariant
)
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/customization/picker/clock/ClockSectionView.kt b/src/com/android/customization/picker/clock/ClockSectionView.kt
index c0432094..fac975ab 100644
--- a/src/com/android/customization/picker/clock/ClockSectionView.kt
+++ b/src/com/android/customization/picker/clock/ClockSectionView.kt
@@ -19,5 +19,5 @@ import android.content.Context
import android.util.AttributeSet
import com.android.wallpaper.picker.SectionView
-/** The [SectionView] for app clock. */
-class ClockSectionView(context: Context?, attrs: AttributeSet?) : SectionView(context, attrs) \ No newline at end of file
+/** The [SectionView] for app clock. */
+class ClockSectionView(context: Context?, attrs: AttributeSet?) : SectionView(context, attrs)