Skip to content

App settings made. #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -33,7 +32,6 @@ android {
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
viewBinding true
Expand All @@ -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'

}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ProgressButton">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/dev/sagar/progressbutton/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
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" />

<Button
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" />

Expand All @@ -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" />
Expand All @@ -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" />

Expand All @@ -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" />
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<resources>
<string name="app_name">ProgressButton</string>
<string name="title_activity_compose">ComposeActivity</string>

<string name="button">Button</string>
<string name="finished">Finished</string>
<string name="enable">Enable</string>
<string name="disable">Disable</string>
<string name="loading">Loading</string>
<string name="button">Button</string>
<string name="click">On click!</string>
<string name="reset">Reset</string>
<string name="email_address">Email Address</string>
<string name="password">Password</string>
<string name="switch_to_compose_activity">Switch To Compose Activity</string>
</resources>
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,7 +19,6 @@ allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
19 changes: 7 additions & 12 deletions progress-button-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -42,7 +41,6 @@ android {
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
Expand All @@ -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'
}
15 changes: 6 additions & 9 deletions progress-button/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
}