android-viewpager

How can I enable actionbar tabs in a fragment?

情到浓时终转凉″ 提交于 2019-12-22 08:05:39
问题 I switched from Activity to Fragment and now I am getting the this error java.lang.IllegalArgumentException: Tabs not supported in this configuration from the following line actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); How can I make these tabs work in a fragment with base ActionBarActivity? rest of the code @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { act = (ActionBarActivity )getActivity(); final ActionBar

Change ViewPager Fragment From Child Fragment

你说的曾经没有我的故事 提交于 2019-12-22 07:36:24
问题 I have a ViewPager using a TabLayout with several fragments. I would like to click a button from one of the ViewPager fragments and direct the user to another tab/fragment using the tab name. When the button is clicked, I would like the TabLayout to change as well as show the fragment associated to that tab. I would also need to send additional data with the request to show on the new fragment. I don't have access to the ViewPager setCurrentItem(int index). Ideally I would like to communicate

Android Design Support Library FAB in a ViewPager Fragment with Coordinator Layout

旧时模样 提交于 2019-12-22 07:05:18
问题 I'm trying to get a Floating Action Button from the Android Design Support Library inside a Fragment which is inside a ViewPager. I've 4 tabs and I want the FAB in only one of the Tabs. My layout are as follows: main_layout.xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent">

How to delete a tab with actionbar, viewpager, and multiple fragments?

你。 提交于 2019-12-22 06:27:21
问题 I'm using code I found here. public class ActionBarTabs extends SherlockFragmentActivity { CustomViewPager mViewPager; TabsAdapter mTabsAdapter; TextView tabCenter; TextView tabText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); mViewPager = new CustomViewPager(this); mViewPager.setId(R.id.pager); setContentView(mViewPager);

Issue using ViewPager and PageTransformer with Android API <11

白昼怎懂夜的黑 提交于 2019-12-22 05:53:12
问题 I need to write a custom transition for a ViewPager on an app with android:minSdkVersion="9" . I'm trying to run the ZoomOutPageTransformer given here. I get no compiling error, and on a Samsung Galaxy S running Android 2.3.3 (API 10), the line pager.setPageTransformer(true, new ZoomOutPageTransformer()); does not give any error, but the code in ZoomOutPageTransformer's transformPage is never executed. The code works perfectly if I set android:minSdkVersion="11" and use my Nexus 4 (API 17).

Android: Viewpager inside a fragment of Navigation Drawer

夙愿已清 提交于 2019-12-22 05:08:10
问题 I'm currently developing an Android application what I need is to implement a Viewpager or Tabs inside a fragment of Navigation Drawer. I already implemented the Navigation Drawer from this tutorial: Navigation Drawer Tutorial Now I have my Navigation Drawer consist of 3 fragments. Fragment A, Fragment B, Fragment C on Fragment A how can I add a Viewpager for this Fragment? 回答1: This is definitely possible. You just need to use child fragments for the viewpager. Other than that the

ViewPager and Database

非 Y 不嫁゛ 提交于 2019-12-22 04:47:04
问题 The data is in a Database, so I would normally use CursorAdapter and have it work with CursorLoader on a ListView, however now I need a ViewPager instead of a ListView and that takes a PagerAdapter and I only have it have seen it work with lists. Is there a native pager adapter that uses a cursor or ill have to make it work? Thanks! 回答1: Based on the internals of the CursorAdapter I have an implementation that extends FragmentPagerAdapter with the only difference that you will use the

ViewPager within ListView row item

£可爱£侵袭症+ 提交于 2019-12-22 04:39:22
问题 I have read a lot of related questions regarding this question. However, none of them has been answered. I am trying to add a ViewPager to each row in the ListView where there are two layouts within the pager. I believe this is doable because of SwipeListView . Now I have implemented it. However, a blank page is showing with a line in the middle. No rows are appearing. Here is my code: MainActivity + ArrayAdapter public class MainActivity extends Activity { ListView list; String[] heros;

PageCurl animations on ViewPager transitions?

强颜欢笑 提交于 2019-12-22 04:27:09
问题 Here's a demo of what a page curl animation looks like: http://www.youtube.com/watch?v=aVZHN_o45sg There are a couple of page curl animation libraries: https://github.com/harism/android_page_curl https://github.com/MysticTreeGames/android-page-curl They are meant to work with Bitmap Drawables and not necessarily ViewGroups. If was wondering if anyone has come up with a similar page curl transition for ViewPagers. 回答1: Not a straight way..but, How about creating the bitmap of view group by

Failed to build Android app (refer to both ActionBarSherlock & ViewPagerTabs) with Ant

北战南征 提交于 2019-12-22 04:17:14
问题 I have one Android app which uses ActionBarSherlock & ViewPagerTabs. I use Eclipse to write and build it, and it just works well until I try to build it with Ant. Here's what I did: go to ActionBarSherlock folder, run "android update lib-project --path ." go to ViewPagerTabs folder, run "android update lib-project --path ." too go to app folder, run "android update project --path ." run "and debug" under app folder, and I got following errors: : [javac] C:\Android\TestApp\src\com\test\App