Skip to content

Commit

Permalink
Migrate to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Dec 7, 2023
1 parent 5a5681d commit 74a4f02
Show file tree
Hide file tree
Showing 215 changed files with 639 additions and 1,237 deletions.
34 changes: 15 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repositories {
url "https://jitpack.io"
}
flatDir {
dirs 'libs'
dirs project(':app').file('libs'), project(':wear').file('libs')
}
}

Expand Down Expand Up @@ -69,11 +69,8 @@ def getLocalProperty(String propertyName) {
}

android {
compileSdkVersion 31
compileSdk 34

dexOptions {
javaMaxHeapSize "3g"
}

configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
Expand All @@ -83,7 +80,7 @@ android {
// changes to databinding libraries can apparently result in nasty bugs on some handsets
// the following checks that databinding dependencies are not changed from the tested configuration
// 2.3.0 and 1.3.1 are from me.tatarka.bindingcollectionadapter2
if (!["3.1.4", "2.3.0", "1.3.1", "3.4.3"].contains(details.target.version)) {
if (!["3.1.4", "2.3.0", "1.3.1", "3.4.3", "3.6.4", "7.4.2"].contains(details.target.version)) {
throw new GradleException("Untested databinding version: " + details.requested.group + " " + details.requested.name + "- " + details.requested.version + " - " + details.target.version)
}
}
Expand All @@ -105,7 +102,7 @@ android {
buildConfigField "long", "buildTimestamp", generateTimestamp()
buildConfigField "int", "targetSDK", targetSdkVersion.mApiLevel.toString()
//vectorDrawables.useSupportLibrary = true // broken in newer gradle versions
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled false

// To get a Google Maps API key, follow this link, follow the directions and press "Create" at the end:
Expand Down Expand Up @@ -201,7 +198,6 @@ android {
dev {
minifyEnabled false
shrinkResources false
useProguard false
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
versionNameSuffix "-debug"
Expand Down Expand Up @@ -240,7 +236,7 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
wearApp project(':wear')
//weapApp files('../wear/build/outputs/apk/wear_release.apk')
//testimplementation 'com.squareup.okhttp:mockwebserver:2.5.0'
Expand All @@ -258,7 +254,7 @@ dependencies {
}

// app auth implementation
implementation(name: 'core-1.1.0', ext: 'aar')
//implementation(name: 'core-1.1.0', ext: 'aar')
implementation(name: 'appauth-release', ext: 'aar') {
exclude group: 'androidx.core', module: 'core' // fix INotificationSideChannel // android.support.v4.app
}
Expand All @@ -272,12 +268,12 @@ dependencies {
//implementation 'androidx.core:core-ktx:1.9.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.22'

implementation ('com.android.support:appcompat-v7:28.0.0')
implementation ('com.android.support:design:28.0.0')
implementation ('com.android.support:support-v13:28.0.0')
implementation ('com.android.support:recyclerview-v7:28.0.0')
implementation ('com.android.support:cardview-v7:28.0.0')
implementation ('com.android.support:preference-v7:28.0.0')
implementation ('androidx.appcompat:appcompat:1.0.0')
implementation ('com.google.android.material:material:1.1.0')
implementation ('androidx.legacy:legacy-support-v13:1.0.0')
implementation ('androidx.recyclerview:recyclerview:1.0.0')
implementation ('androidx.cardview:cardview:1.0.0')
implementation ('androidx.preference:preference:1.0.0')

implementation ('com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0') {
exclude group: 'org.apache.httpcomponents'
Expand Down Expand Up @@ -365,13 +361,13 @@ dependencies {
exclude group: 'com.android.support'
}
// espresso, workarounds needed for correct functioning
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'
}
androidTestImplementation 'com.android.support.test:runner:1.0.2', {
androidTestImplementation 'androidx.test.ext:junit:1.1.1', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test.espresso:espresso-idling-resource:3.0.2'
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
// add this for intent mocking support
//androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.1'
// add this for webview testing support
Expand Down
Binary file removed app/libs/core-1.1.0.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
-keep class com.eveningoutpost.dexdrip.importedlibraries.usbserial.** { *; }
-keep class ar.com.hjg.pngj.** { *; }
-keep class android.support.v7.widget.SearchView { *; }

-keep class kotlinx.serialization.Serializable { *; }

-dontwarn java.util.concurrent.**

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<uses-sdk tools:overrideLibrary="androidx.health.connect.client, info.nightscout.sdk" />
<!-- To receive data from HAPP. -->
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
<uses-permission android:name="com.eveningoutpost.dexdrip.permissions.RECEIVE_EXTERNAL_STATUSLINE" /> <!-- To receive data from Aidex -->
<uses-permission android:name="com.microtechmd.cgms.aidex.permissions.RECEIVE_BG_ESTIMATE" />

Expand Down Expand Up @@ -141,7 +142,7 @@
android:enabled="true"
android:exported="false" />
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import android.graphics.Color;
import android.graphics.PointF;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;

import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;

/**
* Created by jamorham on 01/02/2017.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.PowerManager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;

import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
Expand All @@ -29,6 +28,9 @@

import static com.eveningoutpost.dexdrip.services.Ob1G5CollectionService.getTransmitterID;

import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;

public class AddCalibration extends AppCompatActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
// Unit used
final String unit = Pref.getString("units", "mgdl");
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/eveningoutpost/dexdrip/AlertList.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// jamorham

import android.content.Context;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;


public abstract class BaseAppCompatActivity extends AppCompatActivity {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.databinding.BindingAdapter;
import androidx.databinding.BindingAdapter;
import android.graphics.Typeface;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;

import android.text.InputType;
import android.text.TextUtils;
import android.view.Menu;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.text.InputType;
import android.text.format.DateFormat;
import android.text.method.DigitsKeyListener;
Expand Down
20 changes: 11 additions & 9 deletions app/src/main/java/com/eveningoutpost/dexdrip/EventLogActivity.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package com.eveningoutpost.dexdrip;

import android.content.Intent;
import android.databinding.ObservableArrayList;
import android.databinding.ObservableBoolean;
import android.databinding.ObservableList;
import android.databinding.ViewDataBinding;

import androidx.appcompat.widget.SearchView;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableList;
import androidx.databinding.ViewDataBinding;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import androidx.annotation.LayoutRes;
import androidx.core.view.MenuItemCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.os.Handler;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;

import android.widget.Toast;

import com.eveningoutpost.dexdrip.models.BgReading;
Expand Down Expand Up @@ -55,6 +55,8 @@
import static com.eveningoutpost.dexdrip.models.JoH.isOldVersion;
import static com.eveningoutpost.dexdrip.xdrip.gs;

import androidx.localbroadcastmanager.content.LocalBroadcastManager;

/**
* Created by jamorham on 11/01/16.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.eveningoutpost.dexdrip;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.eveningoutpost.dexdrip.models.JoH;

// jamorham
Expand Down
20 changes: 11 additions & 9 deletions app/src/main/java/com/eveningoutpost/dexdrip/Home.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.speech.RecognizerIntent;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.Toolbar;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;

import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import android.text.InputType;
import android.util.DisplayMetrics;
import android.util.Log;
Expand Down Expand Up @@ -156,6 +157,7 @@
import com.github.amlcurran.showcaseview.ShowcaseView;
import com.github.amlcurran.showcaseview.targets.Target;
import com.github.amlcurran.showcaseview.targets.ViewTarget;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.internal.bind.DateTypeAdapter;
Expand Down Expand Up @@ -3636,7 +3638,7 @@ public static double convertToMgDlIfMmol(double value) {

public static void snackBar(int buttonString, String message, View.OnClickListener mOnClickListener, Activity activity) {

android.support.design.widget.Snackbar.make(
Snackbar.make(

activity.findViewById(android.R.id.content),
message, Snackbar.LENGTH_LONG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import android.view.WindowManager;

import androidx.fragment.app.FragmentActivity;

import com.eveningoutpost.dexdrip.models.JoH;
//import com.google.android.gms.maps.CameraUpdateFactory;
//import com.google.android.gms.maps.GoogleMap;
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/java/com/eveningoutpost/dexdrip/MegaStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@
import static com.eveningoutpost.dexdrip.utils.DexCollectionType.CLFollow;

import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v13.app.FragmentStatePagerAdapter;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewPager;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.viewpager.widget.ViewPager;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
Expand Down Expand Up @@ -301,7 +304,7 @@ protected void onCreate(Bundle savedInstanceState) {
sectionTitles.clear();
populateSectionList();

mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
Expand Down
Loading

0 comments on commit 74a4f02

Please sign in to comment.