Comments (27)
Just looked at everything and I don't think it should be too difficult. Plan of action :
- extend Window (it's an abstract class) with a class "custom window"
- instantiate it in the Activities' onCreate methods and pass it the "actual window" and the SlidingMenu from the Activity
- override getDecorView in custom window to return an arbitrary view
- all other abstract methods should be passed to the actual window
- override getWindow in the Activities to return the custom window
from slidingmenu.
Check up time!
Status : completed, kind of...
Why the "kind of..."? Well, doing this is more complicated than I had planned. Doing everything in my comment above turned out to be relatively easy and I could trick ABS into installing the ActionBar into any view I wanted. The only problem is that integrating involves more steps than that. In order to get the ActionBar to slide with the above view, 2 more steps have to happen and they are
1 - The ABS/res/values-v11 and ABS/res/values/v-14 folders have to be deleted
2 - The ActionBarSherlock class must point to ActionBarSherlockCompat and never use ActionBarSherlockNative
This is as far as I know right now. These steps were taken in the patched version of ABS included with SlidingMenu. I'm going to try to dig farther down and see if I can get this to work with the native ActionBar as well.
from slidingmenu.
Maybe you should get in touch with Jake Wharton about this?
from slidingmenu.
The usages of a customized ActionBarSherlock library is the only thing stopping the library from being great.
Also, just because a project is using the ActionBarSherlock, doesn't mean that we necessarily want the Action Bar to move with the "CustomViewAbove".
I'd love to be able to use this with stock ActionBarSherlock, even (especially) if it mean a stationary Action Bar. Perhaps make this the default, and have the custom one as a separate option?
from slidingmenu.
The only thing different in the patched version of ABS is the the values-v11 and values-v14 folders have been deleted and the ActionBarSherlockNative file is not registered in ActionBarSherlock.java.
Writing non Sherlock dependent Activities would be doable, just more work on my plate.
If you want to use it with any project for now, you can definitely just manage the SlidingMenu yourself as you would manage a ViewGroup because that's really what it is. Does that make sense for the interim?
from slidingmenu.
Thanks for the reply and awesome work. I can definitely code around this (and I have), but it would be nice if I didn't have to. :)
Just to be clear, I am not asking for non-sherlock dependent activities, but rather ones that don't require a modified ABS library. It appears that the only reason for the patched ABS is to allow the action bar to shift with the above content, correct? I just started looking into the library, so please excuse my ignorance.
The amount of polish in here is great, and with a few minor adjustments, this could definitely become the go-to library for Nav Drawers (similar to the way ABS is for Action Bars). The only thing stopping me from recommending it to everyone is this ABS issue.
Keep up the great work!
from slidingmenu.
Thank you so much for the appreciation. I definitely need those recommendations :)
Ah, I'm sorry about the way I worded that. Just to clarify, non-Sherlock dependent activities would be the same thing as what you asked for, I just worded it differently.
Also, do you think the current form of the Activities would be good to keep for the new regular Activity wrappers that I write? (i.e. setContentView, setBehindContentView, getSlidingMenu, etc.).
It just may get incredibly complicated having to maintain regular Activities (those that don't have sliding ActionBars, whether SherlockActivities or not) and then SherlockActivities that have sliding ActionBars. I definitely want to expose the sliding ActionBar Activities to users as well. Any recommendations?
from slidingmenu.
The move off my patched version is almost complete. There is just one bug left where the Behind View will be drawn under the notification bar. If anybody knows how to fix this, please let me know!
from slidingmenu.
I wouldn't have the first idea, but maybe setting a top margin? That seems like a really ugly solution, though, but I'm really glad to hear that this library might be standalone soon!
from slidingmenu.
Yeah, that was the plan for now until I can find a more permanent solution
from slidingmenu.
Done-ish. With a hack for that top margin. There is a method that does exactly what I want but it's only exposed on API 14 and later. It's called setFitsSystemWindows(boolean b)
. If anybody has any ideas about this please let me know.
I've also been using it recently with stock ABS and HoloEverywhere for a project.
Soooo, about those recommendations... :P
from slidingmenu.
Awesome work with the latest update. Sorry I wasn't able to get back sooner, you know how these things go.
I just posted on Google+ recommending this project, and the response is already very positive: https://plus.google.com/u/0/113406723988623654387/posts/iB18AhbWJTS.
from slidingmenu.
Thanks a lot and thanks for the post! I think it brought in around 20 watchers so far. Super exciting :)
Definitely still a ways to go, but this was an awesome round of refactoring.
from slidingmenu.
My pleasure! The recognition is well-deserved. 20 watchers = tip of the iceberg. :-)
I'm actually now having an issue with ABS integration. I created copies of SlidingFragmentActivity and SlidingActivityHelper to extend SherlockFragmentActivity. This works perfectly with the native Action Bar in ICS and JB (surfaced from ABS), but the Action Bar is not showing up on anything below ICS (including Honeycomb).
This is observed on a Nexus One running stock 2.3.6, and a 3.2 Emulator (my Galaxy Tab is dead in more ways than one).
Is there some other modification that I am overlooking, or is this a bug?
EDIT
I should note that I am also using ViewPagerIndicator and HoloEverywhere in this project. The tabs are showing and working correctly in all API versions tested.
from slidingmenu.
Hmmm what theme are you using?
from slidingmenu.
Theme.HoloEverywhereLight.DarkActionBar.Sherlock but the same is happening with Theme.HoloEverywhereLight.Sherlock and Theme.HoloEverywhereDark.Sherlock.
from slidingmenu.
And you're using a stock version of ABS, not the one that I had in the repo before?
from slidingmenu.
Hmmm I just tested on a 2.3.4 Bionic and it seems fine there
from slidingmenu.
Correct. I'm guessing that you're not seeing this?
Paul Burke
ipaul.pro
On Jul 25, 2012 4:54 PM, "Jeremy Feinstein" <
[email protected]>
wrote:
And you're using a stock version of ABS, not the one that I had in the
repo before?
Reply to this email directly or view it on GitHub:
#6 (comment)
from slidingmenu.
Nope. How are your dependencies set up?
from slidingmenu.
Added all stock libraries linked through Eclipse as Android Library
Projects. Using only the libraries mentioned above.
Could you share your setup with ABS, and ViewPagerIndicator that is working
for you?
Paul Burke
ipaul.pro
On Wed, Jul 25, 2012 at 5:04 PM, Jeremy Feinstein <
[email protected]
wrote:
Nope. How are your dependencies set up?
Reply to this email directly or view it on GitHub:
#6 (comment)
from slidingmenu.
Is there a way that I could do that without sharing the project itself?
from slidingmenu.
Not really, but I'm sure your followers would benefit from an "example-abs-vpi" project in the repo that shows how to use this with ActionBarSherlock and ViewPagerIndicator. :-)
from slidingmenu.
Yeah, better examples need to come soon.
Can you get the View Hierarchy of your application and send that to me? I'm not too familiar with the Eclipse tool for doing this. Or just call getWindow().getDecorView() and then trace down to where the ActionBarContainers are and let me know what their parent view is.
from slidingmenu.
From the View Hierarchy, it looks like the ActionBarContainer is either removed by me (oops, if it was) or was never generated. Is the ActionBar fine if you activity doesn't extend Sliding_Activity?
If it is, then I'd like to see your code so I can check it out.
from slidingmenu.
I figured it out! Setting setSlidingActionBarEnabled(false) causes the Action Bar to disappear completely when using ABS. I will create a new, separate Issue for this.
from slidingmenu.
Awesome! ... well not awesome that it happens, but awesome that now we know the cause. I'll get on it as soon as I can. Thanks for rooting this issue out :)
from slidingmenu.
Related Issues (20)
- 在AndroidStudio上怎么配置 HOT 5
- update SlidingMenu Mode from another Fragment
- Previous listview item setchecked in sliding menu when back press from another fragment HOT 3
- Sliding menu with android:windowSoftInputMode adjustResize shows white strip on top of view while keyboard is open
- FloatMath Deprecated from Android 22 onwards
- if your app use theme background in style.xml , it will show nothing in slidingmenu HOT 1
- error when running SlidingMenu FloatMath.sin(f) HOT 1
- Add Fragments
- after slidingMenu open, can't scroll on listview HOT 2
- Customize Sliding HOT 3
- FloatMath library unavailable in API 23 and later HOT 1
- Does it work with Adobe Flash ?
- Using SLIDING_WINDOW mode overlaps with navigation bar HOT 3
- my own issue HOT 1
- A HOT 5
- Multi window feature
- A Black Bar in Slidingmenu HOT 1
- 怎么让内容页出现黑色遮罩呢? HOT 1
- Attr "Mode" is duplicate then migrate to AndroidX
- Migrated to AndroidX but app crashes on back button press HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slidingmenu.