Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Overview

Android ViewPagerIndicator

Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability of content.

Try out the sample application on the Android Market.

ViewPagerIndicator Sample Screenshots

These widgets can also be used in conjunction with ActionBarSherlock!

Usage

For a working implementation of this project see the sample/ folder.

  1. Include one of the widgets in your view. This should usually be placed adjacent to the ViewPager it represents.

    <com.viewpagerindicator.TitlePageIndicator android:id="@+id/titles" android:layout_height="wrap_content" android:layout_width="fill_parent" />

  2. In your onCreate method (or onCreateView for a fragment), bind the indicator to the ViewPager.

    //Set the pager with an adapter
    ViewPager pager = (ViewPager)findViewById(R.id.pager);
    pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
    
    //Bind the title indicator to the adapter
    TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
    titleIndicator.setViewPager(pager);
    
  3. (Optional) If you use an OnPageChangeListener with your view pager you should set it in the indicator rather than on the pager directly.

    //continued from above
    titleIndicator.setOnPageChangeListener(mPageChangeListener);
    

Theming

There are three ways to style the look of the indicators.

  1. Theme XML. An attribute for each type of indicator is provided in which you can specify a custom style.
  2. Layout XML. Through the use of a custom namespace you can include any desired styles.
  3. Object methods. Both styles have getters and setters for each style attribute which can be changed at any point.

Each indicator has a demo which creates the same look using each of these methods.

Including In Your Project

Android-ViewPagerIndicator is presented as an Android library project. A standalone JAR is not possible due to the theming capabilities offered by the indicator widgets.

You can include this project by referencing it as a library project in Eclipse or ant.

If you are a Maven user you can easily include the library by specifying it as a dependency:

<dependency>
  <groupId>com.viewpagerindicator</groupId>
  <artifactId>library</artifactId>
  <version>2.4.1</version>
  <type>apklib</type>
</dependency>

This project depends on the ViewPager class which is available in the Android Support Library or ActionBarSherlock. Details for including one of those libraries is available on their respecitve web sites.

Developed By

Credits

License

Copyright 2012 Jake Wharton
Copyright 2011 Patrik Åkerfeldt
Copyright 2011 Francisco Figueiredo Jr.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • New feature: TitleBarIndicator can now split titles around their center

    New feature: TitleBarIndicator can now split titles around their center

    New attribute clipToCenter[BOOL] makes titles in TitlePageIndicator split around their center point.

    This is useful if you don't know in advance how long your page labels are going to be, or if you have long titles that constantly bump into one another.

    First commit contains all the feature changes. The second commit contains a code refactoring, since I found onDraw was barely legible anymore.

    Tested on Nexus One and Galaxy Nexus.

    I couldn't add a sample Activity, since the sample app doesn't compile for me. I think I opened an issue for that already.

    opened by mttkay 14
  • Creating Indicator from Fragment won't work

    Creating Indicator from Fragment won't work

    Hi there,

    I've included the indicator on Eclipse as library, all classes are resolved by compile time. But if I try to initialize an indicator, I receive this kind of exception

    11-13 21:57:14.230: E/AndroidRuntime(6596): java.lang.NoClassDefFoundError:com.viewpagerindicator.R$attr
    11-13 21:57:14.230: E/AndroidRuntime(6596):     at com.viewpagerindicator.CirclePageIndicator.<init>(CirclePageIndicator.java:72)
    11-13 21:57:14.230: E/AndroidRuntime(6596):     at com.viewpagerindicator.CirclePageIndicator.<init>(CirclePageIndicator.java:68)
    

    I've cleaned the project several times, tried to init the indicator programmatically all always end in this exception.

    I'm using the latest support-lib version, target SDK ist 16.

    Maybe this is important too:

    11-13 22:16:18.850: W/dalvikvm(10440): VFY: unable to resolve static field 1555 (vpiCirclePageIndicatorStyle) in Lcom/viewpagerindicator/R$attr;
    
    opened by onigunn 13
  • Rare NullPointerException via TitlePageIndicator.onTouchEvent

    Rare NullPointerException via TitlePageIndicator.onTouchEvent

    Hi, been using ViewPagerIndicator for a couple of months now in my app. But noticed a sprinkling of these errors reported via acra:

    java.lang.NullPointerException at android.support.v4.view.ViewPager.a(SourceFile:1733) at com.viewpagerindicator.TitlePageIndicator.onTouchEvent(SourceFile:496) at android.view.View.dispatchTouchEvent(View.java:4688)

    I'm using v2.2.2. Only reported on one device "PantechP4100" running 3.2.1(13)

    TitlePageIndicator:

    public boolean onTouchEvent(android.view.MotionEvent ev) {
        if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) {
            return false;
        }
    
        final int action = ev.getAction();
    
        switch (action & MotionEventCompat.ACTION_MASK) {
            case MotionEvent.ACTION_DOWN:
                mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
                mLastMotionX = ev.getX();
                break;
    
            case MotionEvent.ACTION_MOVE: {
                final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
                final float x = MotionEventCompat.getX(ev, activePointerIndex);
                final float deltaX = x - mLastMotionX;
    
                if (!mIsDragging) {
                    if (Math.abs(deltaX) > mTouchSlop) {
                        mIsDragging = true;
                    }
                }
    
                if (mIsDragging) {
                    if (!mViewPager.isFakeDragging()) {
                        mViewPager.beginFakeDrag();
                    }
    
                    mLastMotionX = x;
    
                    mViewPager.fakeDragBy(deltaX);    <---- EXCEPTION BUBBLES HERE
                }
    
                break;
            }
    

    ViewPager:

    public void fakeDragBy(float xOffset) {
        if (!mFakeDragging) {
            throw new IllegalStateException("No fake drag in progress. Call beginFakeDrag first.");
        }
    
        mLastMotionX += xOffset;
        float scrollX = getScrollX() - xOffset;
        final int width = getWidth();
        final int widthWithMargin = width + mPageMargin;
    
        final float leftBound = Math.max(0, (mCurItem - 1) * widthWithMargin);
        final float rightBound =
                Math.min(mCurItem + 1, mAdapter.getCount() - 1) * widthWithMargin;
        if (scrollX < leftBound) {
            scrollX = leftBound;
        } else if (scrollX > rightBound) {
            scrollX = rightBound;
        }
        // Don't lose the rounded component
        mLastMotionX += scrollX - (int) scrollX;
        scrollTo((int) scrollX, getScrollY());
        pageScrolled((int) scrollX);
    
        // Synthesize an event for the VelocityTracker.
        final long time = SystemClock.uptimeMillis();
        final MotionEvent ev = MotionEvent.obtain(mFakeDragBeginTime, time, MotionEvent.ACTION_MOVE,
                mLastMotionX, 0, 0);
        mVelocityTracker.addMovement(ev);     <--- EXCEPTION HERE
        ev.recycle();
    }
    

    Looks like mVelocityTracker hasn't been initialised. I'm guessing this is a bit of a freaky scenario to trigger that as the ViewPager and ViewPagerIndiciator seem to be a very resilient and happy partnership.

    Let me know if I can help further..?

    opened by howardb173 12
  • Multiple TabPagerIndicators with multiple styles

    Multiple TabPagerIndicators with multiple styles

    I have a couple of TabPagerIndicators that are in the same activity that I want to style differently. However, I can't seem to apply inline styles to them (probably because the actual widget pulls from ?attr).

    If there is a proper way to do this, then I'm asking for help (I searched a bit for a forum to do so but didnt find it here nor on the site) and if there isn't than I guess this is a feature request?

    opened by navarr 10
  • Implement better text rendering for the titles

    Implement better text rendering for the titles

    As soon as I tried ViewPagerIndicator on my app, I noticed the title text rendering didn't look that great. I looked into the code to understand how the titles were being drawn and what could I do about it. They are being rendered on a Canvas using the Paint object.

    There's nothing more it can be done about it, anti-aliasing is already enabled on the Paint object. The only thing it could be done is to change this:

    mPaintText = new Paint();
    

    Into this:

    mPaintText = new Paint(Paint.LINEAR_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    

    And also remove mPaintText.setAntiAlias(true);, but this does not give a better solution. Instead, we get a "different" solution. The rendering is just different. If it's better or worse, it really depends on the eye of the beholder.

    If you don't know, the meaning of LINEAR_TEXT_FLAG, in the words of Android Developer Roman Guy, is this:

    "Text rendering uses a font cache containing bitmap representations of each glyph the application needs. Linear text basically lets you skip the font cache."

    So, my suggestion is this:

    Get rid of the Paint object and use TextViews instead for each title. The TextView rendering is much better, here's an example on my app's implementation of the ViewPagerIndicator:

    I understand that this requires a big rewrite to the code, but in the end, the rendering will look much better and more consistent with the rest of the UI.

    opened by rfgamaral 10
  • Support v4 version being used causes issues

    Support v4 version being used causes issues

    Hey Jake,

    Since you're referencing the v4 r7 lib on central, it's causing me a huge headache trying to build with the latest v4 version using the maven android sdk deployer. There's some stuff I really need to use in the latest version. What do I have to do, fork and just work off of a different version in my branch?

    opened by christopherperry 9
  • Crash when switching between higher level fragments

    Crash when switching between higher level fragments

    Right now for debug I have a TabPageIndicator with a ViewFragment that pulls five of the same fragment. That fragment has on it a CirclePageIndicator with a ViewPager enclosed in a self-made view along with a TabPageIndicator and another ViewPager enclosed in a self-made view.

    Switching from the first page -> second page -> first page works fine. Switching from first page -> last page -> first page crashes.

    So it probably has something to do with it leaving memory. When it tries to load back in this happens:

    05-10 17:05:44.361: E/AndroidRuntime(16954): FATAL EXCEPTION: main 05-10 17:05:44.361: E/AndroidRuntime(16954): java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to com.viewpagerindicator.CirclePageIndicator$SavedState 05-10 17:05:44.361: E/AndroidRuntime(16954): at com.viewpagerindicator.CirclePageIndicator.onRestoreInstanceState(CirclePageIndicator.java:514) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.View.dispatchRestoreInstanceState(View.java:9876) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2330) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2330) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2330) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.View.restoreHierarchyState(View.java:9854) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.Fragment.restoreViewState(Fragment.java:407) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:897) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:431) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:160) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.view.ViewPager.populate(ViewPager.java:804) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:433) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:405) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:386) 05-10 17:05:44.361: E/AndroidRuntime(16954): at com.viewpagerindicator.TabPageIndicator$1.onClick(TabPageIndicator.java:41) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.View.performClick(View.java:3480) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.view.View$PerformClick.run(View.java:13983) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.os.Handler.handleCallback(Handler.java:605) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.os.Handler.dispatchMessage(Handler.java:92) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.os.Looper.loop(Looper.java:137) 05-10 17:05:44.361: E/AndroidRuntime(16954): at android.app.ActivityThread.main(ActivityThread.java:4340) 05-10 17:05:44.361: E/AndroidRuntime(16954): at java.lang.reflect.Method.invokeNative(Native Method) 05-10 17:05:44.361: E/AndroidRuntime(16954): at java.lang.reflect.Method.invoke(Method.java:511) 05-10 17:05:44.361: E/AndroidRuntime(16954): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 05-10 17:05:44.361: E/AndroidRuntime(16954): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 05-10 17:05:44.361: E/AndroidRuntime(16954): at dalvik.system.NativeStart.main(Native Method)

    opened by navarr 8
  • Add new revision of the support library to the VPI project

    Add new revision of the support library to the VPI project

    The new ADT 17 has been released and with that came a new revision of the support library. Though this doesn't have any advantage on VPI it does help others who use VPI and need the extra stuff in the new revision.

    Including VPI in our projects also includes the support library attached to the VPI project and we cannot include the new support library revision in our projects because that will conflict with the one in VPI.

    Yes we can replace the one in VPI but will give us conflicts when pulling new commits if the support library is not updated in the repo.

    opened by rfgamaral 8
  • "compatibility-v4-r4.jar" is missing

    Hi, Today I imported your Library in Eclipse but evertime I try to build the sample. I got this error:

    The container 'Maven Dependencies' references non existing library 'C:\Users\Cracksoldier.m2\repository\android\support\compatibility-v4\r4\compatibility-v4-r4.jar'

    I already checked this folder and it only contains the two following files:

    compatibility-v4-r4.jar.lastUpdated compatibility-v4-r4.pom.lastUpdated

    Maven and the plugin is installed and works right. This the output of the Eclipse Console during the import of your git repo:

    20.12.11 21:49:44 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:library:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\library\pom.xml. 20.12.11 21:49:45 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [INFO] Using NULL lifecycle mapping for MavenProject: com.viewpagerindicator:parent:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\pom.xml. 20.12.11 21:49:45 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:sample:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\sample\pom.xml. 20.12.11 21:49:45 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:library:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\library\pom.xml. 20.12.11 21:49:45 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:sample:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\sample\pom.xml. 20.12.11 21:49:45 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available 20.12.11 21:49:45 MEZ: [INFO] Adding source folder /library/src 20.12.11 21:49:45 MEZ: [INFO] Adding source folder /sample/src 20.12.11 21:49:45 MEZ: [INFO] Adding source folder /sample/src 20.12.11 21:49:45 MEZ: [INFO] Project import completed 17 sec 20.12.11 21:49:47 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:library:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\library\pom.xml. 20.12.11 21:49:47 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:library:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\library\pom.xml. 20.12.11 21:49:47 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available 20.12.11 21:49:47 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:sample:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\sample\pom.xml. 20.12.11 22:12:32 MEZ: [INFO] Updated index for repository: central|http://repo1.maven.org/maven2 in 1511023 ms 20.12.11 22:15:59 MEZ: [WARN] The POM for com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.0.0-alpha-10 is missing, no dependency information available 20.12.11 22:16:00 MEZ: [INFO] Using DEFAULT lifecycle mapping for MavenProject: com.viewpagerindicator:library:2.2.0 @ C:\Users\Cracksoldier\Workspace\parent\library\pom.xml. 20.12.11 22:16:00 MEZ: [WARN] The POM for android:android:jar:1.6_r3 is missing, no dependency information available 20.12.11 22:16:00 MEZ: [WARN] The POM for android.support:compatibility-v4:jar:r4 is missing, no dependency information available

    Where can I get this file. I already googled it but I couldnt find it yet. I hope someone can help me.

    Best Regards Cracksoldier

    Fixed-Not-Released Bug Report 
    opened by ghost 8
  • Persistent Exception onResume

    Persistent Exception onResume

    I implemented your library in my project. However now I am getting many bug reports, having to do with the TitlePageIndicator.java code. Specifically here is part of the exception

    java.lang.IndexOutOfBoundsException: Invalid index 3, size is 1
    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
    at java.util.ArrayList.get(ArrayList.java:311)
    at com.jakewharton.android.viewpagerindicator.TitlePageIndicator.onDraw(TitlePageIndicator.java:304)
    

    This seems to be occurring onResume but not if the activity is resumed right away, only if some time passes. Hoping you could shed some light on this issue.

    opened by leowhiterussian 8
  • Styled/Themed underline page indicator in non functional

    Styled/Themed underline page indicator in non functional

    If you style or theme the underline indicator through layout or theme, the first indicator item fills the entire page. The issue exists on the demos as well.

    Screenshot: https://docs.google.com/open?id=0B4UIKIiIblQrb3FmSmViWWxtWlE

    opened by akshaydashrath 7
  • NullPointerException, call beginFakeDrag before fakeDragBy

    NullPointerException, call beginFakeDrag before fakeDragBy

    https://github.com/JakeWharton/ViewPagerIndicator/blob/8cd549f23f3d20ff920e19a2345c54983f65e26b/library/src/com/viewpagerindicator/CirclePageIndicator.java#L309

    java.lang.NullPointerException:   Attempt to invoke virtual method 'void   android.view.VelocityTracker.addMovement(android.view.MotionEvent)' on a null   object reference\n\tat   android.support.v4.view.ViewPager.fakeDragBy(SourceFile:2644)\n\tat   com.xxx.xxx.ui.widget.aj.onTouchEvent(SourceFile:296)\n\tat   android.view.View.dispatchTouchEvent(View.java:9414)\n\tat   
    
    opened by Logan676 0
  • java.lang.NullPointerException

    java.lang.NullPointerException

    I am facing this issue for a long time at Google Play Console. The stack trace is: java.lang.NullPointerException: at android.support.v4.view.ViewPager.endFakeDrag (ViewPager.java:2577) at com.viewpagerindicator.TitlePageIndicator.onTouchEvent (TitlePageIndicator.java:581) at android.view.View.dispatchTouchEvent (View.java:10018) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2876) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2844) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2844) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2844) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2844) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2844) at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2519) at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent (PhoneWindow.java:2869) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1861) at android.app.Activity.dispatchTouchEvent (Activity.java:3061) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:71) at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent (PhoneWindow.java:2830) at android.view.View.dispatchPointerEvent (View.java:10253) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:5529) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:5365) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4810) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4863) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4829) at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4970) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4837) at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5027) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4810) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4863) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4829) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4837) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4810) at android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:7531) at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:7399) at android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:7360) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:7641) at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce (MessageQueue.java) at android.os.MessageQueue.next (MessageQueue.java:323) at android.os.Looper.loop (Looper.java:135) at android.app.ActivityThread.main (ActivityThread.java:7406) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

    Is there any solution to avoid this crash?

    opened by chwakil 2
  • Crash when using color values from styles.

    Crash when using color values from styles.

    I'm trying to set colors like that:

    app:fillColor="?attr/colorAccent"
    app:pageColor="?attr/colorPrimary"
    app:strokeColor="?attr/colorPrimary"
    

    It worked before, but now it throws:

    android.view.InflateException: Binary XML file line #16: Binary XML file line #17: Error inflating class com.viewpagerindicator.CirclePageIndicator caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1d

    I've tried to set @color/color_primary values and '#ff00ff' color hex values: the same issue.

    As a workaround: I set all needed colors in runtime by calling setFillColor(), setPageColor() and setStrokeColor() respectively.

    minSdkVersion 21
    targetSdkVersion 26
    buildToolsVersion "26.0.0"
    
    opened by dmitvitalii 15
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

AnimatedBottomBar A customizable and easy to use bottom bar view with sleek animations. Examples Playground app Download the playground app from Googl

Joery 1.2k Dec 30, 2022
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

Joery Droppers 1000 Dec 5, 2021
A small navigation library for Jetpack Compose with state saving, backstack and animations support.

A small navigation library for Jetpack Compose with state saving, backstack and animations support.

Xinto 5 Dec 27, 2022
Xdimen - Support multiple screen sizes easily by scaling your dimensions

Support multiple screen sizes easily by scaling your dimensions. How does Xdimen work? When you have a UI design with a specific dimension, and

Islam Khaled 38 Dec 8, 2022
🎉 [Android Library] A light-weight library to easily make beautiful Navigation Bar with ton of 🎨 customization option.

Bubble Navigation ?? A light-weight library to easily make beautiful Navigation Bars with a ton of ?? customization options. Demos FloatingTopBarActiv

Gaurav Kumar 1.7k Dec 31, 2022
A small and simple, yet fully fledged and customizable navigation library for Jetpack Compose

A small and simple, yet fully fledged and customizable navigation library for Jetpack Compose

Vitali Olshevski 290 Dec 29, 2022
An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

SlidingMenu (Play Store Demo) SlidingMenu is an Open Source Android library that allows developers to easily create applications with sliding menus li

Jeremy Feinstein 11.1k Dec 27, 2022
Alligator is a modern Android navigation library that will help to organize your navigation code in clean and testable way.

Alligator Alligator is a modern Android navigation library that will help to organize your navigation code in clean and testable way. Features Any app

Artur Artikov 290 Dec 9, 2022
A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android.

Facilis Swipe gesture based navigational library for Android. Watch Demo Video: Getting Started To get this project into your build: Gradle Add it in

Prem Suman 35 Feb 15, 2022
AndroidBriefActions - Android library for sending and observing non persistent actions such as showing a message; nice readable way to call navigation actions from ViewModel or Activity/Fragment.

implementation "com.vladmarkovic.briefactions:briefactions:$briefActionsVersion" Benefits Why use brief-actions library pattern: Prevent short-term ac

null 2 Dec 22, 2022
🛸Voyager is a pragmatic navigation library built for, and seamlessly integrated with, Jetpack Compose.

Voyager is a pragmatic navigation library built for, and seamlessly integrated with, Jetpack Compose.

Adriel Café 831 Dec 26, 2022
[ACTIVE] Simple Stack, a backstack library / navigation framework for simpler navigation and state management (for fragments, views, or whatevers).

Simple Stack Why do I want this? To make navigation to another screen as simple as backstack.goTo(SomeScreen()), and going back as simple as backstack

Gabor Varadi 1.3k Jan 2, 2023
Android Library for making animated tutorials inside your app

##SlidingTutorial Cleveroad introduces Sliding Tutorial Library for Android Hey guys, hope you haven’t started developing a tutorial for your Android

Cleveroad 2.5k Dec 31, 2022
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.

MaterialDrawer ... the flexible, easy to use, all in one drawer library for your Android project. What's included ?? • Setup ??️ • Migration Guide ??

Mike Penz 11.6k Dec 27, 2022
An Android library for managing multiple stacks of fragments

FragNav Android library for managing multiple stacks of fragments (e.g., Bottom Navigation , Navigation Drawer). This library does NOT include the UI

Nic Capdevila 1.5k Jan 6, 2023
A flexible, easy to use, unique drawer library for your Android project.

Duo Navigation Drawer This Android library provides an easy way to create an alternative navigation drawer for android. Instead of a drawer that slide

PSD 1.1k Dec 21, 2022
Memory efficient android library for managing individual fragment backstack.

fragstack : Android library for managing individual fragment backstack. An Easy to use library for managing individual fragment back stack as Instagra

Abhishesh 21 Feb 6, 2021
A small navigation library for Android to ease the use of fragment transactions & handling backstack (also available for Jetpack Compose).

A small navigation library for Android to ease the use of fragment transactions & handling backstack (also available for Jetpack Compose).

Kaustubh Patange 88 Dec 11, 2022
A simple navigation library for Android 🗺️

Enro ??️ A simple navigation library for Android "The novices’ eyes followed the wriggling path up from the well as it swept a great meandering arc ar

Isaac Udy 216 Dec 16, 2022