NappDrawer icon indicating copy to clipboard operation
NappDrawer copied to clipboard

Any way of disabling the action bar?

Open alexbudin opened this issue 11 years ago • 32 comments

Is there any way of disabling the action bar? so we can use custom made navigation bars.

Thank you.

Alex

alexbudin avatar Jul 06 '14 23:07 alexbudin

This worked for me, I got the idea from http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Action_Bar-section-36735509_AndroidActionBar-HidingtheActionBar

Create the custom_theme.xml file in this location platform/android/res/values/custom_theme.xml

Add this code below.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.NoActionBar" parent="@style/Theme.Titanium">
        <!-- Depending on the parent theme, this may be called android:windowActionBar instead of windowActionBar -->
        <item name="android:windowActionBar">false</item>
    </style>
</resources> 

Then go here modules/android/dk.napp.drawer/1.1.3/ and edit timodule.xml and add the following line under the manifest opening tag.

<application android:theme="@style/Theme.NoActionBar"/>

spudatron avatar Jul 07 '14 03:07 spudatron

Just delete the actionbar from your code. The example code in this module has an actionbar. That's why it's there.

viezel avatar Jul 07 '14 05:07 viezel

It was still appearing for me so I had to use the solution above.

spudatron avatar Jul 07 '14 05:07 spudatron

i have to agree with @spudatron. @viezel The code at the bottom just attaches an event listener on the action bar, it does not show or hide it.

I will try @spudatron 's solution and get back.

Thank you

alexbudin avatar Jul 07 '14 08:07 alexbudin

Just an update on hiding the actionbar using the above suggested code. It will revert to using UI picker elements pre API 11. You will this style of picker http://i.stack.imgur.com/KXpiM.png

spudatron avatar Jul 10 '14 11:07 spudatron

Using Latest Ti-SDK 3.3.0 it appear ActionBar in android even i use navBarHidden: true in drawer's TSS file. but with previous Ti-SDK 3.2.3 : it not show it . strange but Legacy window Support has gone in new SDK it make issues. Ti SDK 3.3.0.GA Ti CLI 3.3.0 ALLOY - 1.4.0. Appcelerator Studio, build: 3.3.0.201407111535 Mac OS X 10.9

jayeshIT avatar Jul 22 '14 13:07 jayeshIT

There is no way to hide the ActionBar as of Android 3.4.0.

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

Yes there are tons of ways. And the simplest one is to use themes.

I will comeback with some more details tomorrow once i gather everything from the project i did it in.

Stand by guys.

alexbudin avatar Nov 26 '14 18:11 alexbudin

I have done everything and more in these replies, it just simply won't happen.

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

it works, i can assure you.

alexbudin avatar Nov 26 '14 18:11 alexbudin

install 3.4.1 and nappDrawer 1.1.4 and tell me it does.

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

i had 3.4.1 and 1.1.3 and it worked fine.

alexbudin avatar Nov 26 '14 18:11 alexbudin

wait, are you talking about the phones top bar, or the bar that labels your app on top of a window?

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

You can do the top bar as well of course from themes but the action bar as well.

  • platform
    • android
      • res
        • drawable
        • drawable-hdpi
        • drawable-mdpi
        • drawable-xhdpi
        • drawable-xxhdpi
        • values
        • values-v14

Did you try using themes? Added above a structure for themes in a titanium project.

And then of course making a reference to the new theme in your tiapp file (in the android manifest section):

I will try to post a theme at some point tomorrow as i dont have access to the project from the IP range i am in now.

alexbudin avatar Nov 26 '14 18:11 alexbudin

Yes, I did the exact theme routines that everyone has shown on here, it is just ignored, I can't get a new window I create to not have a bar on top saying [MY APP NAME] and pushing my content down

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

You can use the action bar style generator online and them you can look on what properties to set in the themes XML to hide it

alexbudin avatar Nov 26 '14 18:11 alexbudin

my custom theme is in platform - android - res - values - 'custom_theme.xml'

gabeaguirre avatar Nov 26 '14 18:11 gabeaguirre

maybe if you put a picture with what you are getting now and one with what you are trying to achieve. It would be a bit easier maybe to get the idea

alexbudin avatar Nov 26 '14 18:11 alexbudin

![screen shot 2014-11-26 at 11 00 26 am](https://cloud.githubusercontent.com/assets/8825958/5207049/953bcf26-755b-11e4-8419-e8626a6633d4.png)

gabeaguirre avatar Nov 26 '14 19:11 gabeaguirre

Also did you make sure you are using a new Android API. i was using 14 i think.

alexbudin avatar Nov 26 '14 19:11 alexbudin

screen shot 2014-11-26 at 11 02 28 am

gabeaguirre avatar Nov 26 '14 19:11 gabeaguirre

Yes, I am using the newest, everything is new.

gabeaguirre avatar Nov 26 '14 19:11 gabeaguirre

i will send the theme i have and you can tell me if it works. Ill make an archive. Please do not change anything in there. Also before you use mine make sure you get rid of anything from your tiapp.xml theme related and from your platform folder. Ill come back in 5 minutes

alexbudin avatar Nov 26 '14 19:11 alexbudin

@gabeaguirre try to do this:

<style name="Theme.NoActionBar" parent="Theme.AppCompat.Translucent.NoTitleBar">

iskugor avatar Nov 26 '14 20:11 iskugor

Ok i will try. So many things with windows has changed, now when I have a window with a view on top, it doesn't matter what my view's border radius is because the background of the window is always square, and for some reason contains my slash image.

gabeaguirre avatar Nov 26 '14 20:11 gabeaguirre

Here is the link to the theme i used: https://www.dropbox.com/s/6leps1v41d46d0p/platform.zip?dl=0

and you just need to add this in the tiapp:

This is what i have used

Make sure you get rid of everything old you had in there.

Let me know.

Alex

alexbudin avatar Nov 26 '14 21:11 alexbudin

Sorry, this is the stuff that goes in the tiapp.xml

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <uses-sdk android:targetSdkVersion="19"/>
            <supports-screens android:anyDensity="true"/>
            <application android:theme="@style/Theme.Cheilbreak"/>
        </manifest>
    </android>

alexbudin avatar Nov 26 '14 21:11 alexbudin

I got it to work by adding a theme component to my Windows in alloy. I don't know why this stopped working. Now my problem is that I can't get old legacy style windows back, I don't know how anyone expects to make pop-up non-fullscreen windows in android anymore.

gabeaguirre avatar Nov 26 '14 21:11 gabeaguirre

Why use windows and not a view?

alexbudin avatar Nov 26 '14 21:11 alexbudin

Because the napp drawer complicates this, I'm trying to open up a non-fullscreen view to pick from tools such as flashlight, and this occurs when the left drawer is open

gabeaguirre avatar Nov 26 '14 21:11 gabeaguirre