ANDROID: Fix RequiresApi annotations

These have been checked with Android linter and are not necessary.
setMarginEnd is only available starting with L_MR1 and is not useful.
This commit is contained in:
Le Philousophe 2023-03-11 12:35:47 +01:00
parent bc89781445
commit 528378a560
2 changed files with 2 additions and 9 deletions

View File

@ -852,7 +852,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
private MouseHelper _mouseHelper;
private Thread _scummvm_thread;
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -876,8 +875,7 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
LinearLayout buttonLayout = new LinearLayout(this);
buttonLayout.setOrientation(LinearLayout.HORIZONTAL);
FrameLayout.LayoutParams buttonLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.END);
buttonLayoutParams.setMarginEnd(5);
FrameLayout.LayoutParams buttonLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.RIGHT);
buttonLayoutParams.topMargin = 5;
buttonLayoutParams.rightMargin = 5;
_videoLayout.addView(buttonLayout, buttonLayoutParams);
@ -1270,7 +1268,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
}
// Auxiliary function to overwrite a file (used for overwriting the scummvm.ini file with an existing other one)
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private static void copyFileUsingStream(File source, File dest) throws IOException {
try (InputStream is = new FileInputStream(source); OutputStream os = new FileOutputStream(dest)) {
copyStreamToStream(is, os);
@ -1311,7 +1308,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
return result;
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private static String getVersionInfoFromScummvmConfiguration(String fullIniFilePath) {
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(fullIniFilePath))) {
Map<String, Properties> parsedIniMap = parseINI(bufferedReader);
@ -1326,7 +1322,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
return "";
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private static String getSavepathInfoFromScummvmConfiguration(String fullIniFilePath) {
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(fullIniFilePath))) {
Map<String, Properties> parsedIniMap = parseINI(bufferedReader);
@ -1341,7 +1336,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
return "";
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private boolean seekAndInitScummvmConfiguration() {
// https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)
@ -1920,7 +1914,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
// - We don't need to copy (sub)folders
// - We copy all the files from our assets (not a subset of them)
// Otherwise we would probably need to create a specifically named zip file with the selection of files we'd need to extract to the internal memory
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void copyAssetsToInternalMemory(boolean sideUpgrade) {
// sideUpgrade is set to true, if we upgrade to the same version -- just check for the files existence before copying
if (_actualScummVMDataDir != null) {

View File

@ -35,7 +35,7 @@ android {
setProperty("archivesBaseName", "ScummVM")
minSdkVersion 19
minSdkVersion 16
targetSdkVersion 33
versionName "2.8.0"