diff --git a/photo/.gitignore b/photo/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/photo/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/photo/build.gradle.kts b/photo/build.gradle.kts new file mode 100644 index 00000000..dda953e6 --- /dev/null +++ b/photo/build.gradle.kts @@ -0,0 +1,53 @@ +import com.qmuiteam.plugin.Dep + +plugins { + id("com.android.library") + kotlin("android") + `maven-publish` + id("qmui-publish") +} + +version = Dep.QMUI.photoVer + + +android { + compileSdk = Dep.compileSdk + + defaultConfig { + minSdk = Dep.minSdk + targetSdk = Dep.targetSdk + } + + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = Dep.Compose.version + } + + buildTypes { + getByName("release"){ + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion + } + kotlinOptions { + jvmTarget = Dep.kotlinJvmTarget + } +} + +dependencies { + api(Dep.AndroidX.annotation) + api(Dep.AndroidX.coreKtx) + api(Dep.AndroidX.appcompat) + api(Dep.Compose.ui) + api(Dep.Compose.animation) + api(Dep.Compose.material) + api(Dep.Compose.compiler) +} \ No newline at end of file diff --git a/photo/consumer-rules.pro b/photo/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/photo/proguard-rules.pro b/photo/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/photo/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/photo/src/androidTest/java/com/qmuiteam/ExampleInstrumentedTest.kt b/photo/src/androidTest/java/com/qmuiteam/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..d8cbc95f --- /dev/null +++ b/photo/src/androidTest/java/com/qmuiteam/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.qmuiteam + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.qmuiteam.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/photo/src/main/AndroidManifest.xml b/photo/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b1f7a564 --- /dev/null +++ b/photo/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/photo/src/main/java/com/qmuiteam/photo/activity/QMUIImageViewerActivity.kt b/photo/src/main/java/com/qmuiteam/photo/activity/QMUIImageViewerActivity.kt new file mode 100644 index 00000000..387d7419 --- /dev/null +++ b/photo/src/main/java/com/qmuiteam/photo/activity/QMUIImageViewerActivity.kt @@ -0,0 +1,12 @@ +package com.qmuiteam.photo.activity + +import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.ViewModel + +class ImageViewerViewModel: ViewModel(){ + +} + +class QMUIImageViewerActivity: AppCompatActivity() { + +} \ No newline at end of file diff --git a/photo/src/test/java/com/qmuiteam/ExampleUnitTest.kt b/photo/src/test/java/com/qmuiteam/ExampleUnitTest.kt new file mode 100644 index 00000000..f6381ea5 --- /dev/null +++ b/photo/src/test/java/com/qmuiteam/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.qmuiteam + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt b/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt index ac2ec051..d1e6a74c 100644 --- a/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt +++ b/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt @@ -17,6 +17,7 @@ object Dep { const val archVer = "2.0.1" const val typeVer = "0.0.14" const val composeVer = "0.0.1" + const val photoVer = "0.0.1" } object AndroidX { diff --git a/settings.gradle.kts b/settings.gradle.kts index 3a2a1454..84cf6463 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,6 +7,7 @@ include(":arch-compiler") include(":arch-annotation") include(":type") include(":compose") +include(":photo") includeBuild("./plugin")