How to add bubble counter on tabs in an Android application? Same has been done by eBuddy Android application.
if you mean a 'badge' widget, there is no built in mechanics for this in android.
you have to design your own TabHost widget which displays the 'bubble' the way you want.
Related
I just notice that my Android app, when I run it on
Android TV with leanback intent, that it doesn't
show a sandwich button for the menu items.
This is missing, and everthing else like the title:
What is the suggested alternative? Is it possible
to listen to a button on the remote control and
make the menu items visible?
Incase you are looking for tab based navigation, The Leanback templates provide side navigation in the browse experience, which works well for many apps. If you need tab navigation (typically displayed horizontally across the top of the app), you can instead use Leanback Tabs.
Add the library to your project:
implementation "androidx.leanback:leanback-tab:$version"
Sample code
val leanbackTabLayout = findViewById<LeanbackTabLayout>(R.id.tab_layout)
val leanbackViewPager = findViewById<LeanbackViewPager>(R.id.view_pager)
leanbackViewPager.setAdapter(adapter)
leanbackTabLayout.setupWithViewPager(leanbackViewPager)
Then implement tabs using LeanbackTabLayout and LeanbackViewPager by following the existing ViewPager guide. Note that LeanbackViewPager is based on ViewPager, not ViewPager2.
Note that only themes that are derived from Theme.AppCompat are supported.
What is complete replacement of iOS Tabs Replacement in Android.
I Know that Android is Android and we don't Imitate other platforms on Android. I have Studied Pure Android
But All I want to have the replacment of iOS tabs in Android with following features.
1.) Stores Navigation flow for each tab, As in iOS there is navigation controller for each tab and we can have the previous state for each tab while switching from tab to tab.
2.) Desirable but not necessary- Double click on tab button will refresh the view with the root view as per in iOS.
3.) The animation while switching from tab to tab or with in Tab does not swipe the complete Tabs(including the TAB Bar). It means only the content of each Tab should be replaceable with separate Activity or something like this.
4.) In short User Experience must be similar to iOS Tab Bar.
What I have Tried so far.
1.) Added Tabs with TabHost on bottom of screen.But I Haven't got the stack navigation for each Tab separately.
(Something like: https://github.com/AdilSoomro/Iphone-Tab-in-Android)
2.) Also I have an idea of Using Stack (Java Collection Framework.) But that will be a headache to maintain all the stack by my self.
So, Guys In short:
Do you have any ideas of any Third Party Library, that I can use in my project without much problem to achieve all the features mentioned above?
Any help would be appreciated.
Thanks.
This one is best to implement iOS like tabs in Android
Like this:
You can use the native tabs and style it to seem like iOS ones.
Use Fragments, and store/reload the "Natigation flow" at the onPause/onRestore methods in each Fragment or in the FragmentActivity when you change form one fragment to an other.
BTW, please don't do that. If you studied Pure Android, what's the point do you want to achieve? Android is Android and iOS is iOS, do not mix them please.
UPDATE: 3 September 2017
An other, and imho better, approach to do so is make use of the Bottom Navigation. Take a look to materialdocs to learn how to use it.
I'm working on something in Titanium, and am having some difficulty trying to achieve this.
On the Android version, the tabgroup seems to be fixed to the top. I'm fine with that, but I do want the app's logo bar to be above that.
I'm trying to achieve something similar to what Twitter has for their Android app. They have their logo and a compose tweet button that exist above the tabgroup. Here's a screenshot for clarity:
Is this even possible? If it can't be done with native tabGroups, is there some workaround that I could implement?
Thanks in advance!
You can't do it with a tabGroup in Titanium - they don't have a navBar in Android. With a lot of work, you can create your own by creating a base window, adding tab graphics (view) with click handlers, and they open new windows with a top: attribute that is below the tabs. Good luck.
I want to achieve the two tabs as below using titanium for android.
These are not the normal tabs, so how do I achieve them ?
Thanks !!
These seem to be buttons on a toolbar and not tabs.
As there is no support for Android toolbars in Titanium (I'm not sure if Android a thing called toolbar) you will have to fake it.
To get the same results on Android you would have to use regular createView and add background and different buttons in it. you will also have to make the buttons work.
Use two Buttons and a ViewFlipper that contains different ListViews.
custom tabgroup class working on android and iphone may be useful to you. See the screen shots for android and for iphone also.
By using css or jquery it's easy to bring this grouped buttons. But in android native application how to design a xml file to bring grouped buttons like this, without using tabWidget method (i.e)tab layout.
That's a segmented radio button. There are various solutions but this is a good one: https://github.com/makeramen/android-segmentedradiobutton