android-viewpager

Viewpager not showing inside RecyclerView row

前提是你 提交于 2019-12-20 10:25:09
问题 I want to make a 'Photo details' activity or fragment where i display the photo on top and below it aViewpPager that display both comments and likes of the related photo(2 tabs). In order to make the screen 'Scrollable' so i can scroll up/down on both comments and likes and slide left/right i decided to use a RecyclerView with 2 rows : ROW 1 : The photo (ImageView). ROW 2 : SlidingTabLayout + ViewPager + FragmentPagerAdapter. The code compile and run, display the image and the

ViewPager of Fragment does not show its content when the root Fragment is replaced again

柔情痞子 提交于 2019-12-20 10:24:56
问题 i'm implementing the fragment screen that contains root view pager which contains child fragment and the first of child fragment has a view pager which shows images. it is shown pretty good at first time, but when the fragment which contains root view pager is removed and replaced again (with new keyword for fragment screen ), roow view pager doesn't show child fragment . here is the portion of my source. @AfterViews // this is the method of fragment screen protected void afterViews() { api

insert and remove fragments into viewpager properly

天涯浪子 提交于 2019-12-20 10:09:37
问题 I'm making an adroid application with viewpager and fragments. I want to make an option to add or remove fragment pages to the pager dynamically. I have a custom FragmentPagerAdapter: public class MyAdapter extends FragmentPagerAdapter implements TitleProvider{ protected final List<PageFragment> fragments; /** * @param fm * @param fragments */ public MyAdapter(FragmentManager fm, List<PageFragment> fragments) { super(fm); this.fragments = fragments; } public void addItem(PageFragment f){

Custom ArrayAdapter in a ListFragment

两盒软妹~` 提交于 2019-12-20 10:04:12
问题 I'm trying to create a custom ArrayAdapter to use for my ListFragment . Right now nothing is being displayed in the ListFragment except for the TextView saying what Fragment number it is. I have put a breakpoint in getView() method of my adapter and it is not being called. I searched for reasons that wouldn't be called and some people seem to think that my ListView is hidden, so I've tried changing the layout_height to wrap_content , but that didn't work. Also, I've been following the code

onPageScrolled() not being called

夙愿已清 提交于 2019-12-20 09:35:19
问题 I'm trying to get familiar with ViewPager. My code is given below. The problem is that the onPageChangeListener methods are not being called. What can be the problem? public class TabsViewPagerFragmentActivity extends SherlockFragmentActivity implements ViewPager.OnPageChangeListener { private ViewPager mViewPager; private PagerAdapter mPagerAdapter; private PageIndicator mIndicator; private static final String[] CONTENT = new String[] { "Home", "Popular", "Chat", "Profile"}; protected void

How to programmatically show next view in ViewPager?

半腔热情 提交于 2019-12-20 09:07:19
问题 I created a ViewPager and everything is working fine, however I want to have a previous next button outside of ViewPager which can be used to navigate inside ViewPager. How can I go to next Item on ViewPager without swiping manually? 回答1: As blessenm answered viewpager.setCurrentItem(int index) is the way to go. 回答2: A complete implementation just for completeness: public void MoveNext(View view) { //it doesn't matter if you're already in the last item pager.setCurrentItem(pager

onPageSelected doesn't work for first page

一笑奈何 提交于 2019-12-20 08:24:08
问题 My pager adapter ( extends PagerAdepter ) has a textview in it. And I update this textview with MainActivity's onPageSelected . Its update textview for position > 0 , but start page (position 0) doesn't update on startup. When I swipe forward then swipe back; it sets value for position 0 BUT I couldnt set value ON START. How can set value for star page ? public void onPageSelected(int position) { switch (position) { case 0: PagerAdapter.tv.setText("value"); // => doesnt work on start break;

Android change Fragment page

大憨熊 提交于 2019-12-20 07:47:10
问题 you can download my zip here ok so i made an app with Swipe+Tab View i want each tab to show a diffrent .xml page if u click above you can download my workspace to edit it .. i really need help please be spicific to if u want i can setup teamviwer if it could be faster.. if u dont want to download the file cause u think "it has a virus" just make a reply down below here is my code for the mainactivity.java package twh.reviser.root; import java.util.Locale; import android.os.Bundle; import

accessing Viewpager child elements for clicking and diplaying another view pager elements in a small window

↘锁芯ラ 提交于 2019-12-20 07:09:15
问题 I called the fragements as List<Fragment> fragments = new Vector<Fragment>(); fragments.add(Fragment.instantiate(context, Fragment1.class.getName())); fragments.add(Fragment.instantiate(context, Fragment2.class.getName())); mPageAdapter = new PageAdapter(activity.getSupportFragmentManager(),fragments); ViewPager pager = (ViewPager)findViewById(R.id.viewpager); pager.setAdapter(mPageAdapter);` ,but now in fragment class ,when trying to access the child button as View v = inflater.inflate(R

Views not loading after updating device to Android Pie 9.0

99封情书 提交于 2019-12-20 06:39:54
问题 I recently updated my phone to Android 9.0. The app which I was developing was working fine in earlier Android version. But after the update some views which require internet are not loading. Blank spaces are being displayed in their places. It has a ViewPager as banner and 2 RecyclerView below categories and deals respectively. They all require internet to load data. I don't know know if any extra permissions or dependencies are required in Android Pie. The logs show NetworkDispatcher.run: