Skip to content

Commit

Permalink
Upgraded dependencies and minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoyaquello committed Oct 27, 2019
1 parent 73adf00 commit 3c21bb5
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 157 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
applicationId "verticalstepperform.ernestoyaquello.com.verticalstepperform"
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -23,7 +23,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'

implementation project(path: ':vertical-stepper-form')
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
Expand Down Expand Up @@ -40,7 +42,7 @@ public void onClick(View view) {
}

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
public void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);

dataReceived = savedInstanceState.getBoolean(DATA_RECEIVED, false);
Expand All @@ -55,7 +57,7 @@ public void onRestoreInstanceState(Bundle savedInstanceState) {
}

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
public void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);

savedInstanceState.putBoolean(DATA_RECEIVED, dataReceived);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,20 @@ public void onRestoreInstanceState(Bundle savedInstanceState) {
}

public static class DiscardAlarmConfirmationFragment extends DialogFragment {

private DialogInterface.OnClickListener listener;

@Override
public void onAttach(Context context) {
super.onAttach(context);

listener = (DialogInterface.OnClickListener) context;
}

@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
NewAlarmFormActivity activity = (NewAlarmFormActivity)getActivity();
if (activity == null) {
throw new IllegalStateException("Fragment " + this + " not attached to an activity.");
}

AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.form_discard_question)
.setMessage(R.string.form_info_will_be_lost)
.setPositiveButton(R.string.form_discard, listener)
.setNegativeButton(R.string.form_discard_cancel, listener)
.setCancelable(false);
.setPositiveButton(R.string.form_discard, activity)
.setNegativeButton(R.string.form_discard_cancel, activity)
.setCancelable(false);
Dialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(false);

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<resources>
<string name="app_name">Vertical Stepper Form Example</string>
<string name="add_alarm">Add Alarm</string>
<string name="add_alarm_confirm_subtitle">Confirm data and add alarm</string>
<string name="new_alarm_added">New alarm added successfully</string>
<string name="error_alarm_name_min_characters">At least %1$d character(s)</string>
<string name="error_alarm_days_min_days">At least 1 day must be selected</string>
Expand All @@ -12,7 +11,6 @@
<string name="form_hint_description">Alarm description (optional)</string>
<string name="form_discard_question">Discard alarm?</string>
<string name="form_info_will_be_lost">All the information about this new alarm will be lost</string>
<string name="form_confirm_button">Add alarm</string>
<string name="form_sending_data_message">Adding new alarm…</string>
<string name="form_discard_cancel">Cancel</string>
<string name="form_discard">Discard</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,4 @@
<item name="elevation">0dp</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Apr 27 11:15:07 BST 2019
#Sun Oct 27 11:18:35 GMT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
10 changes: 5 additions & 5 deletions vertical-stepper-form/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ ext {
}

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 29
versionCode 15
versionName libraryVersion
}
Expand All @@ -48,7 +48,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
}

group = publishedGroupId
Expand Down Expand Up @@ -88,7 +88,7 @@ install {
}

task sourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

Expand All @@ -98,7 +98,7 @@ task javadoc(type: Javadoc) {
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

Expand Down
Loading

0 comments on commit 3c21bb5

Please sign in to comment.