swipe tab layout, changes icon on toolbar - java

how to create display toolbar change icon in tab layout as in Line Messenger ?
I've been trying to figure out, but it never worked.enter image description here
Sorry my english is not good . Thanks !

You can use invalidateOptionsMenu(), and the onCreateOptionsMenu() method will be recalled, so you can decide to inflate another XML-Menu layout.
Good luck

Related

Android Dev: Navigation View vs App Bar

I'm new to Android development. I get that a NavigationView is an AppBar (i think). What makes these two different? I want to create a custom "appbar/toolbar" with a centered logo and menu/settings button in the top right corner (instead of the standard left) which reveals a drawer.
I was going to ditch the built in appbar/toolbar all together and just create my own somehow and include button overlay which displays a drawer.
What would you do? Navigation view, app bar, or custom toolbar from scratch? I don't know what the standard is or what is acceptable. What is the difference between a navigationview and appbar. Thank you.
edit: I'm slowing realizing that an appbar is one feature within a navigation view, among others like a drawer layout, menu items etc... i think.
1. NavigationView
By using NavigationView, we can bind the menu directly with NavigationView. This is the benefit of the NavigationView. No need to create ListView and adapter with navigation drawer. By default we can get selector of item click. With menu we can change the color of icon of selected menu.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/NavigationView.html
http://www.technotalkative.com/part-4-playing-with-navigationview/
2. AppBar
Appbar is for toolbar with scrolling effect. We can easily give the material design effect.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html

ActionBarSherlock custom NavigationDrawer icon

I'm implementing NavigationDrawer with ActionBarSherlock and now I'm trying to implement custom icon for opening and closing the drawer. I already set my own icon (white) but I'm not able to get rid of that grey default icon.
in onCreateOptionsMenu I'm doing this:
getSupportActionBar().setDisplayShowTitleEnabled(false); // does not display activity title
getSupportActionBar().setBackgroundDrawable(
getResources().getDrawable(R.drawable.actionbar_background)); // blue background
getSupportActionBar().setIcon(R.drawable.side_menu_button); // white icon
The picture shows difference when navigation drawer is closed (first) and open (second picture).
Is there any way to do it programmatically? Or is there even some way to do it? I hope it is.
Thank you.
EDIT: This is what I'm trying to achieve:
What you are currently doing is setting the icon on the ActionBar, which is different from setting the icon of the ActionBarDrawerToggle, which is what you want to be dealing with. If you look at the documentation (http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html) and find the constructor, you'll see there's a place to specify a custom Drawable to be used by the toggle.

Overlap a layout with viewPager

maybe you can help me. I want to use viewPager to overlap an other layout. so for example: I the first Fragment. On this Fragment is a picture, than I swipe to the right and then the second Fragment should just go over the first Fragment. It's like in the Android Youtube App in which you swipe from left to right and the settings and etc go over the main layout(like in the picture). Can you tell me what i have to do?
Thanks a lot, Vinzenz.
picture:
http://i.stack.imgur.com/CQ8gL.png
What you're asking for is actually not related to ViewPager. There is another layout you can use to implement the same navigation pane overlay: DrawerLayout link: http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

How to create buttons like Android Google Plus App

I am new to Android development, and I am wondering if there are any samples available to create a panel similar to the photo/checkin/mood/write panel at the bottom of the google+ app on android.
1) Are they 4 buttons? How do I style the buttons to look like that?
2) I want to auto hide the panel on scroll down, but show on scroll up.
Appreciate if anyone could guide me in the right direction.
Cheers
To show\hide panel - use animation.
This panel can be linearLayout with 4 buttons.
Do detect what've been scrolled look at: Synchronise ScrollView scroll positions - android
you can use linearlayout and in that take for imageview..when scrolling you can show/hide linearlayout..and for view you can use linearlayout color as black and this imageview images..
OK, so I implemented exactly what you trying to do only without the buttons.
After lot of hours spending googling around I found this one - https://gist.github.com/imminent/4576886 by Dandre' Allison, which is a specific implantation of quick return bar for a list view which is little more trickier from other view components. For more implementations of quick return bar and other scrolling tricks you can use Roman Nurik's Scrolling Tricks library here https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt and here http://www.androidviews.net/2012/11/scrolling-tricks/. I just saw that there is another quick return bar for list view implenation by Lars Werkman in https://github.com/LarsWerkman/QuickReturnListView which I never tested. I used the Dandre' Allison snippet which works great.
Answering your first question.
all the buttons are either in ImageButton, or in ImageView that make it clickable. it's either you can lay it out in LinearLayout or RelativeLayout, well it's depends on how you want to make it.
Try Using split action bar this will basically do the task for you.

Trying to develop a sliding drawer type View in android?

I am working on an app which requires me to make a layout something like this:
Here you could see a black button like view at the right bottom . I want this button to work as a sliding drawer type view.
when I drag this button this would happen:
How could I implement this .Please someone help me with this .
Where could I start from (Please give some link to source or example)?
i cant see ur images so edit ur link and try this one. http://blog.sephiroth.it/2011/03/29/widget-slidingdrawer-top-to-bottom/
I've implemented my own drawer after reading this very good article :
http://w2davids.wordpress.com/android-damn-that-sliding-drawer/
Good luck.

Categories

Resources