Skip to content
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

Major update feature with application version code(only xml) #182

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
migrate to android x
  • Loading branch information
Amit committed Mar 11, 2020
commit 07775ddab5b12f1ab905cf90c23be985b461d8d9
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 29
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "com.github.javiersantos.appupdater.demo"
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 29
versionCode 4
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -31,17 +31,17 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation project(':library')

// Testing-only dependencies
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test:runner:1.0.1', {
androidTestImplementation('androidx.test.ext:junit:1.1.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.javiersantos.appupdater;

import android.support.test.runner.AndroidJUnit4;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.github.javiersantos.appupdater.objects.Update;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.javiersantos.appupdater;

import android.support.test.InstrumentationRegistry;
import android.support.test.rule.UiThreadTestRule;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.UiThreadTestRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.github.javiersantos.appupdater.enums.AppUpdaterError;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.github.javiersantos.appupdater.enums.UpdateFrom;
import com.github.javiersantos.appupdater.objects.Update;

import android.support.test.InstrumentationRegistry;
import android.support.test.rule.UiThreadTestRule;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.UiThreadTestRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Rule;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import androidx.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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 @@ -2,21 +2,21 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.github.javiersantos.appupdater.demo.MainActivity"
tools:ignore="PrivateResource">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.CollapsingToolbarLayout
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -51,20 +51,20 @@
android:textSize="@dimen/abc_text_size_subhead_material"
app:layout_collapseMode="parallax" />

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<include layout="@layout/content_main"
android:id="@+id/included"/>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -73,5 +73,5 @@
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end" />

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
Expand Down
32 changes: 16 additions & 16 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<android.support.v4.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
Expand All @@ -18,7 +18,7 @@
android:layout_marginTop="20dp"
android:orientation="vertical">

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/dialog_update_changelog"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -39,9 +39,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/dialog_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -62,9 +62,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/snackbar_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -85,9 +85,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/notification_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -108,9 +108,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/dialog_no_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -131,9 +131,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/snackbar_no_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -154,9 +154,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/notification_no_update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -177,9 +177,9 @@
android:textAllCaps="true" />
</LinearLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

</LinearLayout>

</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
</layout>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:3.6.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
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 @@
#Thu Jul 05 17:09:53 CEST 2018
#Wed Mar 11 11:42:38 BDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
10 changes: 5 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
compileSdkVersion 29
buildToolsVersion "27.0.3"

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 29
versionCode 28
versionName "2.7"
}
Expand All @@ -25,8 +25,8 @@ android {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api 'com.android.support:appcompat-v7:27.1.1'
api 'com.android.support:design:27.1.1'
api 'com.squareup.okhttp3:okhttp:3.10.0'
api 'androidx.appcompat:appcompat:1.1.0'
api 'com.google.android.material:material:1.1.0'
api 'com.squareup.okhttp3:okhttp:3.12.1'
api 'org.jsoup:jsoup:1.11.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AlertDialog;
import android.text.TextUtils;
import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.javiersantos.appupdater;

import android.content.Context;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.github.javiersantos.appupdater.enums.AppUpdaterError;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.javiersantos.appupdater;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;

import com.github.javiersantos.appupdater.objects.Update;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import android.content.Context;
import android.content.DialogInterface;
import android.media.RingtoneManager;
import android.support.design.widget.Snackbar;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AlertDialog;
import com.google.android.material.snackbar.Snackbar;
import androidx.core.app.NotificationCompat;
import androidx.appcompat.app.AlertDialog;
import android.view.View;

import com.github.javiersantos.appupdater.enums.UpdateFrom;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.javiersantos.appupdater.interfaces;

import android.content.DialogInterface;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;

import com.github.javiersantos.appupdater.AppUpdater;
import com.github.javiersantos.appupdater.DisableClickListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.javiersantos.appupdater.objects;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

public class Version implements Comparable<Version> {
private String version;
Expand Down