Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ internal class SQLiteTableDetails private constructor(

val sqlCreateTempTable =
if (sqlCreateTable.isNullOrEmpty()) throw IllegalStateException("Can't drop column for $originTableName")
else sqlCreateTable!!.replace("CREATE TABLE `$originTableName`", "CREATE TABLE `$copyName`")
else sqlCreateTable.replace("CREATE TABLE `$originTableName`", "CREATE TABLE `$copyName`")

return SQLiteTableDetails(sqlCreateTempTable, sqlCreateIndexes, copyName, sqlKeptColumns)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
*/
open class MultiChoiceDialog<T : DialogChoice>(
@StyleRes theme: Int,
@StringRes private val dialogTitleText: Int,
@field:StringRes private val dialogTitleText: Int,
private val choices: List<T>,
private val onChoiceSelected: (T) -> Unit,
private val onCanceled: (() -> Unit)? = null,
Expand Down Expand Up @@ -215,9 +215,9 @@ private class SmallChoiceViewHolder<T : DialogChoice>(

/** Base class for a dialog choice. */
open class DialogChoice(
@StringRes val title: Int,
@StringRes val description: Int? = null,
@DrawableRes val iconId: Int? = null,
@field:StringRes val title: Int,
@field:StringRes val description: Int? = null,
@field:DrawableRes val iconId: Int? = null,
val enabled: Boolean = true,
@DrawableRes val disabledIconId: Int? = null,
@field:DrawableRes val disabledIconId: Int? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import com.buzbuz.smartautoclicker.core.ui.views.gesturerecord.toActionDescripti

abstract class ItemBriefMenu(
@StyleRes theme: Int? = null,
@StringRes private val noItemText: Int,
@field:StringRes private val noItemText: Int,
private val initialItemIndex: Int = 0,
) : OverlayMenu(theme = theme, recreateOverlayViewOnRotation = true) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ internal class PermissionDialogViewModel @Inject constructor(

internal data class PermissionDialogUiState(
val permission: Permission,
@StringRes val titleRes: Int,
@StringRes val descriptionRes: Int,
@field:StringRes val titleRes: Int,
@field:StringRes val descriptionRes: Int,
)

private fun Permission.toPermissionDialogUiState(): PermissionDialogUiState =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import kotlin.time.Duration.Companion.seconds
import com.buzbuz.smartautoclicker.core.ui.R

open class DropdownItem(
@StringRes val title: Int,
@StringRes val helperText: Int? = null,
@DrawableRes val icon: Int? = null,
@field:StringRes val title: Int,
@field:StringRes val helperText: Int? = null,
@field:DrawableRes val icon: Int? = null,
)

sealed class TimeUnitDropDownItem(@StringRes title: Int) : DropdownItem(title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ data class SelectorState(
val isClickable: Boolean,
val title: String,
val subText: String?,
@DrawableRes val iconRes: Int?,
@field:DrawableRes val iconRes: Int?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat
/** Handles the states of an [ImageButton] and their animated transitions. */
class AnimatedStatesImageButtonController(
context: Context,
@DrawableRes private val state1StaticRes: Int,
@DrawableRes private val state2StaticRes: Int,
@DrawableRes state1to2AnimationRes: Int,
@DrawableRes state2to1AnimationRes: Int,
@field:DrawableRes private val state1StaticRes: Int,
@field:DrawableRes private val state2StaticRes: Int,
@field:DrawableRes state1to2AnimationRes: Int,
@field:DrawableRes state2to1AnimationRes: Int,
) {

/** Animation from state 1 to state 2. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import kotlinx.coroutines.launch

class AutoHideAnimationController {

enum class ScreenSide(@AnimRes internal val inAnim: Int, @AnimRes internal val outAnim: Int) {
enum class ScreenSide(@field:AnimRes internal val inAnim: Int, @field:AnimRes internal val outAnim: Int) {
LEFT(R.anim.slide_in_left, R.anim.slide_out_left),
TOP(R.anim.slide_in_top, R.anim.slide_out_top),
BOTTOM(R.anim.slide_in_bottom, R.anim.slide_out_bottom),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import com.buzbuz.smartautoclicker.core.ui.R


internal class ClickOffsetStyle(
@ColorInt val innerColor: Int,
@ColorInt val outerColor: Int,
@ColorInt val backgroundColor: Int,
@field:ColorInt val innerColor: Int,
@field:ColorInt val outerColor: Int,
@field:ColorInt val backgroundColor: Int,
val radiusPx: Float,
val innerRadiusPx: Float,
val thicknessPx: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import com.buzbuz.smartautoclicker.core.ui.R


internal class GestureRecorderViewStyle(
@ColorInt val color: Int,
@field:ColorInt val color: Int,
val thicknessPx: Int,
val lengthPx: Int,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ data class ClickDescription(


internal data class ClickBriefRendererStyle(
@ColorInt val backgroundColor: Int,
@field:ColorInt val backgroundColor: Int,
val outerPaint: Paint,
val innerPaint: Paint,
val outerRadiusPx: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ internal class DefaultBriefRenderer(
}

internal data class DefaultBriefRendererStyle(
@ColorInt val backgroundColor: Int,
@ColorInt val iconColor: Int,
@field:ColorInt val backgroundColor: Int,
@field:ColorInt val iconColor: Int,
val iconSize: Float,
val outerPaint: Paint,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ enum class ImageConditionBriefRenderingType {
}

internal data class ImageConditionBriefRendererStyle(
@ColorInt val backgroundColor: Int,
@ColorInt val selectorColor: Int,
@field:ColorInt val backgroundColor: Int,
@field:ColorInt val selectorColor: Int,
val thicknessPx: Int,
val cornerRadiusPx: Float,
)
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ data class PauseDescription(
) : ItemBriefDescription

internal data class PauseBriefRendererStyle(
@ColorInt val backgroundColor: Int,
@field:ColorInt val backgroundColor: Int,
val outerPaint: Paint,
val linePaint: Paint,
val thicknessPx: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ data class SwipeDescription(
) : ItemBriefDescription

internal data class SwipeBriefRendererStyle(
@ColorInt val backgroundColor: Int,
@field:ColorInt val backgroundColor: Int,
val linePaint: Paint,
val outerFromPaint: Paint,
val outerToPaint: Paint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ internal class DisplayBorderComponent (
*/
internal class DisplayBorderComponentStyle(
displayConfigManager: DisplayConfigManager,
@ColorInt val color: Int,
@field:ColorInt val color: Int,
val thicknessPx: Int,
) : ViewStyle(displayConfigManager)
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ internal class SelectorComponentStyle(
val selectorAreaOffset: Int,
val cornerRadius: Float,
val selectorThickness: Float,
@ColorInt val selectorColor: Int,
@ColorInt val selectorBackgroundColor: Int,
@field:ColorInt val selectorColor: Int,
@field:ColorInt val selectorBackgroundColor: Int,
) : ViewStyle(displayConfigManager)

/** The ratio of the maximum width to be considered as the minimum width. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal open class SingleHint(
iconsSize: Int,
maxArea: Rect,
@DrawableRes iconId: Int,
@Size(1) private val inSelector: BooleanArray,
@field:Size(1) private val inSelector: BooleanArray,
) : Hint(context, iconsSize, iconId, maxArea, inSelector) {

override fun invalidate(selectorArea: Rect, newCenterX: Int, newCenterY: Int,
Expand Down Expand Up @@ -135,7 +135,7 @@ internal class DoubleHint(
maxArea: Rect,
private val iconsMargin: Int,
@DrawableRes @Size(2) icons: IntArray,
@Size(2) private val inSelector: BooleanArray,
@field:Size(2) private val inSelector: BooleanArray,
private val isVertical: Boolean,
): SingleHint(context, iconsSize, maxArea, icons[0], booleanArrayOf(inSelector[0])) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ internal class HintsComponentStyle(
displayConfigManager: DisplayConfigManager,
val iconsMargin: Int,
val iconsSize: Int,
@DrawableRes val moveIcon: Int,
@DrawableRes val upIcon: Int,
@DrawableRes val downIcon: Int,
@DrawableRes val leftIcon: Int,
@DrawableRes val rightIcon: Int,
@DrawableRes val pinchIcon: Int? = null,
@field:DrawableRes val moveIcon: Int,
@field:DrawableRes val upIcon: Int,
@field:DrawableRes val downIcon: Int,
@field:DrawableRes val leftIcon: Int,
@field:DrawableRes val rightIcon: Int,
@field:DrawableRes val pinchIcon: Int? = null,
val pinchIconMargin: Int? = null,
) : ViewStyle(displayConfigManager)

Expand Down
Loading