diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7f..5fc09217 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,5 +1,10 @@ + + + diff --git a/app/build.gradle b/app/build.gradle index 0e1ab904..0aa9c6f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,5 +37,5 @@ dependencies { implementation "androidx.recyclerview:recyclerview:1.2.0-alpha01" implementation 'com.annimon:stream:1.2.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3' + implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 723e37be..3397ef88 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,46 +21,45 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> + + android:label="@string/About" /> + android:label="@string/Logs" /> + android:label="@string/Install" /> + android:label="@string/Downloads" /> + android:launchMode="singleTop" + android:theme="@style/AppThemeMain"> + - + android:label="@string/Modules" /> + android:label="@string/Settings"/> - - - - - \ No newline at end of file diff --git a/app/src/main/java/org/meowcat/edxposed/manager/AboutActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/AboutActivity.java index 03171453..8b83e3dd 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/AboutActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/AboutActivity.java @@ -8,6 +8,7 @@ import android.view.View; import android.widget.TextView; import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import com.google.android.material.dialog.MaterialAlertDialogBuilder; @@ -15,7 +16,6 @@ import org.meowcat.edxposed.manager.util.NavUtil; import de.psdev.licensesdialog.LicensesDialog; import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20; -import de.psdev.licensesdialog.licenses.MITLicense; import de.psdev.licensesdialog.model.Notice; import de.psdev.licensesdialog.model.Notices; @@ -25,11 +25,14 @@ public class AboutActivity extends BaseActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } + setupWindowInsets(); View changelogView = findViewById(R.id.changelogView); View licensesView = findViewById(R.id.licensesView); View translatorsView = findViewById(R.id.translatorsView); @@ -88,11 +91,8 @@ public class AboutActivity extends BaseActivity { private void createLicenseDialog() { Notices notices = new Notices(); - notices.addNotice(new Notice("material-dialogs", "https://github.com/afollestad/material-dialogs", "Copyright (c) 2014-2016 Aidan Michael Follestad", new MITLicense())); - notices.addNotice(new Notice("StickyListHeaders", "https://github.com/emilsjolander/StickyListHeaders", "Emil Sjölander", new ApacheSoftwareLicense20())); - notices.addNotice(new Notice("PreferenceFragment-Compat", "https://github.com/Machinarius/PreferenceFragment-Compat", "machinarius", new ApacheSoftwareLicense20())); - notices.addNotice(new Notice("libsuperuser", "https://github.com/Chainfire/libsuperuser", "Copyright (C) 2012-2015 Jorrit \"Chainfire\" Jongma", new ApacheSoftwareLicense20())); - notices.addNotice(new Notice("picasso", "https://github.com/square/picasso", "Copyright 2013 Square, Inc.", new ApacheSoftwareLicense20())); + notices.addNotice(new Notice("sticky-headers-recyclerview", "https://github.com/timehop/sticky-headers-recyclerview", "timehop", new ApacheSoftwareLicense20())); + notices.addNotice(new Notice("libsu", "https://github.com/topjohnwu/libsu", "John Wu", new ApacheSoftwareLicense20())); new LicensesDialog.Builder(this) .setNotices(notices) diff --git a/app/src/main/java/org/meowcat/edxposed/manager/BaseActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/BaseActivity.java index 22a41e33..26f45f6f 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/BaseActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/BaseActivity.java @@ -1,14 +1,18 @@ package org.meowcat.edxposed.manager; +import android.Manifest; import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; +import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; +import android.os.Build; import android.os.Bundle; import android.os.Looper; import android.text.TextUtils; import android.view.MenuItem; +import android.view.View; import android.widget.TextView; import android.widget.Toast; @@ -18,6 +22,8 @@ import androidx.annotation.StyleRes; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; +import androidx.core.app.ActivityCompat; +import androidx.core.view.ViewCompat; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.topjohnwu.superuser.Shell; @@ -62,6 +68,15 @@ public class BaseActivity extends AppCompatActivity { return (configuration.uiMode & Configuration.UI_MODE_NIGHT_YES) > 0; } + protected void setupWindowInsets() { + View rootView = findViewById(R.id.snackbar); + rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> { + rootView.setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom()); + return insets; + }); + } + @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -142,6 +157,16 @@ public class BaseActivity extends AppCompatActivity { } } + public boolean checkPermissions() { + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, XposedApp.WRITE_EXTERNAL_PERMISSION); + } + return true; + } + return false; + } + void reboot(String mode) { if (startShell()) return; diff --git a/app/src/main/java/org/meowcat/edxposed/manager/BaseAdvancedInstaller.java b/app/src/main/java/org/meowcat/edxposed/manager/BaseAdvancedInstaller.java index 54ab3e99..16bbde4e 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/BaseAdvancedInstaller.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/BaseAdvancedInstaller.java @@ -35,13 +35,6 @@ import java.util.Objects; import static org.meowcat.edxposed.manager.XposedApp.WRITE_EXTERNAL_PERMISSION; public class BaseAdvancedInstaller extends Fragment { - - // private static final String JAR_PATH = XposedApp.BASE_DIR + "bin/XposedBridge.jar"; -// private static final int INSTALL_MODE_NORMAL = 0; -// private static final int INSTALL_MODE_RECOVERY_AUTO = 1; -// private static final int INSTALL_MODE_RECOVERY_MANUAL = 2; -// private static String APP_PROCESS_NAME = null; - //private List messages = new ArrayList<>(); private View mClickedButton; static BaseAdvancedInstaller newInstance(XposedTab tab) { @@ -69,16 +62,6 @@ public class BaseAdvancedInstaller extends Fragment { return Objects.requireNonNull(tab).notice; } -// private String compatibility() { -// XposedTab tab = Objects.requireNonNull(getArguments()).getParcelable("tab"); -// return Objects.requireNonNull(tab).getCompatibility(); -// } - -// private String incompatibility() { -// XposedTab tab = Objects.requireNonNull(getArguments()).getParcelable("tab"); -// return Objects.requireNonNull(tab).getIncompatibility(); -// } - protected String author() { XposedTab tab = Objects.requireNonNull(getArguments()).getParcelable("tab"); return Objects.requireNonNull(tab).author; diff --git a/app/src/main/java/org/meowcat/edxposed/manager/BlackListActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/BlackListActivity.java index 1b618951..20c144e3 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/BlackListActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/BlackListActivity.java @@ -1,5 +1,6 @@ package org.meowcat.edxposed.manager; +import android.content.Intent; import android.content.pm.ApplicationInfo; import android.os.Bundle; import android.view.Menu; @@ -9,11 +10,14 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.SearchView; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import org.meowcat.edxposed.manager.adapters.AppAdapter; import org.meowcat.edxposed.manager.adapters.AppHelper; import org.meowcat.edxposed.manager.adapters.BlackListAdapter; @@ -29,13 +33,17 @@ public class BlackListActivity extends BaseActivity implements AppAdapter.Callba public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_black_list); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } + setupWindowInsets(); mSwipeRefreshLayout = findViewById(R.id.swipeRefreshLayout); RecyclerView mRecyclerView = findViewById(R.id.recyclerView); + mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); final boolean isWhiteListMode = isWhiteListMode(); mAppAdapter = new BlackListAdapter(this, isWhiteListMode); @@ -72,6 +80,17 @@ public class BlackListActivity extends BaseActivity implements AppAdapter.Callba @Override public void onResume() { super.onResume(); + if (!AppHelper.isBlackListMode()) { + new MaterialAlertDialogBuilder(this) + .setMessage(R.string.warning_list_not_enabled) + .setPositiveButton(R.string.Settings, (dialog, which) -> { + Intent intent = new Intent(); + intent.setClass(BlackListActivity.this, SettingsActivity.class); + startActivity(intent); + }) + .setCancelable(false) + .show(); + } changeTitle(isBlackListMode(), isWhiteListMode()); } @@ -99,7 +118,6 @@ public class BlackListActivity extends BaseActivity implements AppAdapter.Callba mAppAdapter.filter(queryStr); } - @SuppressWarnings("deprecation") @Override public void onItemClick(View v, ApplicationInfo info) { getSupportFragmentManager(); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/CompatListActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/CompatListActivity.java new file mode 100644 index 00000000..d4059dea --- /dev/null +++ b/app/src/main/java/org/meowcat/edxposed/manager/CompatListActivity.java @@ -0,0 +1,109 @@ +package org.meowcat.edxposed.manager; + +import android.content.pm.ApplicationInfo; +import android.os.Bundle; +import android.view.Menu; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.SearchView; +import androidx.appcompat.widget.Toolbar; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import org.meowcat.edxposed.manager.adapters.AppAdapter; +import org.meowcat.edxposed.manager.adapters.AppHelper; +import org.meowcat.edxposed.manager.adapters.CompatListAdapter; + +public class CompatListActivity extends BaseActivity implements AppAdapter.Callback { + + private SwipeRefreshLayout mSwipeRefreshLayout; + private SearchView mSearchView; + private CompatListAdapter mAppAdapter; + + private SearchView.OnQueryTextListener mSearchListener; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_black_list); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); + ActionBar bar = getSupportActionBar(); + if (bar != null) { + bar.setDisplayHomeAsUpEnabled(true); + } + setupWindowInsets(); + mSwipeRefreshLayout = findViewById(R.id.swipeRefreshLayout); + RecyclerView mRecyclerView = findViewById(R.id.recyclerView); + mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + mAppAdapter = new CompatListAdapter(this); + mRecyclerView.setAdapter(mAppAdapter); + DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), + DividerItemDecoration.VERTICAL); + mRecyclerView.addItemDecoration(dividerItemDecoration); + mAppAdapter.setCallback(this); + + mSwipeRefreshLayout.setRefreshing(true); + mSwipeRefreshLayout.setOnRefreshListener(mAppAdapter::refresh); + + mSearchListener = new SearchView.OnQueryTextListener() { + @Override + public boolean onQueryTextSubmit(String query) { + mAppAdapter.filter(query); + return false; + } + + @Override + public boolean onQueryTextChange(String newText) { + mAppAdapter.filter(newText); + return false; + } + }; + } + + @Override + public void onResume() { + super.onResume(); + } + + @Override + public boolean onCreateOptionsMenu(@NonNull Menu menu) { + getMenuInflater().inflate(R.menu.menu_app_list, menu); + mSearchView = (SearchView) menu.findItem(R.id.menu_search).getActionView(); + mSearchView.setOnQueryTextListener(mSearchListener); + return super.onCreateOptionsMenu(menu); + } + + @Override + public void onDataReady() { + mSwipeRefreshLayout.setRefreshing(false); + String queryStr = mSearchView != null ? mSearchView.getQuery().toString() : ""; + mAppAdapter.filter(queryStr); + } + + @Override + public void onItemClick(View v, ApplicationInfo info) { + AppHelper.showMenu(this, getSupportFragmentManager(), v, info); + + } + + @Override + public void onBackPressed() { + if (mSearchView.isIconified()) { + super.onBackPressed(); + } else { + mSearchView.setIconified(true); + } + } + + @Override + public void onPointerCaptureChanged(boolean hasCapture) { + + } +} diff --git a/app/src/main/java/org/meowcat/edxposed/manager/DownloadActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/DownloadActivity.java index b06d60bc..df1ce507 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/DownloadActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/DownloadActivity.java @@ -8,11 +8,9 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.database.Cursor; import android.net.ConnectivityManager; -import android.net.NetworkInfo; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -23,7 +21,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.SearchView; -import androidx.core.view.MenuItemCompat; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -55,18 +53,7 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis private BroadcastReceiver connectionListener = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - ConnectivityManager cm = (ConnectivityManager) context.getSystemService(CONNECTIVITY_SERVICE); - NetworkInfo networkInfo = cm.getActiveNetworkInfo(); - if (mRepoLoader != null) { - /*if (networkInfo == null) { - ((TextView) backgroundList.findViewById(R.id.list_status)).setText(R.string.no_connection_available); - backgroundList.findViewById(R.id.progress).setVisibility(View.GONE); - } else { - ((TextView) backgroundList.findViewById(R.id.list_status)).setText(R.string.update_download_list); - backgroundList.findViewById(R.id.progress).setVisibility(View.VISIBLE); - } -*/ mRepoLoader.triggerReload(true); } } @@ -77,12 +64,15 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis super.onCreate(savedInstanceState); setContentView(R.layout.activity_download); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } + setupWindowInsets(); mPref = XposedApp.getPreferences(); mRepoLoader = RepoLoader.getInstance(); mModuleUtil = ModuleUtil.getInstance(); @@ -116,44 +106,6 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mListView.getContext(), DividerItemDecoration.VERTICAL); mListView.addItemDecoration(dividerItemDecoration); - /*mListView.setOnScrollListener(new AbsListView.OnScrollListener() { - @Override - public void onScrollStateChanged(AbsListView view, int scrollState) { - - } - - @Override - public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { - if (mListView.getChildAt(0) != null) { - refreshLayout.setEnabled(mListView.getFirstVisiblePosition() == 0 && mListView.getChildAt(0).getTop() == 0); - } - } - });*/ - - /*mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - Cursor cursor = (Cursor) mAdapter.getItem(position); - String packageName = cursor.getString(OverviewColumnsIndexes.PKGNAME); - - Intent detailsIntent = new Intent(getActivity(), DownloadDetailsActivity.class); - detailsIntent.setData(Uri.fromParts("package", packageName, null)); - startActivity(detailsIntent); - } - });*/ - mListView.setOnKeyListener(new View.OnKeyListener() { - @Override - public boolean onKey(View v, int keyCode, KeyEvent event) { - // Expand the search view when the SEARCH key is triggered - if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getAction() == KeyEvent.ACTION_UP && (event.getFlags() & KeyEvent.FLAG_CANCELED) == 0) { - if (mSearchView != null) - mSearchView.setIconified(false); - return true; - } - return false; - } - }); - } @@ -208,18 +160,6 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis return true; } }); - MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() { - @Override - public boolean onMenuItemActionCollapse(MenuItem item) { - setFilter(null); - return true; // Return true to collapse action view - } - - @Override - public boolean onMenuItemActionExpand(MenuItem item) { - return true; // Return true to expand action view - } - }); return super.onCreateOptionsMenu(menu); } @@ -236,18 +176,17 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - switch (item.getItemId()) { - case R.id.menu_sort: - new MaterialAlertDialogBuilder(this) - .setTitle(R.string.download_sorting_title) - .setSingleChoiceItems(R.array.download_sort_order, mSortingOrder, (dialog, which) -> { - mSortingOrder = which; - mPref.edit().putInt("download_sorting_order", mSortingOrder).apply(); - reloadItems(); - dialog.dismiss(); - }) - .show(); - return true; + if (item.getItemId() == R.id.menu_sort) { + new MaterialAlertDialogBuilder(this) + .setTitle(R.string.download_sorting_title) + .setSingleChoiceItems(R.array.download_sort_order, mSortingOrder, (dialog, which) -> { + mSortingOrder = which; + mPref.edit().putInt("download_sorting_order", mSortingOrder).apply(); + reloadItems(); + dialog.dismiss(); + }) + .show(); + return true; } return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsActivity.java index 213e8546..1d5fe0a7 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsActivity.java @@ -21,7 +21,6 @@ import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; import androidx.viewpager.widget.ViewPager; -import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayout; import org.meowcat.edxposed.manager.repo.Module; @@ -40,7 +39,6 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. static final String PLAY_STORE_PACKAGE = "com.android.vending"; static final String PLAY_STORE_LINK = "https://play.google.com/store/apps/details?id=%s"; private static final String TAG = "DownloadDetailsActivity"; - private static final String NOT_ACTIVE_NOTE_TAG = "NOT_ACTIVE_NOTE"; private static RepoLoader sRepoLoader = RepoLoader.getInstance(); private static ModuleUtil sModuleUtil = ModuleUtil.getInstance(); private ViewPager mPager; @@ -71,7 +69,6 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - toolbar.setNavigationOnClickListener(view -> finish()); ActionBar ab = getSupportActionBar(); @@ -99,6 +96,7 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. sRepoLoader.triggerReload(true); }); } + setupWindowInsets(); } private void setupTabs() { @@ -106,7 +104,6 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. mPager.setAdapter(new SwipeFragmentPagerAdapter(getSupportFragmentManager())); TabLayout mTabLayout = findViewById(R.id.sliding_tabs); mTabLayout.setupWithViewPager(mPager); - mTabLayout.setBackgroundColor(XposedApp.getColor(this)); } private String getModulePackageName() { @@ -183,28 +180,9 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. } else { menu.removeItem(R.id.ignoreUpdate); } - setupBookmark(false); return true; } - private void setupBookmark(boolean clicked) { - SharedPreferences myPref = getSharedPreferences("bookmarks", MODE_PRIVATE); - - boolean saved = myPref.getBoolean(mModule.packageName, false); - boolean newValue; - - if (clicked) { - newValue = !saved; - myPref.edit().putBoolean(mModule.packageName, newValue).apply(); - - int msg = newValue ? R.string.bookmark_added : R.string.bookmark_removed; - - Snackbar.make(findViewById(android.R.id.content), msg, Snackbar.LENGTH_SHORT).show(); - } - - saved = myPref.getBoolean(mModule.packageName, false); - } - @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { @@ -265,7 +243,7 @@ public class DownloadDetailsActivity extends BaseActivity implements RepoLoader. private String[] tabTitles = new String[]{getString(R.string.download_details_page_description), getString(R.string.download_details_page_versions), getString(R.string.download_details_page_settings),}; SwipeFragmentPagerAdapter(FragmentManager fm) { - super(fm); + super(fm, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT); } @Override diff --git a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsFragment.java b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsFragment.java index a4152b91..5b479cb1 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsFragment.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsFragment.java @@ -1,6 +1,5 @@ package org.meowcat.edxposed.manager; -import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.text.method.LinkMovementMethod; @@ -10,6 +9,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import org.meowcat.edxposed.manager.repo.Module; @@ -18,20 +18,17 @@ import org.meowcat.edxposed.manager.util.NavUtil; import org.meowcat.edxposed.manager.util.chrome.LinkTransformationMethod; public class DownloadDetailsFragment extends Fragment { - private DownloadDetailsActivity mActivity; @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - mActivity = (DownloadDetailsActivity) activity; - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final Module module = mActivity.getModule(); - if (module == null) + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + DownloadDetailsActivity mActivity = (DownloadDetailsActivity) getActivity(); + if (mActivity == null) { return null; - + } + final Module module = mActivity.getModule(); + if (module == null) { + return null; + } final View view = inflater.inflate(R.layout.download_details, container, false); TextView title = view.findViewById(R.id.download_title); @@ -70,12 +67,7 @@ public class DownloadDetailsFragment extends Fragment { final Uri link = NavUtil.parseURL(moreInfoEntry.second); if (link != null) { txtValue.setTextColor(txtValue.getLinkTextColors()); - moreInfoView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - NavUtil.startURL(getActivity(), link); - } - }); + moreInfoView.setOnClickListener(v -> NavUtil.startURL(getActivity(), link)); } moreInfoContainer.addView(moreInfoView); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsSettingsFragment.java b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsSettingsFragment.java index acfcfc4f..bb06d323 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsSettingsFragment.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsSettingsFragment.java @@ -1,6 +1,5 @@ package org.meowcat.edxposed.manager; -import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; @@ -16,19 +15,18 @@ import org.meowcat.edxposed.manager.util.RepoLoader; import java.util.Map; public class DownloadDetailsSettingsFragment extends PreferenceFragmentCompat { - private DownloadDetailsActivity mActivity; - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - mActivity = (DownloadDetailsActivity) activity; - } @Override public void onCreatePreferencesFix(Bundle savedInstanceState, String rootKey) { - final Module module = mActivity.getModule(); - if (module == null) + DownloadDetailsActivity mActivity = (DownloadDetailsActivity) getActivity(); + if (mActivity == null) { return; + } + final Module module = mActivity.getModule(); + if (module == null) { + return; + } final String packageName = module.packageName; diff --git a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsVersionsFragment.java b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsVersionsFragment.java index 77602cdb..cfbd7797 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsVersionsFragment.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/DownloadDetailsVersionsFragment.java @@ -1,6 +1,6 @@ package org.meowcat.edxposed.manager; -import android.app.Activity; +import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; @@ -12,9 +12,11 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.FrameLayout; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; import androidx.fragment.app.ListFragment; @@ -37,21 +39,16 @@ import java.util.Date; import static org.meowcat.edxposed.manager.XposedApp.WRITE_EXTERNAL_PERMISSION; public class DownloadDetailsVersionsFragment extends ListFragment { - private static VersionsAdapter sAdapter; private DownloadDetailsActivity mActivity; - private Module module; - - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - mActivity = (DownloadDetailsActivity) activity; - } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - - module = mActivity.getModule(); + mActivity = (DownloadDetailsActivity) getActivity(); + if (mActivity == null) { + return; + } + Module module = mActivity.getModule(); if (module == null) return; @@ -64,23 +61,24 @@ public class DownloadDetailsVersionsFragment extends ListFragment { TextView txtHeader = new TextView(getActivity()); txtHeader.setText(R.string.download_test_version_not_shown); txtHeader.setTextColor(getResources().getColor(R.color.warning)); - txtHeader.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mActivity.gotoPage(DownloadDetailsActivity.DOWNLOAD_SETTINGS); - } - }); + txtHeader.setOnClickListener(v -> mActivity.gotoPage(DownloadDetailsActivity.DOWNLOAD_SETTINGS)); getListView().addHeaderView(txtHeader); } - sAdapter = new VersionsAdapter(mActivity, mActivity.getInstalledModule()); + VersionsAdapter sAdapter = new VersionsAdapter(mActivity, mActivity.getInstalledModule()); for (ModuleVersion version : module.versions) { if (repoLoader.isVersionShown(version)) sAdapter.add(version); } setListAdapter(sAdapter); } - + if (getView() != null) { + ((FrameLayout) getView()).setClipChildren(false); + ((FrameLayout) getView()).setClipToPadding(false); + } + ((FrameLayout) getListView().getParent()).setClipChildren(false); + ((FrameLayout) getListView().getParent()).setClipToPadding(false); + getListView().setClipToPadding(false); getListView().setClipToPadding(false); } @@ -91,7 +89,7 @@ public class DownloadDetailsVersionsFragment extends ListFragment { } @Override - public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == WRITE_EXTERNAL_PERMISSION) { if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { @@ -171,7 +169,7 @@ public class DownloadDetailsVersionsFragment extends ListFragment { private final String mTextUpdateAvailable; private final long mInstalledVersionCode; - public VersionsAdapter(Context context, InstalledModule installed) { + VersionsAdapter(Context context, InstalledModule installed) { super(context, R.layout.item_version); TypedValue typedValue = new TypedValue(); Resources.Theme theme = context.getTheme(); @@ -186,8 +184,10 @@ public class DownloadDetailsVersionsFragment extends ListFragment { mInstalledVersionCode = (installed != null) ? installed.versionCode : -1; } + @SuppressLint("InflateParams") @Override - public View getView(int position, View convertView, ViewGroup parent) { + @NonNull + public View getView(int position, View convertView, @NonNull ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); @@ -206,7 +206,9 @@ public class DownloadDetailsVersionsFragment extends ListFragment { ViewHolder holder = (ViewHolder) view.getTag(); ModuleVersion item = getItem(position); - + if (item == null) { + return view; + } holder.txtVersion.setText(item.name); holder.txtRelType.setText(item.relType.getTitleId()); holder.txtRelType.setTextColor(item.relType == ReleaseType.STABLE diff --git a/app/src/main/java/org/meowcat/edxposed/manager/EdDownloadActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/EdDownloadActivity.java index 084b1b09..fd99efd6 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/EdDownloadActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/EdDownloadActivity.java @@ -12,6 +12,7 @@ import android.widget.CheckBox; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; @@ -36,7 +37,9 @@ public class EdDownloadActivity extends BaseActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_ed_download); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/LogsActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/LogsActivity.java index d63fada5..f745a15a 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/LogsActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/LogsActivity.java @@ -22,6 +22,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import androidx.core.app.ActivityCompat; import androidx.core.content.FileProvider; @@ -52,11 +53,14 @@ public class LogsActivity extends BaseActivity { public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_logs); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } + setupWindowInsets(); mTxtLog = findViewById(R.id.txtLog); mTxtLog.setTextIsSelectable(true); mSVLog = findViewById(R.id.svLog); @@ -163,7 +167,7 @@ public class LogsActivity extends BaseActivity { } private void send() { - Uri uri = FileProvider.getUriForFile(Objects.requireNonNull(this), "org.meowcat.edxposed.manager.fileprovider", errorLog ? mFileErrorLogError : mFileErrorLog); + Uri uri = FileProvider.getUriForFile(this, "org.meowcat.edxposed.manager.fileprovider", errorLog ? mFileErrorLogError : mFileErrorLog); Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_STREAM, uri); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/MainActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/MainActivity.java index d98a1329..c3a681e1 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/MainActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/MainActivity.java @@ -9,6 +9,9 @@ import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.appcompat.view.menu.MenuBuilder; +import androidx.appcompat.view.menu.MenuPopupHelper; +import androidx.appcompat.widget.PopupMenu; import com.google.android.material.card.MaterialCardView; @@ -62,6 +65,15 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene intent.setClass(getApplicationContext(), AboutActivity.class); startActivity(intent); }); + ImageView menu = findViewById(R.id.menu_more); + menu.setOnClickListener(v -> { + PopupMenu appMenu = new PopupMenu(MainActivity.this, menu); + appMenu.inflate(R.menu.menu_installer); + appMenu.setOnMenuItemClickListener(this::onOptionsItemSelected); + MenuPopupHelper menuHelper = new MenuPopupHelper(MainActivity.this, (MenuBuilder) appMenu.getMenu(), menu); + menuHelper.setForceShowIcon(true); + menuHelper.show(); + }); String installedXposedVersion; try { installedXposedVersion = XposedApp.getXposedProp().getVersion(); @@ -131,24 +143,21 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene @SuppressLint("SetTextI18n") private void notifyDataSetChanged() { - runOnUiThread(new Runnable() { - @Override - public void run() { - String frameworkUpdateVersion = mRepoLoader.getFrameworkUpdateVersion(); - boolean moduleUpdateAvailable = mRepoLoader.hasModuleUpdates(); - ModuleUtil.getInstance().getEnabledModules().size(); - TextView description = findViewById(R.id.activity_main_modules_summary); - description.setText(String.format(getString(R.string.ModulesDetail), ModuleUtil.getInstance().getEnabledModules().size())); - if (frameworkUpdateVersion != null) { - description = findViewById(R.id.activity_main_status_summary); - description.setText(String.format(getString(R.string.welcome_framework_update_available), frameworkUpdateVersion)); - } - description = findViewById(R.id.activity_main_download_summary); - if (moduleUpdateAvailable) { - description.setText(R.string.modules_updates_available); - } else { - description.setText(R.string.ModuleUptodate); - } + runOnUiThread(() -> { + String frameworkUpdateVersion = mRepoLoader.getFrameworkUpdateVersion(); + boolean moduleUpdateAvailable = mRepoLoader.hasModuleUpdates(); + ModuleUtil.getInstance().getEnabledModules().size(); + TextView description = findViewById(R.id.activity_main_modules_summary); + description.setText(String.format(getString(R.string.ModulesDetail), ModuleUtil.getInstance().getEnabledModules().size())); + if (frameworkUpdateVersion != null) { + description = findViewById(R.id.activity_main_status_summary); + description.setText(String.format(getString(R.string.welcome_framework_update_available), frameworkUpdateVersion)); + } + description = findViewById(R.id.activity_main_download_summary); + if (moduleUpdateAvailable) { + description.setText(R.string.modules_updates_available); + } else { + description.setText(R.string.ModuleUptodate); } }); } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/ModulesActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/ModulesActivity.java index f1816abb..768e63c3 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/ModulesActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/ModulesActivity.java @@ -1,6 +1,5 @@ package org.meowcat.edxposed.manager; -import android.Manifest; import android.annotation.SuppressLint; import android.content.ActivityNotFoundException; import android.content.Context; @@ -33,7 +32,7 @@ import androidx.appcompat.view.menu.MenuBuilder; import androidx.appcompat.view.menu.MenuPopupHelper; import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.SearchView; -import androidx.core.app.ActivityCompat; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -119,11 +118,14 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_modules); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } + setupWindowInsets(); filter = new ApplicationFilter(); mModuleUtil = ModuleUtil.getInstance(); mPm = getPackageManager(); @@ -276,15 +278,6 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi return super.onOptionsItemSelected(item); } - private boolean checkPermissions() { - if (ActivityCompat.checkSelfPermission(Objects.requireNonNull(this), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, XposedApp.WRITE_EXTERNAL_PERMISSION); - } - return true; - } - return false; - } private boolean importModules(File path) { if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { @@ -551,9 +544,9 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi holder.appIcon.setImageDrawable(item.getIcon()); TextView descriptionText = holder.appDescription; + descriptionText.setVisibility(View.VISIBLE); if (!item.getDescription().isEmpty()) { descriptionText.setText(item.getDescription()); - //descriptionText.setTextColor(ThemeUtil.getThemeColor(this, android.R.attr.textColorSecondary)); } else { descriptionText.setText(getString(R.string.module_empty_description)); descriptionText.setTextColor(getResources().getColor(R.color.warning)); @@ -634,8 +627,8 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi ViewHolder(View itemView) { super(itemView); - appIcon = itemView.findViewById(R.id.icon); - appName = itemView.findViewById(R.id.title); + appIcon = itemView.findViewById(R.id.app_icon); + appName = itemView.findViewById(R.id.app_name); appDescription = itemView.findViewById(R.id.description); appPackage = itemView.findViewById(R.id.package_name); appVersion = itemView.findViewById(R.id.version_name); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java index cefb46c6..ea6fd67e 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java @@ -2,13 +2,20 @@ package org.meowcat.edxposed.manager; import android.annotation.SuppressLint; import android.content.DialogInterface; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.FileUtils; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.LinearLayout; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; import androidx.preference.Preference; import androidx.preference.SwitchPreference; @@ -30,27 +37,28 @@ public class SettingsActivity extends BaseActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); - setSupportActionBar(findViewById(R.id.toolbar)); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(view -> finish()); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); } - + setupWindowInsets(); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() - .add(R.id.container, new SettingsFragment()).commit(); + .add(R.id.container, SettingsFragment.newInstance(findViewById(R.id.snackbar))).commit(); } } - @SuppressWarnings({"ResultOfMethodCallIgnored", "deprecation"}) public static class SettingsFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener, SharedPreferences.OnSharedPreferenceChangeListener { static final File mDisableResourcesFlag = new File(XposedApp.BASE_DIR + "conf/disable_resources"); static final File mDynamicModulesFlag = new File(XposedApp.BASE_DIR + "conf/dynamicmodules"); + static final File mDeoptBootFlag = new File(XposedApp.BASE_DIR + "conf/deoptbootimage"); static final File mWhiteListModeFlag = new File(XposedApp.BASE_DIR + "conf/usewhitelist"); static final File mBlackWhiteListModeFlag = new File(XposedApp.BASE_DIR + "conf/blackwhitelist"); - static final File mDeoptBootFlag = new File(XposedApp.BASE_DIR + "conf/deoptbootimage"); static final File mDisableVerboseLogsFlag = new File(XposedApp.BASE_DIR + "conf/disable_verbose_log"); static final File mDisableModulesLogsFlag = new File(XposedApp.BASE_DIR + "conf/disable_modules_log"); static final File mVerboseLogProcessID = new File(XposedApp.BASE_DIR + "log/all.pid"); @@ -59,7 +67,12 @@ public class SettingsActivity extends BaseActivity { private Preference stopVerboseLog; private Preference stopLog; - public SettingsFragment() { + private View rootView; + + static SettingsFragment newInstance(View rootView) { + SettingsFragment fragment = new SettingsFragment(); + fragment.setRootView(rootView); + return fragment; } @SuppressWarnings("SameParameterValue") @@ -76,6 +89,10 @@ public class SettingsActivity extends BaseActivity { FileUtils.setPermissions(name, perms, -1, -1); } + void setRootView(View rootView) { + this.rootView = rootView; + } + @SuppressLint({"ObsoleteSdkInt", "WorldReadableFiles"}) @Override public void onCreatePreferencesFix(Bundle savedInstanceState, String rootKey) { @@ -307,6 +324,16 @@ public class SettingsActivity extends BaseActivity { return (enabled == mDisableResourcesFlag.exists()); }); + Preference compat_mode = findPreference("compat_mode"); + if (compat_mode != null) { + compat_mode.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(); + intent.setClass(Objects.requireNonNull(getContext()), CompatListActivity.class); + Objects.requireNonNull(getActivity()).startActivity(intent); + return true; + }); + } + } @Override @@ -367,5 +394,16 @@ public class SettingsActivity extends BaseActivity { .show(); } + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + if (rootView == null) { + return; + } + ((LinearLayout) ((FrameLayout) rootView.findViewById(R.id.container)).getChildAt(0)).setClipToPadding(false); + ((LinearLayout) ((FrameLayout) rootView.findViewById(R.id.container)).getChildAt(0)).setClipChildren(false); + ((FrameLayout) ((LinearLayout) view).getChildAt(0)).setClipChildren(false); + ((FrameLayout) ((LinearLayout) view).getChildAt(0)).setClipToPadding(false); + } } } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/XposedApp.java b/app/src/main/java/org/meowcat/edxposed/manager/XposedApp.java index 6c976a47..20cd66ad 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/XposedApp.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/XposedApp.java @@ -4,7 +4,6 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.app.Application; import android.app.PendingIntent; -import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; @@ -90,13 +89,6 @@ public class XposedApp extends de.robv.android.xposed.installer.XposedApp implem return mInstance.mPref; } - public static int getColor(Context context) { - SharedPreferences prefs = context.getSharedPreferences(context.getPackageName() + "_preferences", MODE_PRIVATE); - int defaultColor = context.getResources().getColor(R.color.colorPrimary); - - return prefs.getInt("colors", defaultColor); - } - public static String getDownloadPath() { return getPreferences().getString("download_location", Environment.getExternalStorageDirectory() + "/Download/EdXposedManager/"); } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/adapters/AppAdapter.java b/app/src/main/java/org/meowcat/edxposed/manager/adapters/AppAdapter.java index b71983d2..af4b02ad 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/adapters/AppAdapter.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/adapters/AppAdapter.java @@ -34,7 +34,7 @@ public class AppAdapter extends RecyclerView.Adapter { protected final Context context; private final ApplicationInfo.DisplayNameComparator displayNameComparator; - public Callback callback; + private Callback callback; private List fullList, showList; private DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); private List checkedList; @@ -60,7 +60,7 @@ public class AppAdapter extends RecyclerView.Adapter { @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - View v = LayoutInflater.from(context).inflate(R.layout.item_app, parent, false); + View v = LayoutInflater.from(context).inflate(R.layout.item_module, parent, false); return new ViewHolder(v); } @@ -186,7 +186,7 @@ public class AppAdapter extends RecyclerView.Adapter { holder.mSwitch.setChecked(checkedList.contains(info.packageName)); holder.mSwitch.setOnCheckedChangeListener((v, isChecked) -> onCheckedChange(v, isChecked, info)); - holder.infoLayout.setOnClickListener(v -> { + holder.itemView.setOnClickListener(v -> { if (callback != null) { callback.onItemClick(v, info); } @@ -218,7 +218,6 @@ public class AppAdapter extends RecyclerView.Adapter { static class ViewHolder extends RecyclerView.ViewHolder { - View infoLayout; ImageView appIcon; TextView appName; TextView appPackage; @@ -229,7 +228,6 @@ public class AppAdapter extends RecyclerView.Adapter { ViewHolder(View itemView) { super(itemView); - infoLayout = itemView.findViewById(R.id.info_layout); appIcon = itemView.findViewById(R.id.app_icon); appName = itemView.findViewById(R.id.app_name); appPackage = itemView.findViewById(R.id.package_name); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/adapters/BlackListAdapter.java b/app/src/main/java/org/meowcat/edxposed/manager/adapters/BlackListAdapter.java index 3b33a20b..d4a829cf 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/adapters/BlackListAdapter.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/adapters/BlackListAdapter.java @@ -23,10 +23,6 @@ public class BlackListAdapter extends AppAdapter { this.isWhiteListMode = isWhiteListMode; } -// public void setWhiteListMode(boolean isWhiteListMode) { -// this.isWhiteListMode = isWhiteListMode; -// } - @Override protected List generateCheckedList() { if (XposedApp.getPreferences().getBoolean("hook_modules", true)) { diff --git a/app/src/main/java/org/meowcat/edxposed/manager/adapters/CompatListAdapter.java b/app/src/main/java/org/meowcat/edxposed/manager/adapters/CompatListAdapter.java new file mode 100644 index 00000000..20272096 --- /dev/null +++ b/app/src/main/java/org/meowcat/edxposed/manager/adapters/CompatListAdapter.java @@ -0,0 +1,41 @@ +package org.meowcat.edxposed.manager.adapters; + +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.widget.CompoundButton; + +import org.meowcat.edxposed.manager.R; +import org.meowcat.edxposed.manager.util.ToastUtil; + +import java.util.List; + +public class CompatListAdapter extends AppAdapter { + + private List checkedList; + + public CompatListAdapter(Context context) { + super(context); + } + + @Override + protected List generateCheckedList() { + AppHelper.makeSurePath(); + return checkedList = AppHelper.getCompatList(); + } + + @Override + protected void onCheckedChange(CompoundButton view, boolean isChecked, ApplicationInfo info) { + boolean success = isChecked ? + AppHelper.addCompatList(info.packageName) : AppHelper.removeCompatList(info.packageName); + if (success) { + if (isChecked) { + checkedList.add(info.packageName); + } else { + checkedList.remove(info.packageName); + } + } else { + ToastUtil.showShortToast(context, R.string.add_package_failed); + view.setChecked(!isChecked); + } + } +} diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java index c47bbf13..99c19e5d 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java @@ -115,8 +115,6 @@ public class InstallApkUtil extends AsyncTask { out.append(o); out.append("\n"); } -// Pattern failurePattern = Pattern.compile("(?m)^Failure\\s+\\[(.*?)]$"); -// Matcher failureMatcher = failurePattern.matcher(out); if (result.equals(0)) { NotificationUtil.showModuleInstallNotification(R.string.installation_successful, R.string.installation_successful_message, info.localFilename, info.title); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/LocaleUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/LocaleUtil.java deleted file mode 100644 index 95997b83..00000000 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/LocaleUtil.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.meowcat.edxposed.manager.util; - -import android.content.Context; -import android.content.res.Configuration; -import android.content.res.Resources; - -import java.util.Locale; - -public class LocaleUtil { - public static void setLocale(Context context, Locale locale) { - Resources resources = context.getResources(); - Configuration configuration = resources.getConfiguration(); - configuration.setLocale(locale); - resources.updateConfiguration(configuration, resources.getDisplayMetrics()); - } -} diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/ModuleUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/ModuleUtil.java index 5b03b052..93d113df 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/ModuleUtil.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/ModuleUtil.java @@ -212,8 +212,7 @@ public final class ModuleUtil { try { Log.i(XposedApp.TAG, "ModuleUtil -> updating modules.list"); int installedXposedVersion = XposedApp.getXposedVersion(); - boolean disabled = false;//StatusInstallerFragment.DISABLE_FILE.exists(); - if (!XposedApp.getPreferences().getBoolean("skip_xposedminversion_check", false) && !disabled && installedXposedVersion <= 0 && showToast) { + if (!XposedApp.getPreferences().getBoolean("skip_xposedminversion_check", false) && installedXposedVersion <= 0 && showToast) { Toast.makeText(mApp, R.string.notinstalled, Toast.LENGTH_SHORT).show(); return; } @@ -223,7 +222,7 @@ public final class ModuleUtil { List enabledModules = getEnabledModules(); for (InstalledModule module : enabledModules) { - if (!XposedApp.getPreferences().getBoolean("skip_xposedminversion_check", false) && (!disabled && (module.minVersion > installedXposedVersion || module.minVersion < MIN_MODULE_VERSION)) && showToast) { + if (!XposedApp.getPreferences().getBoolean("skip_xposedminversion_check", false) && (module.minVersion > installedXposedVersion || module.minVersion < MIN_MODULE_VERSION) && showToast) { Toast.makeText(mApp, R.string.notinstalled, Toast.LENGTH_SHORT).show(); continue; } @@ -305,7 +304,6 @@ public final class ModuleUtil { this.isFramework = isFramework; this.versionName = pkg.versionName; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - //noinspection deprecation this.versionCode = pkg.versionCode; } else { this.versionCode = pkg.getLongVersionCode(); @@ -337,12 +335,6 @@ public final class ModuleUtil { return (app.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; } - /** - * @hide - */ -// public boolean isForwardLocked() { -// return (app.flags & FLAG_FORWARD_LOCK) != 0; -// } public String getAppName() { if (appName == null) appName = app.loadLabel(mPm).toString(); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/NavUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/NavUtil.java index c2b87e09..6afc89eb 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/NavUtil.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/NavUtil.java @@ -3,9 +3,7 @@ package org.meowcat.edxposed.manager.util; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; -import android.content.Intent; import android.net.Uri; -import android.provider.Browser; import android.text.Spannable; import android.text.SpannableString; import android.text.style.URLSpan; @@ -14,7 +12,9 @@ import android.text.util.Linkify; import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.browser.customtabs.CustomTabsIntent; +import androidx.core.content.ContextCompat; +import org.meowcat.edxposed.manager.R; import org.meowcat.edxposed.manager.XposedApp; public final class NavUtil { @@ -31,16 +31,9 @@ public final class NavUtil { } public static void startURL(Activity activity, Uri uri) { - if (!XposedApp.getPreferences().getBoolean("chrome_tabs", true)) { - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - intent.putExtra(Browser.EXTRA_APPLICATION_ID, activity.getPackageName()); - activity.startActivity(intent); - return; - } - CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder(); customTabsIntent.setShowTitle(true); - customTabsIntent.setToolbarColor(XposedApp.getColor(activity)); + customTabsIntent.setToolbarColor(ContextCompat.getColor(activity, R.color.colorPrimary)); customTabsIntent.build().launchUrl(activity, uri); } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/NotificationUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/NotificationUtil.java index 9a0dbca9..e8d571a9 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/NotificationUtil.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/NotificationUtil.java @@ -13,6 +13,7 @@ import android.widget.Toast; import androidx.annotation.StringRes; import androidx.core.app.NotificationCompat; +import androidx.core.content.ContextCompat; import com.topjohnwu.superuser.Shell; @@ -88,10 +89,7 @@ public final class NotificationUtil { if (prefs.getBoolean(HEADS_UP, true) && Build.VERSION.SDK_INT >= 21) builder.setPriority(2); - - if (prefs.getBoolean(COLORED_NOTIFICATION, false)) - builder.setColor(XposedApp.getColor(sContext)); - + builder.setColor(ContextCompat.getColor(sContext, R.color.colorPrimary)); Intent iActivateAndReboot = new Intent(sContext, RebootReceiver.class); iActivateAndReboot.putExtra(RebootReceiver.EXTRA_ACTIVATE_MODULE, packageName); PendingIntent pActivateAndReboot = PendingIntent.getBroadcast(sContext, PENDING_INTENT_ACTIVATE_MODULE_AND_REBOOT, @@ -138,10 +136,7 @@ public final class NotificationUtil { if (prefs.getBoolean(HEADS_UP, true) && Build.VERSION.SDK_INT >= 21) builder.setPriority(2); - - if (prefs.getBoolean(COLORED_NOTIFICATION, false)) - builder.setColor(XposedApp.getColor(sContext)); - + builder.setColor(ContextCompat.getColor(sContext, R.color.colorPrimary)); Intent iSoftReboot = new Intent(sContext, RebootReceiver.class); iSoftReboot.putExtra(RebootReceiver.EXTRA_SOFT_REBOOT, true); PendingIntent pSoftReboot = PendingIntent.getBroadcast(sContext, PENDING_INTENT_SOFT_REBOOT, @@ -178,10 +173,7 @@ public final class NotificationUtil { if (prefs.getBoolean(HEADS_UP, true) && Build.VERSION.SDK_INT >= 21) builder.setPriority(2); - - if (prefs.getBoolean(COLORED_NOTIFICATION, false)) - builder.setColor(XposedApp.getColor(sContext)); - + builder.setColor(ContextCompat.getColor(sContext, R.color.colorPrimary)); NotificationCompat.BigTextStyle notiStyle = new NotificationCompat.BigTextStyle(); notiStyle.setBigContentTitle(title); notiStyle.bigText(message); @@ -203,10 +195,7 @@ public final class NotificationUtil { NotificationCompat.Builder builder = new NotificationCompat.Builder(sContext).setContentTitle(title).setContentText(message) .setVibrate(new long[]{0}).setProgress(0, 0, true) .setSmallIcon(R.drawable.ic_notification).setOngoing(true); - - if (prefs.getBoolean(COLORED_NOTIFICATION, false)) - builder.setColor(XposedApp.getColor(sContext)); - + builder.setColor(ContextCompat.getColor(sContext, R.color.colorPrimary)); NotificationCompat.BigTextStyle notiStyle = new NotificationCompat.BigTextStyle(); notiStyle.setBigContentTitle(title); notiStyle.bigText(message); @@ -232,10 +221,7 @@ public final class NotificationUtil { if (prefs.getBoolean(HEADS_UP, true) && Build.VERSION.SDK_INT >= 21) builder.setPriority(2); - - if (prefs.getBoolean(COLORED_NOTIFICATION, false)) - builder.setColor(XposedApp.getColor(sContext)); - + builder.setColor(ContextCompat.getColor(sContext, R.color.colorPrimary)); NotificationCompat.BigTextStyle notiStyle = new NotificationCompat.BigTextStyle(); notiStyle.setBigContentTitle(title); notiStyle.bigText(message); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/PrefixedSharedPreferences.java b/app/src/main/java/org/meowcat/edxposed/manager/util/PrefixedSharedPreferences.java index 4dd2d902..a8f6631b 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/PrefixedSharedPreferences.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/PrefixedSharedPreferences.java @@ -15,7 +15,7 @@ public class PrefixedSharedPreferences implements SharedPreferences { private final SharedPreferences mBase; private final String mPrefix; - public PrefixedSharedPreferences(SharedPreferences base, String prefix) { + private PrefixedSharedPreferences(SharedPreferences base, String prefix) { mBase = base; mPrefix = prefix + "_"; } diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/RepoLoader.java b/app/src/main/java/org/meowcat/edxposed/manager/util/RepoLoader.java index d98dc5b4..4ac0f66f 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/RepoLoader.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/RepoLoader.java @@ -1,6 +1,9 @@ package org.meowcat.edxposed.manager.util; +import android.app.AlarmManager; +import android.app.PendingIntent; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.database.sqlite.SQLiteException; import android.net.ConnectivityManager; @@ -11,6 +14,9 @@ import android.widget.Toast; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + +import org.meowcat.edxposed.manager.DownloadActivity; import org.meowcat.edxposed.manager.R; import org.meowcat.edxposed.manager.XposedApp; import org.meowcat.edxposed.manager.repo.Module; @@ -43,7 +49,7 @@ public class RepoLoader { private static RepoLoader mInstance = null; private final List mListeners = new CopyOnWriteArrayList<>(); private final Map mLocalReleaseTypesCache = new HashMap<>(); - private XposedApp mApp = null; + private XposedApp mApp; private SharedPreferences mPref; private SharedPreferences mModulePref; private ConnectivityManager mConMgr; @@ -206,11 +212,9 @@ public class RepoLoader { mPref.edit().putLong("last_update_check", System.currentTimeMillis()).apply(); if (!messages.isEmpty()) { - XposedApp.runOnUiThread(new Runnable() { - public void run() { - for (String message : messages) { - Toast.makeText(mApp, message, Toast.LENGTH_LONG).show(); - } + XposedApp.runOnUiThread(() -> { + for (String message : messages) { + Toast.makeText(mApp, message, Toast.LENGTH_LONG).show(); } }); } @@ -250,7 +254,7 @@ public class RepoLoader { return; RepoDb.deleteRepositories(); - mRepositories = new LinkedHashMap(0); + mRepositories = new LinkedHashMap<>(0); DownloadsUtil.clearCache(null); resetLastUpdateCheck(); } @@ -363,30 +367,18 @@ public class RepoLoader { RepoDb.setTransactionSuccessful(); } catch (SQLiteException e) { - XposedApp.runOnUiThread(new Runnable() { - @Override - public void run() { - /*new MaterialDialog.Builder(DownloadFragment.sActivity) - .title(R.string.restart_needed) - .content(R.string.cache_cleaned) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - Intent i = new Intent(DownloadFragment.sActivity, WelcomeActivity.class); - i.putExtra("fragment", 2); - - PendingIntent pi = PendingIntent.getActivity(DownloadFragment.sActivity, 0, i, PendingIntent.FLAG_CANCEL_CURRENT); - - AlarmManager mgr = (AlarmManager) mApp.getSystemService(Context.ALARM_SERVICE); - mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pi); - System.exit(0); - } - }) - .positiveText(R.string.ok) - .canceledOnTouchOutside(false) - .show();*/ - } - }); + XposedApp.runOnUiThread(() -> new MaterialAlertDialogBuilder(mApp) + .setTitle(R.string.restart_needed) + .setMessage(R.string.cache_cleaned) + .setPositiveButton(android.R.string.ok, (dialog, which) -> { + Intent i = new Intent(mApp, DownloadActivity.class); + PendingIntent pi = PendingIntent.getActivity(mApp, 0, i, PendingIntent.FLAG_CANCEL_CURRENT); + AlarmManager mgr = (AlarmManager) mApp.getSystemService(Context.ALARM_SERVICE); + mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pi); + System.exit(0); + }) + .setCancelable(false) + .show()); DownloadsUtil.clearCache(url); } catch (Throwable t) { diff --git a/app/src/main/java/org/meowcat/edxposed/manager/widget/ListPreferenceSummaryFix.java b/app/src/main/java/org/meowcat/edxposed/manager/widget/ListPreferenceSummaryFix.java deleted file mode 100644 index ca183c1d..00000000 --- a/app/src/main/java/org/meowcat/edxposed/manager/widget/ListPreferenceSummaryFix.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.meowcat.edxposed.manager.widget; - -import android.content.Context; -import android.util.AttributeSet; - -import androidx.preference.ListPreference; - -public class ListPreferenceSummaryFix extends ListPreference { - public ListPreferenceSummaryFix(Context context) { - super(context); - } - - public ListPreferenceSummaryFix(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public void setValue(String value) { - super.setValue(value); - notifyChanged(); - } -} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 1f6bb290..00000000 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 0d025f9b..00000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..d9c7f636 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_more.xml b/app/src/main/res/drawable/ic_more.xml new file mode 100644 index 00000000..14ff51ef --- /dev/null +++ b/app/src/main/res/drawable/ic_more.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 19c69463..a63ce8d2 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -2,13 +2,16 @@ + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> @@ -20,22 +23,25 @@ android:orientation="vertical"> + android:adjustViewBounds="true" + android:contentDescription="@string/app_name" + android:scaleType="centerCrop" + android:src="@drawable/ic_launcher_foreground" /> + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_download.xml b/app/src/main/res/layout/activity_download.xml index 92d0831c..5a7a47cf 100644 --- a/app/src/main/res/layout/activity_download.xml +++ b/app/src/main/res/layout/activity_download.xml @@ -1,15 +1,20 @@ + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> + android:background="?colorActionBar" + app:tabMode="fixed" /> @@ -31,7 +33,8 @@ android:id="@+id/download_pager" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginBottom="?attr/actionBarSize" + android:clipChildren="false" + android:clipToPadding="false" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_ed_download.xml b/app/src/main/res/layout/activity_ed_download.xml index 01ceee21..d9954380 100644 --- a/app/src/main/res/layout/activity_ed_download.xml +++ b/app/src/main/res/layout/activity_ed_download.xml @@ -13,17 +13,16 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?colorBackground" + android:background="?colorActionBar" app:popupTheme="@style/AppTheme.PopupOverlay" /> + android:background="?colorActionBar" + app:tabMode="scrollable" /> diff --git a/app/src/main/res/layout/activity_logs.xml b/app/src/main/res/layout/activity_logs.xml index d9bb4da4..156c3c37 100644 --- a/app/src/main/res/layout/activity_logs.xml +++ b/app/src/main/res/layout/activity_logs.xml @@ -2,8 +2,11 @@ @@ -13,6 +16,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="?attr/actionBarSize" + android:clipChildren="false" + android:clipToPadding="false" app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> - + android:layout_marginStart="32dp" + android:layout_marginEnd="32dp" + android:clipChildren="false" + android:clipToPadding="false"> + android:scaleType="centerCrop" + android:src="@drawable/ic_launcher_foreground" /> - - + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + android:background="?selectableItemBackgroundBorderless" + android:clickable="true" + android:focusable="true" + android:padding="5dp" + app:srcCompat="@drawable/ic_more" /> + + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> @@ -10,6 +13,8 @@ android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false" app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/appbar_layout.xml b/app/src/main/res/layout/appbar_layout.xml index 1d08ab8d..67026a62 100644 --- a/app/src/main/res/layout/appbar_layout.xml +++ b/app/src/main/res/layout/appbar_layout.xml @@ -8,7 +8,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?colorBackground" + android:background="?colorActionBar" app:popupTheme="@style/AppTheme.PopupOverlay" /> \ No newline at end of file diff --git a/app/src/main/res/layout/download_moreinfo.xml b/app/src/main/res/layout/download_moreinfo.xml index 7742a3f6..3416831c 100644 --- a/app/src/main/res/layout/download_moreinfo.xml +++ b/app/src/main/res/layout/download_moreinfo.xml @@ -1,6 +1,6 @@ diff --git a/app/src/main/res/layout/item_app.xml b/app/src/main/res/layout/item_app.xml index d949bb95..3739bab1 100644 --- a/app/src/main/res/layout/item_app.xml +++ b/app/src/main/res/layout/item_app.xml @@ -1,18 +1,17 @@ @@ -21,10 +20,6 @@ android:id="@+id/app_icon" android:layout_width="50dp" android:layout_height="50dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="8dp" - android:layout_marginBottom="8dp" android:gravity="end" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/app_name" @@ -37,7 +32,6 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginStart="4dip" - android:layout_marginEnd="4dip" android:layout_weight="1" android:orientation="vertical"> @@ -88,7 +82,7 @@ - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/item_module.xml b/app/src/main/res/layout/item_module.xml index 383e3f1a..c64c489e 100644 --- a/app/src/main/res/layout/item_module.xml +++ b/app/src/main/res/layout/item_module.xml @@ -1,10 +1,12 @@ - @@ -34,7 +40,7 @@ android:layout_height="wrap_content"> + android:layout_marginTop="2dp" + android:text="@string/install_time" /> + android:layout_marginTop="2dp" + android:text="@string/update_time" /> + android:textIsSelectable="false" + android:visibility="gone" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/app_name" + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/app/src/main/res/layout/single_installer_view.xml b/app/src/main/res/layout/single_installer_view.xml index 30ff80aa..a8dc9b3e 100644 --- a/app/src/main/res/layout/single_installer_view.xml +++ b/app/src/main/res/layout/single_installer_view.xml @@ -18,7 +18,9 @@ android:id="@+id/container" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="6dp"> + android:padding="6dp" + android:paddingStart="16dp" + android:paddingEnd="16dp"> - - - + - + - - +