android-tabstrip

Updating offscreen fragments in a ViewPager

混江龙づ霸主 提交于 2019-12-24 13:31:51
问题 I have an application that has three fragments: Records, Chart, and PieChart. These fragments are stored in a ViewPager in a single activity and the user can swipe between them. The Records fragment has a table where the user can enter data. When the user enters data, the other two fragments need to be updated because they reference this data. Originally, I wanted the fragments to update as they were swiped to, but since they're swipeable I can't use onPause() and onResume() because onPause()

Viewpager in Android with fixed tabs at bottom with Icon and Text in each tab

人盡茶涼 提交于 2019-12-14 02:20:16
问题 I want to create the following layout - an activity with a viewpager along with a tab that stays that the bottom of the activity to indicate which of the 4 fragments the user is in (and the selected tab gets highlighted by an 'active colour') I've spent some time looking at various resources online to add this tab. http://developer.android.com/training/implementing-navigation/lateral.html#tabs - this looked like it would work well until I found out that actionBar.setNavigationMode(ActionBar

Android SlidingTabLayout with icons

一个人想着一个人 提交于 2019-11-27 00:52:04
I am using google's SlidingTabLayout in my view, but i want to add icons to the tabs. I'm using this http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html Can anyone please help? void setUpPager(View view){ mViewPager = (ViewPager) view.findViewById(R.id.viewpager); mViewPager.setAdapter(new TabsPagerAdapter(getActivity())); mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager(mViewPager); } Here is my xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Android SlidingTabLayout with icons

大兔子大兔子 提交于 2019-11-26 09:30:51
问题 I am using google\'s SlidingTabLayout in my view, but i want to add icons to the tabs. I\'m using this http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html Can anyone please help? void setUpPager(View view){ mViewPager = (ViewPager) view.findViewById(R.id.viewpager); mViewPager.setAdapter(new TabsPagerAdapter(getActivity())); mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager