Open alexbudin opened 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"/>
Just delete the actionbar from your code. The example code in this module has an actionbar. That's why it's there.
It was still appearing for me so I had to use the solution above.
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
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
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
There is no way to hide the ActionBar as of Android 3.4.0.
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.
I have done everything and more in these replies, it just simply won't happen.
it works, i can assure you.
install 3.4.1 and nappDrawer 1.1.4 and tell me it does.
i had 3.4.1 and 1.1.3 and it worked fine.
wait, are you talking about the phones top bar, or the bar that labels your app on top of a window?
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.
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
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
my custom theme is in platform - android - res - values - 'custom_theme.xml'
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
Also did you make sure you are using a new Android API. i was using 14 i think.
Yes, I am using the newest, everything is new.
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
@gabeaguirre try to do this:
<style name="Theme.NoActionBar" parent="Theme.AppCompat.Translucent.NoTitleBar">
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.
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
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>
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.
Why use windows and not a view?
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
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.
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",
...
})
Is there any way of disabling the action bar? so we can use custom made navigation bars.
Thank you.
Alex