how can I implement common Bottom bar which behave like tab? - android

I have implement bottom bar as show below I achieved this using view flipper, its work perfect but when I select any one item to start new activity, its blink because of activity change.
I want to make this bottom-bar behave like as tab in which only tab change and it wont blink activity.

Design a seperate layout with the Bottom images and their behavior (like using selector etc to change state when you click on it ) and add that layout to your Activity XML using
<include> </include> tag

Related

Tabbar in ios at the top of screen

I want to make tabbar at the top of the screen in iOS and want to place 3-4 tabs. Android is giving functionality by default using Tab bar layout. For more understanding https://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/
Thank you for your help.
You can achieve it by using UICollectionView inside your ViewController. Create a custom tab bar on your ViewController and set actions for each bar to navigate the pages on your UICollectionView.
You can manipulate your Custom UICollectionViewCell inside cellForItemAt to differentiate each page.
For UICollectionView tutorial you can check out this page: https://www.raywenderlich.com/9334-uicollectionview-tutorial-getting-started
I have created a view pager with a bottom tab bar, like instagram has, on one of my apps using this UICollectionView.

Android Actionbar PopupMenu with Custom Item Layouts

I am working on an Android application where I have to design a menu which will populate from the action bar, like this:
I have tried my best but was not able to produce it using the Android controls.
The solutions I have tried are:
With Actionbar, add a menu item with a group with selectable="all", that produces the layout I need but when I click a checkbox for selecting it, the whole menu hides and selection is not done, moreover the menu icon in actionbar does not have the bottom right white arrow.
Tried creating a custom ActionProvider and added the menu items using class's OnPrepareSubMenu method but had the same issue.
I just need a push in the right direction and I can do the rest, suggestions are more than welcome.
Thank you :)
Use popupWindow.
In that you can make any custom layout and set it as content of your popupwindow and also you can specify an ANCHOR in your case it would be
R.id.your_menu_item
set a listener and listen the changes.

Creating an Android Nav Bar that replaces button with image when that activity is active

I am looking to create a Nav Bar in my Android application that functions very similar to the Nav Bar used by the Netflix app. There will be 4 buttons aligned horizontally. When one of those buttons is selected, the appropriate activity loads and that button is replaced by an image.
There are multiple ways I can achieve this, but since I am new to programming for Android, I figured I'd ask the community first. I list the first two that come to my head below.
Create a Linear Layout and define a separate layout for each activity. The Layout would include two more linear layouts, a horizontal linear layout for the nav bar and a vertical layout for the content.
Create a custom ui component named nav bar that extends a linear layout (based upon earlier threads I have seen about nav bars on here). Inflate that layout for each activity, then make a framelayout that overlays an image on top of the active button (the button that was just pressed). Then create onButtonClick listeners for each button except for the active button.
I'm not sure if there is a better way to achieve this and I am open to any suggestions. Any feedback would be great.
I'm not sure how the netflix app looks, but you might want to check out ye good olde tab-layout? ( http://developer.android.com/resources/tutorials/views/hello-tabwidget.html )
Also be sure to take a look at the android design page: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

Custom Component in android

I have created custom component with a Button Bar on the Bottom of
the screen and a Title and status bar on the top of the screen. I want
to include this custom component in every one of my Activities. Now,
in a any given activity, how do I go about adding content on the
screen (say a button in the middle of the screen) in a addition to my
custom component thats ever present?
How about adding a base layout with can contain the header and footer that you use everywhere and then have a stub in the middle that you can inflate with whatever you like?
I think that will solve your problem.
You can read about ViewStub here:
http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-with.html

Android creating Bottom Bar Menu

I want to have an static bottom menu bar exist through out the applications in every page visible at bottom all the time. I have designed the menu bar but i am confused whether i have to integrate the menu code with every layout xmls to make menu visible in every page and write the code in every activity class to perform functions on menu clicks. Or if there is any other way i can create a common bottom bar that lies with every page with writing the code of menu in a single activity class.
Well the best way in my opinion , is to create a bottom bar xml file , and include it in every Activity's xml file
<include android:layout_width="fill_parent" layout="#layout/bottom_bar" />
where your bottom bar xml file name is bottom_bar.xml
This article also might help you
http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html
There is also the include route:
Common layout in all tabs
What you are probably looking for is one Activity with a TabBar with tabs at the top and buttons at the bottom: Android: Tabs at the BOTTOM
Then you can use different Views that correspond to Tabs instead of separate Activities.

Categories

Resources