Skip to content

Commit

Permalink
Finished migration to androidx SharedPreferences
Browse files Browse the repository at this point in the history
  • Loading branch information
Crosswind committed Dec 12, 2023
1 parent c96406b commit 8b2a27f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.preference.PreferenceManager;

import androidx.preference.PreferenceManager;

import android.util.Log;

import java.text.ParseException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import androidx.preference.PreferenceManager;

import android.util.Log;

import org.xmlpull.v1.XmlPullParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected int getLayoutId() {

@Override
protected Toolbar getToolbar() {
return (Toolbar) findViewById(R.id.mainToolbar);
return findViewById(R.id.mainToolbar);
}

@Override
Expand All @@ -42,7 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

if (packageInfo != null) {
mVersionTextView.setText(String.format(getString(R.string.version_number), packageInfo.versionName, packageInfo.versionCode));
mVersionTextView.setText(String.format(getString(R.string.version_number), packageInfo.versionName, packageInfo.getLongVersionCode()));
} else {
mVersionTextView.setText(R.string.version_number_not_found);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;

import androidx.preference.PreferenceManager;
import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -73,7 +76,7 @@ protected SharedPreferences getSharedPreferences(Context context) {
}

protected CoordinatorLayout getCoordinatorLayout() {
return (CoordinatorLayout) activity.findViewById(R.id.welcome_coordinator);
return activity.findViewById(R.id.welcome_coordinator);
}

protected abstract String getNextButtonText();
Expand Down

0 comments on commit 8b2a27f

Please sign in to comment.