Loading res/layout/floating_sheet_app_icon.xml +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ <LinearLayout android:id="@+id/themed_icon_toggle_entry" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" Loading src/com/android/customization/model/grid/DefaultShapeGridManager.kt +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ constructor( } } override suspend fun getShapeOptions(): List<ShapeOptionModel>? = override suspend fun getShapeOptions(): List<ShapeOptionModel> = withContext(bgDispatcher) { if (previewUtils.supportsPreview()) { context.contentResolver Loading Loading @@ -142,9 +142,9 @@ constructor( } list } } } ?: emptyList() } else { null emptyList() } } Loading src/com/android/customization/model/grid/ShapeGridManager.kt +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ interface ShapeGridManager { */ suspend fun getGridOptions(): List<GridOptionModel> suspend fun getShapeOptions(): List<ShapeOptionModel>? suspend fun getShapeOptions(): List<ShapeOptionModel> fun applyGridOption(gridKey: String) Loading src/com/android/customization/picker/grid/data/repository/ShapeRepository.kt +12 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.customization.picker.grid.data.repository import android.content.Context import android.content.res.Resources import com.android.customization.model.ResourceConstants import com.android.customization.model.grid.ShapeGridManager import com.android.customization.model.grid.ShapeOptionModel import com.android.wallpaper.R Loading Loading @@ -53,6 +55,16 @@ constructor( private val _shapeOptions = MutableStateFlow<List<ShapeOptionModel>?>(null) val defaultShapePath = context.resources.getString( Resources.getSystem() .getIdentifier( ResourceConstants.CONFIG_ICON_MASK, "string", ResourceConstants.ANDROID_PACKAGE, ) ) init { bgScope.launch { _shapeOptions.value = shapeGridManager.getShapeOptions() } } Loading src/com/android/customization/picker/grid/domain/interactor/AppIconInteractor.kt +7 −1 Original line number Diff line number Diff line Loading @@ -17,11 +17,13 @@ package com.android.customization.picker.grid.domain.interactor import com.android.customization.model.grid.ShapeOptionModel import com.android.customization.picker.grid.data.repository.ShapeRepository import com.android.customization.picker.themedicon.data.repository.ThemedIconRepository import javax.inject.Inject import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @Singleton class AppIconInteractor Loading @@ -33,7 +35,11 @@ constructor( val shapeOptions = shapeRepository.shapeOptions val selectedShapeOption = shapeRepository.selectedShapeOption private val defaultShape = ShapeOptionModel("default", "", shapeRepository.defaultShapePath, true) val selectedShapeOption = shapeRepository.selectedShapeOption.map { shapeOption -> shapeOption ?: defaultShape } val isThemedIconAvailable: Flow<Boolean> = themedIconRepository.isAvailable Loading Loading
res/layout/floating_sheet_app_icon.xml +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ <LinearLayout android:id="@+id/themed_icon_toggle_entry" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" Loading
src/com/android/customization/model/grid/DefaultShapeGridManager.kt +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ constructor( } } override suspend fun getShapeOptions(): List<ShapeOptionModel>? = override suspend fun getShapeOptions(): List<ShapeOptionModel> = withContext(bgDispatcher) { if (previewUtils.supportsPreview()) { context.contentResolver Loading Loading @@ -142,9 +142,9 @@ constructor( } list } } } ?: emptyList() } else { null emptyList() } } Loading
src/com/android/customization/model/grid/ShapeGridManager.kt +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ interface ShapeGridManager { */ suspend fun getGridOptions(): List<GridOptionModel> suspend fun getShapeOptions(): List<ShapeOptionModel>? suspend fun getShapeOptions(): List<ShapeOptionModel> fun applyGridOption(gridKey: String) Loading
src/com/android/customization/picker/grid/data/repository/ShapeRepository.kt +12 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.customization.picker.grid.data.repository import android.content.Context import android.content.res.Resources import com.android.customization.model.ResourceConstants import com.android.customization.model.grid.ShapeGridManager import com.android.customization.model.grid.ShapeOptionModel import com.android.wallpaper.R Loading Loading @@ -53,6 +55,16 @@ constructor( private val _shapeOptions = MutableStateFlow<List<ShapeOptionModel>?>(null) val defaultShapePath = context.resources.getString( Resources.getSystem() .getIdentifier( ResourceConstants.CONFIG_ICON_MASK, "string", ResourceConstants.ANDROID_PACKAGE, ) ) init { bgScope.launch { _shapeOptions.value = shapeGridManager.getShapeOptions() } } Loading
src/com/android/customization/picker/grid/domain/interactor/AppIconInteractor.kt +7 −1 Original line number Diff line number Diff line Loading @@ -17,11 +17,13 @@ package com.android.customization.picker.grid.domain.interactor import com.android.customization.model.grid.ShapeOptionModel import com.android.customization.picker.grid.data.repository.ShapeRepository import com.android.customization.picker.themedicon.data.repository.ThemedIconRepository import javax.inject.Inject import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @Singleton class AppIconInteractor Loading @@ -33,7 +35,11 @@ constructor( val shapeOptions = shapeRepository.shapeOptions val selectedShapeOption = shapeRepository.selectedShapeOption private val defaultShape = ShapeOptionModel("default", "", shapeRepository.defaultShapePath, true) val selectedShapeOption = shapeRepository.selectedShapeOption.map { shapeOption -> shapeOption ?: defaultShape } val isThemedIconAvailable: Flow<Boolean> = themedIconRepository.isAvailable Loading