diff --git a/app/build.gradle b/app/build.gradle index 2bf45fb..77d23b5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 21 - buildToolsVersion "21.1.1" + compileSdk 33 + buildToolsVersion '33.0.0' defaultConfig { applicationId "com.em.batterywidget" - minSdkVersion 8 - targetSdkVersion 21 + minSdk 29 + targetSdk 33 versionCode 1 versionName "1.0" } @@ -21,7 +21,7 @@ android { } dependencies { - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:21.0.0' - compile files('libs/achartengine-1.0.0.jar') + implementation files('libs/achartengine-1.2.0.jar') + testImplementation 'junit:junit:4.13.2' + implementation 'androidx.appcompat:appcompat:1.6.0' } diff --git a/app/libs/achartengine-1.0.0.jar b/app/libs/achartengine-1.0.0.jar deleted file mode 100644 index fe75dc3..0000000 Binary files a/app/libs/achartengine-1.0.0.jar and /dev/null differ diff --git a/app/libs/achartengine-1.2.0.jar b/app/libs/achartengine-1.2.0.jar new file mode 100644 index 0000000..21fe13d Binary files /dev/null and b/app/libs/achartengine-1.2.0.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 51589c9..2aa1d97 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,8 @@ android:theme="@style/AppTheme"> + android:label="@string/app_name" + android:exported="true"> @@ -37,7 +38,8 @@ - + @@ -49,7 +51,8 @@ + android:permission="android.permission.RECEIVE_BOOT_COMPLETED" + android:exported="true"> diff --git a/app/src/main/java/com/em/batterywidget/UpdateService.java b/app/src/main/java/com/em/batterywidget/UpdateService.java index 80ac9f3..6ac70c5 100644 --- a/app/src/main/java/com/em/batterywidget/UpdateService.java +++ b/app/src/main/java/com/em/batterywidget/UpdateService.java @@ -130,7 +130,7 @@ private RemoteViews createRemoteViews(final int level, final boolean isCharging) View.VISIBLE : View.INVISIBLE); remoteViews.setTextViewText(R.id.batterytext, String.valueOf(level) + "%"); Intent activityIntent = new Intent(this, WidgetActivity.class); - PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, activityIntent, 0); + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, activityIntent, PendingIntent.FLAG_IMMUTABLE ); remoteViews.setOnClickPendingIntent(R.id.widget_view, pendingIntent); return remoteViews; } diff --git a/build.gradle b/build.gradle index f4d8c54..bc41aa9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,4 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' - } -} - -allprojects { - repositories { - jcenter() - } -} +plugins { + id 'com.android.application' version '7.4.1' apply false + id 'com.android.library' version '7.4.1' apply false +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..5465fec --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f23df6e..acabece 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Wed Oct 21 11:34:03 PDT 2015 +#Mon Jan 30 11:56:18 GMT 2023 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip +zipStoreBase=GRADLE_USER_HOME + diff --git a/settings.gradle b/settings.gradle index e7b4def..8916044 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "Android-Battery-Widget" include ':app'