Commit 35bd58dd authored by Bartek Fabiszewski's avatar Bartek Fabiszewski
Browse files

Migrate to androidx

parent 8a541a2f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,5 +40,6 @@ android {
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.preference:preference:1.1.0-alpha02'
}
+5 −4
Original line number Diff line number Diff line
@@ -11,11 +11,12 @@ package net.fabiszewski.ulogger;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.support.v7.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;

import androidx.appcompat.app.AlertDialog;

class Alert {

    /**
@@ -77,9 +78,9 @@ class Alert {
     * @param iconResource Icon resource id
     * @return AlertDialog Dialog
     */
    static AlertDialog showAlert(Context context, CharSequence title, int layoutResource, int iconResource) {
    static AlertDialog showAlert(Activity context, CharSequence title, int layoutResource, int iconResource) {
        @SuppressLint("InflateParams")
        View view = ((Activity) context).getLayoutInflater().inflate(layoutResource, null, false);
        View view = context.getLayoutInflater().inflate(layoutResource, null, false);
        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        alertDialog.setTitle(title);
        alertDialog.setView(view);
@@ -97,7 +98,7 @@ class Alert {
     * @param layoutResource Layout resource id
     * @return AlertDialog Dialog
     */
    static AlertDialog showAlert(Context context, CharSequence title, int layoutResource) {
    static AlertDialog showAlert(Activity context, CharSequence title, int layoutResource) {
        return showAlert(context, title, layoutResource, 0);
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -14,7 +14,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;

import androidx.core.content.ContextCompat;

/**
 * Receiver for boot completed broadcast
@@ -33,7 +34,7 @@ public class BootCompletedReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        boolean autoStart = prefs.getBoolean("prefAutoStart", false);
        boolean autoStart = prefs.getBoolean(SettingsActivity.KEY_AUTO_START, false);
        if (autoStart && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            DbAccess db = DbAccess.getInstance();
            db.open(context);
+2 −1
Original line number Diff line number Diff line
@@ -15,9 +15,10 @@ import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.location.Location;
import android.support.annotation.NonNull;
import android.util.Log;

import androidx.annotation.NonNull;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
+3 −2
Original line number Diff line number Diff line
@@ -15,11 +15,12 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.util.Xml;

import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;

import org.xmlpull.v1.XmlSerializer;

import java.io.File;
Loading