├── settings.gradle ├── app ├── src │ └── main │ │ ├── .gitignore │ │ ├── res │ │ ├── drawable │ │ │ ├── c.png │ │ │ ├── del.png │ │ │ ├── di.png │ │ │ ├── run.png │ │ │ ├── use.png │ │ │ ├── backup.png │ │ │ ├── chat.png │ │ │ ├── image0.png │ │ │ ├── image1.png │ │ │ ├── image2.png │ │ │ ├── image3.png │ │ │ ├── image4.png │ │ │ ├── image5.png │ │ │ ├── image6.png │ │ │ ├── image7.png │ │ │ ├── image8.png │ │ │ ├── image9.png │ │ │ ├── jump.png │ │ │ ├── load.png │ │ │ ├── openmw.png │ │ │ ├── pause.png │ │ │ ├── save.png │ │ │ ├── wait.png │ │ │ ├── crossbow.png │ │ │ ├── joystick.png │ │ │ ├── keyboard.png │ │ │ ├── ontarget.png │ │ │ ├── broadsword1.png │ │ │ ├── file_icon.png │ │ │ ├── inventory.png │ │ │ ├── joystick_bg.png │ │ │ ├── directory_up.png │ │ │ ├── pointer_arrow.png │ │ │ ├── directory_icon.png │ │ │ ├── starsattelites.png │ │ │ ├── divider.xml │ │ │ ├── toolbar_dropshadow.xml │ │ │ └── card_backround.xml │ │ ├── values │ │ │ ├── themes.xml │ │ │ ├── styles.xml │ │ │ ├── attrs.xml │ │ │ └── strings.xml │ │ ├── anim │ │ │ ├── down_from_top.xml │ │ │ └── up_from_bottom.xml │ │ ├── values-v21 │ │ │ └── styles.xml │ │ ├── xml │ │ │ ├── shortcuts.xml │ │ │ └── settings.xml │ │ ├── menu │ │ │ ├── menu_browser.xml │ │ │ ├── menu_settings.xml │ │ │ └── drawer.xml │ │ ├── layout │ │ │ ├── browser.xml │ │ │ ├── listview.xml │ │ │ ├── file_view.xml │ │ │ ├── activity_filechoser.xml │ │ │ ├── toolbar.xml │ │ │ ├── main.xml │ │ │ ├── rowlistview.xml │ │ │ ├── configure_controls.xml │ │ │ ├── settings.xml │ │ │ └── screencontrols.xml │ │ └── values-v14 │ │ │ └── styles.xml │ │ ├── java │ │ ├── ui │ │ │ ├── game │ │ │ │ └── GameState.java │ │ │ ├── controls │ │ │ │ ├── GamepadEmulator.java │ │ │ │ ├── JoystickLeft.java │ │ │ │ ├── JoystickRight.java │ │ │ │ ├── ButtonTouchListener.java │ │ │ │ ├── Joystick.java │ │ │ │ ├── Osk.kt │ │ │ │ └── Osc.kt │ │ │ ├── screen │ │ │ │ └── ScreenScaler.java │ │ │ ├── activity │ │ │ │ ├── TextListener.java │ │ │ │ ├── GlExtensionsActivity.java │ │ │ │ ├── ConfigureControls.kt │ │ │ │ ├── GameActivity.java │ │ │ │ └── MainActivity.java │ │ │ └── fragments │ │ │ │ ├── FragmentSettings.java │ │ │ │ ├── FragmentControls.java │ │ │ │ └── FragmentBrowser.java │ │ ├── parser │ │ │ └── CommandlineParser.java │ │ ├── utils │ │ │ ├── Server.java │ │ │ ├── Utils.java │ │ │ └── CustomAdapter.java │ │ ├── constants │ │ │ └── Constants.java │ │ ├── org │ │ │ └── libsdl │ │ │ │ └── app │ │ │ │ ├── SDL.java │ │ │ │ └── SDLAudioManager.java │ │ ├── permission │ │ │ └── PermissionHelper.java │ │ ├── file │ │ │ ├── Writer.java │ │ │ ├── utils │ │ │ │ └── CopyFilesFromAssets.java │ │ │ └── ConfigsFileStorageHelper.java │ │ ├── prefs │ │ │ └── PreferencesHelper.java │ │ └── cursor │ │ │ └── MouseCursor.java │ │ ├── gdb.sh │ │ └── AndroidManifest.xml ├── version ├── lint.xml ├── settings-base.cfg └── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── CI └── travis.sh ├── .gitignore ├── .travis.yml ├── upload.sh ├── gradlew.bat ├── README.md └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/.gitignore: -------------------------------------------------------------------------------- 1 | gdb.exec 2 | jni 3 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx16384m 2 | -------------------------------------------------------------------------------- /app/version: -------------------------------------------------------------------------------- 1 | 0.44.0 2 | 292536439eeda58becdb7e441fe2e61ebb74529e 3 | 5fd9079b26a60d3a8a52299d0ea8146b85323339 4 | -------------------------------------------------------------------------------- /app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/c.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/del.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/di.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/di.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/use.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/backup.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/chat.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image0.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image6.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image7.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image8.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/image9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/jump.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/load.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/openmw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/openmw.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/wait.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/crossbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/crossbow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/joystick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/joystick.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/keyboard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ontarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/ontarget.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/broadsword1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/broadsword1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/file_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/file_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/inventory.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/joystick_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/joystick_bg.png -------------------------------------------------------------------------------- /CI/travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd buildscripts 6 | ./full-build.sh 7 | 8 | cd .. 9 | 10 | ./gradlew assembleDebug 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/directory_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/directory_up.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pointer_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/pointer_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/directory_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/directory_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/starsattelites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte25/tes3mp-android/HEAD/app/src/main/res/drawable/starsattelites.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build 3 | jniLibs 4 | .idea 5 | local.properties 6 | *.iml 7 | obj 8 | assets 9 | .gdb_history 10 | app/wrap 11 | fabric.properties 12 | captures 13 | mainbuild.sh 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | sudo: false 3 | notifications: 4 | email: false 5 | 6 | script: ./CI/travis.sh 7 | 8 | android: 9 | components: 10 | - tools 11 | - build-tools-26.0.2 12 | - platform-tools 13 | - tools 14 | - android-27 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/toolbar_dropshadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/down_from_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/up_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/ui/game/GameState.java: -------------------------------------------------------------------------------- 1 | package ui.game; 2 | 3 | /** 4 | * Created by sandstranger on 14.10.16. 5 | */ 6 | 7 | public class GameState { 8 | private static boolean isGameStarted = false; 9 | 10 | public static boolean getGameState() { 11 | return isGameStarted; 12 | } 13 | 14 | public static void setGameState(boolean isGameStarted) { 15 | GameState.isGameStarted = isGameStarted; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/settings-base.cfg: -------------------------------------------------------------------------------- 1 | [Video] 2 | resolution x = 800 3 | resolution y = 600 4 | 5 | [Input] 6 | camera sensitivity = 0.4 7 | toggle sneak = true 8 | 9 | [GUI] 10 | scaling factor = 1.0 11 | 12 | [Game] 13 | allow capsule shape = true 14 | 15 | [Cells] 16 | preload enabled = false 17 | 18 | [Camera] 19 | viewing distance = 2000 20 | 21 | small feature culling = true 22 | small feature culling pixel size = 16.0 23 | 24 | [Navigator] 25 | enable = false 26 | 27 | [Map] 28 | local map resolution = 128 29 | 30 | [Terrain] 31 | distant terrain = false 32 | 33 | vertex lod mod = -1 34 | 35 | lod factor = 0.25 36 | 37 | composite map level = -3 38 | composite map resolution = 128 39 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/card_backround.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/parser/CommandlineParser.java: -------------------------------------------------------------------------------- 1 | package parser; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | 6 | public class CommandlineParser { 7 | private ArrayList args = new ArrayList<>(); 8 | private String[] argv; 9 | 10 | public CommandlineParser(String data) { 11 | args.clear(); 12 | args.add("openmw"); 13 | if (data.contains("--")) { 14 | Collections.addAll(args, data.split(" ")); 15 | } 16 | argv = args.toArray(new String[args.size()]); 17 | } 18 | 19 | public int getArgc() { 20 | return args.size(); 21 | } 22 | 23 | public String[] getArgv() { 24 | return argv; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_browser.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/gdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | cd $DIR 6 | 7 | # first argument: arch of the executable used (you have to figure it out yourself!) 8 | ABI=${1:-armeabi-v7a} 9 | source ../../../buildscripts/include/version.sh 10 | 11 | # set up fake "jni" so that ndk-gdb can find a "valid" Android.mk 12 | rm -rf jni && mkdir jni 13 | echo "APP_ABI := $ABI" > jni/Android.mk 14 | 15 | rm -f gdb.exec 16 | echo "shell rm -rf jni" >> gdb.exec 17 | echo "set solib-search-path ../../../buildscripts/symbols/$ABI/" >> gdb.exec 18 | echo "set history save on" >> gdb.exec 19 | echo "set breakpoint pending on" >> gdb.exec 20 | 21 | ../../../buildscripts/toolchain/ndk/ndk-gdb --launch --nowait -x "gdb.exec" 22 | -------------------------------------------------------------------------------- /app/src/main/java/utils/Server.java: -------------------------------------------------------------------------------- 1 | package utils; 2 | 3 | public class Server { 4 | 5 | private boolean isPassworded; 6 | private String ip; 7 | private String serverName; 8 | private int playerCount; 9 | 10 | public Server(boolean isPassworded, String ip, String serverName, int playerCount) { 11 | this.isPassworded = isPassworded; 12 | this.ip = ip; 13 | this.serverName = serverName; 14 | this.playerCount = playerCount; 15 | } 16 | 17 | public boolean getPassworded() { 18 | return isPassworded; 19 | } 20 | 21 | public String getip() { 22 | return ip; 23 | } 24 | 25 | public String getserverName() { 26 | return serverName; 27 | } 28 | 29 | public int getplayerCount() { 30 | return playerCount; 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_settings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 13 | 14 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/ui/controls/GamepadEmulator.java: -------------------------------------------------------------------------------- 1 | package ui.controls; 2 | 3 | import org.libsdl.app.SDLControllerManager; 4 | 5 | class GamepadEmulator { 6 | 7 | private static Boolean registered = false; 8 | 9 | static void updateStick(int stickId, float x, float y) { 10 | // random device ID to make sure it doesn't conflict with anything 11 | int deviceId = 1384510555; 12 | 13 | if (!registered) { 14 | registered = true; 15 | SDLControllerManager.nativeAddJoystick(deviceId, "Virtual", "Virtual", 16 | 0xbad, 0xf00d, 17 | false, 0xFFFFFFFF, 18 | 4, 0, 0); 19 | } 20 | 21 | SDLControllerManager.onNativeJoy(deviceId, stickId * 2 , x); 22 | SDLControllerManager.onNativeJoy(deviceId, stickId * 2 + 1, y); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package constants; 2 | 3 | public class Constants { 4 | 5 | public static String textureCompressionMode =""; 6 | public static final String APP_PREFERENCES = "settings"; 7 | public static final String HIDE_CONTROLS = "hidecontrols"; 8 | 9 | public static final String DATA_PATH = "data_path"; 10 | public static final String LANGUAGE = "encoding"; 11 | public static final String SUBTITLES = "subtitiles"; 12 | public static final String MIPMAPPING = "mipmapping"; 13 | public static final String COMMAND_LINE = "commandline"; 14 | public static final String TOUCH_SENSITIVITY= "camera sensitivity"; 15 | public static final String CAMERA_MULTIPLISER = "camera y multiplier"; 16 | public static final String MOUSE_TRANSPARENCY = "mouse transparency"; 17 | public static String commandLineData = ""; 18 | 19 | public static String APPLICATION_DATA_STORAGE_PATH =""; 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/browser.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/menu/drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/listview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/utils/Utils.java: -------------------------------------------------------------------------------- 1 | package utils; 2 | 3 | import android.app.Activity; 4 | import android.view.View; 5 | 6 | import java.io.File; 7 | 8 | /** 9 | * Created by sandstranger on 15.01.17. 10 | */ 11 | 12 | public class Utils { 13 | public static void deleteFile(String path) { 14 | File file = new File(path); 15 | if (file.exists()) { 16 | file.delete(); 17 | } 18 | } 19 | 20 | public static boolean fileExists(String path) { 21 | return new File(path).exists(); 22 | } 23 | 24 | public static void hideAndroidControls(Activity activity) { 25 | activity.getWindow().getDecorView().setSystemUiVisibility( 26 | View.SYSTEM_UI_FLAG_LAYOUT_STABLE 27 | | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 28 | | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 29 | | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 30 | | View.SYSTEM_UI_FLAG_FULLSCREEN 31 | | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/libsdl/app/SDL.java: -------------------------------------------------------------------------------- 1 | package org.libsdl.app; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | SDL library initialization 7 | */ 8 | public class SDL { 9 | 10 | // This function should be called first and sets up the native code 11 | // so it can call into the Java classes 12 | public static void setupJNI() { 13 | SDLActivity.nativeSetupJNI(); 14 | SDLAudioManager.nativeSetupJNI(); 15 | SDLControllerManager.nativeSetupJNI(); 16 | } 17 | 18 | // This function should be called each time the activity is started 19 | public static void initialize() { 20 | setContext(null); 21 | 22 | SDLActivity.initialize(); 23 | SDLAudioManager.initialize(); 24 | SDLControllerManager.initialize(); 25 | } 26 | 27 | // This function stores the current activity (SDL or not) 28 | public static void setContext(Context context) { 29 | mContext = context; 30 | } 31 | 32 | public static Context getContext() { 33 | return mContext; 34 | } 35 | 36 | protected static Context mContext; 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/permission/PermissionHelper.java: -------------------------------------------------------------------------------- 1 | package permission; 2 | 3 | import android.Manifest; 4 | import android.app.Activity; 5 | import android.content.pm.PackageManager; 6 | import android.os.Build; 7 | import android.support.v4.app.ActivityCompat; 8 | import android.support.v4.content.ContextCompat; 9 | 10 | /** 11 | * Created by sandstranger on 05.09.16. 12 | */ 13 | public class PermissionHelper { 14 | public static void getWriteExternalStoragePermission(Activity activity) { 15 | if (Build.VERSION.SDK_INT >= 23) { 16 | if (ContextCompat.checkSelfPermission(activity, 17 | Manifest.permission.WRITE_EXTERNAL_STORAGE) 18 | != PackageManager.PERMISSION_GRANTED) { 19 | if (ActivityCompat.shouldShowRequestPermissionRationale(activity, 20 | Manifest.permission.WRITE_EXTERNAL_STORAGE)) { 21 | } else { 22 | ActivityCompat.requestPermissions(activity, 23 | new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 23 24 | ); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/file_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 11 | 20 | 21 | 22 | 23 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_filechoser.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 14 | 15 | 19 | 20 | 25 | 26 |