-
-
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.
- Loading branch information
1 parent
87a5a52
commit 5d2e6e3
Showing
31 changed files
with
1,484 additions
and
18 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
118 changes: 118 additions & 0 deletions
118
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,118 @@ | ||
package com.bnyro.clock.domain.model | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.ui.text.AnnotatedString | ||
import androidx.compose.ui.text.ExperimentalTextApi | ||
import androidx.compose.ui.text.SpanStyle | ||
import androidx.compose.ui.text.UrlAnnotation | ||
import androidx.compose.ui.text.buildAnnotatedString | ||
import androidx.compose.ui.text.style.TextDecoration | ||
import androidx.compose.ui.text.withAnnotation | ||
import androidx.compose.ui.text.withStyle | ||
import com.bnyro.clock.R | ||
|
||
data class AnalogClockFace( | ||
val name: String, | ||
val attribution: AnnotatedString? = null, | ||
@DrawableRes val dial: Int = 0, | ||
@DrawableRes val hourHand: Int = 0, | ||
@DrawableRes val minuteHand: Int = 0, | ||
@DrawableRes val secondHand: Int = 0 | ||
) { | ||
@OptIn(ExperimentalTextApi::class) | ||
companion object { | ||
|
||
val all = listOf( | ||
AnalogClockFace( | ||
name = "System" | ||
), AnalogClockFace( | ||
name = "Classic76", | ||
attribution = buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://github.com/shuvashish76")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("§") | ||
} | ||
} | ||
}, | ||
dial = R.drawable.classic76_dial, | ||
hourHand = R.drawable.classic76_hour_hand, | ||
minuteHand = R.drawable.classic76_minute_hand, | ||
secondHand = R.drawable.classic76_second_hand | ||
), AnalogClockFace( | ||
name = "2D Ball", | ||
buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://github.com/shuvashish76")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("§") | ||
} | ||
} | ||
}, | ||
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 | ||
), AnalogClockFace( | ||
name = "Classic Clock You", | ||
attribution = buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://github.com/SuhasDissa")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("SuhasDissa") | ||
} | ||
} | ||
}, | ||
dial = R.drawable.classic_clock_you_dial, | ||
hourHand = R.drawable.classic_clock_you_hour_hand, | ||
minuteHand = R.drawable.classic_clock_you_minute_hand | ||
), AnalogClockFace( | ||
name = "Analog Clock", | ||
attribution = buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://openclipart.org/artist/DG-RA")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("DG-RA") | ||
} | ||
} | ||
append(" on ") | ||
withAnnotation(UrlAnnotation("https://openclipart.org/detail/344177/analog-clock-black-design-ii")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("Open ClipArt") | ||
} | ||
} | ||
}, | ||
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 | ||
), AnalogClockFace( | ||
name = "Minimalistic - Circular", | ||
buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://github.com/shuvashish76")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("§") | ||
} | ||
} | ||
}, | ||
dial = R.drawable.minimalistic_circular_dial, | ||
hourHand = R.drawable.minimalistic_circular_hour_hand, | ||
minuteHand = R.drawable.minimalistic_circular_minute_hand | ||
), AnalogClockFace( | ||
name = "Minimalistic - Bar", | ||
buildAnnotatedString { | ||
append("Design by ") | ||
withAnnotation(UrlAnnotation("https://github.com/shuvashish76")) { | ||
withStyle(style = SpanStyle(textDecoration = TextDecoration.Underline)) { | ||
append("§") | ||
} | ||
} | ||
}, | ||
dial = R.drawable.minimalistic_bar_dial, | ||
hourHand = R.drawable.minimalistic_bar_hour_hand, | ||
minuteHand = R.drawable.minimalistic_bar_minute_hand | ||
) | ||
) | ||
} | ||
} |
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 = "Default", | ||
@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.