Support showing the app title bar through a preference.

This does not change the default behaviour, and will only show the title bar 
when the showTitle preference is true. This allows apps to show and make use of 
the ActionBar in Android 3.x and 4.0.

Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/80ee6c1a
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/80ee6c1a
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/80ee6c1a

Branch: refs/heads/master
Commit: 80ee6c1a9184754bdf431cf45470747237b3b86c
Parents: 22e5ccf
Author: Darryl Pogue <[email protected]>
Authored: Tue Jun 12 10:03:50 2012 -0700
Committer: Darryl Pogue <[email protected]>
Committed: Tue Jun 12 10:03:50 2012 -0700

----------------------------------------------------------------------
 framework/src/org/apache/cordova/DroidGap.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/80ee6c1a/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java 
b/framework/src/org/apache/cordova/DroidGap.java
index 5e2586d..a47ac87 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -313,7 +313,9 @@ public class DroidGap extends Activity implements 
CordovaInterface {
         LOG.d(TAG, "DroidGap.onCreate()");
         super.onCreate(savedInstanceState);
 
-        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        if (!preferences.prefMatches("showTitle", "true")) {
+            getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        }
 
         if (preferences.prefMatches("fullscreen","true")) {
             getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

Reply via email to