-
Notifications
You must be signed in to change notification settings - Fork 0
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 #52 from Jacob3075/WTA-39/add-more-items-to-home-page
Added logic and UI for current streak
- Loading branch information
Showing
46 changed files
with
2,132 additions
and
451 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
8 changes: 7 additions & 1 deletion
8
core/common/src/main/java/com/jacob/wakatimeapp/core/common/Utils.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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package com.jacob.wakatimeapp.core.common // ktlint-disable filename | ||
package com.jacob.wakatimeapp.core.common | ||
|
||
import java.time.format.TextStyle.SHORT | ||
import java.util.Locale | ||
import kotlinx.datetime.Instant | ||
import kotlinx.datetime.LocalDate | ||
import kotlinx.datetime.TimeZone | ||
import kotlinx.datetime.toLocalDateTime | ||
|
||
fun Instant.toDate(timeZone: TimeZone = TimeZone.currentSystemDefault()) = | ||
toLocalDateTime(timeZone).date | ||
|
||
fun LocalDate.getDisplayNameForDay(): String = | ||
dayOfWeek.getDisplayName(SHORT, Locale.getDefault()) |
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
7 changes: 7 additions & 0 deletions
7
core/models/src/main/java/com/jacob/wakatimeapp/core/models/Stats.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,7 @@ | ||
package com.jacob.wakatimeapp.core.models | ||
|
||
data class Stats( | ||
val totalTime: Time, | ||
val dailyStats: List<DailyStats>, | ||
val range: StatsRange, | ||
) |
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
31 changes: 31 additions & 0 deletions
31
core/ui/src/main/java/com/jacob/wakatimeapp/core/ui/WtaPreviews.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,31 @@ | ||
package com.jacob.wakatimeapp.core.ui | ||
|
||
import android.content.res.Configuration | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
||
@Preview( | ||
name = "Light Mode", | ||
uiMode = Configuration.UI_MODE_NIGHT_NO or Configuration.UI_MODE_TYPE_NORMAL, | ||
group = "component" | ||
) | ||
@Preview( | ||
name = "Dark Mode", | ||
showBackground = true, | ||
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, | ||
group = "component" | ||
) | ||
@Preview( | ||
name = "Full Device Light ", | ||
showBackground = true, | ||
uiMode = Configuration.UI_MODE_NIGHT_NO or Configuration.UI_MODE_TYPE_NORMAL, | ||
showSystemUi = true, | ||
group = "full" | ||
) | ||
@Preview( | ||
name = "Full Device Dark ", | ||
showBackground = true, | ||
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, | ||
showSystemUi = true, | ||
group = "full" | ||
) | ||
annotation class WtaPreviews |
21 changes: 21 additions & 0 deletions
21
core/ui/src/main/java/com/jacob/wakatimeapp/core/ui/modifiers/RemoveFontPadding.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,21 @@ | ||
package com.jacob.wakatimeapp.core.ui.modifiers | ||
|
||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.layout | ||
import androidx.compose.ui.text.TextStyle | ||
|
||
/** | ||
* Removes excess padding from the top and bottom of the text. | ||
* | ||
* [Source](https://issuetracker.google.com/issues/171394808#comment38) | ||
*/ | ||
fun Modifier.removeFontPadding( | ||
textStyle: TextStyle, | ||
) = layout { measurable, constraints -> | ||
val placeable = measurable.measure(constraints) | ||
val heightWithoutPadding = | ||
placeable.height - placeable.height.mod(textStyle.lineHeight.roundToPx()) | ||
layout(placeable.width, heightWithoutPadding) { | ||
placeable.placeRelative(0, 0) | ||
} | ||
} |
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.