mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
Fix: QoL stuff (#5443)
* Tweak: align ram selection to multiples of height * tweak: ignore the notch for portrait devices while in the launcher * tweak(colors): make colors consistent across screens * fix(ui): make click animation consistent * fix(modpack-ui): handle long titles overlapping the source icon * fix:(modrinth-api): offset call is being ignored * fix(modpack-ui): remove keyboard after search * fix(profile-editor): properly consume file selection for custom controls Based from the work of @HopiHopy
This commit is contained in:
parent
2164b5be89
commit
85a9f217e5
@ -47,6 +47,11 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
Tools.setFullscreen(this, setFullscreen());
|
||||
Tools.ignoreNotch(PREF_IGNORE_NOTCH,this);
|
||||
Tools.ignoreNotch(shouldIgnoreNotch(),this);
|
||||
}
|
||||
|
||||
/** @return Whether or not the notch should be ignored */
|
||||
protected boolean shouldIgnoreNotch(){
|
||||
return PREF_IGNORE_NOTCH;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||
import android.Manifest;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
@ -153,6 +154,11 @@ public class LauncherActivity extends BaseActivity {
|
||||
private ActivityResultLauncher<String> mRequestNotificationPermissionLauncher;
|
||||
private WeakReference<Runnable> mRequestNotificationPermissionRunnable;
|
||||
|
||||
@Override
|
||||
protected boolean shouldIgnoreNotch() {
|
||||
return getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT || super.shouldIgnoreNotch();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -25,6 +25,7 @@ import java.io.File;
|
||||
public class FileSelectorFragment extends Fragment {
|
||||
public static final String TAG = "FileSelectorFragment";
|
||||
public static final String BUNDLE_SELECT_FOLDER = "select_folder";
|
||||
public static final String BUNDLE_SELECT_FILE = "select_file";
|
||||
public static final String BUNDLE_SHOW_FILE = "show_file";
|
||||
public static final String BUNDLE_SHOW_FOLDER = "show_folder";
|
||||
public static final String BUNDLE_ROOT_PATH = "root_path";
|
||||
|
@ -122,6 +122,8 @@ public class ProfileEditorFragment extends Fragment implements CropperUtils.Crop
|
||||
Bundle bundle = new Bundle(3);
|
||||
bundle.putBoolean(FileSelectorFragment.BUNDLE_SELECT_FOLDER, false);
|
||||
bundle.putString(FileSelectorFragment.BUNDLE_ROOT_PATH, Tools.CTRLMAP_PATH);
|
||||
mValueToConsume = FileSelectorFragment.BUNDLE_SELECT_FILE;
|
||||
|
||||
Tools.swapFragment(requireActivity(),
|
||||
FileSelectorFragment.class, FileSelectorFragment.TAG, bundle);
|
||||
});
|
||||
|
@ -89,7 +89,8 @@ public class SearchModFragment extends Fragment implements ModItemAdapter.Search
|
||||
mSearchProgressBar.setVisibility(View.VISIBLE);
|
||||
mSearchFilters.name = mSearchEditText.getText().toString();
|
||||
mModItemAdapter.performSearchQuery(mSearchFilters);
|
||||
return true;
|
||||
mSearchEditText.clearFocus();
|
||||
return false;
|
||||
});
|
||||
|
||||
mOverlay.post(()->{
|
||||
|
@ -30,9 +30,19 @@ public class ModrinthApi implements ModpackApi{
|
||||
@Override
|
||||
public SearchResult searchMod(SearchFilters searchFilters, SearchResult previousPageResult) {
|
||||
ModrinthSearchResult modrinthSearchResult = (ModrinthSearchResult) previousPageResult;
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
|
||||
// Fixes an issue where the offset being equal or greater than total_hits is ignored
|
||||
if (modrinthSearchResult != null && modrinthSearchResult.previousOffset >= modrinthSearchResult.totalResultCount) {
|
||||
ModrinthSearchResult emptyResult = new ModrinthSearchResult();
|
||||
emptyResult.results = new ModItem[0];
|
||||
emptyResult.totalResultCount = modrinthSearchResult.totalResultCount;
|
||||
emptyResult.previousOffset = modrinthSearchResult.previousOffset;
|
||||
return emptyResult;
|
||||
}
|
||||
|
||||
|
||||
// Build the facets filters
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
StringBuilder facetString = new StringBuilder();
|
||||
facetString.append("[");
|
||||
facetString.append(String.format("[\"project_type:%s\"]", searchFilters.isModpack ? "modpack" : "mod"));
|
||||
|
@ -3,7 +3,6 @@ package net.kdt.pojavlaunch.prefs.screens;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
@ -24,7 +23,7 @@ public class LauncherPreferenceFragment extends PreferenceFragmentCompat impleme
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
view.setBackgroundColor(Color.parseColor("#232323"));
|
||||
view.setBackgroundColor(getResources().getColor(R.color.background_app));
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class LauncherPreferenceJavaFragment extends LauncherPreferenceFragment {
|
||||
int maxRAM;
|
||||
int deviceRam = getTotalDeviceMemory(seek7.getContext());
|
||||
|
||||
if(is32BitsDevice() || deviceRam < 2048) maxRAM = Math.min(1000, deviceRam);
|
||||
if(is32BitsDevice() || deviceRam < 2048) maxRAM = Math.min(1024, deviceRam);
|
||||
else maxRAM = deviceRam - (deviceRam < 3064 ? 800 : 1024); //To have a minimum for the device to breathe
|
||||
|
||||
seek7.setMin(256);
|
||||
|
@ -12,5 +12,4 @@
|
||||
android:color="@color/minebutton_color"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="?attr/selectableItemBackground"/>
|
||||
</layer-list>
|
||||
|
@ -7,9 +7,6 @@
|
||||
|
||||
<corners android:radius="@dimen/_2sdp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/padding_input_bottom"
|
||||
android:top="@dimen/padding_input_top" />
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/_2sdp"
|
||||
@ -17,4 +14,13 @@
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="?attr/selectableItemBackground"/>
|
||||
<item>
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/padding_input_bottom"
|
||||
android:top="@dimen/padding_input_top" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
@ -37,8 +37,9 @@
|
||||
<TextView
|
||||
android:id="@+id/mod_title_textview"
|
||||
style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="@dimen/padding_moderate"
|
||||
android:ellipsize="end"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:statusBarColor">@color/background_status_bar</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@color/background_app</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
|
||||
<item name="android:textSize">@dimen/_14ssp</item>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:statusBarColor">@color/background_status_bar</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@color/background_app</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
|
||||
<item name="android:textSize">@dimen/_12ssp</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
android:summary="@string/mcl_memory_allocation_subtitle"
|
||||
android:title="@string/mcl_memory_allocation"
|
||||
app2:showSeekBarValue="true"
|
||||
app2:seekBarIncrement="10"
|
||||
app2:seekBarIncrement="8"
|
||||
app2:selectable="false"/>
|
||||
|
||||
<SwitchPreference
|
||||
|
Loading…
x
Reference in New Issue
Block a user