Skip to content

Commit

Permalink
Sync with upstream (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheConen authored Dec 11, 2023
1 parent 97bdc7b commit 71bf593
Show file tree
Hide file tree
Showing 256 changed files with 2,544 additions and 1,506 deletions.
48 changes: 24 additions & 24 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 @@ -164,6 +161,10 @@ android {
//exclude 'META-INF/androidx.core_core.version'
exclude 'META-INF/com.android.tools/proguard/coroutines.pro'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/androidx.interpolator_interpolator.version'
exclude 'META-INF/androidx.core_core.version'
pickFirst 'org/bouncycastle/x509/CertPathReviewerMessages.properties'
pickFirst 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'
}

compileOptions {
Expand Down Expand Up @@ -197,7 +198,6 @@ android {
dev {
minifyEnabled false
shrinkResources false
useProguard false
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
versionNameSuffix "-debug"
Expand Down Expand Up @@ -236,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 @@ -254,26 +254,26 @@ 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
}
implementation("androidx.browser:browser:1.3.0") {
exclude group: 'androidx.core', module: 'core' // fix INotificationSideChannel // android.support.v4.app
}

api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1"
implementation(name: 'ns-sdk-full-release', ext: 'aar')

//implementation 'androidx.core:core-ktx:1.9.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.22'

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v13:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:preference-v7:26.1.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 @@ -302,7 +302,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
implementation 'com.getpebble:pebblekit:3.1.0'
implementation ("androidx.health.connect:connect-client:1.0.0-alpha07") {
implementation ("androidx.health.connect:connect-client:1.1.0-alpha06") {
exclude group: 'androidx.core', module: 'core'
}
implementation 'com.github.jamorham:amazfitcommunication:master-SNAPSHOT'
Expand Down Expand Up @@ -332,20 +332,20 @@ dependencies {
implementation(name: 'colorpicker', ext: 'aar')
implementation(name: 'hellocharts-library-release', ext: 'aar')
implementation(name: 'search-preference', ext: 'aar')
implementation(name: 'javakotlininterop', ext: 'aar')
implementation 'org.apache.commons:commons-text:1.3'
implementation 'com.google.dagger:dagger:2.25.4'
implementation "com.evernote:android-job:1.2.6"
//implementation 'com.android.support:multidex:1.0.3'
//implementation 'com.google.dagger:dagger-android-support:2.x' // if you use the support libraries
annotationProcessor 'com.google.dagger:dagger-compiler:2.25.4'
implementation 'net.danlew:android.joda:2.10.6.1'
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.68'
testImplementation 'joda-time:joda-time:2.10.7'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.objenesis:objenesis:2.5.1'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation "org.robolectric:robolectric:4.4.1"
testImplementation "org.robolectric:robolectric:4.11.1"
testImplementation "com.google.truth:truth:1.1.3"

testImplementation 'org.mockito:mockito-inline:2.13.0'
Expand All @@ -361,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.1'
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.
Binary file removed app/libs/javakotlininterop.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
48 changes: 44 additions & 4 deletions 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 @@ -61,6 +62,32 @@
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />

<uses-permission android:name="android.permission.MANAGE_HEALTH_DATA"/>
<uses-permission android:name="android.permission.MANAGE_HEALTH_PERMISSIONS"/>

<uses-permission android:name="android.permission.health.READ_HEART_RATE"/>
<uses-permission android:name="android.permission.health.READ_BLOOD_GLUCOSE"/>
<uses-permission android:name="android.permission.health.WRITE_BLOOD_GLUCOSE"/>
<uses-permission android:name="android.permission.health.READ_STEPS"/>
<uses-permission android:name="android.permission.health.READ_EXERCISE"/>
<uses-permission android:name="android.permission.health.READ_TOTAL_CALORIES_BURNED"/>
<uses-permission android:name="android.permission.health.READ_WEIGHT"/>
<uses-permission android:name="android.permission.health.READ_DISTANCE"/>
<uses-permission android:name="android.permission.health.READ_ELEVATION_GAINED"/>
<uses-permission android:name="android.permission.health.READ_FLOORS_CLIMBED"/>
<uses-permission android:name="android.permission.health.READ_HEART_RATE_VARIABILITY"/>
<uses-permission android:name="android.permission.health.READ_HEIGHT"/>
<uses-permission android:name="android.permission.health.READ_HYDRATION"/>
<uses-permission android:name="android.permission.health.READ_NUTRITION"/>
<uses-permission android:name="android.permission.health.WRITE_NUTRITION"/>
<uses-permission android:name="android.permission.health.READ_POWER"/>
<uses-permission android:name="android.permission.health.READ_RESTING_HEART_RATE"/>
<uses-permission android:name="android.permission.health.READ_SLEEP"/>
<uses-permission android:name="android.permission.health.READ_SPEED"/>
<uses-permission android:name="android.permission.health.READ_WHEELCHAIR_PUSHES"/>

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

<application
android:name=".xdrip"
android:allowBackup="false"
Expand All @@ -69,6 +96,8 @@
android:largeHeap="true"
android:maxAspectRatio="2.1"
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory"
android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
android:usesCleartextTraffic="true">
<activity
android:name=".HealthPrivacy"
Expand All @@ -77,10 +106,21 @@
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
<meta-data
android:name="health_permissions"
android:resource="@array/health_permissions" />
</activity>
<activity-alias
android:name="AndroidURationaleActivity"
android:exported="true"
android:targetActivity=".HealthPrivacy">
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
<!-- Permission handling for Android 14 -->
<intent-filter>
<action android:name="android.intent.action.VIEW_PERMISSION_USAGE"/>
<category android:name="android.intent.category.HEALTH_PERMISSIONS"/>
</intent-filter>
</activity-alias>

<activity
android:name=".cloud.backup.BackupActivity"
android:exported="false"
Expand All @@ -102,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
4 changes: 3 additions & 1 deletion app/src/main/java/com/eveningoutpost/dexdrip/BGHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class BGHistory extends ActivityWithMenu {
private int noDays = 1;
private SharedPreferences prefs;
private TextView statisticsTextView;
private static final int SAMPLE_PERIOD = 1; // In minutes - The time between two consecutive readings - The lowest period we currently support: 1 minute
private static final int GRACE_READINGS_PER_DAY = 2; // When switching from one source to another, there may be a misalignment in sample timing resulting in more readings per day

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -148,7 +150,7 @@ private void setupCharts() {

Calendar endDate = (GregorianCalendar) date1.clone();
endDate.add(Calendar.DATE, noDays);
int numValues = noDays * (60 / 2) * 24; // LimiTTer sample rate 1 per 2 minutes
int numValues = noDays * (24 * (60 / SAMPLE_PERIOD) + GRACE_READINGS_PER_DAY); // The highest sample rate we currently support
BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues, false);

chart = (LineChartView) findViewById(R.id.chart);
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
Loading

0 comments on commit 71bf593

Please sign in to comment.