Coder Social home page Coder Social logo

infiniteviewpager's People

Contributors

aeroechelon avatar antonyt avatar johnjohndoe avatar kongyang80 avatar ninjinkun avatar scottkennedy avatar yhirano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infiniteviewpager's Issues

how can i Tablayout with it

Hi,
i want to user tablayout with infiniteviewpager.
Can someone guide me.

Right now i am facing an issue while using it,

Process: com.kotlin.mNative, PID: 7342
java.lang.OutOfMemoryError: Failed to allocate a 108832 byte allocation with 102312 free bytes and 99KB until OOM, max allowed footprint 268435456, growth limit 268435456
at android.view.ViewGroup.addInArray(ViewGroup.java:5361)
at android.view.ViewGroup.addViewInner(ViewGroup.java:5274)
at android.view.ViewGroup.addView(ViewGroup.java:5083)
at com.google.android.material.tabs.TabLayout.addTabView(TabLayout.java:1370)
at com.google.android.material.tabs.TabLayout.addTab(TabLayout.java:620)
at com.google.android.material.tabs.TabLayout.addTab(TabLayout.java:605)
at com.google.android.material.tabs.TabLayout.populateFromPagerAdapter(TabLayout.java:1323)
at com.google.android.material.tabs.TabLayout.setPagerAdapter(TabLayout.java:1314)
at com.google.android.material.tabs.TabLayout.setupWithViewPager(TabLayout.java:1227)
at com.google.android.material.tabs.TabLayout.setupWithViewPager(TabLayout.java:1188)

Hiding Button as a function of position

The following code sets up my InfiniteViewPager and hides a button depending on the position of the pager. It works, as in the buttons starts GONE, and appears when you swipe to a new position, but as you swipe back to "position 0" the button reappears. I believe this is because when I swipe back, the position is no longer really "position 0". I get the following in my logcat when I return to the image contained in "position 0":

11-23 23:29:49.694  25109-25109/com.app.store D/InfinitePagerAdapter﹕ instantiateItem: real position: 3301
11-23 23:29:49.694  25109-25109/com.app.store D/InfinitePagerAdapter﹕ instantiateItem: virtual position: 1

This is the code for initiating my pager and the OnPageChangeListener.

private void init(Context context) {
    View view = inflate(context, R.layout.listview_item, this);
    view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    ViewPager viewPager;
    CustomPagerAdapter adapter;
    viewPager = (ViewPager) findViewById(R.id.view_pager);
    adapter = new CustomPagerAdapter(context);

    PagerAdapter wrappedAdapter = new InfinitePagerAdapter(adapter);
    viewPager.setAdapter(wrappedAdapter);

    //Hide the button unless showing image
    final Button selectButton = (Button) findViewById(R.id.selectButton);
    selectButton.setVisibility(GONE);

    viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

        }

        @Override
        public void onPageSelected(int position) {
             if(position==0)
                selectButton.setVisibility(View.GONE);
             else
                selectButton.setVisibility(View.VISIBLE);
        }

        @Override
        public void onPageScrollStateChanged(int state) {

        }
    });

Auto scroll

Hey bro auto scroll crash while using this library this is my logcat

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v4.view.PagerAdapter.getCount()' on a null object reference

InfinteViewPager crashing when updating viewpager with new set of content

Hi,

When i am updating the viewpager with new set of content and calling notifyDataSetChanged, the app getting crashed.

Below is the logcat details:

java.lang.IndexOutOfBoundsException: Invalid index 10, size is 4
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
        at java.util.ArrayList.set(ArrayList.java:481)
        at android.support.v4.app.FragmentStatePagerAdapter.destroyItem(FragmentStatePagerAdapter.java:137)
        at in.jackson.goopa.MainActivity$CustomViewPagerAdapter.destroyItem(MainActivity.java:771)
        at in.jackson.goopa.customlib.InfinitePagerAdapter.destroyItem(InfinitePagerAdapter.java:70)
        at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:417)
        at in.jackson.goopa.customlib.InfiniteViewPager.setAdapter(InfiniteViewPager.java:78)
        at in.jackson.goopa.MainActivity$DilBackgroundService$1.run(MainActivity.java:435)
        at android.os.Handler.handleCallback(Handler.java:808)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5304)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
        at dalvik.system.NativeStart.main(Native Method)

The demo doesn't work.

I used code in your sample but it doesn't work. I scroll the the end and the next item is blank. The fragment doesn't redraw itself

setAdapter in a seperate Thread, cause a problem

Hi,
I use your ViewPager to make a slidehow using images that i download from my server using AsyncTask then set the adapter in onPostExecute().
When i set the adapter in the AsyncTask Thread the images doesn't show and i have to swipe twice or thrice so the images appear.
When i use the adapter in the main thread the problem doesn't exist.
By the way i tried also with java Thread and i get the same problem.

This snapshot is from logcat when i set the adapter in the AsyncTask
at

And this is the one when i set the adapter in the main thread.
mt

I'm using 4 pages in the ViewPager, as you can see in the first snapshot the InfinitePageAdapter instantiate the items then destroy them and that is why they don't show.

In the end i want to thank you for this great project, this what i needed, best regards.

Scrolling change causes skipped pages

I've got a strange bug, when i use the InfiniteViewPager in my code. If i change the direction of page scrolling it skips 2 fragments. For istance if i'm at page 5 and i've been scrolling right, than if i scroll right i'll go to page 6. If i scroll left i'll go at page 2, skipping the 2 pages in the middle.

Here is the MainActivity:

`
public class MainActivity extends AppCompatActivity {

@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navigation_drawer_layout);

    //InfinitePageViewer Implementation
    PagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {

        @Override
        public int getCount() {
            return 1000;
        }

        @Override
        public MyFragment getItem(int position) {
            int index;

            if(position < 500)
                index = position;
            else
                index = position - 1000;    // 999->-1 998->-2

            Bundle bundle = new Bundle();


            MyFragment fragment = new MyFragment();
            bundle.putStringArrayList("GoalList", mDay.getGoalList());

            bundle.putLong("Page", index);
            fragment.setArguments(bundle);
            return fragment;
        }
    };

    // wrap pager to provide infinite paging with wrap-around
    PagerAdapter wrappedAdapter = new InfinitePagerAdapter(adapter);

    // actually an InfiniteViewPager
    ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
    viewPager.setAdapter(wrappedAdapter);


}

//Set the date on the Toolbar
Toolbar toolbar = (Toolbar)findViewById(R.id.my_awesome_toolbar);
toolbar.setTitle("My title");
setSupportActionBar(toolbar);

mDrawerLayout  = (DrawerLayout) findViewById(R.id.drawer_layout);
toggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close);
toggle.setDrawerIndicatorEnabled(true);

mDrawerLayout.setDrawerListener(toggle);

setupDrawerUI();

}
`

Here is the navigation_drawer_layout.xml:
`

<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_900"
app:titleTextColor="@color/grey_white_1000"
app:subtitleTextColor="@color/grey_white_1000"
app:collapseIcon="@color/grey_white_1000"
android:navigationIcon="@color/grey_white_1000"
android:collapseContentDescription="@color/grey_white_1000"

android:minHeight="?attr/actionBarSize" />

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.antonyt.infiniteviewpager.InfiniteViewPager
    android:id="@+id/pager"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

<!-- The navigation drawer -->
<LinearLayout
    android:id="@+id/navigation_drawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="@color/grey_white_1000"
    android:orientation="vertical" >

    <Button
        android:id="@+id/secondButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:background="@drawable/listview_selector"
        android:gravity="center"
        android:text="Show Odd Numbers"
        android:textColor="@color/primary" />

    <Button
        android:id="@+id/firstButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:background="@drawable/listview_selector"
        android:gravity="center"
        android:text="Show Even Number"
        android:textColor="@color/primary" />
</LinearLayout>

</android.support.v4.widget.DrawerLayout>
`

On the fragment i have a RecyclerView, can it be him the cause?

Gradle-like usage

Hi! It should be great to public this awesome library somewhere to use it with gradle!

Class Not Found Exception

Hello,
I am facing the problem of class not found exception in my project when i used your code. And I am using your code with actionbar sherlock
You are passing color array and I am passing image array. and I have already added your InfiniteViewPager.java and InfinitePagerAdapter as it is .
Here is ,my code and log cat.

Log Cat :-

12-26 10:24:58.648 1157-1157/com.bito1.Shoplu E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bito1.Shoplu/com.bito1.Shoplu.Main.actMain}: android.view.InflateException: Binary XML file line #8: Error inflating class com.antonyt.infiniteviewpager.InfiniteViewPager
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.antonyt.infiniteviewpager.InfiniteViewPager
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
at com.actionbarsherlock.internal.ActionBarSherlockNative.setContentView(ActionBarSherlockNative.java:133)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:261)
at com.bito1.Shoplu.Main.actMain.onCreate(actMain.java:26)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.antonyt.infiniteviewpager.InfiniteViewPager" on path: DexPathList[[zip file "/data/app/com.bito1.Shoplu-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.bito1.Shoplu-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
            at com.actionbarsherlock.internal.ActionBarSherlockNative.setContentView(ActionBarSherlockNative.java:133)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:261)
            at com.bito1.Shoplu.Main.actMain.onCreate(actMain.java:26)
            at android.app.Activity.performCreate(Activity.java:5133)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)

I am attching my Main Activity and main.xml and my fragment class file. so please check out and let me know the solution.

MainActivity:-

public class actMain extends SherlockFragmentActivity implements View.OnClickListener {

Button BTN_FACEBOOK;
ViewPager PAGER;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    initiatePageControls();

    startTour();
}

private void startTour() {
    PagerAdapter _adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
        int[] _images = new int[]{R.drawable.ic_launcher, R.drawable.a, R.drawable.b, R.drawable.c, R.drawable.d};

        @Override
        public int getCount() {
            return _images.length;
        }

        @Override
        public Fragment getItem(int position) {
            Fragment _fragment = new frg_tour_slide();

            Bundle _args = new Bundle();
            _args.putInt("images", _images[position]);
            _args.putInt("position", position);
            _fragment.setArguments(_args);

            return _fragment;
        }
    };

    PagerAdapter _wrappedAdapter = new InfinitePagerAdapter(_adapter);
    PAGER.setAdapter(_wrappedAdapter);
}

private void initiatePageControls() {
    BTN_FACEBOOK = (Button) findViewById(R.id.btnFacebook);
    BTN_FACEBOOK.setOnClickListener(this);
    PAGER = (ViewPager) findViewById(R.id.pager);
}

@Override
public void onClick(View view) {
    if (view.getId() == BTN_FACEBOOK.getId()) {
        startActivity(new Intent(getApplicationContext(), actTestService.class));
        //startActivity(new Intent(getApplicationContext(), actFacebook.class));
    }
}

}

Fragment :-
public class frg_tour_slide extends SherlockFragment {

ImageView SLIDE_1;
private int IMAGES;
private int IMAGE_POSITION;
private Context CONTEXT;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    IMAGES = args.getInt("images");
    IMAGE_POSITION = args.getInt("position");
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View _view = inflater.inflate(R.layout.tour_slide, null);

    SLIDE_1 = (ImageView) _view.findViewById(R.id.imgSlideShow);
    SLIDE_1.setImageResource(IMAGES);

    return _view;
}

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean("dummy", true);
}

}

Please help me for this issue.
Thanking you in advance.

This solution wo'nt work in some cases

The case is I need to show 3 view at the same time. So I set: setOffscreenPageLimit(2)
That means, there are 5 views to be cached. And currently, I only have 4 fragments to make view. So, fragment manager will have a chance to attach duplicate fragment which cause fragment to be blank !.

PagerAdapter

Does this only work for the default PagerAdapter class or will it wrap around a custom pager adapter?

Import using Gradle doesn't work

Hi,
I have followed your readme file to import the library into my project.

I put the dependency statement into build.gradle file:
dependencies {
compile 'com.antonyt.infiniteviewpager:library:1.0.0'
}

When I do the the project sync with Gradle files I get the following error:

Failed to resolve: com.antonyt.infiniteviewpager:library:1.0.0

What can I do to import correctly your library into my project?

How to make Scrolling fast?

Hello,
i used your this custom infinite view pager for rotate globe with custom images but currently its scrolling speed is slow so how to increase its scrolling speed or make it smooth scroll.
I want to give scrolling speed dynamically.
Please give me any solution or positive response.
Thanks

Sometimes there will be blank pages (the data has been set to more than 4)?

In my case, I play loop it in the timertask and change viewpagerTransform every time (It's like random animation),But there will always be a blank page at some time.

private Handler mh = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            moveNextPosition();
       }
};

Any help is greatly appreciated

Open source license

Love your code... it's exactly what I've been looking for. I can't use it in my app though unless I know the terms of the license. Would you mind adding a license to your repository? Thanks so much!!!!

Ingrid

onCreateOptionsMenu not called in child fragment when using FragmentPagerAdapter

That's because setPrimaryItem() is not forwarded to set adapter instance.
To make it work, add the method below to InfinitePagerAdapter class:

@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
    adapter.setPrimaryItem(container, position, object);
}

Inside setPrimaryItem() FragmentPagerAdapter calls setMenuVisibility() on fragments to ensure only one would get menu callbacks. Without calling setPrimaryItem() all fragments have menu visibility set to false by default.

java.lang.IllegalStateException: Fragment BalloonFragment{4070b790} is not currently in the FragmentManager

When forcing an auto-scroll to (setCurrentItem) the mIndex of the item being destroyed is -1 and thus causing an IllegalStateException

E/AndroidRuntime( 3076): FATAL EXCEPTION: main
E/AndroidRuntime( 3076): java.lang.IllegalStateException: Fragment BalloonFragment{4070b790} is not currently in the FragmentManager
E/AndroidRuntime( 3076): at android.support.v4.app.FragmentManagerImpl.saveFragmentInstanceState(FragmentManager.java:595)
E/AndroidRuntime( 3076): at android.support.v4.app.FragmentStatePagerAdapter.destroyItem(FragmentStatePagerAdapter.java:136)
E/AndroidRuntime( 3076): at com.antonyt.InfiniteViewPagerAdapter.destroyItem()
E/AndroidRuntime( 3076): at android.support.v4.view.ViewPager.populate(ViewPager.java:1022)
E/AndroidRuntime( 3076): at android.support.v4.view.ViewPager.populate(ViewPager.java:934)
E/AndroidRuntime( 3076): at android.support.v4.view.ViewPager$3.run(ViewPager.java:247)
E/AndroidRuntime( 3076): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 3076): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 3076): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 3076): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 3076): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3076): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 3076): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 3076): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 3076): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1186): Force finishing activity com.showtime.player/.HomeActivity

get Current Item from InfiniteViewPager

Hello,

 I would like to get the current Item from InfiniteViewPager. I have tried to get the current item. But I haven't got the current Item. Is there any way to get the current item?

Thanks.
julia.

Get actual current position of the page

Is there any metghod to get actual current position method, pager.getCurrentRealPosition() is not providing me actual position, and i have call setCurrentRealPosition at last of currentItem method.

override fun setCurrentItem(item: Int, smoothScroll: Boolean) {
var item = item
if (adapter!!.count == 0) {
super.setCurrentItem(item, smoothScroll)
return
}
item = offsetAmount + item % adapter!!.count
super.setCurrentItem(item, smoothScroll)
setRealCurrentItem(item, true)
}

InfiniteViewPager setCurrentItem not display fragment content

After swipe the infiniteviewpager fragments number of times,For navigate on particulate fragment Using programatically we call the setCurrentItem , It show the fragment with blank, sometime come the fragment without layout when we try to touch the fragment it show the content of current fragment.

PageTitleStrip is now Working

<com.ui.view.InfiniteViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" >

        <android.support.v4.view.PagerTitleStrip
            android:id="@+id/pager_title_strip"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:background="@color/black"
            android:paddingBottom="4dp"
            android:paddingTop="4dp"
            android:textColor="#ffffff" />
    </com.ui.view.InfiniteViewPager>

GitHub release

Would be nice to have a GitHub release of InfiniteViewPager

ViewPager sometimes displays 'empty' pages

I've noticed that when you initialize a fragment with this ViewPager, navigate away then navigate 'Back'; an empty page is shown. After navigating back to this fragment, you can continue to swipe on the pager, then after X amount of items the view pager it against populated with more items.

Initializing a fragment with this ViewPager seems to work fine; however, coming back to a fragment that had already been created creates some blank pages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.