diff --git a/app/build.gradle b/app/build.gradle index 5fba460..ac345d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,8 +60,8 @@ android { applicationId "com.fox2code.mmm" minSdk 24 targetSdk 33 - versionCode 64 - versionName "2.0.0-beta.1" + versionCode 65 + versionName "2.0.0" archivesBaseName = "FoxMMM-v$versionName" vectorDrawables { useSupportLibrary true diff --git a/app/src/main/java/com/fox2code/mmm/CrashHandler.java b/app/src/main/java/com/fox2code/mmm/CrashHandler.java index 4ea63b6..80d698b 100644 --- a/app/src/main/java/com/fox2code/mmm/CrashHandler.java +++ b/app/src/main/java/com/fox2code/mmm/CrashHandler.java @@ -35,7 +35,6 @@ public class CrashHandler extends FoxActivity { setContentView(R.layout.activity_crash_handler); // set crash_details MaterialTextView to the exception passed in the intent or unknown if null // convert stacktrace from array to string, and pretty print it (first line is the exception, the rest is the stacktrace, with each line indented by 4 spaces) - // first line is the exception, the rest is the stacktrace, with each line indented by 4 spaces. empty out the material text view first MaterialTextView crashDetails = findViewById(R.id.crash_details); crashDetails.setText(""); // get the exception from the intent diff --git a/app/src/main/java/com/fox2code/mmm/MainActivity.java b/app/src/main/java/com/fox2code/mmm/MainActivity.java index 18e4ca6..ed9e858 100644 --- a/app/src/main/java/com/fox2code/mmm/MainActivity.java +++ b/app/src/main/java/com/fox2code/mmm/MainActivity.java @@ -207,6 +207,9 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe MainActivity.this.moduleList.setVisibility(View.GONE); } }); + // set search view to be enabled + this.searchView.setEnabled(true); + this.searchView.setVisibility(View.VISIBLE); } else if (item.getItemId() == R.id.installed_menu_item) { // set module_list_online as gone and module_list as visible. fade in/out this.moduleList.setAlpha(0F); @@ -218,6 +221,9 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe MainActivity.this.moduleListOnline.setVisibility(View.GONE); } }); + // set search view to be disabled + this.searchView.setEnabled(false); + this.searchView.setVisibility(View.GONE); } // update the padding of blur_frame to match the new bottom nav height View blurFrame = findViewById(R.id.blur_frame); diff --git a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java index a359367..6c7e171 100644 --- a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java +++ b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java @@ -590,6 +590,7 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { String finalUserRepo = userRepo.replaceAll("^(https?://)?(www\\.)?(github\\.com|gitlab\\.com|bitbucket\\.org|git\\.io|git\\.me|git\\.net|git\\.xyz|git\\.tk|git\\.co)/", ""); linkClickable.setSummary(String.format(getString(R.string.source_code_summary), BuildConfig.COMMIT_HASH, finalUserRepo)); Timber.d("finalUserRepo: %s", finalUserRepo); + String finalUserRepo1 = userRepo; linkClickable.setOnPreferenceClickListener(p -> { if (devModeStep == 2) { devModeStep = 0; @@ -606,7 +607,7 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { return true; } // build url from BuildConfig.REMOTE_URL and BuildConfig.COMMIT_HASH. May have to remove the .git at the end - IntentHelper.openUrl(p.getContext(), finalUserRepo + "/tree/" + BuildConfig.COMMIT_HASH); + IntentHelper.openUrl(p.getContext(), finalUserRepo1.replace(".git", "") + "/tree/" + BuildConfig.COMMIT_HASH); return true; }); linkClickable.setOnPreferenceLongClickListener(p -> { diff --git a/app/src/main/java/com/fox2code/mmm/utils/IntentHelper.java b/app/src/main/java/com/fox2code/mmm/utils/IntentHelper.java index ab75cbf..bbd5ab5 100644 --- a/app/src/main/java/com/fox2code/mmm/utils/IntentHelper.java +++ b/app/src/main/java/com/fox2code/mmm/utils/IntentHelper.java @@ -76,8 +76,8 @@ public enum IntentHelper { } startActivity(context, myIntent, false); } catch (ActivityNotFoundException e) { - Toast.makeText(context, "No application can handle this request.\n" - + " Please install a web-browser", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, FoxActivity.getFoxActivity(context).getString( + R.string.no_browser), Toast.LENGTH_LONG).show(); } } @@ -90,8 +90,8 @@ public enum IntentHelper { tabIntent.addCategory(Intent.CATEGORY_BROWSABLE); startActivityEx(context, tabIntent, viewIntent); } catch (ActivityNotFoundException e) { - Toast.makeText(context, "No application can handle this request.\n" - + " Please install a web-browser", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, FoxActivity.getFoxActivity(context).getString( + R.string.no_browser), Toast.LENGTH_LONG).show(); } } diff --git a/app/src/main/res/drawable/baseline_search_24.xml b/app/src/main/res/drawable/baseline_search_24.xml new file mode 100644 index 0000000..f3d8997 --- /dev/null +++ b/app/src/main/res/drawable/baseline_search_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5f11073..b2882e2 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -12,16 +12,16 @@ android:id="@+id/swipe_refresh" android:layout_width="match_parent" android:layout_height="match_parent" + app:layout_constraintBottom_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintBottom_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"> + android:layout_height="match_parent" + android:paddingBottom="56dp"> + app:layout_constraintTop_toBottomOf="parent" + app:layout_constraintTop_toTopOf="@+id/swipe_refresh" + app:showAnimationBehavior="outward" /> @@ -66,34 +68,31 @@ setting high app:cardCornerRadius is not supported on some versions so we must use code to get a round appearance. --> - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d0edc1d..71365aa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -373,4 +373,6 @@ Yer a wizard, Harry! Keep tapping to be admitted into Hogwarts! Modules + You do not have a browser installed. Please install one to continue. + Search