27 lines
792 B
Kotlin
27 lines
792 B
Kotlin
package com.hippo.ehviewer.widget
|
|
|
|
import android.content.Context
|
|
import android.util.AttributeSet
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.getValue
|
|
import androidx.compose.runtime.mutableStateOf
|
|
import androidx.compose.runtime.setValue
|
|
import androidx.compose.ui.platform.AbstractComposeView
|
|
import com.google.accompanist.themeadapter.material3.Mdc3Theme
|
|
import com.hippo.ehviewer.ui.widget.GalleryListCardRating
|
|
|
|
class SimpleRatingView @JvmOverloads constructor(
|
|
context: Context,
|
|
attrs: AttributeSet? = null,
|
|
defStyle: Int = 0,
|
|
) : AbstractComposeView(context, attrs, defStyle) {
|
|
var rating by mutableStateOf(0f)
|
|
|
|
@Composable
|
|
override fun Content() {
|
|
Mdc3Theme {
|
|
GalleryListCardRating(rating)
|
|
}
|
|
}
|
|
}
|