More cleanup

This commit is contained in:
Anuken
2019-09-07 12:10:26 -04:00
parent 168011586b
commit 06e6deae42
3 changed files with 7 additions and 33 deletions

View File

@ -1,12 +1,11 @@
package io.anuke.mindustry;
import android.*;
import android.app.*;
import android.content.*;
import android.content.pm.*;
import android.net.*;
import android.os.*;
import android.os.Build.*;
import android.os.*;
import android.provider.Settings.*;
import android.telephony.*;
import io.anuke.arc.*;
@ -24,7 +23,6 @@ import io.anuke.mindustry.ui.dialogs.*;
import java.io.*;
import java.lang.System;
import java.util.*;
import static io.anuke.mindustry.Vars.*;
@ -38,13 +36,9 @@ public class AndroidLauncher extends AndroidApplication{
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useImmersiveMode = true;
config.depth = 0;
if(doubleScaleTablets && isTablet(this.getContext())){
UnitScl.dp.addition = 0.5f;
}
config.hideStatusBar = true;
Net.setClientProvider(new ArcNetClient());
Net.setServerProvider(new ArcNetServer());
initialize(new ClientLauncher(){
@ -72,24 +66,6 @@ public class AndroidLauncher extends AndroidApplication{
}
}
@Override
public void requestExternalPerms(Runnable callback){
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&
checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){
callback.run();
}else{
permCallback = callback;
ArrayList<String> perms = new ArrayList<>();
if(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
perms.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
if(checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
perms.add(Manifest.permission.READ_EXTERNAL_STORAGE);
}
requestPermissions(perms.toArray(new String[0]), PERMISSION_REQUEST_CODE);
}
}
@Override
public void shareFile(FileHandle file){
}
@ -97,7 +73,6 @@ public class AndroidLauncher extends AndroidApplication{
@Override
public void showFileChooser(boolean open, String extension, Consumer<FileHandle> cons){
if(VERSION.SDK_INT >= 19){
Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
@ -145,7 +120,11 @@ public class AndroidLauncher extends AndroidApplication{
public boolean canDonate(){
return true;
}
}, config);
}, new AndroidApplicationConfiguration(){{
config.useImmersiveMode = true;
config.depth = 0;
config.hideStatusBar = true;
}});
checkFiles(getIntent());
}

View File

@ -233,7 +233,7 @@ editor.removeunit = Remove Unit
editor.teams = Teams
editor.errorload = Error loading file:\n[accent]{0}
editor.errorsave = Error saving file:\n[accent]{0}
editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy Map' button in the editor.
editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy MThereap' button in the editor.
editor.errorlegacy = This map is too old, and uses a legacy map format that is no longer supported.
editor.errornot = This is not a map file.
editor.errorheader = This map file is either not valid or corrupt.

View File

@ -36,11 +36,6 @@ public interface Platform{
});
}
/** Request external read/write perms. Run callback when complete.*/
default void requestExternalPerms(Runnable callback){
callback.run();
}
/** Update discord RPC. */
default void updateRPC(){
}