Окончательная миграция на Kotlin DSL
This commit is contained in:
Generated
-3
@@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
Generated
-123
@@ -1,123 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JetCodeStyleSettings>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="localhost:58526" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-04-02T15:04:59.965857200Z" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-2
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="corretto-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
Generated
+30
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+9
-1
@@ -1,9 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
<component name="SuppressABINotification">
|
||||
<option name="modulesWithSuppressedNotConfigured">
|
||||
<set>
|
||||
<option value="MyDnevnik.app" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -65,4 +65,7 @@ dependencies {
|
||||
//test libs
|
||||
testImplementation(AppDependencies.testLibraries)
|
||||
androidTestImplementation(AppDependencies.androidTestLibraries)
|
||||
|
||||
coreLibraryDesugaring(AppDependencies.desugaringLibraries)
|
||||
debugImplementation(AppDependencies.debugLibraries)
|
||||
}
|
||||
@@ -14,8 +14,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.navigation.animation.AnimatedNavHost
|
||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
||||
import ru.megboyzz.dnevnik.screens.*
|
||||
|
||||
sealed class BaseNavRote(open val route: String)
|
||||
@@ -36,7 +34,7 @@ sealed class AppNavRoute(override val route: String): BaseNavRote(route){
|
||||
fun AppNavHost(){
|
||||
|
||||
val scaffoldState = rememberScaffoldState()
|
||||
val navController = rememberAnimatedNavController()
|
||||
val navController = rememberNavController()
|
||||
|
||||
NavHost(
|
||||
navController = navController,
|
||||
|
||||
@@ -7,14 +7,9 @@ import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.navigation.NavGraph
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import androidx.navigation.NavigatorProvider
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.createGraph
|
||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import ru.megboyzz.dnevnik.AsString
|
||||
import ru.megboyzz.dnevnik.R
|
||||
import ru.megboyzz.dnevnik.screens.*
|
||||
@@ -35,7 +30,7 @@ sealed class MarksNavRoute(override val route: String): BaseNavRote(route){
|
||||
@Composable
|
||||
fun MarksSubScreenNavHost() {
|
||||
|
||||
val navController = rememberAnimatedNavController()
|
||||
val navController = rememberNavController()
|
||||
|
||||
val list = listOf(
|
||||
SubScreenData(
|
||||
|
||||
@@ -19,7 +19,6 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
||||
import com.kizitonwose.calendar.core.daysOfWeek
|
||||
import ru.megboyzz.dnevnik.screens.SettingsScreen
|
||||
import ru.megboyzz.dnevnik.screens.ui.*
|
||||
@@ -68,7 +67,7 @@ fun text() {
|
||||
@Composable
|
||||
fun DrawerPrev() {
|
||||
val scaffoldState = rememberScaffoldState()
|
||||
val navController = rememberAnimatedNavController()
|
||||
val navController = rememberNavController()
|
||||
Box(Modifier.background(mainBlue)) {
|
||||
DrawerContent(navController = navController, scaffoldState = scaffoldState)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
plugins {
|
||||
id("com.android.application") version(Versions.gradle)
|
||||
id("org.jetbrains.kotlin.android") version(Versions.kotlin)
|
||||
id("com.android.application") version("7.2.1") apply(false)
|
||||
id("org.jetbrains.kotlin.android") version(Versions.kotlin) apply(false)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ object AppConfig {
|
||||
|
||||
const val compileSdk = 33
|
||||
const val minSdk = 21
|
||||
const val targetSdk = 32
|
||||
const val targetSdk = 33
|
||||
const val versionCode = 1
|
||||
const val versionName = "1.0.0"
|
||||
const val buildToolsVersion = "29.0.3"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
|
||||
//TODO - придумать обработчик зависмостей основанный на рефлексии
|
||||
object AppDependencies {
|
||||
//std lib
|
||||
val kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlin}"
|
||||
@@ -7,23 +8,69 @@ object AppDependencies {
|
||||
//android ui
|
||||
private val appcompat = "androidx.appcompat:appcompat:${Versions.appcompat}"
|
||||
private val coreKtx = "androidx.core:core-ktx:${Versions.coreKtx}"
|
||||
private val constraintLayout =
|
||||
"androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"
|
||||
private val lifecycleRuntimeKtx = "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
|
||||
|
||||
//compose
|
||||
private val composeConstraintLayout =
|
||||
"androidx.constraintlayout:constraintlayout-compose:1.0.1"
|
||||
private val composeUi = "androidx.compose.ui:ui:${Versions.compose}"
|
||||
private val composeMaterial = "androidx.compose.material:material:${Versions.compose}"
|
||||
private val composePreview = "androidx.compose.ui:ui-tooling-preview:${Versions.compose}"
|
||||
private val composeActivity = "androidx.activity:activity-compose:1.7.0"
|
||||
private val composeIcons = "androidx.compose.material:material-icons-extended:${Versions.compose}"
|
||||
private val composeGraphics = "androidx.compose.ui:ui-graphics:${Versions.compose}"
|
||||
|
||||
//compose-debug
|
||||
private val composeUiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
|
||||
private val composeTestManifest = "androidx.compose.ui:ui-test-manifest:${Versions.compose}"
|
||||
|
||||
//navigation
|
||||
private val composeNavigation = "androidx.navigation:navigation-compose:2.5.3"
|
||||
|
||||
//other
|
||||
private val pieChartLib = "com.github.PhilJay:MPAndroidChart:v3.1.0"
|
||||
private val retrofit = "com.squareup.retrofit2:retrofit:2.6.4"
|
||||
private val retrofitConverterGson = "com.squareup.retrofit2:converter-gson:2.3.0"
|
||||
private val accompanist = "com.google.accompanist:accompanist-swiperefresh:0.23.0"
|
||||
private val lazyHorizontalGrid = "androidx.compose.foundation:foundation:1.3.1"
|
||||
private val calendar = "com.kizitonwose.calendar:compose:2.1.1"
|
||||
private val asyncImage = "io.coil-kt:coil-compose:2.2.0"
|
||||
|
||||
//test libs
|
||||
private val junit = "junit:junit:${Versions.junit}"
|
||||
private val extJUnit = "androidx.test.ext:junit:${Versions.extJunit}"
|
||||
private val espressoCore = "androidx.test.espresso:espresso-core:${Versions.espresso}"
|
||||
|
||||
//desugaring
|
||||
private val desugarJdk = "com.android.tools:desugar_jdk_libs:${Versions.desugarJdkVersion}"
|
||||
|
||||
val appLibraries = arrayListOf<String>().apply {
|
||||
add(kotlinStdLib)
|
||||
add(coreKtx)
|
||||
add(appcompat)
|
||||
add(constraintLayout)
|
||||
|
||||
add(composeConstraintLayout)
|
||||
add(composeUi)
|
||||
add(composeMaterial)
|
||||
add(composePreview)
|
||||
add(composeActivity)
|
||||
add(composeIcons)
|
||||
add(pieChartLib)
|
||||
add(composeNavigation)
|
||||
add(retrofit)
|
||||
add(retrofitConverterGson)
|
||||
add(accompanist)
|
||||
add(lazyHorizontalGrid)
|
||||
add(asyncImage)
|
||||
add(calendar)
|
||||
}
|
||||
|
||||
val desugaringLibraries = arrayListOf<String>().apply {
|
||||
add(desugarJdk)
|
||||
}
|
||||
|
||||
val debugLibraries = arrayListOf<String>().apply {
|
||||
add(composeUiTooling)
|
||||
add(composeTestManifest)
|
||||
}
|
||||
|
||||
val androidTestLibraries = arrayListOf<String>().apply {
|
||||
|
||||
@@ -4,19 +4,21 @@
|
||||
object Versions {
|
||||
|
||||
//app level
|
||||
const val gradle = "7.2.1"
|
||||
const val kotlin = "1.8.10"
|
||||
const val gradle = "7.5"
|
||||
const val kotlin = "1.8.0"
|
||||
|
||||
//libs
|
||||
val coreKtx = "1.7.0"
|
||||
val appcompat = "1.3.0-alpha01"
|
||||
val constraintLayout = "2.0.0-beta8"
|
||||
|
||||
val compose = "1.4.4"
|
||||
val compose = "1.4.1"
|
||||
|
||||
//test
|
||||
val junit = "4.12"
|
||||
val extJunit = "1.1.1"
|
||||
val espresso = "3.2.0"
|
||||
|
||||
val desugarJdkVersion = "1.1.5"
|
||||
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 26 23:09:42 MSK 2022
|
||||
#Fri Apr 07 23:25:54 MSK 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+2
-3
@@ -7,7 +7,6 @@ pluginManagement {
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
@@ -15,5 +14,5 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "MyDnevnik"
|
||||
include(":app")
|
||||
include(":app")
|
||||
rootProject.name = "MyDnevnik"
|
||||
Reference in New Issue
Block a user