How does instagram fixed and change the bar when scroll up in android? - android

Notice: I cannot provide pictures due to my reputation.
When we scroll down from the feed in instagram the action bar is actually hide and a white bar that indicate the user name and time is fixed at the top. When we scrolling down again the previous white bar will scroll up and next bar will fixed at the top again. I want to make something like that for my school project.
So my first question is how can I hide the action bar while scrolling up and show it again while i scrolling down?
Second question is how can I make the white bar just like how instagram did it?
Any help will be highly apperciate!!

I am not a 100% sure what to do to accomplish the movable action-bar, but you may want to look into "toolbar" which may provide more manipulation potential.
http://www.google.com/design/spec/layout/structure.html#structure-toolbars
http://developer.android.com/reference/android/widget/Toolbar.html
http://cyrilmottier.com/2013/05/24/pushing-the-actionbar-to-the-next-level/
Also, if you are looking for the white part that has to do with usernames and such inside instagram, you should look for an effect called sticky-headers.
Awesome library to quickly add list view animations, such as sticky-headers
https://github.com/nhaarman/ListViewAnimations

Related

How to position the elements in a custom action bar layout in Android?

I need to develop a custom layout for the action bar in Android.
I'm now stuck because I have no clue how to calculate the available space for my custom layout.
In the image, the red part is my custom layout, the blue part is the space occupied by the action buttons.
Clearly I need to know/calculate the size of the red part to be able to correctly position the elements in my custom action bar (for example center the title in the window or make sure not to overflow in the blue part).
How can I achieve this?
I couldn't find useful examples or a clear API in the Android documentation.
I think that anyone using the custom action bar layout must be facing this kind of problem, I'm a bit confused.
Or am I supposed not to use action buttons in this case? Perhaps I'm supposed to replicate the action buttons by myself?
Thanks in advance
Try using ToolBar instead of ActionBar. It will give you a lot more control over ActionBar elements than ActionBar.
Here is a simple tutorial about how to replace ActionBar with ToolBar and how you can customise it.
Material ToolBar
Possibilities are endless with ToolBar but my recommendation is to don't overdo anything.
As per my suggestion try to use the entire action bar by your custom layout. So that you can arrange all the things use it as a fragment inside a framelayout for all your screens so that the code can be reused for all your layouts.

UI screen design

I am working on an Android application and have to code up the following design for one of the screens:
(Ignore the yellow stuff, I have just masked the Logo and the App-specific information for now)
My question is: How do I design this particular type of screen? The top pane is akin to an ActionBar in Android. However, when any button on the top pane is hit, this custom "popup" having a rectangular form with a small arrow on top pointing towards the button is display and does not interrupt the current/main activity.
I have looked around, but still dont understand how to accomplish this.
Any thoughts? Thanks!
You can use the native Action Bar along with the icons.
The only problem is if you want to show them all at once.
Some icons may be hidden depending on the size of the phone.
As for the custom pop-up, the toast feature is available to do that.
It is quite easy to adjust the position of toasts and customise toasts :
Customisation of toasts: http://developer.android.com/guide/topics/ui/notifiers/toasts.html#CustomToastView
Changing postion of toasts: How to change position of Toast in Android?

GridView removing row too soon

I'm using a GridView that fills the whole of my main activity. To make it look nicer I'm using a transparent action bar. I'm using these values on my grid view so that the content doesn't start in the action bar but still scrolls through it:
android:paddingTop="?android:attr/actionBarSize"
android:clipToPadding="false"
The only problem is once the bottom of the row enters the action bar it disappears. I'm assuming because Android thinks it is no longer visible so it's safe to remove.
I'd like a way for it to not disappear, even past the status bar as I'll probably make that transparent on KitKat too. Either a different approach or a simple solution would be great.
Turns out this was a problem with the TwoWayGridView library I was using (https://github.com/jess-anders/two-way-gridview). Switched back to a normal GridView and it works fine.

Android: Positioning Action Items on the left of the Action Bar

Hello everyone,
The first two pictures from the top is currently what I have. The arrow changes images when you click it. I want to make the arrow(action item) closer to the title(sort by) due to design requirements. I have tried to add blank action items to push the arrow over closer to the title but will not work to the various screen sizes.I also realize that the action bar is quite limited as you can only add action items to the right of the action bar.
I gave an example by displaying the bottom two pictures. As you can see the arrow is close to the Chinese title.
Any Ideas will be greatly appreciated as I am quite stuck. Thanks in advance !
Regards,
Ryan
You might be able to tell what the Chinese app is doing via uiautomatorviewer. Possibilities include:
They are using the logo, where the Chinese characters and the arrow are both part of the graphic image. See setDisplayUseLogoEnabled().
They have disabled the title and are using a custom navigation view. See setCustomView().

Vertical Action Bar for Android

I want to display the Action Bar Vertically in my App.
I have found few examples for the Horizontal One, but not any for the Vertical One.
Can anyone please give me any example for the Vertical Action Bar.
Thanks,
David Brown
There's nothing in the Android UI design guide about a vertical ActionBar. But you might be able to coerce a similar effect by locking the display orientation, and then applying a rotation to the View in the content area. You also might be able to get somewhere by downloading the source code for ActionBarSherlock and implementing your own version of the ActionBar. But I don't recommend either of these solutions. If you're really that intent on putting actions on the side of your screen, I suggest either a small vertical LinearLayout, or implement one of the side navigation solutions as discussed in Android Facebook style slide.

Categories

Resources