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/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/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"> - + diff --git a/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt b/app/src/main/java/dev/sagar/progressbutton/MainActivity.kt index cd2b0bb..abfeb57 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 7f42e30..3939133 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,10 +1,14 @@ ProgressButton ComposeActivity - - Button Finished Enable Disable Loading + Button + On click! + Reset + Email Address + Password + Switch To Compose Activity \ No newline at end of file diff --git a/build.gradle b/build.gradle index fea1f84..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.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.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/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 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