tangled
alpha
login
or
join now
geesawra.industries
/
jerry-no
8
fork
atom
A cheap attempt at a native Bluesky client for Android
8
fork
atom
overview
issues
pulls
pipelines
*: rename a bunch of things to make more sense
geesawra.industries
5 months ago
99df3243
0ccf47a3
+12
-12
2 changed files
expand all
collapse all
unified
split
app
src
main
java
industries
geesawra
monarch
MainActivity.kt
MainView.kt
+8
-8
app/src/main/java/industries/geesawra/monarch/MainActivity.kt
···
40
40
@HiltAndroidApp
41
41
class Application : Application()
42
42
43
43
-
enum class TimelineScreen() {
43
43
+
enum class ViewList() {
44
44
Login,
45
45
-
Timeline,
45
45
+
Main,
46
46
}
47
47
48
48
@AndroidEntryPoint
···
98
98
}
99
99
100
100
val initialRoute =
101
101
-
if (timelineViewModel.uiState.authenticated) TimelineScreen.Timeline.name else TimelineScreen.Login.name
101
101
+
if (timelineViewModel.uiState.authenticated) ViewList.Main.name else ViewList.Login.name
102
102
103
103
NavHost(
104
104
navController = navController,
···
114
114
EnterTransition.None
115
115
},
116
116
) {
117
117
-
composable(route = TimelineScreen.Timeline.name) {
118
118
-
TimelineView(
117
117
+
composable(route = ViewList.Main.name) {
118
118
+
MainView(
119
119
timelineViewModel = timelineViewModel,
120
120
coroutineScope = rememberCoroutineScope(),
121
121
onLoginError = {
122
122
-
navController.navigate(TimelineScreen.Login.name)
122
122
+
navController.navigate(ViewList.Login.name)
123
123
}
124
124
)
125
125
}
126
126
-
composable(route = TimelineScreen.Login.name) {
126
126
+
composable(route = ViewList.Login.name) {
127
127
Surface(
128
128
modifier = Modifier.fillMaxSize(),
129
129
color = MaterialTheme.colorScheme.background // Set login screen background
···
135
135
contentAlignment = Alignment.Center
136
136
) {
137
137
LoginView {
138
138
-
navController.navigate(TimelineScreen.Timeline.name)
138
138
+
navController.navigate(ViewList.Main.name)
139
139
}
140
140
}
141
141
}
+4
-4
app/src/main/java/industries/geesawra/monarch/TimelineView.kt
app/src/main/java/industries/geesawra/monarch/MainView.kt
···
72
72
val icon: ImageVector,
73
73
@param:StringRes val contentDescription: Int
74
74
) {
75
75
-
HOME(R.string.timeline, Icons.Filled.Home, R.string.timeline),
75
75
+
TIMELINE(R.string.timeline, Icons.Filled.Home, R.string.timeline),
76
76
NOTIFICATIONS(R.string.notifications, Icons.Filled.Notifications, R.string.notifications)
77
77
}
78
78
79
79
80
80
@OptIn(ExperimentalMaterial3Api::class)
81
81
@Composable
82
82
-
fun TimelineView(
82
82
+
fun MainView(
83
83
timelineViewModel: TimelineViewModel,
84
84
coroutineScope: CoroutineScope,
85
85
onLoginError: () -> Unit,
···
146
146
fobOnClick: () -> Unit,
147
147
loginError: () -> Unit,
148
148
) {
149
149
-
var currentDestination by rememberSaveable { mutableStateOf(TabBarDestinations.HOME) }
149
149
+
var currentDestination by rememberSaveable { mutableStateOf(TabBarDestinations.TIMELINE) }
150
150
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(
151
151
rememberTopAppBarState()
152
152
)
···
283
283
}
284
284
) { values ->
285
285
when (currentDestination) {
286
286
-
TabBarDestinations.HOME -> ShowSkeets(
286
286
+
TabBarDestinations.TIMELINE -> ShowSkeets(
287
287
viewModel = timelineViewModel,
288
288
state = listState,
289
289
modifier = Modifier.padding(values),