android-viewpager

Replace ListFragment with Fragment inside ViewPager with Tabs

心不动则不痛 提交于 2019-12-30 02:33:47
问题 I try to setup following navigation in my app: Actual condition: ViewPager + Tabs to swipe between lists: ListFragment A ListFragment B Desired condition: ViewPager + Tabs: ListFragment A onListItemSelected replace ListFragment A with DetailFragment A ListFragment B onListItemSelected replace ListFragment B with DetailFragment B The goal is to display the detail fragments inside the tab navigation. I can't replace the fragmentList by a detailFragment (the fragmentList has no custom layout and

Tabs of TabLayout not showing

谁都会走 提交于 2019-12-30 02:10:05
问题 I have a main activity, which hosts a fragment, which in turn hosts a TabLayout (with a ViewPager). The tab bar is shown, baut the tabs themselves are not shown. Here is my code in the main activity for displaying the host fragment: Fragment fragment = new BMITabsFragment(); FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).addToBackStack(Constants.BMI_TABS_FRAGMENT).commit(); Here is my the Fragment which

ViewPager + PagerAdapter shows blank pages after first two items

◇◆丶佛笑我妖孽 提交于 2019-12-30 01:35:12
问题 What's happening : The first two ViewPager pages loaded nicely (ViewPager automatically loads +-1 from current page). When you scroll past these the next pages aren't showing up. GIF demo of the problem below. Debug info : The pages are being instantiated (see code below) and are successfully added to the ViewPager ArrayList<ItemInfo>mItems (confirmed via Log messages). I recompiled the android.support.v4 library with debug=true set ( mmm frameworks/support/v4/ in aosp) and it shows

ViewPager + SurfaceView = long delay when navigating back to activity

喜夏-厌秋 提交于 2019-12-30 01:29:29
问题 Basically what the title says, My application consists primarily of a ViewPager which uses a FragmentStatePagerAdapter The problem occurs when I add a series of SurfaceViews to the FragmentStatePagerAdapter. Just for testing purposes I did not subclass the SurfaceViews in any way. When I navigate a few pages in, hit "home," and then return to the activity, the entire device freezes for a second or two before rendering anything. I can launch and finish() the app several times in the time it

Image Zoom Issue with Universal Image Loader and View Pager

半腔热情 提交于 2019-12-29 14:59:03
问题 I'd like to use ImageViewZoom with Universal Image Loader in ImagePagerActivity. I am able to zoom the image, Swipe to the next image. But i am facing problem when image is in Zoom position. if an image is zoomed and i am at center position, if i want to see the right side part of the same image and swipe left it is going to the next image. Please help me in doing this. here is my XML code: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill

Image Zoom Issue with Universal Image Loader and View Pager

北战南征 提交于 2019-12-29 14:58:45
问题 I'd like to use ImageViewZoom with Universal Image Loader in ImagePagerActivity. I am able to zoom the image, Swipe to the next image. But i am facing problem when image is in Zoom position. if an image is zoomed and i am at center position, if i want to see the right side part of the same image and swipe left it is going to the next image. Please help me in doing this. here is my XML code: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill

Make ViewPager snap with shorter drag

烈酒焚心 提交于 2019-12-29 14:31:31
问题 Is there any way to make the support package ViewPager snap to the next page with a shorter drag? The default behaviour seems to be that even if I drag almost 75% the page still snaps back to the previous page when I let go. I'd like to make the snap threshold shorter and make the ViewPager snap to the next page instead. Note that this applied to drag gesture. A fling gesture requires much shorter gesture already. 回答1: You can do this ad-hoc, without worrying too much about the internals of

java.lang.IllegalStateException: Fragment already added:

馋奶兔 提交于 2019-12-29 09:34:11
问题 I have a ViewPager with a TabLayout. I have created ViewPagerAdapter by extending FragmentStatePagerAdapter. When i swipe ViewPager i got the following error FATAL EXCEPTION: main Process: com.anubavam.creatrix, PID: 21388 java.lang.IllegalStateException: Fragment already added: AttendanceViewFragment Here is ViewPagerAdapter Class code private class ViewPagerAdapter extends FragmentStatePagerAdapter { private List<AttendanceViewFragment> mFragments = new ArrayList<>(); private ArrayList

Android Fragment Pager and Custom Page Indicator( ViewPagerIndicator created by Jake Wharton)

好久不见. 提交于 2019-12-29 08:45:09
问题 I am using ViewPageIndicator for developing a pager view with its indicator MyCode Activity public class Pager extends Activity{ private MyPagerAdapter mAdapter; private ViewPager mPager; private CirclePageIndicator mIndicator; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pager); mAdapter=new MyPagerAdapter(getApplicationContext()); mPager = (ViewPager)findViewById(R.id.pager); mPager.setAdapter(mAdapter);

Android ViewPager Refresh fragment

邮差的信 提交于 2019-12-29 07:03:07
问题 In my app there's 2 tabs (Android Design Support Library) this is the Fragment with ViewPagerAdapter: public class ListaCanali extends Fragment { public static TabLayout tabLayout; public static ViewPager viewPager; public static int int_items = 2 ; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v =inflater.inflate(R.layout.lista_canali, container,false); //Titolo Fragment ((MainActivity) getActivity())