Skip to content
Snippets Groups Projects
Verified Commit b13f8ac7 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Cleanup code

parent a26104e1
No related branches found
No related tags found
1 merge request!2Draft: Jetpack compose rewrite
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("de.kuschku.justcode")
}
android {
defaultConfig {
setMinSdkVersion(21)
setTargetSdkVersion(30)
applicationId = "com.iskrembilen.quasseldroid"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
setMinSdkVersion(21)
setTargetSdkVersion(30)
}
buildTypes {
release {
setMinifyEnabled(false)
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
buildFeatures {
compose = true
}
composeOptions {
val androidxComposeVersion: String by project.extra
kotlinCompilerExtensionVersion = androidxComposeVersion
}
}
kapt {
correctErrorTypes = true
}
dependencies {
val androidxCoreVersion: String by project.extra
implementation("androidx.core", "core-ktx", androidxCoreVersion)
......@@ -60,6 +47,17 @@ dependencies {
val androidxLifecycleVersion: String by project.extra
implementation("androidx.lifecycle", "lifecycle-runtime-ktx", androidxLifecycleVersion)
val androidxMultidexVersion: String by project.extra
implementation("androidx.multidex", "multidex", androidxMultidexVersion)
val daggerHiltVersion: String by project.extra
implementation("com.google.dagger", "hilt-android", daggerHiltVersion)
annotationProcessor("com.google.dagger", "hilt-android-compiler", daggerHiltVersion)
testImplementation("com.google.dagger", "hilt-android-testing", daggerHiltVersion)
testAnnotationProcessor("com.google.dagger", "hilt-android-compiler", daggerHiltVersion)
androidTestImplementation("com.google.dagger", "hilt-android-testing", daggerHiltVersion)
androidTestAnnotationProcessor("com.google.dagger", "hilt-android-compiler", daggerHiltVersion)
implementation("org.threeten", "threetenbp", "1.4.0")
implementation("io.coil-kt", "coil", "1.1.1")
......
......@@ -13,6 +13,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="de.kuschku.quasseldroid.QuasseldroidApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
......
......@@ -19,26 +19,34 @@ import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
import de.kuschku.quasseldroid.ui.theme.QuasseldroidTheme
import de.kuschku.quasseldroid.ui.theme.shapes
import de.kuschku.quasseldroid.ui.theme.typography
import dev.chrisbanes.accompanist.coil.CoilImage
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flow
import org.threeten.bp.ZonedDateTime
import org.threeten.bp.format.DateTimeFormatter
import kotlin.random.Random
val time = flow<ZonedDateTime> {
emit(ZonedDateTime.now())
delay(1000)
}
val time = MutableStateFlow(ZonedDateTime.now())
inline class Password1(private val s: String)
class MainActivity : AppCompatActivity() {
var timer: Job? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
lifecycleScope.launchWhenResumed {
while (true) {
time.value = ZonedDateTime.now()
delay(1000)
}
}
setContent {
JetChat()
}
......@@ -79,7 +87,7 @@ fun parseString(text: String): AnnotatedString {
if (monospace) builder.addStyle(
SpanStyle(
fontFamily = FontFamily.Monospace,
background = Color.Gray,
background = Color(0xFFDEDEDE),
),
before,
after
......@@ -114,7 +122,7 @@ fun ChatBubble(
content: @Composable () -> Unit
) {
Surface(
color = Color.LightGray,
color = Color(0xFFF5F5F5),
shape = shapes.medium,
modifier = Modifier
.padding(2.dp)
......
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2021 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid
import androidx.multidex.MultiDexApplication
import dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp
class QuasseldroidApplication : MultiDexApplication() {
}
......@@ -17,6 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
google()
......@@ -24,8 +26,9 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.0-alpha05")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21-2")
classpath("com.android.tools.build", "gradle", "7.0.0-alpha05")
classpath("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.4.21-2")
classpath("com.google.dagger", "hilt-android-gradle-plugin", "2.31.2-alpha")
}
}
......@@ -34,6 +37,8 @@ allprojects {
extra["androidxCoreVersion"] = "1.2.0"
extra["androidxComposeVersion"] = "1.0.0-alpha11"
extra["androidxLifecycleVersion"] = "2.3.0-rc01"
extra["androidxMultidexVersion"] = "2.0.1"
extra["daggerHiltVersion"] = "2.31.2-alpha"
extra["mdcVersion"] = "1.2.1"
repositories {
......@@ -41,4 +46,15 @@ allprojects {
mavenCentral()
jcenter()
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs = listOf(
"-Xinline-classes",
"-Xuse-experimental=kotlin.ExperimentalUnsignedTypes"
)
jvmTarget = "1.8"
useIR = true
}
}
}
......@@ -44,7 +44,38 @@ class JustCodePlugin : Plugin<Project> {
gitCommitDate()
)
setProperty("archivesBaseName", "${rootProject.name}-$versionName")
signingConfig = signingConfigs.findByName("default")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Disable test runner analytics
testInstrumentationRunnerArguments(mapOf(
"disableAnalytics" to "true"
))
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
multiDexEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
getByName("debug") {
applicationIdSuffix = ".debug"
multiDexEnabled = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}
......
......@@ -17,16 +17,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
rootProject.name = "Quasseldroid"
rootProject.buildFileName = "build.gradle.kts"
include(
":app"//,
//":invokerannotations",
//":invokergenerator",
//":lib",
//":lifecycle-ktx",
//":malheur",
//":persistence",
//":viewmodel",
//":ui_spinner"
":app"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment