Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
DesarrolloAntonio committed May 21, 2024
2 parents dfc7fb6 + 36776ac commit c98f5f7
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 16 deletions.
261 changes: 261 additions & 0 deletions .idea/other.xml

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

5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ android.nonTransitiveRClass=true
compileSdkVersion=34
minSdkVersion=21
targetSdkVersion=34
versionCode=39
versionName=1.31
versionCode=40
versionName=1.31.01

android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
10 changes: 10 additions & 0 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id ("de.mannodermaus.android-junit5")
}

android {
Expand Down Expand Up @@ -100,6 +101,15 @@ dependencies {
implementation (libs.androidx.datastore.preferences)
implementation (libs.coil.compose)

// Testing libraries
testImplementation(libs.junit.jupiter) // JUnit Jupiter for unit testing with JUnit 5.
testRuntimeOnly(libs.junit.jupiter.engine) // JUnit Jupiter Engine for running JUnit 5 tests.
testImplementation(libs.junit.jupiter.api) // JUnit Jupiter API for writing tests and extensions in JUnit 5.
testImplementation(libs.mockito.core) // Mockito for mocking objects in tests.
testImplementation(libs.mockito.kotlin) // Kotlin extension for Mockito to better support Kotlin features.
testImplementation(libs.kotlin.coroutines.test) // Coroutines Test library for testing Kotlin coroutines.
testImplementation(libs.kotlin.test.junit5) // Kotlin Test library for JUnit 5 support.

}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package com.desarrollodroide.pagekeeper.extensions
*
* @return True if the string contains more than half Arabic characters, false otherwise.
*/
fun String.isArabicText(): Boolean {
fun String.isRTLText(): Boolean {
// Take the first 20 characters of the string
val textSample = this.take(20)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ fun FeedScreen(
content = bookmarksUiState.error,
openDialog = remember { mutableStateOf(true) },
onConfirm = {
actions.onClearError()
actions.goToLogin.invoke()
if (bookmarksUiState.error == SESSION_HAS_BEEN_EXPIRED){
actions.onClearError()
actions.goToLogin.invoke()
}
},
properties = DialogProperties(
dismissOnClickOutside = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,10 @@ class FeedViewModel(
when (result) {
is Result.Error -> {
Log.v("FeedViewModel", "Error getting tags: ${result.error?.message}")
_tagsState.error(
errorMessage = result.error?.message ?: ""
)
}

is Result.Loading -> {
Log.v("FeedViewModel", "updating tags...")
Log.v("FeedViewModel", "Loading, updating tags from cache...")
_tagsState.success(result.data)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import com.desarrollodroide.data.extensions.removeTrailingSlash
import com.desarrollodroide.model.Bookmark
import com.desarrollodroide.pagekeeper.extensions.isArabicText
import com.desarrollodroide.pagekeeper.extensions.isRTLText

@Composable
fun FullBookmarkView(
Expand All @@ -32,7 +32,7 @@ fun FullBookmarkView(
token: String,
actions: BookmarkActions
) {
val isArabic = bookmark.title.isArabicText() || bookmark.excerpt.isArabicText()
val isArabic = bookmark.title.isRTLText() || bookmark.excerpt.isRTLText()
val imageUrl =
"${serverURL.removeTrailingSlash()}${bookmark.imageURL}?lastUpdated=${bookmark.modified}"
Column {
Expand All @@ -57,13 +57,16 @@ fun FullBookmarkView(
) {
CompositionLocalProvider(LocalLayoutDirection provides if (isArabic) LayoutDirection.Rtl else LayoutDirection.Ltr) {
Text(
modifier = Modifier.fillMaxWidth(),
text = bookmark.title,
style = MaterialTheme.typography.titleLarge,
overflow = TextOverflow.Ellipsis,
maxLines = 2
)
Text(
modifier = Modifier.padding(top = 5.dp),
modifier = Modifier
.fillMaxWidth()
.padding(top = 5.dp),
text = bookmark.excerpt,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.secondary,
Expand Down
Loading

0 comments on commit c98f5f7

Please sign in to comment.