From a40824d917623b3cc19416775db471c7ad0b1580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zel?= Date: Sun, 16 Oct 2022 22:23:11 +0300 Subject: [PATCH 1/4] Gradle version upgraded. --- .idea/deploymentTargetDropDown.xml | 17 +++++++++++++++++ .idea/gradle.xml | 1 - build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .idea/deploymentTargetDropDown.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..bc75955 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 1fd78f4..4b10c96 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -15,7 +15,6 @@ - diff --git a/build.gradle b/build.gradle index fea1f84..fc11211 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,8 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10" + classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5a29bdf..97a9b96 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Sep 22 20:53:13 IST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 7a32b1685d0f13213595c65fbbf737739ae2c65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zel?= Date: Sun, 16 Oct 2022 22:26:28 +0300 Subject: [PATCH 2/4] New strings added for strings.xml --- .../dev/sagar/progressbutton/ComposeActivity.kt | 13 +++++++------ .../dev/sagar/progressbutton/MainActivity.kt | 2 +- app/src/main/res/layout/activity_main.xml | 16 ++++++++-------- app/src/main/res/values/strings.xml | 10 ++++++++++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/dev/sagar/progressbutton/ComposeActivity.kt b/app/src/main/java/dev/sagar/progressbutton/ComposeActivity.kt index f2e69c0..3c2488d 100644 --- a/app/src/main/java/dev/sagar/progressbutton/ComposeActivity.kt +++ b/app/src/main/java/dev/sagar/progressbutton/ComposeActivity.kt @@ -13,6 +13,7 @@ import androidx.compose.runtime.* // ktlint-disable no-wildcard-imports import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import dev.sagar.progress_button_compose.ButtonState @@ -49,8 +50,8 @@ fun MainScreenContent() { ) { ProgressButton( buttonState = buttonState, - text = "Button", - completedText = "Finished", + text = stringResource(R.string.button), + completedText = stringResource(R.string.finished), shape = RoundedCornerShape(12.dp), modifier = Modifier .fillMaxWidth(), @@ -59,19 +60,19 @@ fun MainScreenContent() { Spacer(modifier = Modifier.height(100.dp)) - ControlButton(text = "Enable") { + ControlButton(text = stringResource(R.string.enable)) { buttonState = ButtonState.ENABLED } Spacer(modifier = Modifier.height(16.dp)) - ControlButton(text = "Disable") { + ControlButton(text = stringResource(R.string.disable)) { buttonState = ButtonState.DISABLED } Spacer(modifier = Modifier.height(16.dp)) - ControlButton(text = "Loading") { + ControlButton(text = stringResource(R.string.loading)) { buttonState = ButtonState.LOADING } Spacer(modifier = Modifier.height(16.dp)) - ControlButton(text = "Finished") { + ControlButton(text = stringResource(R.string.finished)) { buttonState = ButtonState.FINISHED } } diff --git a/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt b/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt index 3fc32de..30616ad 100644 --- a/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt +++ b/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt @@ -48,7 +48,7 @@ class MainActivity : AppCompatActivity() { private fun initClickListeners() = binding.apply { progressButton.setOnClickListener { - Toast.makeText(this@MainActivity, "On click!", Toast.LENGTH_SHORT).show() + Toast.makeText(this@MainActivity, getString(R.string.click), Toast.LENGTH_SHORT).show() } btnLoading.setOnClickListener { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 2d65958..1c4ff68 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -23,7 +23,7 @@ android:layout_height="wrap_content" android:layout_marginStart="24dp" android:layout_marginBottom="24dp" - android:text="Loading" + android:text="@string/loading" app:layout_constraintBottom_toTopOf="@+id/btnEnable" app:layout_constraintStart_toStartOf="parent" /> @@ -31,7 +31,7 @@ android:id="@+id/btnFinish" android:layout_width="@dimen/button_width" android:layout_height="wrap_content" - android:text="Finish" + android:text="@string/finished" app:layout_constraintBottom_toBottomOf="@+id/btnLoading" app:layout_constraintEnd_toEndOf="@+id/btnDisable" /> @@ -41,7 +41,7 @@ android:layout_height="wrap_content" android:layout_marginStart="24dp" android:layout_marginBottom="24dp" - android:text="Enable" + android:text="@string/enable" app:layout_constraintBottom_toTopOf="@+id/btnReset" app:layout_constraintEnd_toEndOf="@+id/btnLoading" app:layout_constraintStart_toStartOf="parent" /> @@ -51,7 +51,7 @@ android:layout_width="@dimen/button_width" android:layout_height="wrap_content" android:layout_marginEnd="24dp" - android:text="Disable" + android:text="@string/disable" app:layout_constraintBottom_toBottomOf="@+id/btnEnable" app:layout_constraintEnd_toEndOf="parent" /> @@ -60,7 +60,7 @@ android:layout_width="@dimen/button_width" android:layout_height="wrap_content" android:layout_marginBottom="24dp" - android:text="Reset" + android:text="@string/reset" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -73,7 +73,7 @@ android:layout_marginTop="200dp" android:layout_marginEnd="24dp" android:ems="10" - android:hint="Email Address" + android:hint="@string/email_address" android:inputType="textPersonName" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.492" @@ -86,7 +86,7 @@ android:layout_height="wrap_content" android:layout_marginTop="32dp" android:ems="10" - android:hint="Password" + android:hint="@string/password" android:inputType="textPersonName" app:layout_constraintEnd_toEndOf="@+id/editTextTextPersonName" app:layout_constraintStart_toStartOf="@+id/editTextTextPersonName" @@ -99,7 +99,7 @@ android:layout_marginTop="32dp" android:background="?attr/colorSecondary" android:paddingHorizontal="16dp" - android:text="Switch To Compose Activity" + android:text="@string/switch_to_compose_activity" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9e148ec..3939133 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,4 +1,14 @@ ProgressButton ComposeActivity + Finished + Enable + Disable + Loading + Button + On click! + Reset + Email Address + Password + Switch To Compose Activity \ No newline at end of file From b75613e56fe287e5b35a3bf46b5b255ccb40e7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zel?= Date: Sun, 16 Oct 2022 22:26:51 +0300 Subject: [PATCH 3/4] Android 12 setting made. --- app/src/main/AndroidManifest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8dd6531..9545b14 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.ProgressButton"> - + From 30b69df1ffead9e82e5ba57fcd7ced8b81803aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zel?= Date: Sun, 16 Oct 2022 22:38:38 +0300 Subject: [PATCH 4/4] Dependencies settings made. --- app/build.gradle | 24 ++++++++++-------------- build.gradle | 7 +++---- progress-button-compose/build.gradle | 19 +++++++------------ progress-button/build.gradle | 15 ++++++--------- 4 files changed, 26 insertions(+), 39 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d4a7cfa..4c704cc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,13 +4,12 @@ plugins { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdkVersion 33 defaultConfig { applicationId "dev.sagar.progressbutton" minSdkVersion 26 - targetSdkVersion 30 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -33,7 +32,6 @@ android { } kotlinOptions { jvmTarget = '1.8' - useIR = true } buildFeatures { viewBinding true @@ -46,30 +44,28 @@ android { } dependencies { - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.5.0' - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation project(path: ':progress-button') implementation project(path: ':progress-button-compose') - testImplementation 'junit:junit:4.+' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' // Material Design - implementation 'com.google.android.material:material:1.4.0' + implementation 'com.google.android.material:material:1.6.1' // Lifecycle implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1" implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling:$compose_version" - implementation 'androidx.activity:activity-compose:1.3.0-beta02' + implementation 'androidx.activity:activity-compose:1.7.0-alpha01' } \ No newline at end of file diff --git a/build.gradle b/build.gradle index fc11211..02a1240 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.5.10" - ext.compose_version = '1.0.0-beta09' + ext.kotlin_version = "1.7.10" + ext.compose_version = '1.3.0-rc01' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.1' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -19,7 +19,6 @@ allprojects { repositories { google() mavenCentral() - jcenter() // Warning: this repository is going to shut down soon } } diff --git a/progress-button-compose/build.gradle b/progress-button-compose/build.gradle index a4ad6b1..d43126a 100644 --- a/progress-button-compose/build.gradle +++ b/progress-button-compose/build.gradle @@ -15,12 +15,11 @@ project.afterEvaluate { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdkVersion 33 defaultConfig { minSdkVersion 26 - targetSdkVersion 30 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -42,7 +41,6 @@ android { } kotlinOptions { jvmTarget = '1.8' - useIR = true } buildFeatures { compose true @@ -53,18 +51,15 @@ android { } dependencies { - - implementation 'androidx.core:core-ktx:1.6.0' - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'com.google.android.material:material:1.3.0' - testImplementation 'junit:junit:4.+' + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.6.1' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - - implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling:$compose_version" - implementation 'androidx.activity:activity-compose:1.3.0-beta02' + implementation 'androidx.activity:activity-compose:1.7.0-alpha01' } \ No newline at end of file diff --git a/progress-button/build.gradle b/progress-button/build.gradle index 2c5c4f5..da01e7c 100644 --- a/progress-button/build.gradle +++ b/progress-button/build.gradle @@ -15,12 +15,11 @@ project.afterEvaluate { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -42,12 +41,10 @@ android { } dependencies { - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.5.0' - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'com.google.android.material:material:1.4.0' - testImplementation 'junit:junit:4.+' + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.6.1' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } \ No newline at end of file