From 0874d5d7e6d143b7e402423e04042d27a87a2cf6 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 2 Feb 2016 13:00:08 +0000 Subject: [PATCH] Re-save JUCE demo after changing Java files --- examples/Demo/Builds/Android/local.properties | 4 +- .../src/com/juce/jucedemo/JuceDemo.java | 47 ++++++++++++++++++- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/examples/Demo/Builds/Android/local.properties b/examples/Demo/Builds/Android/local.properties index 45d3a8b7ad..2720240294 100644 --- a/examples/Demo/Builds/Android/local.properties +++ b/examples/Demo/Builds/Android/local.properties @@ -1,8 +1,8 @@ # This file is used to override default values used by the Ant build system. # It is automatically generated by the Introjucer - DO NOT EDIT IT or your changes will be lost!. -sdk.dir=${user.home}/Library/Android/sdk -ndk.dir=${user.home}/Library/Android/sdk/ndk-bundle +sdk.dir=/home/fr810/SDKs/android-sdk +ndk.dir=/home/fr810/SDKs/android-sdk/ndk-bundle key.store=${user.home}/.android/debug.keystore key.alias=androiddebugkey key.store.password=android diff --git a/examples/Demo/Builds/Android/src/com/juce/jucedemo/JuceDemo.java b/examples/Demo/Builds/Android/src/com/juce/jucedemo/JuceDemo.java index b84e6e2f7e..99ac1f870a 100644 --- a/examples/Demo/Builds/Android/src/com/juce/jucedemo/JuceDemo.java +++ b/examples/Demo/Builds/Android/src/com/juce/jucedemo/JuceDemo.java @@ -970,7 +970,7 @@ public class JuceDemo extends Activity super.onCreate (savedInstanceState); isScreenSaverEnabled = true; - getActionBar().hide(); + hideActionBar(); viewHolder = new ViewHolder (this); setContentView (viewHolder); @@ -1013,6 +1013,49 @@ public class JuceDemo extends Activity getApplicationInfo().dataDir); } + private void hideActionBar() + { + // get "getActionBar" method + java.lang.reflect.Method getActionBarMethod = null; + try + { + getActionBarMethod = this.getClass().getMethod ("getActionBar"); + } + catch (SecurityException e) { return; } + catch (NoSuchMethodException e) { return; } + if (getActionBarMethod == null) return; + + // invoke "getActionBar" method + Object actionBar = null; + try + { + actionBar = getActionBarMethod.invoke (this); + } + catch (java.lang.IllegalArgumentException e) { return; } + catch (java.lang.IllegalAccessException e) { return; } + catch (java.lang.reflect.InvocationTargetException e) { return; } + if (actionBar == null) return; + + // get "hide" method + java.lang.reflect.Method actionBarHideMethod = null; + try + { + actionBarHideMethod = actionBar.getClass().getMethod ("hide"); + } + catch (SecurityException e) { return; } + catch (NoSuchMethodException e) { return; } + if (actionBarHideMethod == null) return; + + // invoke "hide" method + try + { + actionBarHideMethod.invoke (actionBar); + } + catch (java.lang.IllegalArgumentException e) {} + catch (java.lang.IllegalAccessException e) {} + catch (java.lang.reflect.InvocationTargetException e) {} + } + //============================================================================== private native void launchApp (String appFile, String appDataDir); private native void quitApp(); @@ -1761,7 +1804,7 @@ public class JuceDemo extends Activity return Environment.getExternalStoragePublicDirectory (type).getAbsolutePath(); } - public static final String getDocumentsFolder() { return getFileLocation (Environment.DIRECTORY_DOCUMENTS); } + public static final String getDocumentsFolder() { return Environment.getDataDirectory().getAbsolutePath(); } public static final String getPicturesFolder() { return getFileLocation (Environment.DIRECTORY_PICTURES); } public static final String getMusicFolder() { return getFileLocation (Environment.DIRECTORY_MUSIC); } public static final String getMoviesFolder() { return getFileLocation (Environment.DIRECTORY_MOVIES); }