Skip to content

Commit

Permalink
Updated to SDK33
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbunny2008 committed Dec 30, 2022
1 parent be0013b commit f70f7d2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
22 changes: 10 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
compileSdkVersion 33
defaultConfig {
applicationId "com.odiousapps.weewxweather"
minSdkVersion 19
//noinspection OldTargetApi
targetSdkVersion 30
versionCode 9016
versionName "0.9.16"
targetSdkVersion 33
versionCode 1000001
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'com.odiousapps.weewxweather'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':colorpicker')
//noinspection GradleDependency
implementation 'androidx.appcompat:appcompat:1.3.1'
//noinspection GradleDependency
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'rongi.rotate-layout:rotate-layout:3.0.0'
implementation 'com.github.smart-fun:XmlToJson:1.5.1'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
}
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools"
package="com.odiousapps.weewxweather"
xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.VIBRATE"/>

<application
Expand All @@ -18,11 +18,11 @@
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:networkSecurityConfig="@xml/network_security_config">
android:networkSecurityConfig="@xml/network_security_config"
android:dataExtractionRules="@xml/data_extraction_rules">

<activity
android:name=".SplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:configChanges="orientation"
android:screenOrientation="portrait"
Expand All @@ -36,8 +36,8 @@
</intent-filter>
</activity>
<activity
android:exported="false"
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:configChanges="orientation"
android:screenOrientation="portrait"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/odiousapps/weewxweather/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void setAlarm(String from)
AlarmManager mgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent myIntent = new Intent(context, UpdateCheck.class);
@SuppressLint("UnspecifiedImmutableFlag")
PendingIntent pi = PendingIntent.getBroadcast(context, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);

if (mgr != null)
mgr.setExact(AlarmManager.RTC_WAKEUP, start, pi);
Expand Down Expand Up @@ -2732,7 +2732,7 @@ String[] processYahoo(String data, boolean showHeader)
}

String[] ret = checkFiles(myday.icon);
if (ret[0] != null)
if (ret[0] != null)
{
File f = new File(ret[1]);
FileInputStream imageInFile = new FileInputStream(f);
Expand All @@ -2742,7 +2742,7 @@ String[] processYahoo(String data, boolean showHeader)
} else
return ret;

LogMessage(myday.toString());
LogMessage(myday.toString());
days.add(myday);
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ public void getWeather()

private final BroadcastReceiver serviceReceiver = new BroadcastReceiver()
{
@SuppressLint("SuspiciousIndentation")
@Override
public void onReceive(Context context, Intent intent)
{
Expand All @@ -1127,7 +1128,7 @@ public void run()
});
}

if(action != null && action.equals(Common.UPDATE_INTENT))
if(action != null && action.equals(Common.UPDATE_INTENT))
{
String hex = "#" + Integer.toHexString(common.GetIntPref("fgColour", 0xFF000000)).toUpperCase();
fgColour.setText(hex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.widget.RemoteViews;

public class WidgetProvider extends AppWidgetProvider
Expand All @@ -25,8 +26,8 @@ public void onReceive(Context context, Intent intent)
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
common = new Common(context);
common.setAlarm("WidgetProvider");
common = new Common(context);
common.setAlarm("WidgetProvider");

final int count = appWidgetIds.length;

Expand All @@ -38,7 +39,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
RemoteViews remoteViews = common.buildUpdate(context);

Intent launchActivity = new Intent(context, SplashScreen.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, launchActivity, 0);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, launchActivity, PendingIntent.FLAG_IMMUTABLE);
remoteViews.setOnClickPendingIntent(R.id.widget, pendingIntent);
appWidgetManager.updateAppWidget(widgetId, remoteViews);
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
</cloud-backup>
</data-extraction-rules>
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.3.1'


// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -18,7 +18,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
Expand Down

0 comments on commit f70f7d2

Please sign in to comment.