Skip to content

Commit

Permalink
支持android x
Browse files Browse the repository at this point in the history
  • Loading branch information
yaozs committed Jun 24, 2020
1 parent e22644c commit 135ab39
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 171 deletions.
19 changes: 8 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.yzs.yzsbaseactivity"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,13 +20,10 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile project(':yzsbaseactivitylib')
compile 'com.github.bumptech.glide:glide:3.7.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation project(':yzsbaseactivitylib')
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

}

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
android:text="_" />
</FrameLayout>

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/my_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fg_demo_change_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_height="wrap_content"
app:srlAccentColor="#888" />

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@id/yzs_base_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/layout/fg_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
android:layout_height="match_parent">
<!-- 在继承Y轴是BaseHomeActivity是必须声明的id -base_tabLayout
二选一声明base_tabLayout_viewPager或base_tabLayout_frameLayout-->
<android.support.v4.view.ViewPager
android:id="@id/yzs_base_tabLayout_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp" />
<androidx.viewpager.widget.ViewPager
android:id="@id/yzs_base_tabLayout_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp" />

<!--<FrameLayout-->
<!--android:id="@id/yzs_base_tabLayout_frameLayout"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginBottom="56dp" />-->
<!--android:id="@id/yzs_base_tabLayout_frameLayout"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginBottom="56dp" />-->


<com.flyco.tablayout.CommonTabLayout
Expand Down
17 changes: 0 additions & 17 deletions app/src/test/java/com/yzs/yzsbaseactivity/ExampleUnitTest.java

This file was deleted.

6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}
Expand Down
11 changes: 7 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# 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
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
32 changes: 14 additions & 18 deletions yzsbaseactivitylib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"

Expand All @@ -22,26 +22,22 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
//viewpager指示器 与 导航栏控件
compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
api 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
// 为"单Activity + 多Fragment","多模块Activity + 多Fragment"架构而生,替代官方fragment
compile 'me.yokeyword:fragmentation:1.2.4'
api 'me.xuexuan:fragmentationx:1.0.6'
//事件总线
//RecyclerView的强大的BaseAdapter
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.orhanobut:logger:2.1.1'
api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
api 'androidx.recyclerview:recyclerview:1.1.0'
api 'com.orhanobut:logger:2.1.1'
//沉浸式库
compile 'com.gyf.barlibrary:barlibrary:2.3.0'
compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
api 'com.gyf.barlibrary:barlibrary:2.3.0'
api 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
// Activity作用域的EventBus,更安全,可有效避免after onSavenInstanceState()异常
compile 'me.yokeyword:eventbus-activity-scope:1.1.0'
api 'me.yokeyword:eventbus-activity-scope:1.1.0'
// Your EventBus's version
compile 'org.greenrobot:eventbus:3.0.0'
api 'org.greenrobot:eventbus:3.2.0'
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.yzs.yzsbaseactivitylib.adapter;

import android.support.v4.util.SparseArrayCompat;

import androidx.collection.SparseArrayCompat;

/**
* Created by zhy on 16/6/22.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yzs.yzsbaseactivitylib.annotations;

import android.support.annotation.IntDef;

import androidx.annotation.IntDef;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

/**
* 创建人:姚智胜
* 创建时间: 2016/11/11.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

/**
* 创建人:姚智胜
* 创建时间: 2016/11/14.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;

import androidx.fragment.app.Fragment;

/**
* Author 姚智胜
* Version V1.0版本
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

/**
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import android.view.View;
import android.view.View.OnTouchListener;

import androidx.appcompat.widget.AppCompatImageView;


/**
*
Expand All @@ -17,7 +19,7 @@
*
*
*/
public class ColorFilterImageView extends android.support.v7.widget.AppCompatImageView implements OnTouchListener {
public class ColorFilterImageView extends AppCompatImageView implements OnTouchListener {
public ColorFilterImageView(Context context) {
this(context, null, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewStub;
import android.widget.FrameLayout;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;

import com.yzs.yzsbaseactivitylib.R;
import com.yzs.yzsbaseactivitylib.basemvp.BaseModel;
import com.yzs.yzsbaseactivitylib.basemvp.BasePresenter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.yzs.yzsbaseactivitylib.yzsbase;

import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -15,6 +12,10 @@
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;

import com.gyf.barlibrary.ImmersionBar;
import com.yzs.yzsbaseactivitylib.R;
import com.yzs.yzsbaseactivitylib.basemvp.BaseModel;
Expand Down
Loading

0 comments on commit 135ab39

Please sign in to comment.