Fix some weird layout issues

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/267/head
androidacy-user 1 year ago
parent 9e9793ddcd
commit d675e6702a

@ -139,7 +139,7 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
}
setContentView(R.layout.activity_main);
this.setTitle(R.string.app_name);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, 0);
setActionBarBackground(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
WindowManager.LayoutParams layoutParams = this.getWindow().getAttributes();
@ -749,6 +749,7 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
View view = getLayoutInflater().inflate(R.layout.setup_box, null);
// Make the setup_box linear layout the sole child of the root_container constraint layout
setContentView(view);
updateScreenInsets();
// Handle action bar. Set it to setup_title and make it visible
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {

@ -1,7 +1,6 @@
package com.fox2code.mmm.androidacy;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
@ -58,8 +57,17 @@ public final class AndroidacyRepoData extends RepoData {
public AndroidacyRepoData(File cacheRoot, SharedPreferences cachedPreferences, boolean testMode) {
super(testMode ? RepoManager.ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT : RepoManager.ANDROIDACY_MAGISK_REPO_ENDPOINT, cacheRoot, cachedPreferences);
// make sure the metadata db exists
SQLiteDatabase.openOrCreateDatabase(new File(cacheRoot, "modules.db"), null);
// make sure the modules.json exists
File modulesJson = new File(cacheRoot, "modules.json");
if (!modulesJson.exists()) {
try {
if (!modulesJson.createNewFile()) {
throw new IOException("Failed to create modules.json");
}
} catch (IOException e) {
e.printStackTrace();
}
}
this.defaultName = "Androidacy Modules Repo";
this.defaultWebsite = RepoManager.ANDROIDACY_MAGISK_REPO_HOMEPAGE;
this.defaultSupport = "https://t.me/androidacy_discussions";

@ -106,8 +106,7 @@ public class MarkdownActivity extends FoxActivity {
}
setActionBarBackground(null);
this.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, 0);
if (config != null && !config.isEmpty()) {
String configPkg = IntentHelper.getPackageOfConfig(config);
try {

@ -1,43 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<!-- App name as subheader -->
<ScrollView
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/setup_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="fill_vertical"
android:layout_gravity="fill"
android:orientation="vertical"
android:padding="16dp"
android:scrollbars="vertical">
android:fillViewport="true"
android:padding="6dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- App name as subheader -->
<TextView
android:id="@+id/setup_title"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:text="@string/setup_title"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" />
android:text="@string/setup_title" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/setup_scroll" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/setup_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/setup_title"
android:text="@string/setup_message" />
<ScrollView
android:id="@+id/setup_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/setup_summary"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Theme radio select. Options are system, light, dark, black, transparent_light -->
<!-- First, choose theme header -->
<TextView
@ -51,7 +50,7 @@
<!-- Button to trigger theme selection -->
<com.google.android.material.button.MaterialButton
android:id="@+id/setup_theme_button"
android:layout_width="match_parent"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:backgroundTint="@color/gray_900"
@ -66,18 +65,16 @@
app:iconPadding="8dp"
app:iconTint="@color/white"
app:iconTintMode="src_in"
app:rippleColor="@color/gray_800" />
app:rippleColor="@color/gray_800" tools:ignore="DuplicateSpeakableTextCheck" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/repos"
android:textAppearance="@android:style/TextAppearance.Material.Headline" />
<com.google.android.material.materialswitch.MaterialSwitch
android:textAppearance="@android:style/TextAppearance.Material.Headline" /><com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/setup_androidacy_repo"
android:layout_width="match_parent"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:checked="false"
@ -97,7 +94,7 @@
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/setup_magisk_alt_repo"
android:layout_width="match_parent"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:checked="false"
@ -131,7 +128,7 @@
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/setup_crash_reporting"
android:layout_width="match_parent"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:checked="false"
@ -150,7 +147,7 @@
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/setup_background_update_check"
android:layout_width="match_parent"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:checked="false"
@ -178,31 +175,28 @@
android:key="pref_app_analytics"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:text="@string/setup_app_analytics" />-->
</LinearLayout>
</ScrollView>
<!-- setup_cancel and setup_continue side by side buttons, stuck to bottom right, with a small space in between -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/setup_scroll"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom|end"
android:layout_margin="4dp"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/setup_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_weight="1"
android:text="@string/cancel" />
<!-- Linear layout for the finish and cancel buttons -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="4dp"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/setup_cancel"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_weight="1"
android:text="@string/cancel" android:textColor="#5D4037" />
<com.google.android.material.button.MaterialButton
android:id="@+id/setup_continue"
android:layout_width="wrap_content"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/finish" />
</LinearLayout>
</RelativeLayout>
android:text="@string/finish" android:textColor="#5D4037" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Loading…
Cancel
Save