I wish to know if it is possible to do something. I know this is not the purpose of a drawer, but I have to use it something else than navigation in my case.
For example, it want to display some text, with drag and drop, the user can delete text or add new text with a button in it.
I can't display this text outside of this drawer because of UI.
I think it's not possible (I find nothing to do or talk about it on internet), if you can confirm this to me, it will be helpfull.
If you think it's possible, do you have any idea where to start ?
And, can I use a short video instead of an icon for an item ?
Thanks for your answer.
The DrawerLayout is just a different type of ViewGroup. You can place anything you want within it.
Related
I tried to look for a question like this here but couldn't find one.
I'm trying to implement something like Google Keep's "Add Label" in my Navigation Drawer and make that category stay permanently. I think the last part can be done with SharedPreferences. It's just the first I need help with. Any ideas as to how I can implement something similar? Or any examples I can take a look at? Thanks a lot.
You could use this method to add items:
dynamically add items to Navigation Drawer
Now it depends in what kind of dialog you want the user to enter them.
I am not quite sure what I should be searching for, so I thought I would ask if anyone could 1) Help me identify the NAME of what it is I am trying to create or 2) give me an idea of a library / how I would go about creating this.
See this (Poorly-drawn) picture:
What I am trying to do is to create a normal Fragment which has normal content in it, but when you press a button somewhere (IE action bar), it creates a recyclerview that is "floating" as a type of overlay on top of your fragment. Ideally if the user clicks elsewhere, it will close it (So it should simulate the behavior of a dismissible dialog box), but also allow clicking within the view itself.
Also, if possible, I want to make a connection between the + sign and the recyclerview (Like a line or something) just to indicate it is connected and is an overlay.
Anyone have any recommendations as to what I should do or what I should be looking for? Thanks!
-Sil
You can place your RecyclerView within a DialogFragment. That way you can get the overlay feel, and you can also dismiss it when user clicks anywhere outside of it.
I am looking to create a navigation or menu bar similar to the functionality of the one at the top of the Fox News app. I started to code this myself using a Gallery but I'm not sure how to hide the left and right arrows when they are not needed. I was also wandering if you would have to use images for the menu items or if you could just use TextView or buttons so I could change the text without having to modify an image. I have seen this type of navigation on several apps and I tried all types of searches trying to find code examples but I must not be using the correct name for this type of scrollable menu because I couldn't find anything. If anyone has an example or provide a link to an article I would greatly appreciate it.
Look into HorizontalScrollView. It is a Layout that will handle the smooth scrolling and is likely to be much less of a hassle to work with than Gallery for this operation (I just added one for a similar reason).
To handle the left/right, look into setOnTouchListener. I'm not sure if you can get the current scroll position without making a new child class of HorizontalScrollView to access protected methods. There may be other ways, however - I didn't need to add buttons so I didn't investigate.
The New York Times Android application has something like a notification bar at the top.
I suspect this is an included layout with a text view. The thing is that they managed to drag that title down in order to present the top news.
Can anyone give any insight on how to replicate this?
Edit:
Yes the drawer was the solution to my problem nevertheless i needed one as New York time and the default SlidingDrawer are meant to only go bottom to top... so i looked over on St Google and got a nice Custom Componente Sliding Drawer, get some difficult to make it work as i need it but you can follow the case in Layout positioning problem with Custom SlidingDrawer
I think what you're looking for is a Sliding Drawer.
http://developer.android.com/reference/android/widget/SlidingDrawer.html
edit:
the link I post is good for the documentation, but might not give a full idea of what is actually happening. A good place to find an example might be here:
http://techdroid.kbeanie.com/2009/08/android-sliding-drawer-example.html
They have most likely just used a TextView as you said. Moving it down can be done in multiple ways. The simplest is just to have another view or view group in top of it and initially set its visibility to gone, and then to visible when you want to show it.
Sorry, i misunderstood what you meant. Since the top element was so small, i simply thought you meant you wanted to expose a element on top of the other element. Ill up vote the other answer since this is most likely what you are after :)
I want to create a custom OptionsMenu in my application. The default OptionsMenu display only three items in one row. Now i want to display five to six items having only icons. Also i want to change the background color of the OptionsMenu but not getting the appropriate way of doing this. If it is possible then please let me know about it.
Short answer
As an user it bothers me when the application changes my android's widgets. I wouldn't recommend changing that and android doesn't provide a way to do it.
Long answer
Even though Android doesn't provide a way to customize that you can always handle the key event and show a view from your own. Similar discussion in stackoverflow.