Skip to content

Commit

Permalink
release build: v04.01.01
Browse files Browse the repository at this point in the history
fix: remove call to method added in API 23

syntactic sugar:
  replaced:
    Fragment.getContext()
  with:
    Fragment.getActivity().getApplicationContext()
  • Loading branch information
warren-bank committed Dec 6, 2023
1 parent 47f3bce commit 44c60ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.warren_bank.webmonkey.R;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
Expand Down Expand Up @@ -55,7 +56,7 @@ private SharedPreferences getPrefs() {
}

private void updateVisibilityOf_customHomePagePref(SharedPreferences prefs) {
String pref_value = SettingsUtils.getUnresolvedHomePageValue(getContext(), prefs);
String pref_value = SettingsUtils.getUnresolvedHomePageValue(getApplicationContext(), prefs);

if (pref_value.equals(getString(R.string.pref_custom_homepage_key))) {
// ensure that Custom URL text preference is: visible
Expand All @@ -76,7 +77,7 @@ private void updateVisibilityOf_customHomePagePref(SharedPreferences prefs) {
}

private void updateVisibilityOf_customUserAgentPref(SharedPreferences prefs) {
String pref_value = SettingsUtils.getUnresolvedUserAgentValue(getContext(), prefs);
String pref_value = SettingsUtils.getUnresolvedUserAgentValue(getApplicationContext(), prefs);

if (pref_value.equals(getString(R.string.pref_custom_useragent_key))) {
// ensure that Custom User Agent text preference is: visible
Expand All @@ -96,6 +97,10 @@ private void updateVisibilityOf_customUserAgentPref(SharedPreferences prefs) {
}
}

private Context getApplicationContext() {
return getActivity().getApplicationContext();
}

// -------------------------------------------------------
// implementation:
// SharedPreferences.OnSharedPreferenceChangeListener
Expand Down
4 changes: 2 additions & 2 deletions android-studio-project/constants.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project.ext {
releaseVersionCode = Integer.parseInt("004010011", 10) //Integer.MAX_VALUE == 2147483647
releaseVersion = '004.01.00-11API'
releaseVersionCode = Integer.parseInt("004010111", 10) //Integer.MAX_VALUE == 2147483647
releaseVersion = '004.01.01-11API'
javaVersion = JavaVersion.VERSION_1_8
minSdkVersion = 11
targetSdkVersion = 33
Expand Down

0 comments on commit 44c60ef

Please sign in to comment.