android-tabs

put tabs in the bottom of screen

孤者浪人 提交于 2019-11-30 11:28:25
I want to put tabs at the bottom part of my screen . For this purpose I have the following code : package info.androidhive.tabsswipe; import info.androidhive.tabsswipe.adapter.TabsPagerAdapter; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; public class MainActivity extends FragmentActivity implements ActionBar.TabListener { private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; // Tab

Android, Tabs without Actionbar

亡梦爱人 提交于 2019-11-30 10:52:14
问题 This question has been asked (for example, here Using ViewPager with Tabs without actionBar), however the answer there doesn't work. There's some links to Swipey but unfortunately the link is broken too. The example from Android site EffectiveNavigation uses Actionbar to host the tab fragment, so obviously if I set a .NoActionBar theme, then there's no host. Any different way? Thanks. Update screenshot of what I want to create, at the top, there's no actionbar. Update 2 this is from the

ActionBar Tabs with multiple fragments

落花浮王杯 提交于 2019-11-30 08:46:45
I've been trying to update my app and get going with fragments, the action bar, and all the other UI features that I'm missing out on. I understand I can have multiple fragments in an activity, have different layouts based upon the device and all that good stuff but I'm struggling with getting some tab stuff the way I want. I understand how to add tabs, switching between them but how do I have more than one fragment in a tab? So for example I have essentially two screens I want the user to be able to switch back and forth from easily (why I want to use tabs). If I have two separate activities

How to refresh a Fragment of a FragmentPagerAdapter?

十年热恋 提交于 2019-11-30 08:36:23
I have got 2 tabs called tab1 (home) and tab2 (profile) using TabPageIndicator and FragmentPagerAdapter libraries. In tab2, I have a button named "Log in" (tab2 inflates abc.xml ). When users click "log in" button, the app will show a login form in a new activity. After logging in, the activity finishes and the content view of tab2 will change ( it shows user's profile because it will inflate xyz.xml ). How can I do that? public class MainActivity extends SherlockFragmentActivity { private static String[] TAB_NAMES = null; private Context context = this; private static FragmentPagerAdapter

How is TabItem used when placed in the layout XML?

扶醉桌前 提交于 2019-11-30 05:55:06
The TabLayout documentation gives an example of nesting TabItem directly inside TabLayout like so: <android.support.design.widget.TabLayout android:layout_height="wrap_content" android:layout_width="match_parent"> <android.support.design.widget.TabItem android:text="@string/tab_text"/> <android.support.design.widget.TabItem android:icon="@drawable/ic_android"/> </android.support.design.widget.TabLayout> But it gives no example of how this could be used in practice, and the documentation for TabItem says: This view is not actually added to TabLayout, it is just a dummy which allows setting of a

How to implement horizontally scrollable tabs?

為{幸葍}努か 提交于 2019-11-30 05:21:19
I'm trying to implement this application. At the moment I have designed tabs on it and since I have more than 7 tabs it looks too congested. How can I design it so that the tabwidget is scrollable horizontally. I have seen this design on few of the apps at the market but no clue how to implement this in my app. One app I saw had a horizontal scrollview where it scrolls on its own and when you press the particular image/button it displays some content. It didn't seem to be tabs I guess. So does anyone have an idea of this? Please check out Jake Wharton's ViewPager app. That is exactly what you

How to Style ActionBar, tab background on selected tab

蹲街弑〆低调 提交于 2019-11-30 03:23:47
I'm struggling with styling the ActionBar. My app has an ActionBar with three tabs. I'm trying to get the selected tab to have a background color, and the unselected tabs to show a different color. I'm following this reference: Customizing Action Bar . But all the TABs are showing the Selected color. My styles.xml file is as follows: <style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBar.TabBar"> <item name="android:background">@drawable/tab_background</item> <item name="android:paddingLeft">32dp</item> <item name="android:paddingRight">32dp</item> </style> <style

How to get which fragment has been selected

安稳与你 提交于 2019-11-30 02:46:07
问题 I am creating a tab application, using fragments. I have successfully created tabs, but now I need to create an object when a specific fragment is selected. e.g. When I select SettingsTab I need to call a function that is defined in Test class . and similarly destroy // SettingsTab package com.example.sensorspositioningn; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class SettingsTab

Multiple maps v2 in TabActivity

有些话、适合烂在心里 提交于 2019-11-30 02:05:51
I'm currently trying to have 2 maps v2 in different tabs of a TabActivity using MapView objects. The problem arises in the following scenario: tab1 with a map is displayed go to tab2 in order to display another map in this second tab looks like the map image from first tab is overlapping the new map. See the following picture: On the right you can see how the first map is still displayed on top of it. The touch events are going to the new map but that doesn't really help. I spent a lot of time trying to convert our app to use fragments and run into other types of issues. One of them being http

Tabs below action bar

删除回忆录丶 提交于 2019-11-29 23:50:17
问题 I'm developing for Android 4.3 and been having a problem with my code that I can't seem to figure out. I've been looking for answers for a while and all I could find was people that want my current situation while I want their bugged program. I have 3 tabs which I've placed in the action bar by Android's tutorial for tabs in ActionBar. What is supposed to happen: The tabs should appear on the action bar What happens instead: The tabs appear below the action bar My questions are: 1. How can I