-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Freat[misc_settings]: check for Turnip compatibility to hide the driv…
…er option
- Loading branch information
Showing
4 changed files
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
.../main/java/net/kdt/pojavlaunch/prefs/screens/LauncherPreferenceMiscellaneousFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
package net.kdt.pojavlaunch.prefs.screens; | ||
|
||
import android.content.pm.PackageManager; | ||
import android.os.Bundle; | ||
|
||
import androidx.preference.Preference; | ||
|
||
import net.kdt.pojavlaunch.R; | ||
import net.kdt.pojavlaunch.Tools; | ||
import net.kdt.pojavlaunch.utils.GLInfoUtils; | ||
|
||
public class LauncherPreferenceMiscellaneousFragment extends LauncherPreferenceFragment { | ||
@Override | ||
public void onCreatePreferences(Bundle b, String str) { | ||
addPreferencesFromResource(R.xml.pref_misc); | ||
Preference driverPreference = requirePreference("zinkPreferSystemDriver"); | ||
if(!Tools.checkVulkanSupport(driverPreference.getContext().getPackageManager())) { | ||
driverPreference.setVisible(false); | ||
} | ||
PackageManager packageManager = driverPreference.getContext().getPackageManager(); | ||
boolean supportsTurnip = Tools.checkVulkanSupport(packageManager) && GLInfoUtils.getGlInfo().isAdreno(); | ||
driverPreference.setVisible(supportsTurnip); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters