Skip to content

Commit

Permalink
fixed ui issues
Browse files Browse the repository at this point in the history
Signed-off-by: Snehil <[email protected]>
  • Loading branch information
hashsalt0 committed Oct 24, 2023
1 parent 864358a commit e21b444
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 89 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/otaku/fetch/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MainActivity : AppCompatActivity() {
) {
Row(horizontalArrangement = Arrangement.Center) {
Text(
text = "Fetch!",
text = getString(com.otaku.fetch.R.string.fetch),
fontFamily = sohen,
fontWeight = FontWeight.Bold,
fontSize = 42.sp
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">Fetch</string>
<string name="fetch">Fetch!</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fun DownloadList(tree: ItemTree) {
verticalArrangement = Arrangement.Center
) {
Text(
text = "NO DOWNLOAD",
text = stringResource(R.string.no_download),
style = MaterialTheme.typography.displayMedium,
textAlign = TextAlign.Center,
fontWeight = FontWeight.W800
Expand Down Expand Up @@ -403,7 +403,7 @@ private fun DeleteWarning(
dismiss: () -> Unit
) {
AlertDialog(title = {
Text(text = "Delete")
Text(text = stringResource(R.string.delete))
}, text = {
Text(text = warning)
}, onDismissRequest = {
Expand All @@ -413,13 +413,13 @@ private fun DeleteWarning(
dismiss()
onClick()
}) {
Text(text = "Okay")
Text(text = stringResource(R.string.okay))
}
}, dismissButton = {
Button(onClick = {
dismiss()
}) {
Text(text = "Cancel")
Text(text = stringResource(R.string.cancel))
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringSetPreferencesKey
import com.otaku.fetch.base.R
import com.otaku.fetch.base.ui.composepref.LocalPrefsDataStore
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -142,7 +144,10 @@ fun MultiSelectListPref(
TextButton(
onClick = { showDialog = false },
) {
Text(text = "Select", style = MaterialTheme.typography.bodyLarge)
Text(
text = stringResource(R.string.select),
style = MaterialTheme.typography.bodyLarge
)
}
},
properties = DialogProperties(
Expand Down
5 changes: 5 additions & 0 deletions base/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@
<string name="notifications_updates_unavailable">As you have not allowed notifications pemission, you won\'t be reciving anime release updates</string>
<string name="new_update_avalaible">New Update Available</string>
<string name="new_update_avalaible_desc">A new update is released on github</string>
<string name="no_download">NO DOWNLOAD</string>
<string name="delete">Delete</string>
<string name="okay">Okay</string>
<string name="cancel">Cancel</string>
<string name="select">Select</string>
</resources>
7 changes: 4 additions & 3 deletions kickassanime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.livedata"
implementation "androidx.appcompat:appcompat:$versions.appcompat"
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout"
implementation "androidx.preference:preference:$versions.preference"
implementation "androidx.preference:preference-ktx:$versions.preference"
implementation project(path: ':shinebar')
implementation 'androidx.palette:palette-ktx:1.0.0'
testImplementation "androidx.paging:paging-common:$versions.paging"
testImplementation "androidx.paging:paging-common-ktx:$versions.paging"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$versions.swipe_refresh_layout"
implementation "com.squareup.retrofit2:converter-gson:$versions.gson_conveter"
implementation "com.mikepenz:iconics-core:$versions.iconics"
Expand All @@ -79,8 +79,9 @@ dependencies {
implementation "com.maxkeppeler.sheets:info:$versions.sheets"
implementation "com.maxkeppeler.sheets:input:$versions.sheets"
implementation "com.mikepenz:iconics-views:$versions.iconics"
implementation "com.mikepenz:iconics-compose:$versions.iconics"
// paging
implementation "androidx.paging:paging-runtime:$versions.paging"
implementation "androidx.paging:paging-runtime-ktx:$versions.paging"
implementation "com.squareup.retrofit2:converter-scalars:$versions.retrofit"

// OkHttp / Retrofit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.os.bundleOf
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.paging.PagingData
import com.mikepenz.iconics.compose.Image
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesome
import com.otaku.fetch.base.livedata.State
import com.otaku.kickassanime.db.models.entity.AnimeEntity
import com.otaku.kickassanime.db.models.entity.AnimeLanguageEntity
Expand Down Expand Up @@ -110,6 +113,9 @@ class AnimeActivity : AppCompatActivity() {
) {
val (isFavourite, setFavorite) = remember { mutableStateOf(isFavouriteValue) }
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()

val isDownloadClicked = remember { mutableStateOf(false) }

KickassAnimeTheme {
Scaffold(
modifier = Modifier.fillMaxSize(),
Expand All @@ -130,6 +136,14 @@ class AnimeActivity : AppCompatActivity() {
applyFavourite(!isFavourite)
setFavorite(!isFavourite)
}, isChecked = isFavourite)
IconButton(onClick = {
isDownloadClicked.value = true
}) {
Image(
asset = FontAwesome.Icon.faw_download,
colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.onSurface)
)
}
},
scrollBehavior = scrollBehavior
)
Expand All @@ -147,6 +161,7 @@ class AnimeActivity : AppCompatActivity() {
getAnime,
getLanguages,
getEpisodeList,
isDownloadClicked,
onEpisodeClick
)
}
Expand Down
Loading

0 comments on commit e21b444

Please sign in to comment.