-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): re-design the ui of provider's screens
- Loading branch information
Showing
51 changed files
with
1,498 additions
and
704 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
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
7 changes: 7 additions & 0 deletions
7
...on/src/main/kotlin/com/flixclusive/core/ui/common/navigation/ProviderInfoScreenNavArgs.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.flixclusive.core.ui.common.navigation | ||
|
||
import com.flixclusive.gradle.entities.ProviderData | ||
|
||
data class ProviderInfoScreenNavArgs( | ||
val providerData: ProviderData | ||
) |
7 changes: 7 additions & 0 deletions
7
.../main/kotlin/com/flixclusive/core/ui/common/navigation/RepositorySearchScreenNavigator.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.flixclusive.core.ui.common.navigation | ||
|
||
import com.flixclusive.gradle.entities.Repository | ||
|
||
interface RepositorySearchScreenNavigator : GoBackAction { | ||
fun openRepositoryScreen(repository: Repository) | ||
} |
29 changes: 29 additions & 0 deletions
29
core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/util/DummyDataForPreview.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,29 @@ | ||
package com.flixclusive.core.ui.common.util | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import com.flixclusive.gradle.entities.Author | ||
import com.flixclusive.gradle.entities.Language | ||
import com.flixclusive.gradle.entities.ProviderData | ||
import com.flixclusive.gradle.entities.ProviderType | ||
import com.flixclusive.gradle.entities.Status | ||
|
||
object DummyDataForPreview { | ||
@Composable | ||
fun getDummyProviderData() = remember { | ||
ProviderData( | ||
authors = List(5) { Author("FLX $it") }, | ||
repositoryUrl = "https://github.com/flixclusive/123Movies", | ||
buildUrl = "https://raw.githubusercontent.com/Flixclusive/plugins-template/builds/updater.json", | ||
changelog = """Test""", | ||
versionName = "1.0.0", | ||
versionCode = 10000, | ||
description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", | ||
iconUrl = null, | ||
language = Language.Multiple, | ||
name = "CineFlix", | ||
providerType = ProviderType.All, | ||
status = Status.Working | ||
) | ||
} | ||
} |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:pathData="M292.31,820q-29.92,0 -51.12,-21.19Q220,777.61 220,747.69L220,240h-40v-60h180v-35.38h240L600,180h180v60h-40v507.69Q740,778 719,799q-21,21 -51.31,21L292.31,820ZM680,240L280,240v507.69q0,5.39 3.46,8.85t8.85,3.46h375.38q4.62,0 8.46,-3.85 3.85,-3.84 3.85,-8.46L680,240ZM376.16,680h59.99v-360h-59.99v360ZM523.85,680h59.99v-360h-59.99v360ZM280,240v520,-520Z" | ||
android:fillColor="#e8eaed"/> | ||
</vector> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:pathData="M479.89,833.85q-70.27,0 -119.6,-48.36T310.96,667.5v-361.35h-1.73q-26.35,0 -44.71,-17.98 -18.37,-17.98 -18.37,-44.32v-54.62q0,-26.35 18.37,-44.71 18.36,-18.37 44.71,-18.37L650,126.15q26.71,0 45.28,18.37 18.57,18.36 18.57,44.71v54.62q0,26.34 -18.75,44.32T650,306.15h-1.35v372.89q-5,66.04 -53.66,110.42 -48.66,44.39 -115.1,44.39ZM309.23,269.23L650,269.23q10.77,0 18.85,-7.31 8.07,-7.3 8.07,-18.07v-54.62q0,-10.77 -8.07,-18.46 -8.08,-7.69 -18.85,-7.69L309.23,163.08q-10.77,0 -18.46,7.69 -7.69,7.69 -7.69,18.46v54.62q0,10.77 7.69,18.07 7.69,7.31 18.46,7.31ZM480.07,796.92q54.7,0 93.18,-37.3 38.48,-37.3 38.48,-92.12v-34.42L487.12,633.08v-36.93h124.61v-113.84L487.12,482.31v-36.93h124.61v-139.23L347.88,306.15v361.54q0,54.54 38.75,91.89 38.75,37.34 93.44,37.34ZM283.08,269.23v-106.15,106.15Z" | ||
android:fillColor="#e8eaed"/> | ||
</vector> |
131 changes: 131 additions & 0 deletions
131
.../com/flixclusive/core/ui/mobile/component/provider/ButtonWithCircularProgressIndicator.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,131 @@ | ||
package com.flixclusive.core.ui.mobile.component.provider | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.animation.AnimatedContent | ||
import androidx.compose.foundation.BorderStroke | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.CircularProgressIndicator | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.OutlinedButton | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.flixclusive.core.ui.common.util.onMediumEmphasis | ||
|
||
@Composable | ||
fun ButtonWithCircularProgressIndicator( | ||
modifier: Modifier = Modifier, | ||
onClick: () -> Unit, | ||
@DrawableRes iconId: Int, | ||
label: String, | ||
isLoading: Boolean = false, | ||
enabled: Boolean = true, | ||
emphasize: Boolean = false, | ||
indicatorSize: Dp = 20.dp, | ||
contentPadding: PaddingValues = PaddingValues(vertical = 15.dp) | ||
) { | ||
if (emphasize) { | ||
Button( | ||
enabled = enabled, | ||
onClick = onClick, | ||
contentPadding = contentPadding, | ||
shape = MaterialTheme.shapes.medium, | ||
modifier = modifier, | ||
) { | ||
AnimatedContent( | ||
targetState = isLoading, | ||
label = "" | ||
) { state -> | ||
if (state) { | ||
CircularProgressIndicator( | ||
strokeWidth = 2.dp, | ||
modifier = Modifier | ||
.size(indicatorSize) | ||
) | ||
} else { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Icon( | ||
painter = painterResource(id = iconId), | ||
contentDescription = label, | ||
modifier = Modifier | ||
.size(16.dp) | ||
) | ||
|
||
Text( | ||
text = label, | ||
style = MaterialTheme.typography.labelLarge.copy( | ||
fontWeight = FontWeight.Medium | ||
), | ||
modifier = Modifier | ||
.padding(start = 3.dp) | ||
) | ||
} | ||
|
||
} | ||
} | ||
} | ||
} else { | ||
OutlinedButton( | ||
enabled = enabled, | ||
onClick = onClick, | ||
colors = ButtonDefaults.outlinedButtonColors( | ||
contentColor = MaterialTheme.colorScheme.onSurface.onMediumEmphasis(0.8F) | ||
), | ||
border = BorderStroke( | ||
width = 1.dp, | ||
color = MaterialTheme.colorScheme.onSurface.onMediumEmphasis(), | ||
), | ||
contentPadding = contentPadding, | ||
shape = MaterialTheme.shapes.small, | ||
modifier = modifier, | ||
) { | ||
AnimatedContent( | ||
targetState = isLoading, | ||
label = "" | ||
) { state -> | ||
if (state) { | ||
CircularProgressIndicator( | ||
strokeWidth = 2.dp, | ||
modifier = Modifier | ||
.size(indicatorSize) | ||
) | ||
} else { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Icon( | ||
painter = painterResource(id = iconId), | ||
contentDescription = label, | ||
modifier = Modifier | ||
.size(16.dp) | ||
) | ||
|
||
Text( | ||
text = label, | ||
style = MaterialTheme.typography.labelLarge.copy( | ||
fontWeight = FontWeight.Medium | ||
), | ||
modifier = Modifier | ||
.padding(start = 3.dp) | ||
) | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.