android-tabs

Android Fragments with Tabs and Viewpager

安稳与你 提交于 2019-11-29 04:16:14
问题 We are building an App as shown above that has nesting of Fragments. Tabs Featuring - Details Tab and MAps Tab Details Tab will have a slideshow - like the View Page Slider and information below that which will be scrollable. Maps Tab which will display the maps. I have implmented the tabs and maps as well as the Slider as seen above. Now i am confused how i can add content below the Slider which will make the Details Tab scrollable. What i have tried ? On CLicking the Details tab the

Nested Action Bar Tabs(with ViewPager)

扶醉桌前 提交于 2019-11-29 04:15:26
问题 I have a project that uses Action Bar Tabs(with ViewPager). Tabs move really smoothly when swiping between them, but I need to add two sub tabs, in TAB 2, then move to the next tabs or of course back, just like on the Glassdoor or Flipboard. Please help. MainActivity public class MainActivity extends AppCompatActivity { private SectionsPagerAdapter mSectionsPagerAdapter; private ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Align-Center SlidingTabLayout

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 02:28:32
After I moved my app to 5.0, I had to move from the basic tabs to the slidingTabLayout that a google developer provides . The problem is, I can't figure out how to center both buttons in a way that they get both centered like the old one. Btw, I'm not talking about the style, just the positioning of the buttons, sharing the same amount o widht space! To make things clear I'll post some images: What I have now: What I expect to have: My layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match

How to Style ActionBar, tab background on selected tab

天大地大妈咪最大 提交于 2019-11-29 00:28:28
问题 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

Multiple maps v2 in TabActivity

ε祈祈猫儿з 提交于 2019-11-28 23:01: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

Tab+ViewPager not updating instead shows weird warning expected state 3 found 2

别来无恙 提交于 2019-11-28 20:53:59
I have a mainactivity which includes a TabLayout with ViewPager I have added 3 tabs and each tab has separate fragments which contains a recyclerview, and these recyclerviews has a checkbox that should be simultaneously updated/refreshed whenever i swipe the viewpager(i save checked positions in shared preference and updates via shared preference). My problem here is whenever i check a checkbox in tab1, tab2 is not updating/refreshing until i scroll down the Recyclerview. and tab3 is working fine. and i am getting a weird warning in logcat too. 03-05 09:35:53.345 4317-4327/com.example.rubin W

Android Actionbar Sherlock with Tabs

白昼怎懂夜的黑 提交于 2019-11-28 19:21:52
问题 I am trying to implement ActionBar Sherlock with Tabs below that as shown in the above wire-frame. Should i use TabActivity ? - since i saw that it is deprecated. Which is the best way to achieve the same. 回答1: I implemented this functionality with a SherlockFragmentActivity as tabview container and with SherlockFragment as tabs. Here is a sketch (I omitted the usual Android activity stuff): This is the tabview activity with two tabs: public class TabViewActivity extends

Disable swiping between tabs

丶灬走出姿态 提交于 2019-11-28 17:00:02
I set up sliding tabs with two Fragment s each Fragment has a Button which goes to a WebView . The problem with this is when the WebView Button is clicked the sliding tabs are still activated and when a user tries to navigate within the WebView you end up swiping to the other tab. Is there a way in an on click method to disable the swiping ability of the tabs? Any help would be hugely appreciated! Here the code: public class MyWebViewClass extends Fragment { private WebView mWebView; private Button mButton; public MyWebViewClass() { // Required empty public constructor } @Override public View

Tablayout with icons only

假装没事ソ 提交于 2019-11-28 16:03:50
I am using design support to create tabs. I am also using ViewPager for swipable tabs. Now, I don't know how to use only icons instead of texts in tabs. I tried finding out but didn't get any success. My code: Toolbar toolbar; private TabLayout tabLayout; private ViewPager viewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); viewPager = (ViewPager) findViewById(R.id.pager); setupViewPager(viewPager); setupTablayout(); } private void setupTablayout() { tabLayout = (TabLayout) findViewById(R.id

Android: How to build Multiplelevel Tabs

三世轮回 提交于 2019-11-28 10:33:58
I want to create multilevel tabs in android. It should follow a multilevel hierarchy, or a nested tabs philosophy as shown in image. Please provide the link or url if necessary. Use Multiple Layers of Android TabLayout, Refer this . TabLayout is quite customize-able. For e.g. adding tabs, setting divider height, using custom views in tabs. You should use ViewPager to do so. Below code will help you to make multilevel tabs in android. view_pager_main.xml <android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com