Fixes
This commit is contained in:
parent
3af5851053
commit
785f7d261b
|
|
@ -31,8 +31,8 @@ android {
|
|||
minSdkVersion 26
|
||||
//noinspection OldTargetApi
|
||||
targetSdkVersion 27
|
||||
versionCode 45409
|
||||
versionName "4.5.4.5"
|
||||
versionCode 45410
|
||||
versionName "4.5.4.6"
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
buildTypes {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,13 @@
|
|||
android:label="@string/Modules" />
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:label="@string/Settings" />
|
||||
android:label="@string/Settings">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver
|
||||
android:name=".receivers.PackageChangeReceiver"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.content.Context;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
|
|
@ -106,16 +107,23 @@ public class BaseActivity extends AppCompatActivity {
|
|||
mTheme = getTheme(this);
|
||||
}
|
||||
|
||||
public int getThemedColor(int id) {
|
||||
TypedArray typedArray = getTheme().obtainStyledAttributes(new int[]{id});
|
||||
int color = typedArray.getColor(0, 0);
|
||||
typedArray.recycle();
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
/*if (!(this instanceof MainActivity) && getWindow().getStatusBarColor() != Color.BLACK) {
|
||||
if (!(this instanceof MainActivity)) {
|
||||
if (XposedApp.getPreferences().getBoolean("transparent_status_bar", false)) {
|
||||
getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.colorActionBar));
|
||||
getWindow().setStatusBarColor(getThemedColor(R.attr.colorActionBar));
|
||||
} else {
|
||||
getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
|
||||
getWindow().setStatusBarColor(getThemedColor(R.attr.colorPrimaryDark));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!Objects.equals(mTheme, getTheme(this))) {
|
||||
recreate();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.TooltipCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
|
@ -118,7 +117,7 @@ public class BaseAdvancedInstaller extends Fragment {
|
|||
binding.warningUnofficial.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
binding.showOnXda.setOnClickListener(v -> NavUtil.startURL((AppCompatActivity) getActivity(), tab.support));
|
||||
binding.showOnXda.setOnClickListener(v -> NavUtil.startURL((BaseActivity) getActivity(), tab.support));
|
||||
binding.updateDescription.setOnClickListener(v -> new MaterialAlertDialogBuilder(Objects.requireNonNull(getContext()))
|
||||
.setTitle(R.string.changes)
|
||||
.setMessage(HtmlCompat.fromHtml(tab.description, HtmlCompat.FROM_HTML_MODE_LEGACY))
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.database.Cursor;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
|
|
@ -344,10 +343,7 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis
|
|||
txtStatus.setText(context.getString(
|
||||
R.string.download_status_installed, installedVersion));
|
||||
txtStatus.setTextColor(ContextCompat.getColor(DownloadActivity.this, R.color.warning));
|
||||
TypedArray typedArray = DownloadActivity.this.getTheme().obtainStyledAttributes(new int[]{android.R.attr.textColorHighlight});
|
||||
int textColor = typedArray.getColor(0, 0);
|
||||
typedArray.recycle();
|
||||
txtStatus.setTextColor(textColor);
|
||||
txtStatus.setTextColor(getThemedColor(android.R.attr.textColorHighlight));
|
||||
txtStatus.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
txtStatus.setVisibility(View.GONE);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
|
|
@ -52,7 +51,7 @@ public class DownloadDetailsFragment extends Fragment {
|
|||
if (module.description != null) {
|
||||
if (module.descriptionIsHtml) {
|
||||
binding.downloadDescription.setText(RepoParser.parseSimpleHtml(getActivity(), module.description, binding.downloadDescription));
|
||||
binding.downloadDescription.setTransformationMethod(new LinkTransformationMethod((AppCompatActivity) getActivity()));
|
||||
binding.downloadDescription.setTransformationMethod(new LinkTransformationMethod((BaseActivity) getActivity()));
|
||||
binding.downloadDescription.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
} else {
|
||||
binding.downloadDescription.setText(module.description);
|
||||
|
|
@ -71,7 +70,7 @@ public class DownloadDetailsFragment extends Fragment {
|
|||
final Uri link = NavUtil.parseURL(moreInfoEntry.second);
|
||||
if (link != null) {
|
||||
moreinfoBinding.message.setTextColor(moreinfoBinding.message.getLinkTextColors());
|
||||
moreinfoBinding.getRoot().setOnClickListener(v -> NavUtil.startURL((AppCompatActivity) getActivity(), link));
|
||||
moreinfoBinding.getRoot().setOnClickListener(v -> NavUtil.startURL((BaseActivity) getActivity(), link));
|
||||
}
|
||||
|
||||
binding.downloadMoreinfoContainer.addView(moreinfoBinding.getRoot());
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.ListFragment;
|
||||
|
|
@ -283,7 +282,7 @@ public class DownloadDetailsVersionsFragment extends ListFragment {
|
|||
|
||||
if (item.changelogIsHtml) {
|
||||
holder.txtChanges.setText(RepoParser.parseSimpleHtml(getActivity(), item.changelog, holder.txtChanges));
|
||||
holder.txtChanges.setTransformationMethod(new LinkTransformationMethod((AppCompatActivity) getActivity()));
|
||||
holder.txtChanges.setTransformationMethod(new LinkTransformationMethod((BaseActivity) getActivity()));
|
||||
holder.txtChanges.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
} else {
|
||||
holder.txtChanges.setText(item.changelog);
|
||||
|
|
|
|||
|
|
@ -393,21 +393,21 @@ public class SettingsActivity extends BaseActivity {
|
|||
});
|
||||
}
|
||||
|
||||
/*SwitchPreferenceCompat transparent = findPreference("transparent_status_bar");
|
||||
SwitchPreferenceCompat transparent = findPreference("transparent_status_bar");
|
||||
if (transparent != null) {
|
||||
transparent.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
Activity activity = getActivity();
|
||||
if (activity != null && activity.getWindow().getStatusBarColor() != Color.BLACK) {
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
if (activity != null) {
|
||||
if (enabled) {
|
||||
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, R.color.colorActionBar));
|
||||
activity.getWindow().setStatusBarColor(activity.getThemedColor(R.attr.colorActionBar));
|
||||
} else {
|
||||
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, R.color.colorPrimaryDark));
|
||||
activity.getWindow().setStatusBarColor(activity.getThemedColor(R.attr.colorPrimaryDark));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}*/
|
||||
}
|
||||
|
||||
Preference compat_mode = findPreference("compat_mode");
|
||||
if (compat_mode != null) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import android.app.DownloadManager;
|
|||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.meowcat.edxposed.manager.util.DownloadsUtil;
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ public class DownloadReceiver extends BroadcastReceiver {
|
|||
}
|
||||
} catch (Exception e) {//Flyme
|
||||
e.printStackTrace();
|
||||
Toast.makeText(context, "shit flyme boom", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import java.util.Objects;
|
|||
|
||||
public class DownloadsUtil {
|
||||
public static final String MIME_TYPE_APK = "application/vnd.android.package-archive";
|
||||
//private static final String MIME_TYPE_ZIP = "application/zip";
|
||||
private static final Map<String, DownloadFinishedCallback> callbacks = new HashMap<>();
|
||||
private static final SharedPreferences pref = XposedApp.getInstance().getSharedPreferences("download_cache", Context.MODE_PRIVATE);
|
||||
|
||||
|
|
@ -47,17 +46,10 @@ public class DownloadsUtil {
|
|||
Request request = new Request(Uri.parse(b.url));
|
||||
request.setTitle(b.title);
|
||||
request.setMimeType(b.mimeType.toString());
|
||||
/*if (b.mSave) {
|
||||
try {
|
||||
request.setDestinationInExternalPublicDir(savePath, b.title + b.mimeType.getExtension());
|
||||
} catch (IllegalStateException e) {
|
||||
Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else */
|
||||
request.setNotificationVisibility(Request.VISIBILITY_VISIBLE);
|
||||
File destination = new File(context.getExternalCacheDir(), "/downloads/" + b.title + b.mimeType.getExtension());
|
||||
removeAllForLocalFile(context, destination);
|
||||
request.setDestinationUri(Uri.fromFile(destination));
|
||||
request.setNotificationVisibility(Request.VISIBILITY_VISIBLE);
|
||||
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
long id = dm.enqueue(request);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@ import android.text.util.Linkify;
|
|||
|
||||
import androidx.annotation.AnyThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.browser.customtabs.CustomTabsIntent;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.meowcat.edxposed.manager.BaseActivity;
|
||||
import org.meowcat.edxposed.manager.R;
|
||||
import org.meowcat.edxposed.manager.XposedApp;
|
||||
|
||||
|
|
@ -31,14 +30,14 @@ public final class NavUtil {
|
|||
return (spans.length > 0) ? Uri.parse(spans[0].getURL()) : null;
|
||||
}
|
||||
|
||||
public static void startURL(AppCompatActivity activity, Uri uri) {
|
||||
public static void startURL(BaseActivity activity, Uri uri) {
|
||||
CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();
|
||||
customTabsIntent.setShowTitle(true);
|
||||
customTabsIntent.setToolbarColor(ContextCompat.getColor(activity, R.color.colorActionBar));
|
||||
customTabsIntent.setToolbarColor(activity.getThemedColor(R.attr.colorActionBar));
|
||||
customTabsIntent.build().launchUrl(activity, uri);
|
||||
}
|
||||
|
||||
public static void startURL(AppCompatActivity activity, String url) {
|
||||
public static void startURL(BaseActivity activity, String url) {
|
||||
startURL(activity, parseURL(url));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ package org.meowcat.edxposed.manager.util.chrome;
|
|||
import android.text.style.URLSpan;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import org.meowcat.edxposed.manager.BaseActivity;
|
||||
import org.meowcat.edxposed.manager.util.NavUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -12,9 +11,9 @@ import org.meowcat.edxposed.manager.util.NavUtil;
|
|||
*/
|
||||
public class CustomTabsURLSpan extends URLSpan {
|
||||
|
||||
private AppCompatActivity activity;
|
||||
private BaseActivity activity;
|
||||
|
||||
CustomTabsURLSpan(AppCompatActivity activity, String url) {
|
||||
CustomTabsURLSpan(BaseActivity activity, String url) {
|
||||
super(url);
|
||||
this.activity = activity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ import android.text.util.Linkify;
|
|||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import org.meowcat.edxposed.manager.BaseActivity;
|
||||
|
||||
/**
|
||||
* Created by Nikola D. on 12/23/2015.
|
||||
*/
|
||||
public class LinkTransformationMethod implements TransformationMethod {
|
||||
|
||||
private AppCompatActivity activity;
|
||||
private BaseActivity activity;
|
||||
|
||||
public LinkTransformationMethod(AppCompatActivity activity) {
|
||||
public LinkTransformationMethod(BaseActivity activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/timestamps"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -300,4 +300,5 @@
|
|||
<string name="primary_color">主要色</string>
|
||||
<string name="accent_color">强调色</string>
|
||||
<string name="colorized_action_bar">着色应用栏</string>
|
||||
<string name="settings_group_theme">主题</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -300,4 +300,5 @@
|
|||
<string name="primary_color">主要色</string>
|
||||
<string name="accent_color">強調色</string>
|
||||
<string name="colorized_action_bar">着色應用欄</string>
|
||||
<string name="settings_group_theme">主題</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -300,4 +300,5 @@
|
|||
<string name="primary_color">主要色</string>
|
||||
<string name="accent_color">強調色</string>
|
||||
<string name="colorized_action_bar">著色應用欄</string>
|
||||
<string name="settings_group_theme">主題</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<color name="warning">@color/red_500</color>
|
||||
<color name="download_status_update_available">#4CAF50</color>
|
||||
<color name="amber_500">#FFC107</color>
|
||||
<color name="navigationBarColor">@color/colorPrimary</color>
|
||||
<color name="navigationBarColor">?colorPrimary</color>
|
||||
<color name="colorStickyHeader">#eafafafa</color>
|
||||
<color name="ic_launcher_background">#35C0CA</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<resources>
|
||||
<string name="app_name">EdXposed Manager</string>
|
||||
<string name="app_name" translatable="false">EdXposed Manager</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="Activated">Activated</string>
|
||||
<string name="Inactivate">Inactivate</string>
|
||||
|
|
@ -331,4 +331,5 @@
|
|||
<string name="primary_color">Primary color</string>
|
||||
<string name="accent_color">Accent color</string>
|
||||
<string name="colorized_action_bar">Colorized action bar</string>
|
||||
<string name="settings_group_theme">Theme</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@
|
|||
<style name="ThemeOverlay" />
|
||||
|
||||
<style name="ThemeOverlay.ActionBarPrimaryColor">
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorActionBar">@color/colorPrimary</item>
|
||||
<item name="actionBarTheme">@style/ThemeOverlay.MaterialComponents.Dark.ActionBar</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
|
||||
<item name="tabLayoutTheme">@style/Widget.MaterialComponents.TabLayout.Colored</item>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--suppress ALL -->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceCategory
|
||||
android:key="group_app"
|
||||
android:title="@string/settings_group_app"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="skip_xposedminversion_check"
|
||||
android:summary="@string/skip_xposedminversion_check_summ"
|
||||
android:title="@string/skip_xposedminversion_check"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="show_modules"
|
||||
android:summary="@string/show_modules_summary"
|
||||
android:title="@string/show_modules"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<org.meowcat.edxposed.manager.widget.IntegerListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/list_sort_texts"
|
||||
android:entryValues="@array/list_sort_values"
|
||||
android:key="list_sort"
|
||||
android:summary="%s"
|
||||
android:title="@string/list_sort"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/settings_group_theme"
|
||||
app:iconSpaceReserved="false">
|
||||
<org.meowcat.edxposed.manager.widget.ThemeColorPreference
|
||||
android:defaultValue="#1976D2"
|
||||
android:dialogTitle="@string/primary_color"
|
||||
|
|
@ -29,45 +57,15 @@
|
|||
android:key="colorized_action_bar"
|
||||
android:title="@string/colorized_action_bar"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="transparent_status_bar"
|
||||
android:title="@string/transparent_status_bar"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="black_dark_theme"
|
||||
android:title="@string/pure_black_dark_theme"
|
||||
app:iconSpaceReserved="false" />
|
||||
<!--<SwitchPreferenceCompat
|
||||
android:key="transparent_status_bar"
|
||||
android:title="@string/transparent_status_bar"
|
||||
app:iconSpaceReserved="false" />-->
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="confirm_reboots"
|
||||
android:title="@string/confirm_reboots"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="skip_xposedminversion_check"
|
||||
android:summary="@string/skip_xposedminversion_check_summ"
|
||||
android:title="@string/skip_xposedminversion_check"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="show_modules"
|
||||
android:summary="@string/show_modules_summary"
|
||||
android:title="@string/show_modules"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<org.meowcat.edxposed.manager.widget.IntegerListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/list_sort_texts"
|
||||
android:entryValues="@array/list_sort_values"
|
||||
android:key="list_sort"
|
||||
android:summary="%s"
|
||||
android:title="@string/list_sort"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="group_download"
|
||||
android:title="@string/settings_group_download"
|
||||
|
|
@ -109,13 +107,6 @@
|
|||
android:title="@string/notify_module_update"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="alt_download"
|
||||
android:summary="@string/alt_download_method_summ"
|
||||
android:title="@string/alt_download_method"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="custom_list"
|
||||
|
|
|
|||
Loading…
Reference in New Issue