GithubHelp home page GithubHelp logo

pagertabindicator's People

Contributors

ancazapuc9 avatar crysis21 avatar

Stargazers

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

Watchers

 avatar  avatar

pagertabindicator's Issues

Need onPageSelected listener

I need to change tab text on page selection change, so for that i need listener to set updated text on page change. I don't know how to implement this using PagerTabIndicator.
Previously I was using com.astuetz.PagerSlidingTabStrip but since Its giving problem in Android studio 3.0 so I switched to com.hold1:pagertabindicator:1.0.2.
In PagerSlidingTabStrip there is listener called setOnPageChangeListener which having 3 methods by using them I am able to change tab text dynamically on page change. but now i need to implement same by using com.hold1:pagertabindicator:1.0.2.

Comparing properties with PagerSlidingTabStrip

Without me having to dig through two codebases, is there a quick and dirty comparison between the properties between PagerSlidingTabStrip and PagerTabIndicator?

I'm trying to sort out pstsTabBackgroundResIds for example, and I can't quite get my tab collection to go across the entire bottom of the view.

Basically, I'm seeing if I can switch from this layout fragment:

<com.astuetz.PagerSlidingTabStrip
        android:id="@+id/bottombar"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        app:pstsDividerPadding="0dp"
        app:pstsIndicatorHeight="60dp"
        app:pstsIndicatorColor="@color/text_grey_500"
        app:pstsShouldExpand="true"
        app:pstsTabBackgroundResIds="@array/setting_tab_backgrounds"
        app:pstsTextAllCaps="false" />

Unable to find using Maven Central in Android Studio

For some reason I'm unable to sync my Gradle with this implementation. is there anything special I need to know or understand when importing this into my android studio project? I have maven central and many other libraries, but for some reason yours 'fails to resolve'.

implementation 'com.hold1:pagertabindicator:1.0.7'

Cutting Text on tab_lock_expand=true

The tab text is cutting not displaying properly. Similar feature available on pagerslidingtabstrip (should_expand) which is working as expected. Please fix it. This is library is very useful for me. Other than pagerslidingtabstrip library isn't working after upgrading sdk.
Alternatively can you add text typeface function?

NullPointerException for 'int android.view.View.getLeft()'

When i tried to run application Its giving me following error; but When I run application in debug mode its runs perfectly.

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getLeft()' on a null object reference
at com.hold1.pagertabsindicator.PagerTabsIndicator.drawIndicator(PagerTabsIndicator.java:332)
at com.hold1.pagertabsindicator.PagerTabsIndicator.onDraw(PagerTabsIndicator.java:317)
at android.view.View.draw(View.java:17185)
at android.widget.HorizontalScrollView.draw(HorizontalScrollView.java:1643)
at android.view.View.updateDisplayListIfDirty(View.java:16167)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)

Following is way i implement PagerTabsIndicator;
In xml;

<com.hold1.pagertabsindicator.PagerTabsIndicator
        android:id="@+id/transactionTabs"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:background="#FBE9E9EC"
        app:tab_indicator="bottom_bar"
        app:tab_indicator_bg_color="#FBE9E9EC"
        app:tab_lock_expanded="true"
        app:tab_divider_color="@color/colorPrimary"
        app:tab_indicator_color="@color/drawerBgColor"
        app:tab_indicator_height="80dp"
        />

In Activity;

tabPagerAdapter = new TransactionTabPagerAdapter(getSupportFragmentManager(),userTransactionResDTO,this);
mPager.setAdapter(tabPagerAdapter);
mTabStrip.setViewPager(mPager);

To change Tab text color dynamically I used;

if (position==0) {
mTabStrip.setTextColor(getResources().getColor(R.color.colorPrimary));
 } else {
mTabStrip.setTextColor(Color.BLACK);
}

In gradle;
compile 'com.hold1:pagertabindicator:1.0.5'

it crashes when switch back from an empty tabs

Hello, thanks for this lib, it is really nice, i found an issue, please have a look

to reproduce

  1. create 2 tabs as usual
  2. clear all the fragments list in the adapter
  3. call notifyDataSetChanged()
  4. add back the tabs in step 1
  5. call notifyDataSetChanged() will throw an exception inside PagerTabsIndicator at below

if(this.targetPosition == -1) { this.scrollToChild(position, (int)(positionOffset * (float)this.tabsContainer.getChildAt(position).getWidth())); }

BTW, i found that the fragement will be resued unless I use FragmentStatePagerAdapter to be the base class of my adaption and with below also

public int getItemPosition(Object object) { return POSITION_NONE; }

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.