work on some things

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/287/head
androidacy-user 1 year ago
parent df46a7c93b
commit a3b3c8b547

@ -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

@ -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

@ -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);

@ -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 -> {

@ -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();
}
}

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.8l-0.3,-0.3C15.4,12.6 16,11.1 16,9.5 16,5.9 13.1,3 9.5,3S3,5.9 3,9.5 5.9,16 9.5,16c1.6,0 3.1,-0.6 4.2,-1.6l0.3,0.3v0.8l5,5L20.5,19l-5,-5zM9.5,14C7,14 5,12 5,9.5S7,5 9.5,5 14,7 14,9.5 12,14 9.5,14z"/>
</vector>

@ -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">
<!-- FrameLayout is the best way to fix blurring -->
<FrameLayout
android:id="@+id/blur_frame"
android:paddingBottom="56dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:paddingBottom="56dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/module_list"
@ -44,11 +44,11 @@
android:layout_height="wrap_content"
android:indeterminate="true"
android:scaleY="2"
app:showAnimationBehavior="outward"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/swipe_refresh" />
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/swipe_refresh"
app:showAnimationBehavior="outward" />
<LinearLayout
android:id="@+id/search_container"
@ -57,8 +57,10 @@
android:layout_marginHorizontal="12dp"
android:layout_marginVertical="8dp"
android:filterTouchesWhenObscured="true"
android:gravity="bottom|end"
android:gravity="bottom|start"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_fitsSystemWindowsInsets="bottom"
tools:ignore="RtlHardcoded">
@ -66,34 +68,31 @@
setting high app:cardCornerRadius is not supported on some versions
so we must use code to get a round appearance.
-->
<!-- Material down arrow icon -->
<com.google.android.material.button.MaterialButton
android:id="@+id/down_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:background="@color/transparent"
android:visibility="gone" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/search_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="65dp"
android:layout_gravity="center"
android:background="@null"
android:shape="ring"
android:visibility="visible"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="true"
android:visibility="gone"
app:strokeColor="@android:color/transparent"
app:strokeWidth="0dp">
<androidx.appcompat.widget.SearchView
android:id="@+id/search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="300dp"
android:layout_height="24dp"
android:background="@null"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/bottom_navigation"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:iconifiedByDefault="true"
app:useDrawerArrowDrawable="true" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout>

@ -373,4 +373,6 @@
<string name="yer_a_wizard_harry">Yer a wizard, Harry!</string>
<string name="keep_tapping_to_enter_hogwarts">Keep tapping to be admitted into Hogwarts!</string>
<string name="modules">Modules</string>
<string name="no_browser">You do not have a browser installed. Please install one to continue.</string>
<string name="search">Search</string>
</resources>

Loading…
Cancel
Save