hackware1993 / MagicIndicator

A powerful, customizable and extensible ViewPager indicator framework. As the best alternative of ViewPagerIndicator, TabLayout and PagerSlidingTabStrip —— 强大、可定制、易扩展的 ViewPager 指示器框架。是ViewPagerIndicator、TabLayout、PagerSlidingTabStrip的最佳替代品。支持角标,更支持在非ViewPager场景下使用(使用hide()、show()切换Fragment或使用setVisibility切换FrameLayout里的View等),http://www.jianshu.com/p/f3022211821c
9.72k stars 1.55k forks source link

We badly need a library update #165

Open taar1 opened 5 years ago

taar1 commented 5 years ago

MadicIndicator isn't compatible with any of my projects anymore since targetSdkVersion 28

Neither with Android X nor with the Android Support Library.

We badly need an update that is compatible with Android Oreo and Pie etc.

tinwhisker commented 5 years ago

Strange, I had no issues with switching to AndroidX. What was happening for you?

Excerpt from my build.gradle:

compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
    minSdkVersion 19
    targetSdkVersion 28
}
dependencies {
    ...
    implementation 'com.github.hackware1993:MagicIndicator:1.5.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}

Example layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <net.lucode.hackware.magicindicator.MagicIndicator
                android:id="@+id/magicIndicatorThing"
                android:layout_width="fill_parent"
                android:layout_height="45dp" />

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/viewPagerThing"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>
</LinearLayout>