Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a732a02 authored by George Lin's avatar George Lin
Browse files

Rename ShapeGrid to Grid

The classes that used to serve shape options no longer do. Change the
names accordingly.

Test: Unit tests
Bug: 393983228
Flag: EXEMPT bugfix
Change-Id: If406f4234782d302035c6a871abf527bbf2451cf
parent 766807dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

@Singleton
class ShapeGridRepository
class GridRepository2
@Inject
constructor(
    private val manager: ShapeGridManager,
+2 −2
Original line number Diff line number Diff line
@@ -18,12 +18,12 @@
package com.android.customization.picker.grid.domain.interactor

import android.graphics.drawable.Drawable
import com.android.customization.picker.grid.data.repository.ShapeGridRepository
import com.android.customization.picker.grid.data.repository.GridRepository2
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class ShapeGridInteractor @Inject constructor(private val repository: ShapeGridRepository) {
class GridInteractor2 @Inject constructor(private val repository: GridRepository2) {

    val gridOptions = repository.gridOptions

+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.content.res.Resources
import android.graphics.drawable.Drawable
import com.android.customization.model.ResourceConstants
import com.android.customization.model.grid.GridOptionModel
import com.android.customization.picker.grid.domain.interactor.ShapeGridInteractor
import com.android.customization.picker.grid.domain.interactor.GridInteractor2
import com.android.customization.widget.GridTileDrawable
import com.android.wallpaper.picker.common.text.ui.viewmodel.Text
import com.android.wallpaper.picker.option.ui.viewmodel.OptionItemViewModel2
@@ -40,11 +40,11 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.flow.stateIn

class ShapeGridPickerViewModel
class GridPickerViewModel
@AssistedInject
constructor(
    @ApplicationContext private val context: Context,
    private val interactor: ShapeGridInteractor,
    private val interactor: GridInteractor2,
    @Assisted private val viewModelScope: CoroutineScope,
) {
    // The currently-set system grid option
@@ -127,6 +127,6 @@ constructor(
    @ViewModelScoped
    @AssistedFactory
    interface Factory {
        fun create(viewModelScope: CoroutineScope): ShapeGridPickerViewModel
        fun create(viewModelScope: CoroutineScope): GridPickerViewModel
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ constructor(
    keyguardQuickAffordancePickerViewModel2Factory: KeyguardQuickAffordancePickerViewModel2.Factory,
    colorPickerViewModel2Factory: ColorPickerViewModel2.Factory,
    clockPickerViewModelFactory: ClockPickerViewModel.Factory,
    shapeGridPickerViewModelFactory: ShapeGridPickerViewModel.Factory,
    gridPickerViewModelFactory: GridPickerViewModel.Factory,
    appIconPickerViewModelFactory: AppIconPickerViewModel.Factory,
    val colorContrastSectionViewModel: ColorContrastSectionViewModel2,
    val darkModeViewModel: DarkModeViewModel,
@@ -65,7 +65,7 @@ constructor(
        keyguardQuickAffordancePickerViewModel2Factory.create(viewModelScope = viewModelScope)
    val colorPickerViewModel2 = colorPickerViewModel2Factory.create(viewModelScope = viewModelScope)
    val shapeGridPickerViewModel =
        shapeGridPickerViewModelFactory.create(viewModelScope = viewModelScope)
        gridPickerViewModelFactory.create(viewModelScope = viewModelScope)
    val appIconPickerViewModel =
        appIconPickerViewModelFactory.create(viewModelScope = viewModelScope)

+3 −3
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ import org.robolectric.RobolectricTestRunner
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(RobolectricTestRunner::class)
class ShapeGridRepositoryTest {
class GridRepository2Test {

    @get:Rule var hiltRule = HiltAndroidRule(this)
    @Inject lateinit var gridOptionsManager: FakeShapeGridManager
@@ -50,13 +50,13 @@ class ShapeGridRepositoryTest {
    @BackgroundDispatcher @Inject lateinit var bgScope: CoroutineScope
    @BackgroundDispatcher @Inject lateinit var bgDispatcher: CoroutineDispatcher

    private lateinit var underTest: ShapeGridRepository
    private lateinit var underTest: GridRepository2

    @Before
    fun setUp() {
        hiltRule.inject()
        underTest =
            ShapeGridRepository(
            GridRepository2(
                manager = gridOptionsManager,
                bgScope = bgScope,
                bgDispatcher = bgDispatcher,
Loading