Compare commits
5 commits
d4cc355cc6
...
1ae6f25a45
Author | SHA1 | Date | |
---|---|---|---|
1ae6f25a45 | |||
64ab2bf345 | |||
2f5a58c101 | |||
50c181004f | |||
e7f0603446 |
8 changed files with 17 additions and 15 deletions
|
@ -37,11 +37,11 @@ android {
|
||||||
}
|
}
|
||||||
compileSdk = libs.versions.maxSdk.get().toInt()
|
compileSdk = libs.versions.maxSdk.get().toInt()
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.wbrawner.simplemarkdown"
|
applicationId = "com.wbrawner.simplemarkdown"
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -327,7 +326,7 @@ private fun MainScreen(
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@OptIn(ExperimentalFoundationApi::class, ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
private fun TabbedMarkdownEditor(
|
private fun TabbedMarkdownEditor(
|
||||||
initialMarkdown: String,
|
initialMarkdown: String,
|
||||||
markdown: String,
|
markdown: String,
|
||||||
|
@ -349,7 +348,7 @@ private fun TabbedMarkdownEditor(
|
||||||
}
|
}
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
modifier = Modifier.fillMaxSize(1f), state = pagerState,
|
modifier = Modifier.fillMaxSize(1f), state = pagerState,
|
||||||
beyondBoundsPageCount = 1,
|
beyondViewportPageCount = 1,
|
||||||
userScrollEnabled = !lockSwiping
|
userScrollEnabled = !lockSwiping
|
||||||
) { page ->
|
) { page ->
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
|
|
|
@ -47,6 +47,7 @@ class AndroidPreferenceHelper(context: Context, private val coroutineScope: Coro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
override fun <T> observe(preference: Preference): StateFlow<T> = states[preference]!!.asStateFlow() as StateFlow<T>
|
override fun <T> observe(preference: Preference): StateFlow<T> = states[preference]!!.asStateFlow() as StateFlow<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ class FakePreferenceHelper: PreferenceHelper {
|
||||||
preferences[preference] = value
|
preferences[preference] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
override fun <T> observe(preference: Preference): StateFlow<T> =
|
override fun <T> observe(preference: Preference): StateFlow<T> =
|
||||||
preferenceFlow(preference) as StateFlow<T>
|
preferenceFlow(preference) as StateFlow<T>
|
||||||
}
|
}
|
|
@ -23,6 +23,7 @@ import timber.log.Timber
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
|
||||||
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class MarkdownViewModelTest {
|
class MarkdownViewModelTest {
|
||||||
private lateinit var fileHelper: FakeFileHelper
|
private lateinit var fileHelper: FakeFileHelper
|
||||||
private lateinit var preferenceHelper: FakePreferenceHelper
|
private lateinit var preferenceHelper: FakePreferenceHelper
|
||||||
|
|
|
@ -41,11 +41,11 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
||||||
|
|
|
@ -27,11 +27,11 @@ android {
|
||||||
compose = true
|
compose = true
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
||||||
|
|
|
@ -24,14 +24,14 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose = true
|
compose = true
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
disable += listOf("AndroidGradlePluginVersion", "GradleDependency")
|
||||||
|
|
Loading…
Reference in a new issue