Updates to 2024 Google libs

This commit is contained in:
2024-04-07 14:35:44 +02:00
parent d96f1703ab
commit 592e96366d
25 changed files with 469 additions and 213 deletions

View File

@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.jkanetwork.st.calendariodefrases"
minSdkVersion 19 //KitKat
targetSdkVersion 29
versionName "1.3.3"
minSdkVersion 21
compileSdk 34
targetSdkVersion 34
versionName "1.3.5"
// Sube automáticamente la build en cada
def versionPropsFile = file('version.count')
def Properties versionProps = new Properties()
@@ -27,8 +27,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
namespace 'com.jkanetwork.st.calendariodefrases'
}
dependencies {
@@ -36,11 +35,11 @@ dependencies {
/*androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})*/
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core:1.12.0'
implementation 'com.google.android.material:material:1.11.0'
implementation 'com.github.marcohc:robotocalendarview:3.1.1'
implementation 'com.google.android.gms:play-services-ads:18.1.1'
implementation 'com.google.android.gms:play-services-ads:23.0.0'
//compile 'com.tappx.sdk.android:tappx-sdk:3.+'
//testImplementation 'junit:junit:4.12'
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jkanetwork.st.calendariodefrases">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
@@ -14,16 +13,16 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".OptsActivity" android:label="Opciones"/>
<activity android:name=".FavsActivity" android:label="Favoritos"/>
<activity android:name=".AboutOfActivity" android:label="Acerca de"/>
<activity android:name=".OptsActivity" android:label="Opciones" android:exported="false"/>
<activity android:name=".FavsActivity" android:label="Favoritos" android:exported="false"/>
<activity android:name=".AboutOfActivity" android:label="Acerca de" android:exported="false"/>
<receiver
android:name=".Alarm"
android:process=":runalarm" />

View File

@@ -36,7 +36,7 @@ public class Alarm extends BroadcastReceiver
/* Common vars for alarm config */
Intent i = new Intent(context, Alarm.class);
AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent sender = PendingIntent.getBroadcast(context, 1, i, 0);
PendingIntent sender = PendingIntent.getBroadcast(context, 1, i, PendingIntent.FLAG_IMMUTABLE);
/* Cancel alarm first */
alarmMgr.cancel(sender);

View File

@@ -12,6 +12,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Objects;
public class DatabaseHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 12;
@@ -58,7 +59,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
sentence = c.getString(0);
c.close();
} catch (Exception e) {
Log.e("Database", e.getMessage());
Log.e("Database", Objects.requireNonNull(e.getMessage()));
sentence = "";
}
return sentence;
@@ -100,10 +101,10 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
/** Returns ID from a day X sentence, if possible */
Integer getIDFraseDay(int year,int month,int dayOfMonth){
int getIDFraseDay(int year,int month,int dayOfMonth){
Calendar cal = Calendar.getInstance();
try {
Integer ret;
int ret;
SQLiteDatabase db = this.getWritableDatabase();
/* For ever have two digits month and day */
@@ -116,12 +117,12 @@ public class DatabaseHelper extends SQLiteOpenHelper {
String cMonth; /* Calendar month */
String cDay; /* Calendar day */
if ((cal.get(Calendar.MONTH)+1) < 10) {
cMonth = "0" + Integer.toString(cal.get(Calendar.MONTH)+1);
cMonth = "0" + (cal.get(Calendar.MONTH)+1);
}else{
cMonth = Integer.toString(cal.get(Calendar.MONTH)+1);
}
if (cal.get(Calendar.DAY_OF_MONTH) < 10) {
cDay = "0" + Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
cDay = "0" + (cal.get(Calendar.DAY_OF_MONTH));
}else{
cDay = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
}

View File

@@ -109,7 +109,7 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
robotoCalendarView.showDateTitle(true);
/* Admob ads */
MobileAds.initialize(getApplicationContext(), MainActivity.this.getString(R.string.admob_launch_api));
MobileAds.initialize(getApplicationContext());
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest); //request a new ad

View File

@@ -43,7 +43,7 @@ public class NotificationHelper extends Service {
nm.cancel(1); /* Cancel first */
if (conf.getNotifOn().equals(true)) { /* Only set things if notification is enabled */
Intent OpenIntent = new Intent(NotificationHelper.this, MainActivity.class);
PendingIntent notifIntent = PendingIntent.getActivity(NotificationHelper.this, 0, OpenIntent, 0);
PendingIntent notifIntent = PendingIntent.getActivity(NotificationHelper.this, 0, OpenIntent, PendingIntent.FLAG_IMMUTABLE);
CharSequence ticker = "Frase del día";
CharSequence contentTitle = "Frase de hoy:";

View File

@@ -50,6 +50,7 @@
android:layout_height="match_parent"
android:layout_marginLeft="12dp"
android:background="@drawable/star_on"
android:contentDescription="Favorite button"
android:scaleType="centerInside" />
<ImageButton
@@ -58,6 +59,7 @@
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:background="@null"
android:contentDescription="Share button"
android:paddingTop="2dp"
app:srcCompat="@android:drawable/ic_menu_share" />

View File

@@ -1,2 +1,2 @@
#Fri Aug 16 19:03:42 CEST 2019
VERSION_CODE=315
#Sun Apr 07 14:20:00 CEST 2024
VERSION_CODE=353