-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from SuhasDissa/analog_clock
feat: Analog clock configuration
- Loading branch information
Showing
33 changed files
with
1,452 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
app/src/main/java/com/bnyro/clock/domain/model/AnalogClockFace.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.bnyro.clock.domain.model | ||
|
||
import androidx.annotation.DrawableRes | ||
import com.bnyro.clock.R | ||
|
||
sealed class AnalogClockFace( | ||
val name: String, | ||
val author: String? = null, | ||
val authorUrl: String? = null, | ||
@DrawableRes val dial: Int = 0, | ||
@DrawableRes val hourHand: Int = 0, | ||
@DrawableRes val minuteHand: Int = 0, | ||
@DrawableRes val secondHand: Int = 0 | ||
) { | ||
|
||
object System : AnalogClockFace( | ||
name = "System" | ||
) | ||
|
||
object Classic76 : AnalogClockFace( | ||
name = "Classic76", | ||
author = "§", | ||
authorUrl = "https://github.com/shuvashish76", | ||
dial = R.drawable.classic76_dial, | ||
hourHand = R.drawable.classic76_hour_hand, | ||
minuteHand = R.drawable.classic76_minute_hand, | ||
secondHand = R.drawable.classic76_second_hand | ||
) | ||
|
||
object TwoDBall : AnalogClockFace( | ||
name = "2D Ball", | ||
author = "§", | ||
authorUrl = "https://github.com/shuvashish76", | ||
dial = R.drawable.twod_ball_dial, | ||
hourHand = R.drawable.twod_ball_hour_hand, | ||
minuteHand = R.drawable.twod_ball_minute_hand, | ||
secondHand = R.drawable.twod_ball_second_hand | ||
) | ||
|
||
object ClassicClockYou : AnalogClockFace( | ||
name = "Classic Clock You", | ||
author = "SuhasDissa", | ||
authorUrl = "https://github.com/SuhasDissa", | ||
dial = R.drawable.classic_clock_you_dial, | ||
hourHand = R.drawable.classic_clock_you_hour_hand, | ||
minuteHand = R.drawable.classic_clock_you_minute_hand | ||
) | ||
|
||
object AnalogClock : AnalogClockFace( | ||
name = "Analog Clock", | ||
author = "DG-RA", | ||
authorUrl = "https://openclipart.org/artist/DG-RA", | ||
dial = R.drawable.analog_clock_black_dial, | ||
hourHand = R.drawable.analog_clock_black_hour_hand, | ||
minuteHand = R.drawable.analog_clock_black_minute_hand, | ||
secondHand = R.drawable.analog_clock_black_second_hand | ||
) | ||
|
||
object MinimalisticCircular : AnalogClockFace( | ||
name = "Minimalistic - Circular", | ||
author = "§", | ||
authorUrl = "https://github.com/shuvashish76", | ||
dial = R.drawable.minimalistic_circular_dial, | ||
hourHand = R.drawable.minimalistic_circular_hour_hand, | ||
minuteHand = R.drawable.minimalistic_circular_minute_hand | ||
) | ||
|
||
object MinimalisticBar : AnalogClockFace( | ||
name = "Minimalistic - Bar", | ||
author = "§", | ||
authorUrl = "https://github.com/shuvashish76", | ||
dial = R.drawable.minimalistic_bar_dial, | ||
hourHand = R.drawable.minimalistic_bar_hour_hand, | ||
minuteHand = R.drawable.minimalistic_bar_minute_hand | ||
) | ||
|
||
companion object { | ||
val all = listOf( | ||
System, | ||
Classic76, | ||
TwoDBall, | ||
ClassicClockYou, | ||
AnalogClock, | ||
MinimalisticCircular, | ||
MinimalisticBar | ||
) | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/bnyro/clock/domain/model/AnalogClockWidgetOptions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.bnyro.clock.domain.model | ||
|
||
import androidx.annotation.DrawableRes | ||
|
||
data class AnalogClockWidgetOptions( | ||
var clockFaceName: String, | ||
@DrawableRes var hourHand: Int, | ||
@DrawableRes var minuteHand: Int, | ||
@DrawableRes var secondHand: Int, | ||
@DrawableRes var dial: Int | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.