mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 07:57:03 +05:30
Merge pull request #40 from msfjarvis/more-ui-tweaks
Multiple improvements across the board
This commit is contained in:
commit
3c21002d32
7 changed files with 19 additions and 21 deletions
3
.github/auto-merge.yml
vendored
3
.github/auto-merge.yml
vendored
|
@ -1,3 +0,0 @@
|
||||||
requiredLabels:
|
|
||||||
- automerge
|
|
||||||
deleteBranchAfterMerge: true
|
|
2
.github/workflows/automerge.yml
vendored
2
.github/workflows/automerge.yml
vendored
|
@ -25,3 +25,5 @@ jobs:
|
||||||
uses: "pascalgn/automerge-action@v0.11.0"
|
uses: "pascalgn/automerge-action@v0.11.0"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
UPDATE_RETRIES: 10
|
||||||
|
UPDATE_RETRY_SLEEP: 60000
|
||||||
|
|
6
.github/workflows/pull_request.yml
vendored
6
.github/workflows/pull_request.yml
vendored
|
@ -17,9 +17,9 @@ jobs:
|
||||||
pull_number: context.payload.number,
|
pull_number: context.payload.number,
|
||||||
per_page: 100
|
per_page: 100
|
||||||
})
|
})
|
||||||
const serviceChanged = result.data.filter(f => f.filename.startsWith("app/") || f.filename.endsWith("gradle") || f.filename.startsWith(".github/workflows/pull_request.yml") || f.filename.startsWith("gradle") || f.filename.endsWith("properties")).length > 0
|
const shouldRun = result.data.filter(f => !f.filename.endsWith(".md") || !f.filename.endsWith(".yml")).length > 0
|
||||||
console.log(serviceChanged)
|
console.log(shouldRun)
|
||||||
return serviceChanged
|
return shouldRun
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
if: ${{ steps.service-changed.outputs.result == 'true' }}
|
if: ${{ steps.service-changed.outputs.result == 'true' }}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
import kotlinx.coroutines.flow.collectLatest
|
import kotlinx.coroutines.flow.collectLatest
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import java.net.SocketTimeoutException
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
|
|
||||||
class LobstersViewModel @ViewModelInject constructor(
|
class LobstersViewModel @ViewModelInject constructor(
|
||||||
|
@ -22,8 +23,8 @@ class LobstersViewModel @ViewModelInject constructor(
|
||||||
private val dao = database.postsDao()
|
private val dao = database.postsDao()
|
||||||
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable ->
|
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable ->
|
||||||
when (throwable) {
|
when (throwable) {
|
||||||
// Swallow UHE since that happens when there is no internet and we'll just rely on our cache
|
// Swallow known network errors that can be recovered from.
|
||||||
is UnknownHostException -> {}
|
is UnknownHostException, is SocketTimeoutException -> {}
|
||||||
else -> throw throwable
|
else -> throw throwable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package dev.msfjarvis.lobsters.ui
|
package dev.msfjarvis.lobsters.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
|
||||||
import androidx.compose.foundation.Text
|
import androidx.compose.foundation.Text
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -56,9 +54,8 @@ fun LazyItemScope.LobstersItem(
|
||||||
Text(
|
Text(
|
||||||
text = tag,
|
text = tag,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.border(BorderStroke(1.dp, Color.Gray))
|
.background(Color(0xFFFFFCD7), RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xFFFFFCD7), RoundedCornerShape(4.dp))
|
.padding(vertical = 2.dp, horizontal = 6.dp),
|
||||||
.padding(vertical = 2.dp, horizontal = 4.dp),
|
|
||||||
color = Color.DarkGray,
|
color = Color.DarkGray,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
package dev.msfjarvis.lobsters.ui
|
package dev.msfjarvis.lobsters.ui
|
||||||
|
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.material.lightColors
|
import androidx.compose.material.darkColors
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
val lightColors = lightColors(
|
val darkColors = darkColors(
|
||||||
primary = Color.White,
|
primary = Color.White,
|
||||||
secondary = Color(0xFF6C0000),
|
secondary = Color(0xFF6C0000),
|
||||||
background = Color.White,
|
background = Color.Black,
|
||||||
surface = Color.White,
|
surface = Color.Black,
|
||||||
onPrimary = Color.DarkGray,
|
onPrimary = Color.Black,
|
||||||
onSecondary = Color.White,
|
onSecondary = Color.White,
|
||||||
onBackground = Color.Black,
|
onBackground = Color.White,
|
||||||
onSurface = Color.Black,
|
onSurface = Color.White,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LobstersTheme(children: @Composable () -> Unit) {
|
fun LobstersTheme(children: @Composable () -> Unit) {
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colors = lightColors,
|
colors = darkColors,
|
||||||
content = children,
|
content = children,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ class UrlLauncherImpl(private val context: Context) : UrlLauncher {
|
||||||
val customTabsIntent = CustomTabsIntent.Builder()
|
val customTabsIntent = CustomTabsIntent.Builder()
|
||||||
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
||||||
.setShowTitle(true)
|
.setShowTitle(true)
|
||||||
|
.setColorScheme(CustomTabsIntent.COLOR_SCHEME_DARK)
|
||||||
.build()
|
.build()
|
||||||
customTabsIntent.launchUrl(context, Uri.parse(url))
|
customTabsIntent.launchUrl(context, Uri.parse(url))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue