viezel / NappDrawer

A side drawer navigation container view controller for Appcelerator Titanium.
MIT License
247 stars 128 forks source link

Any way of disabling the action bar? #99

Open alexbudin opened 10 years ago

alexbudin commented 10 years ago

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

Thank you.

Alex

spudatron commented 10 years ago

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"/>
viezel commented 10 years ago

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

spudatron commented 10 years ago

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

alexbudin commented 10 years ago

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

spudatron commented 10 years ago

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

jayeshIT commented 10 years ago

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

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

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.

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

it works, i can assure you.

gabeaguirre commented 9 years ago

install 3.4.1 and nappDrawer 1.1.4 and tell me it does.

alexbudin commented 9 years ago

i had 3.4.1 and 1.1.3 and it worked fine.

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

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

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.

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

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

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

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

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

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

gabeaguirre commented 9 years ago

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

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

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

iskugor commented 9 years ago

@gabeaguirre try to do this:

<style name="Theme.NoActionBar" parent="Theme.AppCompat.Translucent.NoTitleBar">
gabeaguirre commented 9 years ago

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.

alexbudin commented 9 years ago

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 commented 9 years ago

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>
gabeaguirre commented 9 years ago

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.

alexbudin commented 9 years ago

Why use windows and not a view?

gabeaguirre commented 9 years ago

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

alexbudin commented 9 years ago

Napp uses windows but you can have views in those windows.

I could not help you more as i don't know your implementation. I hope you make it work. Let me know if i can help with anything.

I am in the process of publishing some example apps with nappdrawer, i need to make a few more tweaks and i will start putting them on github. make sure you follow me if you want to know when they are here.

qasim90 commented 6 years ago

Can somebody tell if the theme can be set using theme property in createDrawer() method (like normal Titanium windows) to achieve window specific theming?

I am creating the drawer like following but the theme has no affect and action bar is still there. Had to hide it programmatically in the window open event which is not very clean:

 var drawer = NappDrawerModule.createDrawer({
    theme: "Theme.NoActionBar",
         ...
 })