Updates to 2024 Google libs

This commit is contained in:
kprkpr committed 2024-04-07 14:35:44 +02:00
1 parent d96f1703ab
commit 592e96366d
25 files changed
+469 -213

No files matched your search

+5 -6
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" />
@@ -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);
@@ -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));
}
@@ -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
@@ -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:";
@@ -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" />