Merge pull request #40 from msfjarvis/more-ui-tweaks

Multiple improvements across the board
This commit is contained in:
probot-auto-merge[bot] 2020-10-07 20:10:42 +00:00 committed by GitHub
commit 3c21002d32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 21 deletions

View file

@ -1,3 +0,0 @@
requiredLabels:
- automerge
deleteBranchAfterMerge: true

View file

@ -25,3 +25,5 @@ jobs:
uses: "pascalgn/automerge-action@v0.11.0"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
UPDATE_RETRIES: 10
UPDATE_RETRY_SLEEP: 60000

View file

@ -17,9 +17,9 @@ jobs:
pull_number: context.payload.number,
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
console.log(serviceChanged)
return serviceChanged
const shouldRun = result.data.filter(f => !f.filename.endsWith(".md") || !f.filename.endsWith(".yml")).length > 0
console.log(shouldRun)
return shouldRun
- name: Checkout repository
if: ${{ steps.service-changed.outputs.result == 'true' }}

View file

@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import java.net.SocketTimeoutException
import java.net.UnknownHostException
class LobstersViewModel @ViewModelInject constructor(
@ -22,8 +23,8 @@ class LobstersViewModel @ViewModelInject constructor(
private val dao = database.postsDao()
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable ->
when (throwable) {
// Swallow UHE since that happens when there is no internet and we'll just rely on our cache
is UnknownHostException -> {}
// Swallow known network errors that can be recovered from.
is UnknownHostException, is SocketTimeoutException -> {}
else -> throw throwable
}
}

View file

@ -1,9 +1,7 @@
package dev.msfjarvis.lobsters.ui
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
@ -56,9 +54,8 @@ fun LazyItemScope.LobstersItem(
Text(
text = tag,
modifier = Modifier
.border(BorderStroke(1.dp, Color.Gray))
.background(Color(0xFFFFFCD7), RoundedCornerShape(4.dp))
.padding(vertical = 2.dp, horizontal = 4.dp),
.background(Color(0xFFFFFCD7), RoundedCornerShape(8.dp))
.padding(vertical = 2.dp, horizontal = 6.dp),
color = Color.DarkGray,
)
}

View file

@ -1,25 +1,25 @@
package dev.msfjarvis.lobsters.ui
import androidx.compose.material.MaterialTheme
import androidx.compose.material.lightColors
import androidx.compose.material.darkColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
val lightColors = lightColors(
val darkColors = darkColors(
primary = Color.White,
secondary = Color(0xFF6C0000),
background = Color.White,
surface = Color.White,
onPrimary = Color.DarkGray,
background = Color.Black,
surface = Color.Black,
onPrimary = Color.Black,
onSecondary = Color.White,
onBackground = Color.Black,
onSurface = Color.Black,
onBackground = Color.White,
onSurface = Color.White,
)
@Composable
fun LobstersTheme(children: @Composable () -> Unit) {
MaterialTheme(
colors = lightColors,
colors = darkColors,
content = children,
)
}

View file

@ -9,6 +9,7 @@ class UrlLauncherImpl(private val context: Context) : UrlLauncher {
val customTabsIntent = CustomTabsIntent.Builder()
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
.setShowTitle(true)
.setColorScheme(CustomTabsIntent.COLOR_SCHEME_DARK)
.build()
customTabsIntent.launchUrl(context, Uri.parse(url))
}