-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get empty accounts state working again
- Ensure that the user is redirected to the Accounts Index when there are no accounts - Adds a landing page for feeds
- Loading branch information
Showing
15 changed files
with
129 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.jocmp.basilreader | ||
|
||
sealed class Async<out T>(private val value: T?) { | ||
open operator fun invoke(): T? = value | ||
|
||
data object Uninitialized : Async<Nothing>(value = null) | ||
|
||
data object Loading : Async<Nothing>(value = null) | ||
|
||
data class Success<out T>(private val value: T) : Async<T>(value = value) { | ||
override operator fun invoke(): T = value | ||
} | ||
|
||
data class Failure<out T>(val error: Throwable, private val value: T? = null) : Async<T>(value = value) | ||
} |
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
10 changes: 7 additions & 3 deletions
10
app/src/main/java/com/jocmp/basilreader/ui/accounts/AccountNavigation.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,13 +1,17 @@ | ||
package com.jocmp.basilreader.ui.accounts | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import com.jocmp.basil.Account | ||
|
||
fun NavGraphBuilder.accountIndex( | ||
onNavigate: (accountID: String) -> Unit | ||
onSelect: () -> Unit | ||
) { | ||
composable("accounts") { | ||
AccountIndexView(onNavigate = onNavigate) | ||
AccountIndexView(onSelect = onSelect) | ||
} | ||
} | ||
|
||
fun NavController.navigateToAddAccount() { | ||
navigate("accounts") | ||
} |
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
19 changes: 18 additions & 1 deletion
19
app/src/main/java/com/jocmp/basilreader/ui/articles/FeedRow.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,13 +1,30 @@ | ||
package com.jocmp.basilreader.ui.articles | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.jocmp.basil.Feed | ||
|
||
@Composable | ||
fun FeedRow( | ||
feed: Feed, | ||
onSelect: (id: String) -> Unit | ||
) { | ||
Text("${feed.name} (${feed.feedURL})") | ||
Box( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.clickable { | ||
onSelect(feed.id) | ||
} | ||
) { | ||
Text( | ||
"${feed.name} (${feed.feedURL})", | ||
modifier = Modifier.padding(8.dp) | ||
) | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
app/src/main/java/com/jocmp/basilreader/ui/articles/FolderRow.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
package com.jocmp.basil | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AccountPreferences( | ||
val displayName: String | ||
) |
Oops, something went wrong.