[app] Use rikka's libraries
This commit is contained in:
parent
905f54d0fa
commit
e39c99844b
|
|
@ -61,9 +61,10 @@ android {
|
|||
dependencies {
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
|
||||
implementation "androidx.activity:activity:1.3.0-alpha02"
|
||||
implementation 'androidx.browser:browser:1.3.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation "androidx.fragment:fragment:1.3.0"
|
||||
implementation "androidx.recyclerview:recyclerview:1.1.0"
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
implementation 'com.caverock:androidsvg-aar:1.4'
|
||||
|
|
@ -84,8 +85,12 @@ dependencies {
|
|||
implementation "io.noties.markwon:html:$markwon_version"
|
||||
implementation "io.noties.markwon:image-glide:$markwon_version"
|
||||
implementation "io.noties.markwon:linkify:$markwon_version"
|
||||
implementation "rikka.appcompat:appcompat:1.2.0-rc01"
|
||||
implementation "rikka.core:core:1.3.0"
|
||||
implementation 'rikka.insets:insets:1.0.1'
|
||||
implementation 'rikka.material:material:1.6.0'
|
||||
implementation 'rikka.recyclerview:recyclerview-utils:1.2.0'
|
||||
implementation "rikka.widget:borderview:1.0.0"
|
||||
implementation "rikka.widget:switchbar:1.0.2"
|
||||
implementation 'rikka.layoutinflater:layoutinflater:1.0.1'
|
||||
implementation 'tech.rectifier.preferencex-android:preferencex-simplemenu:88f93154b2'
|
||||
|
|
@ -98,4 +103,5 @@ dependencies {
|
|||
configurations {
|
||||
cleanedAnnotations
|
||||
compile.exclude group: 'org.jetbrains' , module:'annotations'
|
||||
compile.exclude group: 'androidx.appcompat', module: 'appcompat'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import io.github.lsposed.manager.ui.activity.CrashReportActivity;
|
|||
import io.github.lsposed.manager.util.DoHDNS;
|
||||
import okhttp3.Cache;
|
||||
import okhttp3.OkHttpClient;
|
||||
import rikka.material.app.DayNightDelegate;
|
||||
|
||||
public class App extends Application {
|
||||
public static final String TAG = "LSPosedManager";
|
||||
|
|
@ -71,6 +72,8 @@ public class App extends Application {
|
|||
instance = this;
|
||||
|
||||
pref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
DayNightDelegate.setApplicationContext(this);
|
||||
DayNightDelegate.setDefaultNightMode(pref.getInt("theme", -1));
|
||||
RepoLoader.getInstance().loadRemoteData();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import android.os.Bundle;
|
|||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.databinding.ActivityAboutBinding;
|
||||
|
|
@ -15,7 +14,6 @@ public class AboutActivity extends BaseActivity {
|
|||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityAboutBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
|
|
|||
|
|
@ -35,12 +35,6 @@ public class AppListActivity extends BaseActivity {
|
|||
|
||||
private SearchView.OnQueryTextListener searchListener;
|
||||
private ActivityAppListBinding binding;
|
||||
private final Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
binding.swipeRefreshLayout.setRefreshing(true);
|
||||
}
|
||||
};
|
||||
private final Handler handler = new Handler(Looper.getMainLooper());
|
||||
public ActivityResultLauncher<String> backupLauncher;
|
||||
public ActivityResultLauncher<String[]> restoreLauncher;
|
||||
|
|
@ -52,9 +46,9 @@ public class AppListActivity extends BaseActivity {
|
|||
String moduleName = getIntent().getStringExtra("moduleName");
|
||||
binding = ActivityAppListBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.appBar.setRaised(true);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
binding.appBar.setLiftOnScroll(false);
|
||||
ActionBar bar = getSupportActionBar();
|
||||
assert bar != null;
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
|
|
@ -65,15 +59,12 @@ public class AppListActivity extends BaseActivity {
|
|||
binding.recyclerView.setAdapter(scopeAdapter);
|
||||
binding.recyclerView.setHasFixedSize(true);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||
RecyclerViewKt.addFastScroller(binding.recyclerView, binding.swipeRefreshLayout);
|
||||
RecyclerViewKt.fixEdgeEffect(binding.recyclerView, false, true);
|
||||
if (!preferences.getBoolean("md2", true)) {
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||
DividerItemDecoration.VERTICAL);
|
||||
binding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
}
|
||||
handler.postDelayed(runnable, 300);
|
||||
binding.swipeRefreshLayout.setOnRefreshListener(scopeAdapter::refresh);
|
||||
|
||||
searchListener = new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
|
|
@ -161,8 +152,6 @@ public class AppListActivity extends BaseActivity {
|
|||
}
|
||||
|
||||
public void onDataReady() {
|
||||
handler.removeCallbacks(runnable);
|
||||
binding.swipeRefreshLayout.setRefreshing(false);
|
||||
String queryStr = searchView != null ? searchView.getQuery().toString() : "";
|
||||
runOnUiThread(() -> scopeAdapter.getFilter().filter(queryStr));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,10 @@ import android.content.res.Configuration;
|
|||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
|
@ -24,11 +22,11 @@ import io.github.lsposed.manager.Constants;
|
|||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.util.CustomThemeColor;
|
||||
import io.github.lsposed.manager.util.CustomThemeColors;
|
||||
import io.github.lsposed.manager.util.InsetsViewInflater;
|
||||
import io.github.lsposed.manager.util.NavUtil;
|
||||
import io.github.lsposed.manager.util.Version;
|
||||
import rikka.material.app.MaterialActivity;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
public class BaseActivity extends MaterialActivity {
|
||||
|
||||
private static final String THEME_DEFAULT = "DEFAULT";
|
||||
private static final String THEME_BLACK = "BLACK";
|
||||
|
|
@ -43,9 +41,6 @@ public class BaseActivity extends AppCompatActivity {
|
|||
return preferences.getBoolean("black_dark_theme", false);
|
||||
}
|
||||
|
||||
private void onInstallViewFactory(LayoutInflater layoutInflater) {
|
||||
layoutInflater.setFactory2(new InsetsViewInflater(getDelegate()));
|
||||
}
|
||||
|
||||
public String getTheme(Context context) {
|
||||
if (isBlackNightTheme()
|
||||
|
|
@ -61,9 +56,6 @@ public class BaseActivity extends AppCompatActivity {
|
|||
|
||||
@StyleRes
|
||||
public int getThemeStyleRes(Context context) {
|
||||
if (this instanceof AboutActivity) {
|
||||
return R.style.ThemeOverlay_Black;
|
||||
}
|
||||
switch (getTheme(context)) {
|
||||
case THEME_BLACK:
|
||||
return R.style.ThemeOverlay_Black;
|
||||
|
|
@ -98,9 +90,7 @@ public class BaseActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
onInstallViewFactory(LayoutInflater.from(this));
|
||||
super.onCreate(savedInstanceState);
|
||||
AppCompatDelegate.setDefaultNightMode(preferences.getInt("theme", -1));
|
||||
theme = getTheme(this) + getCustomTheme() + preferences.getBoolean("md2", true);
|
||||
|
||||
// make sure the versions are consistent
|
||||
|
|
@ -131,22 +121,14 @@ public class BaseActivity extends AppCompatActivity {
|
|||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (!(this instanceof MainActivity)) {
|
||||
if (preferences.getBoolean("transparent_status_bar", false)) {
|
||||
getWindow().setStatusBarColor(getThemedColor(R.attr.colorActionBar));
|
||||
} else {
|
||||
getWindow().setStatusBarColor(getThemedColor(R.attr.colorPrimaryDark));
|
||||
}
|
||||
} else {
|
||||
getWindow().setStatusBarColor(0);
|
||||
}
|
||||
getWindow().setStatusBarColor(0);
|
||||
if (!Objects.equals(theme, getTheme(this) + getCustomTheme() + preferences.getBoolean("md2", true))) {
|
||||
recreate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
|
||||
protected void onApplyThemeResource(@NonNull Resources.Theme theme, int resid, boolean first) {
|
||||
// apply real style and our custom style
|
||||
if (getParent() == null) {
|
||||
theme.applyStyle(resid, true);
|
||||
|
|
|
|||
|
|
@ -69,13 +69,14 @@ public class LogsActivity extends BaseActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityLogsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> finish());
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.getRoot().bringChildToFront(binding.appBar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> binding.appBar.setRaised(!top));
|
||||
ActionBar bar = getSupportActionBar();
|
||||
if (bar != null) {
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
if (!preferences.getBoolean("hide_logcat_warning", false)) {
|
||||
DialogInstallWarningBinding binding = DialogInstallWarningBinding.inflate(getLayoutInflater());
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
|
|
@ -97,9 +98,11 @@ public class LogsActivity extends BaseActivity {
|
|||
try {
|
||||
if (Files.readAllBytes(Paths.get(Constants.getMiscDir(), "disable_verbose_log"))[0] == 49) {
|
||||
binding.slidingTabs.setVisibility(View.GONE);
|
||||
} else {
|
||||
RecyclerViewKt.addVerticalPadding(binding.recyclerView, 48, 0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
binding.slidingTabs.setVisibility(View.GONE);
|
||||
}
|
||||
binding.slidingTabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import java.util.List;
|
|||
import io.github.lsposed.manager.Constants;
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.adapters.AppHelper;
|
||||
import io.github.lsposed.manager.databinding.ActivityAppListBinding;
|
||||
import io.github.lsposed.manager.databinding.ActivityListBinding;
|
||||
import io.github.lsposed.manager.util.GlideApp;
|
||||
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
||||
import io.github.lsposed.manager.util.ModuleUtil;
|
||||
|
|
@ -54,7 +54,7 @@ import static android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
|
|||
|
||||
public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleListener {
|
||||
|
||||
ActivityAppListBinding binding;
|
||||
ActivityListBinding binding;
|
||||
private SearchView searchView;
|
||||
private SearchView.OnQueryTextListener mSearchListener;
|
||||
private PackageManager pm;
|
||||
|
|
@ -65,12 +65,12 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityAppListBinding.inflate(getLayoutInflater());
|
||||
binding = ActivityListBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.getRoot().bringChildToFront(binding.appBar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
binding.appBar.setLiftOnScrollTargetViewId(R.id.recyclerView);
|
||||
binding.masterSwitch.setVisibility(View.GONE);
|
||||
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> binding.appBar.setRaised(!top));
|
||||
ActionBar bar = getSupportActionBar();
|
||||
if (bar != null) {
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
|
|
@ -83,14 +83,14 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
|
|||
binding.recyclerView.setAdapter(adapter);
|
||||
binding.recyclerView.setHasFixedSize(true);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||
RecyclerViewKt.addFastScroller(binding.recyclerView, binding.swipeRefreshLayout);
|
||||
//RecyclerViewKt.addFastScroller(binding.recyclerView, binding.swipeRefreshLayout);
|
||||
RecyclerViewKt.fixEdgeEffect(binding.recyclerView, false, true);
|
||||
if (!preferences.getBoolean("md2", true)) {
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||
DividerItemDecoration.VERTICAL);
|
||||
binding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
}
|
||||
binding.swipeRefreshLayout.setOnRefreshListener(() -> adapter.refresh(true));
|
||||
//binding.swipeRefreshLayout.setOnRefreshListener(() -> adapter.refresh(true));
|
||||
mSearchListener = new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
|
|
@ -310,7 +310,7 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
|
|||
}
|
||||
});
|
||||
showList = fullList;
|
||||
binding.swipeRefreshLayout.setRefreshing(false);
|
||||
//binding.swipeRefreshLayout.setRefreshing(false);
|
||||
String queryStr = searchView != null ? searchView.getQuery().toString() : "";
|
||||
runOnUiThread(() -> getFilter().filter(queryStr));
|
||||
moduleUtil.updateModulesList();
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.databinding.ActivityAppListBinding;
|
||||
import io.github.lsposed.manager.databinding.ActivityListBinding;
|
||||
import io.github.lsposed.manager.repo.RepoLoader;
|
||||
import io.github.lsposed.manager.repo.model.OnlineModule;
|
||||
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
||||
|
|
@ -56,18 +56,18 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
|
|||
private final RepoLoader repoLoader = RepoLoader.getInstance();
|
||||
private SearchView searchView;
|
||||
private SearchView.OnQueryTextListener searchListener;
|
||||
private ActivityAppListBinding binding;
|
||||
private ActivityListBinding binding;
|
||||
private RepoAdapter adapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityAppListBinding.inflate(getLayoutInflater());
|
||||
binding = ActivityListBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.getRoot().bringChildToFront(binding.appBar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
binding.appBar.setLiftOnScrollTargetViewId(R.id.recyclerView);
|
||||
binding.masterSwitch.setVisibility(View.GONE);
|
||||
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> binding.appBar.setRaised(!top));
|
||||
ActionBar bar = getSupportActionBar();
|
||||
assert bar != null;
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
|
|
@ -76,7 +76,6 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
|
|||
binding.recyclerView.setAdapter(adapter);
|
||||
binding.recyclerView.setHasFixedSize(true);
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||
RecyclerViewKt.addFastScroller(binding.recyclerView, binding.swipeRefreshLayout);
|
||||
RecyclerViewKt.fixEdgeEffect(binding.recyclerView, false, true);
|
||||
if (!preferences.getBoolean("md2", true)) {
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||
|
|
@ -84,7 +83,6 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
|
|||
binding.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
}
|
||||
repoLoader.addListener(this);
|
||||
binding.swipeRefreshLayout.setOnRefreshListener(repoLoader::loadRemoteData);
|
||||
searchListener = new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
|
|
@ -114,10 +112,7 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
|
|||
|
||||
@Override
|
||||
public void repoLoaded() {
|
||||
runOnUiThread(() -> {
|
||||
binding.swipeRefreshLayout.setRefreshing(false);
|
||||
adapter.setData(repoLoader.getOnlineModules());
|
||||
});
|
||||
runOnUiThread(() -> adapter.setData(repoLoader.getOnlineModules()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -178,7 +173,7 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
|
|||
public void initData() {
|
||||
Collection<OnlineModule> modules = repoLoader.getOnlineModules();
|
||||
if (!repoLoader.isRepoLoaded()) {
|
||||
binding.swipeRefreshLayout.setRefreshing(true);
|
||||
//binding.swipeRefreshLayout.setRefreshing(true);
|
||||
repoLoader.loadRemoteData();
|
||||
} else {
|
||||
adapter.setData(modules);
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ import io.noties.markwon.image.glide.GlideImagesPlugin;
|
|||
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||
import io.noties.markwon.utils.NoCopySpannableFactory;
|
||||
import rikka.recyclerview.RecyclerViewKt;
|
||||
import rikka.widget.borderview.BorderNestedScrollView;
|
||||
import rikka.widget.borderview.BorderRecyclerView;
|
||||
import rikka.widget.borderview.BorderViewDelegate;
|
||||
|
||||
public class RepoItemActivity extends BaseActivity {
|
||||
ActivityModuleDetailBinding binding;
|
||||
|
|
@ -86,7 +89,8 @@ public class RepoItemActivity extends BaseActivity {
|
|||
String modulePackageName = getIntent().getStringExtra("modulePackageName");
|
||||
String moduleName = getIntent().getStringExtra("moduleName");
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.getRoot().bringChildToFront(binding.appBar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
ActionBar bar = getSupportActionBar();
|
||||
assert bar != null;
|
||||
|
|
@ -107,11 +111,15 @@ public class RepoItemActivity extends BaseActivity {
|
|||
binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
BorderViewDelegate delegate;
|
||||
if (position == 0) {
|
||||
binding.appBar.setLiftOnScrollTargetViewId(R.id.scrollView);
|
||||
BorderNestedScrollView borderNestedScrollView = findViewById(R.id.scrollView);
|
||||
delegate = borderNestedScrollView.getBorderViewDelegate();
|
||||
} else {
|
||||
binding.appBar.setLiftOnScrollTargetViewId(R.id.recyclerView);
|
||||
BorderRecyclerView borderRecyclerView = findViewById(R.id.recyclerView);
|
||||
delegate = borderRecyclerView.getBorderViewDelegate();
|
||||
}
|
||||
binding.appBar.setRaised(!delegate.isShowingTopBorder());
|
||||
}
|
||||
});
|
||||
int[] titles = new int[]{R.string.module_readme, R.string.module_releases, R.string.module_information};
|
||||
|
|
@ -302,6 +310,7 @@ public class RepoItemActivity extends BaseActivity {
|
|||
switch (position) {
|
||||
case 0:
|
||||
holder.textView.setTransformationMethod(new LinkTransformationMethod(RepoItemActivity.this));
|
||||
holder.scrollView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> binding.appBar.setRaised(!top));
|
||||
markwon.setMarkdown(holder.textView, module.getReadme());
|
||||
break;
|
||||
case 1:
|
||||
|
|
@ -312,6 +321,7 @@ public class RepoItemActivity extends BaseActivity {
|
|||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(RepoItemActivity.this, DividerItemDecoration.VERTICAL);
|
||||
holder.recyclerView.addItemDecoration(dividerItemDecoration);
|
||||
}
|
||||
holder.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> binding.appBar.setRaised(!top));
|
||||
RecyclerViewKt.fixEdgeEffect(holder.recyclerView, false, true);
|
||||
RecyclerViewKt.addFastScroller(holder.recyclerView, holder.itemView);
|
||||
break;
|
||||
|
|
@ -330,12 +340,14 @@ public class RepoItemActivity extends BaseActivity {
|
|||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView textView;
|
||||
RecyclerView recyclerView;
|
||||
BorderNestedScrollView scrollView;
|
||||
BorderRecyclerView recyclerView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView, int viewType) {
|
||||
super(itemView);
|
||||
if (viewType == 0) {
|
||||
textView = itemView.findViewById(R.id.readme);
|
||||
scrollView = itemView.findViewById(R.id.scrollView);
|
||||
} else {
|
||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,27 +4,21 @@ import android.annotation.SuppressLint;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.SwitchPreferenceCompat;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
|
@ -46,7 +40,9 @@ import io.github.lsposed.manager.databinding.ActivitySettingsBinding;
|
|||
import io.github.lsposed.manager.ui.fragment.StatusDialogBuilder;
|
||||
import io.github.lsposed.manager.ui.widget.IntegerListPreference;
|
||||
import io.github.lsposed.manager.util.BackupUtils;
|
||||
import rikka.material.app.DayNightDelegate;
|
||||
import rikka.recyclerview.RecyclerViewKt;
|
||||
import rikka.widget.borderview.BorderRecyclerView;
|
||||
|
||||
public class SettingsActivity extends BaseActivity {
|
||||
private static final String KEY_PREFIX = SettingsActivity.class.getName() + '.';
|
||||
|
|
@ -73,7 +69,8 @@ public class SettingsActivity extends BaseActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
binding = ActivitySettingsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
setAppBar(binding.appBar, binding.toolbar);
|
||||
binding.getRoot().bringChildToFront(binding.appBar);
|
||||
binding.toolbar.setNavigationOnClickListener(view -> finish());
|
||||
ActionBar bar = getSupportActionBar();
|
||||
if (bar != null) {
|
||||
|
|
@ -187,7 +184,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
addPreferencesFromResource(R.xml.prefs);
|
||||
|
||||
boolean installed = Constants.getXposedVersion() != null;
|
||||
SwitchPreferenceCompat prefVerboseLogs = findPreference("disable_verbose_log");
|
||||
SwitchPreference prefVerboseLogs = findPreference("disable_verbose_log");
|
||||
if (prefVerboseLogs != null) {
|
||||
if (requireActivity().getApplicationInfo().uid / 100000 != 0) {
|
||||
prefVerboseLogs.setVisible(false);
|
||||
|
|
@ -211,7 +208,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
SwitchPreferenceCompat prefEnableResources = findPreference("enable_resources");
|
||||
SwitchPreference prefEnableResources = findPreference("enable_resources");
|
||||
if (prefEnableResources != null) {
|
||||
prefEnableResources.setEnabled(installed);
|
||||
prefEnableResources.setChecked(Files.exists(enableResourcesFlag));
|
||||
|
|
@ -265,7 +262,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
});
|
||||
}
|
||||
|
||||
SwitchPreferenceCompat transparent = findPreference("transparent_status_bar");
|
||||
SwitchPreference transparent = findPreference("transparent_status_bar");
|
||||
if (transparent != null) {
|
||||
transparent.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
|
|
@ -284,12 +281,18 @@ public class SettingsActivity extends BaseActivity {
|
|||
IntegerListPreference theme = findPreference("theme");
|
||||
if (theme != null) {
|
||||
theme.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
AppCompatDelegate.setDefaultNightMode(Integer.parseInt((String) newValue));
|
||||
if (preferences.getInt("theme", -1) != Integer.parseInt((String) newValue)) {
|
||||
DayNightDelegate.setDefaultNightMode(Integer.parseInt((String) newValue));
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
if (activity != null) {
|
||||
activity.restart();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
SwitchPreferenceCompat black_dark_theme = findPreference("black_dark_theme");
|
||||
SwitchPreference black_dark_theme = findPreference("black_dark_theme");
|
||||
if (black_dark_theme != null) {
|
||||
black_dark_theme.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
|
|
@ -333,7 +336,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
});
|
||||
}
|
||||
|
||||
SwitchPreferenceCompat md2 = findPreference("md2");
|
||||
SwitchPreference md2 = findPreference("md2");
|
||||
if (md2 != null) {
|
||||
md2.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
|
|
@ -383,18 +386,16 @@ public class SettingsActivity extends BaseActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
RecyclerView recyclerView = getListView();
|
||||
recyclerView.setClipToPadding(false);
|
||||
RecyclerViewKt.fixEdgeEffect(recyclerView, false, true);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(recyclerView, (v, insets) -> {
|
||||
Insets insets1 = insets.getInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime());
|
||||
v.setPadding(0, 0, 0, insets1.bottom);
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
|
||||
BorderRecyclerView recyclerView = (BorderRecyclerView) super.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
||||
RecyclerViewKt.fixEdgeEffect(recyclerView, false, true);
|
||||
recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> {
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
if (activity != null) {
|
||||
activity.binding.appBar.setRaised(!top);
|
||||
}
|
||||
});
|
||||
return recyclerView;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,38 +10,40 @@ public class Version implements Comparable<Version> {
|
|||
}
|
||||
|
||||
public Version(String version) {
|
||||
if(version == null)
|
||||
if (version == null)
|
||||
throw new IllegalArgumentException("Version can not be null");
|
||||
if(!version.matches("v[0-9]+(\\.[0-9]+)*"))
|
||||
if (!version.matches("v[0-9]+(\\.[0-9]+)*"))
|
||||
throw new IllegalArgumentException("Invalid version format");
|
||||
this.version = version.substring(1); // v
|
||||
}
|
||||
|
||||
@Override public int compareTo(Version that) {
|
||||
if(that == null)
|
||||
@Override
|
||||
public int compareTo(Version that) {
|
||||
if (that == null)
|
||||
return 1;
|
||||
String[] thisParts = this.get().split("\\.");
|
||||
String[] thatParts = that.get().split("\\.");
|
||||
int length = Math.max(thisParts.length, thatParts.length);
|
||||
for(int i = 0; i < length; i++) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
int thisPart = i < thisParts.length ?
|
||||
Integer.parseInt(thisParts[i]) : 0;
|
||||
int thatPart = i < thatParts.length ?
|
||||
Integer.parseInt(thatParts[i]) : 0;
|
||||
if(thisPart < thatPart)
|
||||
if (thisPart < thatPart)
|
||||
return -1;
|
||||
if(thisPart > thatPart)
|
||||
if (thisPart > thatPart)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object that) {
|
||||
if(this == that)
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that)
|
||||
return true;
|
||||
if(that == null)
|
||||
if (that == null)
|
||||
return false;
|
||||
if(this.getClass() != that.getClass())
|
||||
if (this.getClass() != that.getClass())
|
||||
return false;
|
||||
return this.compareTo((Version) that) == 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ This file is part of LSPosed.
|
||||
~
|
||||
~ LSPosed is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ LSPosed is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
||||
~
|
||||
~ Copyright (C) 2020 EdXposed Contributors
|
||||
~ Copyright (C) 2021 LSPosed Contributors
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item app:state_raised="true">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:propertyName="alpha"
|
||||
android:valueTo="0.9"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</item>
|
||||
<item>
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:propertyName="alpha"
|
||||
android:valueTo="1"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</item>
|
||||
</selector>
|
||||
|
|
@ -3,7 +3,8 @@
|
|||
android:width="24.0dip"
|
||||
android:height="24.0dip"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" />
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@
|
|||
android:viewportHeight="240"
|
||||
android:viewportWidth="240"
|
||||
android:width="24dp"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:tint="?colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M120.062,120.062m-120.062,0a120.062,120.062 135,1 1,240.124 0a120.062,120.062 45,1 1,-240.124 0" />
|
||||
<path
|
||||
android:fillColor="@android:color/black"
|
||||
android:pathData="M165.866,71.135s12.492,-4.858 11.451,6.94c-0.347,4.858 -3.47,21.861 -5.899,40.252L163.09,172.806s-0.694,7.981 -6.94,9.369c-6.246,1.388 -15.615,-4.858 -17.35,-6.246 -1.388,-1.041 -26.025,-16.656 -34.7,-24.29 -2.429,-2.082 -5.205,-6.246 0.347,-11.104l36.435,-34.7c4.164,-4.164 8.328,-13.88 -9.022,-2.082l-48.58,32.965s-5.552,3.47 -15.962,0.347l-22.555,-6.94s-8.328,-5.205 5.899,-10.41c34.7,-16.309 77.381,-32.965 115.204,-48.58z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -38,38 +38,45 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:padding="20dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="#000"
|
||||
app:cardCornerRadius="0dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="48sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:textStyle="bold"
|
||||
android:text="LS" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:background="@drawable/ph_drawable"
|
||||
android:paddingVertical="7dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:padding="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textColor="#fff"
|
||||
android:textSize="48sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:textStyle="bold"
|
||||
android:text="Posed" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
android:text="LS" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:background="@drawable/ph_drawable"
|
||||
android:paddingVertical="7dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold"
|
||||
android:text="Posed" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -93,6 +100,8 @@
|
|||
<ImageView
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
app:srcCompat="@drawable/ic_telegram_2019_logo" />
|
||||
|
||||
<TextView
|
||||
|
|
@ -120,8 +129,7 @@
|
|||
<ImageView
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
app:tint="?colorControlNormal"
|
||||
app:srcCompat="@drawable/ic_github" />
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -1,34 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ This file is part of LSPosed.
|
||||
~
|
||||
~ LSPosed is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ LSPosed is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
||||
~
|
||||
~ Copyright (C) 2020 EdXposed Contributors
|
||||
~ Copyright (C) 2021 LSPosed Contributors
|
||||
-->
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/snackbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:consumeSystemWindowsInsets="top|start|end"
|
||||
app:consumeSystemWindowsInsets="start|end"
|
||||
app:edgeToEdge="true"
|
||||
app:fitSystemWindowsInsets="top|start|end">
|
||||
app:fitSystemWindowsInsets="start|end">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
<rikka.material.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
style="?appBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?actionBarTheme"
|
||||
android:elevation="4dp">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:subtitleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle"
|
||||
app:titleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Title"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</rikka.material.widget.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="?actionBarSize"
|
||||
app:fitSystemWindowsInsets="top"
|
||||
tools:ignore="MissingPrefix">
|
||||
|
||||
<rikka.widget.switchbar.SwitchBar
|
||||
android:id="@+id/master_switch"
|
||||
|
|
@ -37,19 +61,14 @@
|
|||
app:switchOnText="@string/enable_module"
|
||||
app:switchOffText="@string/enable_module" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
<rikka.widget.borderview.BorderRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
app:fitSystemWindowsInsets="bottom" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
android:clipToPadding="false"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderBottomVisibility="never"
|
||||
app:fitSystemWindowsInsets="bottom" />
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ This file is part of LSPosed.
|
||||
~
|
||||
~ LSPosed is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ LSPosed is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
||||
~
|
||||
~ Copyright (C) 2020 EdXposed Contributors
|
||||
~ Copyright (C) 2021 LSPosed Contributors
|
||||
-->
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/snackbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:consumeSystemWindowsInsets="start|end"
|
||||
app:edgeToEdge="true"
|
||||
app:fitSystemWindowsInsets="start|end">
|
||||
|
||||
<rikka.material.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
style="?appBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:subtitleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle"
|
||||
app:titleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Title"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
|
||||
</rikka.material.widget.AppBarLayout>
|
||||
|
||||
<rikka.widget.borderview.BorderRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="?actionBarSize"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderBottomVisibility="never"
|
||||
app:fitSystemWindowsInsets="top|bottom" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -4,55 +4,67 @@
|
|||
android:id="@+id/snackbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:consumeSystemWindowsInsets="top|start|end"
|
||||
app:consumeSystemWindowsInsets="start|end"
|
||||
app:edgeToEdge="true"
|
||||
app:fitSystemWindowsInsets="top|start|end">
|
||||
app:fitSystemWindowsInsets="start|end">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
<rikka.material.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
style="?appBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?actionBarTheme">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/sliding_tabs"
|
||||
style="?tabLayoutTheme"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?colorActionBar"
|
||||
app:tabMode="fixed">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:subtitleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle"
|
||||
app:titleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Title"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nav_item_logs_err" />
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/tab_layout_height"
|
||||
android:background="?colorActionBar"
|
||||
app:tabMode="fixed"
|
||||
style="?tabLayoutTheme">
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nav_item_logs" />
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nav_item_logs_err" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nav_item_logs" />
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
</LinearLayout>
|
||||
</rikka.material.widget.AppBarLayout>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/horizontalScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:scrollbars="none">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<rikka.widget.borderview.BorderRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:clipToPadding="false"
|
||||
app:fitSystemWindowsInsets="bottom" />
|
||||
android:paddingTop="?actionBarSize"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderBottomVisibility="never"
|
||||
app:fitSystemWindowsInsets="top|bottom" />
|
||||
</HorizontalScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -22,46 +22,42 @@
|
|||
android:id="@+id/snackbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:consumeSystemWindowsInsets="top|start|end"
|
||||
app:consumeSystemWindowsInsets="start|end"
|
||||
app:edgeToEdge="true"
|
||||
app:fitSystemWindowsInsets="top|start|end">
|
||||
app:fitSystemWindowsInsets="start|end">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
<rikka.material.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
style="?appBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?actionBarTheme"
|
||||
android:elevation="4dp">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?colorActionBar"
|
||||
style="?tabLayoutTheme">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:subtitleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle"
|
||||
app:titleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Title"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/tab_layout_height"
|
||||
android:background="?colorActionBar"
|
||||
style="?tabLayoutTheme" />
|
||||
</LinearLayout>
|
||||
</rikka.material.widget.AppBarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.viewpager2.widget.ViewPager2>
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -4,27 +4,31 @@
|
|||
android:id="@+id/snackbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:consumeSystemWindowsInsets="top|start|end"
|
||||
app:consumeSystemWindowsInsets="start|end"
|
||||
app:edgeToEdge="true"
|
||||
app:fitSystemWindowsInsets="top|start|end">
|
||||
app:fitSystemWindowsInsets="start|end">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
<rikka.material.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
style="?appBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?actionBarTheme">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?colorActionBar"
|
||||
app:subtitleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle"
|
||||
app:titleTextAppearance="@android:style/TextAppearance.Material.Widget.Toolbar.Title"
|
||||
app:popupTheme="?actionBarPopupTheme" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</rikka.material.widget.AppBarLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -24,17 +24,21 @@
|
|||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false"
|
||||
app:fitSystemWindowsInsets="bottom">
|
||||
android:paddingTop="104dp"
|
||||
app:fitSystemWindowsInsets="top|bottom">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<rikka.widget.borderview.BorderNestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderBottomVisibility="never">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/readme"
|
||||
android:padding="16dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</rikka.widget.borderview.BorderNestedScrollView>
|
||||
</FrameLayout>
|
||||
|
|
@ -18,10 +18,14 @@
|
|||
~ Copyright (C) 2021 LSPosed Contributors
|
||||
-->
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<rikka.widget.borderview.BorderRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
app:fitSystemWindowsInsets="bottom" />
|
||||
android:paddingTop="104dp"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderBottomVisibility="never"
|
||||
app:fitSystemWindowsInsets="top|bottom" />
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ This file is part of LSPosed.
|
||||
~
|
||||
~ LSPosed is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ LSPosed is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
||||
~
|
||||
~ Copyright (C) 2020 EdXposed Contributors
|
||||
~ Copyright (C) 2021 LSPosed Contributors
|
||||
-->
|
||||
|
||||
<rikka.widget.borderview.BorderRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:fadeScrollbars="true"
|
||||
android:paddingTop="?actionBarSize"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbars="vertical"
|
||||
app:borderBottomVisibility="never"
|
||||
app:borderTopDrawable="@null"
|
||||
app:borderTopVisibility="whenTop"
|
||||
app:fitSystemWindowsInsets="bottom|top"
|
||||
tools:ignore="UnusedResources"
|
||||
tools:viewBindingIgnore="true" />
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
<resources>
|
||||
<dimen name="app_icon_size">48dp</dimen>\
|
||||
<dimen name="app_icon_size">48dp</dimen>
|
||||
<dimen name="tab_layout_height">48dp</dimen>
|
||||
</resources>
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="colorActionBar">@color/colorActionBar</item>
|
||||
<item name="actionBarTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
|
||||
<item name="android:colorBackground">@color/colorBackground</item>
|
||||
<item name="android:windowBackground">@color/colorBackground</item>
|
||||
<item name="listItemBackground">?selectableItemBackground</item>
|
||||
|
|
@ -25,6 +24,38 @@
|
|||
<item name="switchBarTheme">@style/ThemeOverlay.SwitchBar</item>
|
||||
<item name="switchBarBackgroundNormal">@color/switchbar_background_light</item>
|
||||
<item name="switchBarBackgroundDisabled">@color/switchbar_background_light</item>
|
||||
<item name="actionBarStyle">@style/Widget.Material.ActionBar.Surface</item>
|
||||
<item name="actionBarTheme">@style/ThemeOverlay.ActionBar</item>
|
||||
<item name="toolbarStyle">@style/Widget.Material.Toolbar</item>
|
||||
<item name="appBarStyle">@style/Widget.AppBar.Surface.Raisable</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.AppBar" parent="">
|
||||
<item name="android:background">?toolbarColor</item>
|
||||
<item name="android:theme">?actionBarTheme</item>
|
||||
<item name="android:stateListAnimator">@animator/raise_animator</item>
|
||||
<item name="android:elevation">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Material.Toolbar" parent="Widget.MaterialComponents.Toolbar">
|
||||
<item name="android:background">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.AppBar.Surface">
|
||||
<item name="android:background">?android:colorBackground</item>
|
||||
<item name="android:stateListAnimator">@animator/alpha_animator</item>
|
||||
<item name="android:elevation">@dimen/app_bar_elevation</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.AppBar.Surface.Raisable">
|
||||
<item name="android:elevation">0dp</item>
|
||||
<item name="android:stateListAnimator">@animator/raise_animator</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.ActionBar" parent="ThemeOverlay.MaterialComponents.ActionBar">
|
||||
<item name="elevation">0dp</item>
|
||||
<item name="titleTextAppearance">@android:style/TextAppearance.Material.Widget.Toolbar.Title</item>
|
||||
<item name="subtitleTextAppearance">@android:style/TextAppearance.Material.Widget.Toolbar.Subtitle</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Button.OutlinedButton.IconOnly" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
android:title="@string/group_network"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="doh"
|
||||
android:summary="@string/dns_over_http_summary"
|
||||
|
|
@ -38,20 +38,20 @@
|
|||
android:summary="%s"
|
||||
android:title="@string/settings_theme"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:key="md2"
|
||||
android:title="@string/material_design_2"
|
||||
android:defaultValue="true"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:key="colorized_action_bar"
|
||||
android:title="@string/colorized_action_bar"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:key="transparent_status_bar"
|
||||
android:title="@string/transparent_status_bar"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:key="black_dark_theme"
|
||||
android:title="@string/pure_black_dark_theme"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
android:persistent="false"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="enable_resources"
|
||||
android:summary="@string/settings_enable_resources_summary"
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
android:persistent="false"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="disable_verbose_log"
|
||||
android:title="@string/pref_title_disable_verbose_log"
|
||||
|
|
|
|||
Loading…
Reference in New Issue