├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── colors.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── xml
│ │ │ │ ├── backup_rules.xml
│ │ │ │ └── data_extraction_rules.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── zekierciyas
│ │ │ └── jitpack_template
│ │ │ └── MainActivity.kt
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── zekierciyas
│ │ │ └── jitpack_template
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── zekierciyas
│ │ └── jitpack_template
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle.kts
├── library
├── .gitignore
├── consumer-rules.pro
├── src
│ ├── .DS_Store
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── zekierciyas
│ │ │ │ ├── .DS_Store
│ │ │ │ └── library
│ │ │ │ ├── model
│ │ │ │ ├── QuestionType.kt
│ │ │ │ ├── SurveyModel.kt
│ │ │ │ ├── SingleOptionUI.kt
│ │ │ │ ├── MultipleOptionUI.kt
│ │ │ │ ├── TextOptionUI.kt
│ │ │ │ ├── SurveyOutlinedText.kt
│ │ │ │ └── SurveyText.kt
│ │ │ │ └── view
│ │ │ │ ├── SurveyScreen.kt
│ │ │ │ ├── TextQuestion.kt
│ │ │ │ ├── SingleChoiceQuestion.kt
│ │ │ │ └── MultipleChoiceQuestion.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── zekierciyas
│ │ │ └── library
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── zekierciyas
│ │ └── library
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle.kts
├── previews
├── preview_image.jpg
└── preview_video.gif
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── settings.gradle.kts
├── .gitignore
├── gradle.properties
├── gradlew.bat
├── README.md
├── gradlew
└── LICENSE
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/library/consumer-rules.pro:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/library/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/library/src/.DS_Store
--------------------------------------------------------------------------------
/previews/preview_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/previews/preview_image.jpg
--------------------------------------------------------------------------------
/previews/preview_video.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/previews/preview_video.gif
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | jitpack-template
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/library/src/main/java/com/zekierciyas/.DS_Store
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zekierciyas/survey-compose/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/QuestionType.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | enum class QuestionType {
4 | MULTIPLE_CHOICE,
5 | SINGLE_CHOICE,
6 | TEXT
7 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Feb 09 21:58:52 TRT 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/SurveyModel.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | data class SurveyModel(
4 | val questionType: QuestionType,
5 | val questionId: String,
6 | val questionTitle: String,
7 | val questionDescription: String,
8 | val answers: List = listOf()
9 | )
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/library/src/test/java/com/zekierciyas/library/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/test/java/com/zekierciyas/jitpack_template/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.jitpack_template
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/SingleOptionUI.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 | data class SingleOptionUI (
5 | val questionTitle: SurveyText = SurveyText(),
6 | val questionDescription: SurveyText = SurveyText(),
7 | val answer: SurveyText = SurveyText(),
8 | val selectedColor: Color = Color.White,
9 | val unSelectedColor: Color = Color.Gray,
10 | val borderColor: Color = Color.Gray,
11 | val backgroundColor: Color = Color.Gray
12 | )
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/MultipleOptionUI.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 | data class MultipleOptionUI (
5 | val questionTitle: SurveyText = SurveyText(),
6 | val questionDescription: SurveyText = SurveyText(),
7 | val answer: SurveyText = SurveyText(),
8 | val checkedColor: Color = Color.Gray,
9 | val uncheckedColor: Color = Color.White,
10 | val borderColor: Color = Color.Gray,
11 | val backgroundColor: Color = Color.Gray
12 | )
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 |
2 | pluginManagement {
3 | repositories {
4 | google()
5 | mavenCentral()
6 | gradlePluginPortal()
7 | maven("https://www.jitpack.io")
8 | }
9 | }
10 | dependencyResolutionManagement {
11 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
12 | repositories {
13 | google()
14 | mavenCentral()
15 | maven("https://www.jitpack.io")
16 | }
17 | }
18 |
19 | rootProject.name = "jitpack-template"
20 | include(":app")
21 | include(":library")
22 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/TextOptionUI.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 | data class TextOptionUI (
5 | val questionTitle: SurveyText = SurveyText(),
6 | val questionDescription: SurveyText = SurveyText(),
7 | val answer: SurveyText = SurveyText(),
8 | val borderColor: Color = Color.Gray,
9 | val backgroundColor: Color = Color.White,
10 | val hintText: SurveyText = SurveyText(),
11 | val surveyOutlinedText: SurveyOutlinedText = SurveyOutlinedText()
12 | )
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/SurveyOutlinedText.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | data class SurveyOutlinedText(
6 | val focusedTextColor: Color = Color.Gray,
7 | val unfocusedTextColor: Color = Color.Gray,
8 | val disabledTextColor: Color = Color.Gray,
9 | val focusedContainerColor: Color = Color.White,
10 | val unfocusedContainerColor: Color = Color.White,
11 | val focusedBorderColor: Color = Color.Gray,
12 | val focuedLabelColor: Color = Color.Gray
13 | )
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Gradle files
2 | .gradle/
3 | build/
4 |
5 | # Local configuration file (sdk path, etc)
6 | local.properties
7 |
8 | # Log/OS Files
9 | *.log
10 |
11 | # Android Studio generated files and folders
12 | captures/
13 | .externalNativeBuild/
14 | .cxx/
15 | *.apk
16 | output.json
17 |
18 | # IntelliJ
19 | *.iml
20 | .idea/
21 | misc.xml
22 | deploymentTargetDropDown.xml
23 | render.experimental.xml
24 |
25 | # Keystore files
26 | *.jks
27 | *.keystore
28 |
29 | # Google Services (e.g. APIs or Firebase)
30 | google-services.json
31 |
32 | # Android Profiling
33 | *.hprof
34 | app/.DS_Store
35 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/library/src/androidTest/java/com/zekierciyas/library/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.zekierciyas.library.test", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/zekierciyas/jitpack_template/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.jitpack_template
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.zekierciyas.jitpack_template", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/model/SurveyText.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import androidx.compose.ui.text.font.FontFamily
5 | import androidx.compose.ui.text.font.FontStyle
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.text.style.TextAlign
8 | import androidx.compose.ui.text.style.TextDecoration
9 | import androidx.compose.ui.text.style.TextOverflow
10 | import androidx.compose.ui.unit.TextUnit
11 |
12 | data class SurveyText(
13 | val color: Color = Color.Unspecified,
14 | val fontSize: TextUnit = TextUnit.Unspecified,
15 | val fontStyle: FontStyle? = null,
16 | val fontWeight: FontWeight? = null,
17 | val fontFamily: FontFamily? = null,
18 | val letterSpacing: TextUnit = TextUnit.Unspecified,
19 | val textDecoration: TextDecoration? = null,
20 | val textAlign: TextAlign? = null,
21 | val lineHeight: TextUnit = TextUnit.Unspecified,
22 | val overflow: TextOverflow = TextOverflow.Clip,
23 | val softWrap: Boolean = true,
24 | val maxLines: Int = Int.MAX_VALUE,
25 | val minLines: Int = 1,
26 | val text: String = "Enter your answer here"
27 | )
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | id("org.jetbrains.kotlin.android")
4 | }
5 |
6 | android {
7 | namespace = "com.zekierciyas.jitpack_template"
8 | compileSdk = 34
9 |
10 | defaultConfig {
11 | applicationId = "com.zekierciyas.jitpack_template"
12 | minSdk = 21
13 | targetSdk = 34
14 | versionCode = 1
15 | versionName = "1.0"
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | vectorDrawables {
19 | useSupportLibrary = true
20 | }
21 | }
22 |
23 | buildTypes {
24 | release {
25 | isMinifyEnabled = false
26 | proguardFiles(
27 | getDefaultProguardFile("proguard-android-optimize.txt"),
28 | "proguard-rules.pro"
29 | )
30 | }
31 | }
32 | compileOptions {
33 | sourceCompatibility = JavaVersion.VERSION_17
34 | targetCompatibility = JavaVersion.VERSION_17
35 | }
36 | kotlinOptions {
37 | jvmTarget = "17"
38 | }
39 | buildFeatures {
40 | compose = true
41 | }
42 | composeOptions {
43 | kotlinCompilerExtensionVersion = "1.5.1"
44 | }
45 | packaging {
46 | resources {
47 | excludes += "/META-INF/{AL2.0,LGPL2.1}"
48 | }
49 | }
50 | }
51 |
52 | dependencies {
53 |
54 | implementation("androidx.core:core-ktx:1.12.0")
55 | implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
56 | implementation("androidx.activity:activity-compose:1.8.2")
57 | implementation(platform("androidx.compose:compose-bom:2023.08.00"))
58 | implementation("androidx.compose.ui:ui")
59 | implementation("androidx.compose.ui:ui-graphics")
60 | implementation("androidx.compose.ui:ui-tooling-preview")
61 | implementation("androidx.compose.material3:material3")
62 | implementation(project(":library"))
63 | testImplementation("junit:junit:4.13.2")
64 | androidTestImplementation("androidx.test.ext:junit:1.1.5")
65 | androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
66 | androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
67 | androidTestImplementation("androidx.compose.ui:ui-test-junit4")
68 | debugImplementation("androidx.compose.ui:ui-tooling")
69 | debugImplementation("androidx.compose.ui:ui-test-manifest")
70 | }
--------------------------------------------------------------------------------
/library/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | id("org.jetbrains.kotlin.android")
4 | id("maven-publish")
5 | }
6 |
7 | android {
8 | namespace = "com.zekierciyas.library"
9 | compileSdk = 34
10 |
11 | defaultConfig {
12 | minSdk = 21
13 |
14 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
15 | consumerProguardFiles("consumer-rules.pro")
16 | }
17 |
18 | buildTypes {
19 | release {
20 | isMinifyEnabled = false
21 | proguardFiles(
22 | getDefaultProguardFile("proguard-android-optimize.txt"),
23 | "proguard-rules.pro"
24 | )
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility = JavaVersion.VERSION_17
29 | targetCompatibility = JavaVersion.VERSION_17
30 | }
31 | kotlinOptions {
32 | jvmTarget = "17"
33 | }
34 |
35 | buildFeatures {
36 | compose = true
37 | }
38 | composeOptions {
39 | kotlinCompilerExtensionVersion = "1.5.1"
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation("androidx.core:core-ktx:1.12.0")
45 | implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
46 | implementation("androidx.activity:activity-compose:1.8.2")
47 | implementation(platform("androidx.compose:compose-bom:2023.08.00"))
48 | implementation("androidx.compose.ui:ui")
49 | implementation("androidx.compose.ui:ui-graphics")
50 | implementation("androidx.compose.ui:ui-tooling-preview")
51 | implementation("androidx.compose.material3:material3")
52 | testImplementation("junit:junit:4.13.2")
53 | androidTestImplementation("androidx.test.ext:junit:1.1.5")
54 | androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
55 | androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
56 | androidTestImplementation("androidx.compose.ui:ui-test-junit4")
57 | debugImplementation("androidx.compose.ui:ui-tooling")
58 | debugImplementation("androidx.compose.ui:ui-test-manifest")
59 | }
60 |
61 | afterEvaluate {
62 | publishing {
63 | publications {
64 | create("release") {
65 | from(components["release"])
66 | groupId = "com.github.zekierciyas"
67 | artifactId = "android-library-template"
68 | version = "1.0.2"
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/library/src/main/java/com/zekierciyas/library/view/SurveyScreen.kt:
--------------------------------------------------------------------------------
1 | package com.zekierciyas.library.view
2 |
3 | import androidx.compose.foundation.background
4 | import androidx.compose.foundation.layout.Spacer
5 | import androidx.compose.foundation.layout.fillMaxSize
6 | import androidx.compose.foundation.layout.padding
7 | import androidx.compose.foundation.lazy.LazyColumn
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.runtime.getValue
10 | import androidx.compose.runtime.mutableStateOf
11 | import androidx.compose.runtime.remember
12 | import androidx.compose.runtime.setValue
13 | import androidx.compose.ui.Modifier
14 | import androidx.compose.ui.graphics.Color
15 | import androidx.compose.ui.unit.dp
16 | import com.zekierciyas.library.model.MultipleOptionUI
17 | import com.zekierciyas.library.model.QuestionType
18 | import com.zekierciyas.library.model.SingleOptionUI
19 | import com.zekierciyas.library.model.SurveyModel
20 | import com.zekierciyas.library.model.TextOptionUI
21 |
22 | @Composable
23 | fun SurveyScreen(
24 | survey: List,
25 | backgroundColor: Color = Color.White,
26 | singleOptionUI: SingleOptionUI = SingleOptionUI(),
27 | multipleOptionUI: MultipleOptionUI = MultipleOptionUI(),
28 | textOptionUI: TextOptionUI = TextOptionUI(),
29 | callbackAnswers: (Map>) -> Unit = {},
30 | callbackAllAnswered: (Map>) -> Unit = {}
31 | ) {
32 | var answers by remember { mutableStateOf