Skip to content

Commit

Permalink
Merge 9ad164c into 0108d44
Browse files Browse the repository at this point in the history
  • Loading branch information
PetoAdam authored Dec 2, 2023
2 parents 0108d44 + 9ad164c commit 9a0b9a6
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 40 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ jobs:
run: ./gradlew build
- name: Build Debug APK
run: ./gradlew assembleDebug
- name: Get commit hash
id: get_commit_hash
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
tag_name: v${{ steps.get_commit_hash.outputs.commit_hash }}
release_name: Release ${{ steps.get_commit_hash.outputs.commit_hash }}
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencies {
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.3.2'
implementation 'androidx.core:core-ktx:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ fun ImageSection(
Icon(
imageVector = Icons.TwoTone.Star,
contentDescription = "Rating",
tint = Color.White,
modifier = Modifier
.weight(1f)
.align(Alignment.CenterVertically)
Expand All @@ -176,6 +177,7 @@ fun ImageSection(
Text(
text = roundedRating.toString() ?: "Unknown",
style = MaterialTheme.typography.headlineLarge,
color = Color.White,
modifier = Modifier
.padding(10.dp)
.weight(2f),
Expand All @@ -194,6 +196,7 @@ fun ImageSection(
Text(
text = movie.first.title.orEmpty(),
style = MaterialTheme.typography.headlineLarge,
color = Color.White,
modifier = Modifier
.padding(8.dp)
.width(300.dp)
Expand All @@ -215,6 +218,7 @@ fun ImageSection(
} else {
Icons.TwoTone.Favorite
},
tint = Color.White,
contentDescription = "Favorite"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ fun MovieListScreenContent(
onFavouriteIconClicked: () -> Unit
) {
ContentWithBackgroundLoadingIndicator(state = movieListUiState, onRetry = onRetry) { state ->
Column(modifier = Modifier.fillMaxSize())
Column(
modifier = Modifier
.fillMaxSize()
.background(color = MaterialTheme.colorScheme.background),
)
{
MovieListHeader(
isFavourite = state.showFavourites,
Expand Down Expand Up @@ -110,7 +114,8 @@ fun MovieListHeader(
modifier = modifier
.fillMaxWidth()
.height(80.dp)
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp)
.background(MaterialTheme.colorScheme.background),
verticalAlignment = Alignment.CenterVertically
) {
val searchWeight = if (searchText == "") 1f else 5f
Expand All @@ -131,7 +136,8 @@ fun MovieListHeader(
text = "Movies",
style = MaterialTheme.typography.headlineLarge,
modifier = Modifier.weight(3f),
textAlign = TextAlign.Center
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onBackground
)

Spacer(modifier = Modifier.width(16.dp))
Expand Down Expand Up @@ -165,14 +171,15 @@ fun SearchBar(
modifier = modifier
.clip(RoundedCornerShape(4.dp))
.padding(horizontal = 8.dp, vertical = 4.dp)
.height(36.dp),
.height(36.dp)
.background(MaterialTheme.colorScheme.background),
singleLine = true,
textStyle = MaterialTheme.typography.bodyMedium,
leadingIcon = {
Icon(
imageVector = Icons.Filled.Search,
contentDescription = "Search Icon",
tint = Color(0.3f, 0.3f, 0.3f, 0.7f)
tint = MaterialTheme.colorScheme.onBackground,
)
},
shape = RoundedCornerShape(8.dp)
Expand All @@ -188,11 +195,12 @@ fun TwoWaySlider(
IconButton(
onClick = onCheckedChange,
modifier = modifier
.background(MaterialTheme.colorScheme.background)
) {
Icon(
imageVector = if (isChecked) Icons.Filled.Favorite else Icons.TwoTone.Favorite,
contentDescription = null,
tint = if (isChecked) Color.Red else LocalContentColor.current // Set red tint for filled version
tint = if (isChecked) Color.Red else MaterialTheme.colorScheme.onBackground // Set red tint for filled version
)
}
}
Expand All @@ -207,6 +215,7 @@ fun MovieList(
AnimatedVisibility(movieListUiState.searchText != "") {
Text(
text = "Showing results for: " + movieListUiState.searchText,
color = MaterialTheme.colorScheme.onBackground,
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
Expand Down Expand Up @@ -250,7 +259,7 @@ fun MovieListItem(
)
}
Divider(
color = Color.Black,
color = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.padding(start = 20.dp, end = 20.dp)
)
}
Expand Down Expand Up @@ -294,7 +303,7 @@ fun MovieDetails(movie: Movie, modifier: Modifier) {
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(bottom = 2.dp),
color = Color.Black
color = MaterialTheme.colorScheme.onBackground
)
Text(
text =
Expand All @@ -305,14 +314,14 @@ fun MovieDetails(movie: Movie, modifier: Modifier) {
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodyMedium,
color = Color.Black
color = MaterialTheme.colorScheme.onBackground
)
Text(
text = "Rating: " + movie.vote_average,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodyMedium,
color = Color.Black
color = MaterialTheme.colorScheme.onBackground
)
}
}
Expand Down
16 changes: 10 additions & 6 deletions app/src/main/java/com/example/cinemasurf/ui/theme/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ package com.example.cinemasurf.ui.theme

import androidx.compose.ui.graphics.Color

val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
// Light Color Scheme
val LightGrey = Color(0xFFE5E5E5)
val LightGreyVariant = Color(0xFFD2D2D2)
val White = Color(0xFFFFFFFF)
val DarkGrey = Color(0xFF333333)
val AccentColor = Color(0xFF009688)

val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
// Dark Color Scheme
val DarkGreyBackground = Color(0xFF121212)
val AlmostBlack = Color(0xFF1C1C1C)
val DarkAccentColor = Color(0xFF005850)
42 changes: 23 additions & 19 deletions app/src/main/java/com/example/cinemasurf/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,30 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat

private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
val DarkColorScheme = darkColorScheme(
primary = AlmostBlack,
secondary = DarkGreyBackground,
tertiary = DarkAccentColor,
background = DarkGreyBackground,
surface = AlmostBlack,
onPrimary = White,
onSecondary = White,
onTertiary = White,
onBackground = LightGrey,
onSurface = White,
)

private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40

/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
val LightColorScheme = lightColorScheme(
primary = White,
secondary = LightGrey,
tertiary = AccentColor,
background = White,
surface = White,
onPrimary = DarkGrey,
onSecondary = DarkGrey,
onTertiary = DarkGrey,
onBackground = DarkGrey,
onSurface = DarkGrey,
)

@Composable
Expand All @@ -58,7 +62,7 @@ fun CinemaSurfTheme(
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
}
}

Expand Down

0 comments on commit 9a0b9a6

Please sign in to comment.