diff --git a/build.gradle.kts b/build.gradle.kts index 483fc23..eb04112 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,9 +2,9 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile buildscript { repositories { - mavenCentral() - google() maven { url = uri("https://repository.quickbirdstudios.com/repository/public") } + google() + mavenCentral() } dependencies { @@ -14,8 +14,8 @@ buildscript { allprojects { repositories { - mavenCentral() google() + mavenCentral() } tasks.withType(KotlinJvmCompile::class.java).all { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 48ffffe..4ed1343 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,16 +1,14 @@ - - plugins { `kotlin-dsl` } repositories { - mavenCentral() google() + mavenCentral() } dependencies { implementation(gradleApi()) implementation(localGroovy()) - implementation("com.android.tools.build:gradle:4.0.2") + implementation("com.android.tools.build:gradle:8.0.2") } diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt index ef40bf6..1927734 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Deps.kt @@ -1,7 +1,7 @@ object Versions { - const val kotlin = "1.3.50" - const val coroutines = "1.3.0" + const val kotlin = "1.8.20" + const val coroutines = "1.7.0" const val test = "1.1.1" const val jUnit = "5.5.2" const val jUnitPlatform = "1.5.2" @@ -9,10 +9,10 @@ object Versions { const val espresso = "3.1.0" object AndroidSupport { - const val appCompat = "1.0.0" - const val constraintLayout = "1.1.3" + const val appCompat = "1.3.0" + const val constraintLayout = "2.0.4" const val annotation = "1.0.0" - const val recyclerView = "1.0.0" + const val recyclerView = "1.2.1" } object PlayServices { @@ -20,7 +20,7 @@ object Versions { } object Google { - const val material = "1.2.1" + const val material = "1.4.0" } } diff --git a/buildSrc/src/main/kotlin/Project.kt b/buildSrc/src/main/kotlin/Project.kt index 0795a99..84372e9 100644 --- a/buildSrc/src/main/kotlin/Project.kt +++ b/buildSrc/src/main/kotlin/Project.kt @@ -1,8 +1,8 @@ object Project { object Android { - const val compileSdkVersion = 28 - const val targetSdkVersion = 28 - const val minSdkVersion = 21 + const val compileSdkVersion = "android-32" + const val targetSdkVersion = "32" + const val minSdkVersion = "21" const val testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } } diff --git a/example/build.gradle.kts b/example/build.gradle.kts index 9efb6a9..5a6543f 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -3,27 +3,36 @@ import com.quickbirdstudios.surveykit.ApiKeys.yandexMapsKey plugins { id("com.android.application") + id("kotlin-parcelize") kotlin("android") - id("org.jetbrains.kotlin.android.extensions") } -androidExtensions { isExperimental = true } - android { - compileSdkVersion(Project.Android.compileSdkVersion) + compileSdkVersion = Project.Android.compileSdkVersion defaultConfig { versionName = Library.version versionCode = 1 - minSdkVersion(Project.Android.minSdkVersion) + minSdkPreview = Project.Android.minSdkVersion targetSdkVersion(Project.Android.targetSdkVersion) testInstrumentationRunner = Project.Android.testInstrumentationRunner resValue("string", "google_api_key", googleMapsKey()) resValue("string", "yandex_api_key", yandexMapsKey()) } + + buildFeatures { + viewBinding = true + } + packagingOptions { - exclude("META-INF/*kotlin*") + jniLibs { + excludes += setOf("META-INF/*kotlin*") + } + resources { + excludes += setOf("META-INF/*kotlin*") + } } + namespace = "com.quickbirdstudios.example" } dependencies { diff --git a/example/src/main/AndroidManifest.xml b/example/src/main/AndroidManifest.xml index e61a351..72f4845 100644 --- a/example/src/main/AndroidManifest.xml +++ b/example/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> @@ -27,7 +26,8 @@ android:screenOrientation="portrait" tools:ignore="LockedOrientationActivity" tools:replace="android:appComponentFactory" - tools:targetApi="p"> + tools:targetApi="p" + android:exported="true"> diff --git a/example/src/main/java/com/quickbirdstudios/example/ui/main/MainActivity.kt b/example/src/main/java/com/quickbirdstudios/example/ui/main/MainActivity.kt index 5691cb8..c983fd5 100644 --- a/example/src/main/java/com/quickbirdstudios/example/ui/main/MainActivity.kt +++ b/example/src/main/java/com/quickbirdstudios/example/ui/main/MainActivity.kt @@ -6,12 +6,12 @@ import android.os.Parcelable import android.util.Log import android.view.KeyEvent import android.view.View -import android.view.ViewGroup import android.widget.Button import android.widget.EditText import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import com.quickbirdstudios.example.R +import com.quickbirdstudios.example.databinding.MainActivityBinding import com.quickbirdstudios.surveykit.AnswerFormat import com.quickbirdstudios.surveykit.FinishReason import com.quickbirdstudios.surveykit.Identifier @@ -36,16 +36,13 @@ import kotlinx.android.parcel.Parcelize class MainActivity : AppCompatActivity() { - private lateinit var survey: SurveyView - private lateinit var container: ViewGroup + private lateinit var binding: MainActivityBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.main_activity) - - survey = findViewById(R.id.survey_view) - container = findViewById(R.id.surveyContainer) - setupSurvey(survey) + binding = MainActivityBinding.inflate(layoutInflater) + setContentView(binding.root) + setupSurvey(binding.surveyView) } private fun setupSurvey(surveyView: SurveyView) { @@ -194,7 +191,7 @@ class MainActivity : AppCompatActivity() { if (reason == FinishReason.Completed) { taskResult.results.forEach { stepResult -> Log.e("ASDF", "answer ${stepResult.results.firstOrNull()}") - container.removeAllViews() + binding.surveyContainer.removeAllViews() } } } @@ -216,7 +213,7 @@ class MainActivity : AppCompatActivity() { override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { return if (keyCode == KeyEvent.KEYCODE_BACK) { - survey.backPressed() + binding.surveyView.backPressed() true } else false } diff --git a/example/src/main/res/layout/main_activity.xml b/example/src/main/res/layout/main_activity.xml index c697978..817d6e2 100644 --- a/example/src/main/res/layout/main_activity.xml +++ b/example/src/main/res/layout/main_activity.xml @@ -1,14 +1,14 @@ + android:orientation="vertical"> + android:layout_height="match_parent"> + diff --git a/gradle.properties b/gradle.properties index d14632b..63e7203 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,7 @@ org.gradle.parallel=true android.useAndroidX=true android.enableJetifier=true repositoryName=SurveyKit -projectSummary=Create beautiful surveys on Android \ No newline at end of file +projectSummary=Create beautiful surveys on Android +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 865bf0b..89c5115 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 01 15:38:24 CEST 2019 +#Thu Jun 01 14:36:42 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/settings.gradle b/settings.gradle index bfe4a35..985ce5d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,12 +1,14 @@ buildscript { repositories { - mavenCentral() google() + mavenCentral() maven { url 'https://repository.quickbirdstudios.com/repository/public' } } dependencies { classpath("com.quickbirdstudios:gradle-publishing:0.1.0") + classpath("com.android.tools.build:gradle:8.0.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20") } } diff --git a/survey/build.gradle.kts b/survey/build.gradle.kts index 792f677..5654608 100644 --- a/survey/build.gradle.kts +++ b/survey/build.gradle.kts @@ -3,25 +3,28 @@ plugins { id("com.android.library") kotlin("android") - id("org.jetbrains.kotlin.android.extensions") id("gradle-publishing") + id("kotlin-parcelize") } -androidExtensions { isExperimental = true } - android { - compileSdkVersion(Project.Android.compileSdkVersion) + compileSdkVersion = Project.Android.compileSdkVersion defaultConfig { version = Library.version - minSdkVersion(Project.Android.minSdkVersion) - targetSdkVersion(Project.Android.targetSdkVersion) + minSdkPreview = Project.Android.minSdkVersion + targetSdkPreview = Project.Android.targetSdkVersion testInstrumentationRunner = Project.Android.testInstrumentationRunner } + buildFeatures { + viewBinding = true + } + testOptions { animationsDisabled = true } + namespace = "com.quickbirdstudios.surveykit" } dependencies { diff --git a/survey/src/main/AndroidManifest.xml b/survey/src/main/AndroidManifest.xml index 60f3d29..8072ee0 100644 --- a/survey/src/main/AndroidManifest.xml +++ b/survey/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - - + diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Context.kt b/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Context.kt deleted file mode 100644 index 4e91eb8..0000000 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Context.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.quickbirdstudios.surveykit.backend.helpers.extensions - -import android.Manifest -import android.content.Context -import android.content.pm.PackageManager -import androidx.core.app.ActivityCompat - -fun Context.isLocationPermissionGranted(): Boolean { - return ( - ActivityCompat.checkSelfPermission( - this, - Manifest.permission.ACCESS_FINE_LOCATION - ) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission( - this, - Manifest.permission.ACCESS_COARSE_LOCATION - ) == PackageManager.PERMISSION_GRANTED - ) -} diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/AnswerFormat.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/AnswerFormat.kt similarity index 89% rename from survey/src/main/java/com.quickbirdstudios.surveykit/AnswerFormat.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/AnswerFormat.kt index b3d3a53..e19524e 100644 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/AnswerFormat.kt +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/AnswerFormat.kt @@ -78,8 +78,8 @@ sealed class AnswerFormat { check(defaultValue == null || choices.contains(defaultValue)) { throw IllegalStateException( "${ValuePickerAnswerFormat::class.simpleName}:" + - "${ValuePickerAnswerFormat::defaultValue.name}($defaultValue) " + - "has to be part of " + ValuePickerAnswerFormat::choices.name + "($choices)" + "${ValuePickerAnswerFormat::defaultValue.name}($defaultValue) " + + "has to be part of " + ValuePickerAnswerFormat::choices.name + "($choices)" ) } } @@ -151,15 +151,17 @@ sealed class AnswerFormat { } companion object { - operator fun invoke(): DateTimeAnswerFormat = DateTimeAnswerFormat( - defaultValue = DateTime( - day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH), - month = Calendar.getInstance().get(Calendar.MONTH), - year = Calendar.getInstance().get(Calendar.YEAR), - hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY), - minute = Calendar.getInstance().get(Calendar.MINUTE) + operator fun invoke(): DateTimeAnswerFormat = with(Calendar.getInstance()) { + DateTimeAnswerFormat( + defaultValue = DateTime( + day = get(Calendar.DAY_OF_MONTH), + month = get(Calendar.MONTH), + year = get(Calendar.YEAR), + hour = get(Calendar.HOUR_OF_DAY), + minute = get(Calendar.MINUTE) + ) ) - ) + } } } diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/FinishReason.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/FinishReason.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/FinishReason.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/FinishReason.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/Identifier.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/Identifier.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/Identifier.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/Identifier.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/NavigationRule.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/NavigationRule.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/NavigationRule.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/NavigationRule.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/SurveyTheme.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/SurveyTheme.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/SurveyTheme.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/SurveyTheme.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/Task.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/Task.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/Task.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/Task.kt diff --git a/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Context.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Context.kt new file mode 100644 index 0000000..2c147d4 --- /dev/null +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Context.kt @@ -0,0 +1,11 @@ +package com.quickbirdstudios.surveykit.backend.helpers.extensions + +import android.Manifest.permission.ACCESS_COARSE_LOCATION +import android.Manifest.permission.ACCESS_FINE_LOCATION +import android.content.Context +import android.content.pm.PackageManager.PERMISSION_GRANTED +import androidx.core.app.ActivityCompat.checkSelfPermission + +fun Context.isLocationPermissionGranted(): Boolean = + checkSelfPermission(this, ACCESS_FINE_LOCATION) == PERMISSION_GRANTED && + checkSelfPermission(this, ACCESS_COARSE_LOCATION) == PERMISSION_GRANTED diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Dimensions.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Dimensions.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Dimensions.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Dimensions.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Drawable.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Drawable.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/Drawable.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/Drawable.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/EditText+afterTextChanged.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/EditText+afterTextChanged.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/EditText+afterTextChanged.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/EditText+afterTextChanged.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/View.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/View.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/extensions/View.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/extensions/View.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/logTag.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/logTag.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/helpers/logTag.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/helpers/logTag.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/NavigableOrderedTaskNavigator.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/NavigableOrderedTaskNavigator.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/NavigableOrderedTaskNavigator.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/NavigableOrderedTaskNavigator.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/OrderedTaskNavigator.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/OrderedTaskNavigator.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/OrderedTaskNavigator.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/OrderedTaskNavigator.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/TaskNavigator.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/TaskNavigator.kt similarity index 88% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/TaskNavigator.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/TaskNavigator.kt index c9ae681..c116b4d 100644 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/navigator/TaskNavigator.kt +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/navigator/TaskNavigator.kt @@ -34,7 +34,7 @@ interface TaskNavigator { return history.peek() } - fun hasPreviousStep() : Boolean { + fun hasPreviousStep(): Boolean { val previousStep = peekHistory() return previousStep != null } @@ -48,12 +48,8 @@ interface TaskNavigator { companion object { operator fun invoke(task: Task): TaskNavigator = when (task) { - is OrderedTask -> OrderedTaskNavigator( - task - ) - is NavigableOrderedTask -> NavigableOrderedTaskNavigator( - task - ) + is OrderedTask -> OrderedTaskNavigator(task) + is NavigableOrderedTask -> NavigableOrderedTaskNavigator(task) else -> throw NotImplementedError() } } diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/NextAction.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/NextAction.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/NextAction.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/NextAction.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/Presenter.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/Presenter.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/Presenter.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/Presenter.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/PresenterImpl.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/PresenterImpl.kt similarity index 95% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/PresenterImpl.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/PresenterImpl.kt index 97a277c..b81f8e0 100644 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/PresenterImpl.kt +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/PresenterImpl.kt @@ -11,8 +11,6 @@ import com.quickbirdstudios.surveykit.backend.views.step.QuestionView import com.quickbirdstudios.surveykit.backend.views.step.StepView import com.quickbirdstudios.surveykit.result.StepResult import com.quickbirdstudios.surveykit.steps.Step -import kotlinx.android.synthetic.main.layout_header.view.* -import kotlinx.android.synthetic.main.view_question.view.* import java.util.Date import kotlin.coroutines.resume import kotlin.coroutines.suspendCoroutine @@ -103,8 +101,8 @@ internal class PresenterImpl( val previousQuestionView = currentQuestionView - if (!hasPreviousStep()) { - questionView.questionHeader?.canBack = false + if (!hasPreviousStep() && questionView is QuestionView) { + questionView.header.canBack = false } currentQuestionView = questionView diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/animations/ViewAnimator.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/animations/ViewAnimator.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/presenter/animations/ViewAnimator.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/presenter/animations/ViewAnimator.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/result_gatherer/ResultGatherer.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/result_gatherer/ResultGatherer.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/result_gatherer/ResultGatherer.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/result_gatherer/ResultGatherer.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/result_gatherer/ResultGathererImpl.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/result_gatherer/ResultGathererImpl.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/result_gatherer/ResultGathererImpl.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/result_gatherer/ResultGathererImpl.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/AbortDialogConfiguration.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/AbortDialogConfiguration.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/AbortDialogConfiguration.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/AbortDialogConfiguration.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Content.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Content.kt similarity index 79% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Content.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Content.kt index 8d59294..8c3db4d 100644 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Content.kt +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Content.kt @@ -2,12 +2,14 @@ package com.quickbirdstudios.surveykit.backend.views.main_parts import android.content.Context import android.util.AttributeSet +import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.LinearLayout import androidx.core.widget.NestedScrollView import com.quickbirdstudios.surveykit.R import com.quickbirdstudios.surveykit.SurveyTheme +import com.quickbirdstudios.surveykit.databinding.LayoutContentBinding class Content @JvmOverloads constructor( context: Context, @@ -16,10 +18,14 @@ class Content @JvmOverloads constructor( ) : NestedScrollView(context, attrs, defStyleRes), StyleablePart { //region Member + private val root = LayoutContentBinding.inflate( + LayoutInflater.from(context), + this, + true + ) - private val root: View = View.inflate(context, R.layout.layout_content, this) - private val container: ViewGroup = root.findViewById(R.id.content_container) - private val footerContainer: ViewGroup = root.findViewById(R.id.footer_container) + private val container: ViewGroup = root.contentContainer + private val footerContainer: ViewGroup = root.footerContainer private val footer: Footer = Footer(context).apply { id = R.id.questionFooter } //endregion diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/DialogConfiguration.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/DialogConfiguration.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/DialogConfiguration.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/DialogConfiguration.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Dialogs.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Dialogs.kt similarity index 100% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Dialogs.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Dialogs.kt diff --git a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Footer.kt b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Footer.kt similarity index 90% rename from survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Footer.kt rename to survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Footer.kt index 8e41006..3e66526 100644 --- a/survey/src/main/java/com.quickbirdstudios.surveykit/backend/views/main_parts/Footer.kt +++ b/survey/src/main/java/com/quickbirdstudios/surveykit/backend/views/main_parts/Footer.kt @@ -6,6 +6,7 @@ import android.graphics.Color import android.graphics.PorterDuff import android.graphics.drawable.GradientDrawable import android.util.AttributeSet +import android.view.LayoutInflater import android.view.View import android.view.inputmethod.InputMethodManager import android.widget.Button @@ -15,6 +16,7 @@ import com.quickbirdstudios.surveykit.R import com.quickbirdstudios.surveykit.SurveyTheme import com.quickbirdstudios.surveykit.backend.helpers.extensions.colorStroke import com.quickbirdstudios.surveykit.backend.helpers.extensions.px +import com.quickbirdstudios.surveykit.databinding.LayoutFooterBinding class Footer @JvmOverloads constructor( context: Context, @@ -60,15 +62,21 @@ class Footer @JvmOverloads constructor( //region Members - private val root: View = View.inflate(context, R.layout.layout_footer, this) - private val buttonContinue = root.findViewById