diff --git a/app/build.gradle b/app/build.gradle index c37964dd..4410c2c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,6 +19,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':magicindicator') - testImplementation 'junit:junit:4.12' - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' } \ No newline at end of file diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/BadgeTabExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/BadgeTabExampleActivity.java index 17f91502..fe249662 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/BadgeTabExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/BadgeTabExampleActivity.java @@ -4,8 +4,6 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.animation.AccelerateInterpolator; @@ -14,6 +12,9 @@ import android.widget.LinearLayout; import android.widget.TextView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; + import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; import net.lucode.hackware.magicindicator.buildins.UIUtil; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/CustomNavigatorExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/CustomNavigatorExampleActivity.java index 4c8873d1..7a3d25df 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/CustomNavigatorExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/CustomNavigatorExampleActivity.java @@ -2,8 +2,9 @@ import android.graphics.Color; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/DynamicTabExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/DynamicTabExampleActivity.java index c513374f..d53f3c84 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/DynamicTabExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/DynamicTabExampleActivity.java @@ -3,11 +3,12 @@ import android.content.Context; import android.graphics.Color; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; + import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExampleMainActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExampleMainActivity.java index 83c751e9..8a845f82 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExampleMainActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExampleMainActivity.java @@ -2,9 +2,10 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.view.View; +import androidx.appcompat.app.AppCompatActivity; + import net.lucode.hackware.magicindicatordemo.R; public class ExampleMainActivity extends AppCompatActivity { diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExamplePagerAdapter.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExamplePagerAdapter.java index 85dc037f..5c9ba2f1 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExamplePagerAdapter.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ExamplePagerAdapter.java @@ -1,12 +1,13 @@ package net.lucode.hackware.magicindicatordemo.example; import android.graphics.Color; -import android.support.v4.view.PagerAdapter; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.viewpager.widget.PagerAdapter; + import java.util.List; /** diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FixedTabExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FixedTabExampleActivity.java index 8e524abb..4ca5d5fe 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FixedTabExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FixedTabExampleActivity.java @@ -4,14 +4,15 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.LinearLayout; +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; + import net.lucode.hackware.magicindicator.FragmentContainerHelper; import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FragmentContainerExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FragmentContainerExampleActivity.java index 48aa39a6..6bdbd8e9 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FragmentContainerExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/FragmentContainerExampleActivity.java @@ -3,12 +3,13 @@ import android.content.Context; import android.graphics.Color; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AppCompatActivity; import android.view.View; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + import net.lucode.hackware.magicindicator.FragmentContainerHelper; import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.buildins.UIUtil; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/LoadCustomLayoutExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/LoadCustomLayoutExampleActivity.java index a822e5fd..1605e537 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/LoadCustomLayoutExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/LoadCustomLayoutExampleActivity.java @@ -3,13 +3,14 @@ import android.content.Context; import android.graphics.Color; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; + import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/NoTabOnlyIndicatorExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/NoTabOnlyIndicatorExampleActivity.java index 71df542c..a507d785 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/NoTabOnlyIndicatorExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/NoTabOnlyIndicatorExampleActivity.java @@ -3,8 +3,9 @@ import android.content.Context; import android.graphics.Color; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ScrollableTabExampleActivity.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ScrollableTabExampleActivity.java index e66e841c..fe6eca31 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ScrollableTabExampleActivity.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/ScrollableTabExampleActivity.java @@ -3,12 +3,13 @@ import android.content.Context; import android.graphics.Color; import android.os.Bundle; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; +import androidx.appcompat.app.AppCompatActivity; +import androidx.viewpager.widget.ViewPager; + import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; import net.lucode.hackware.magicindicator.buildins.UIUtil; diff --git a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/TestFragment.java b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/TestFragment.java index abca57a7..77729ebe 100644 --- a/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/TestFragment.java +++ b/app/src/main/java/net/lucode/hackware/magicindicatordemo/example/TestFragment.java @@ -1,13 +1,14 @@ package net.lucode.hackware.magicindicatordemo.example; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + import net.lucode.hackware.magicindicatordemo.R; /** diff --git a/app/src/main/res/layout/activity_badge_tab_example_layout.xml b/app/src/main/res/layout/activity_badge_tab_example_layout.xml index 14a55725..53d95c11 100644 --- a/app/src/main/res/layout/activity_badge_tab_example_layout.xml +++ b/app/src/main/res/layout/activity_badge_tab_example_layout.xml @@ -56,7 +56,7 @@ - - diff --git a/app/src/main/res/layout/activity_dynamic_tab_example_layout.xml b/app/src/main/res/layout/activity_dynamic_tab_example_layout.xml index 335e4dca..74d87d84 100644 --- a/app/src/main/res/layout/activity_dynamic_tab_example_layout.xml +++ b/app/src/main/res/layout/activity_dynamic_tab_example_layout.xml @@ -11,7 +11,7 @@ android:layout_width="match_parent" android:layout_height="@dimen/common_navigator_height" /> - - - - - diff --git a/build.gradle b/build.gradle index 9bd4044d..5e0a19aa 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.1' + classpath 'com.android.tools.build:gradle:3.6.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle.properties b/gradle.properties index 9b6ae2a0..4e15b62b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,5 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6c6ea182..b0f2ccf5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Feb 25 09:57:26 CST 2019 +#Tue Sep 29 13:32:52 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/magicindicator/build.gradle b/magicindicator/build.gradle index 292f0319..4b5faa96 100644 --- a/magicindicator/build.gradle +++ b/magicindicator/build.gradle @@ -17,5 +17,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.viewpager:viewpager:1.0.0' } \ No newline at end of file diff --git a/magicindicator/src/main/java/net/lucode/hackware/magicindicator/ViewPagerHelper.java b/magicindicator/src/main/java/net/lucode/hackware/magicindicator/ViewPagerHelper.java index 24c975b2..14b3da36 100644 --- a/magicindicator/src/main/java/net/lucode/hackware/magicindicator/ViewPagerHelper.java +++ b/magicindicator/src/main/java/net/lucode/hackware/magicindicator/ViewPagerHelper.java @@ -1,6 +1,6 @@ package net.lucode.hackware.magicindicator; -import android.support.v4.view.ViewPager; +import androidx.viewpager.widget.ViewPager; /** * 简化和ViewPager绑定