Skip to content

Commit

Permalink
适配androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-P-J committed Nov 6, 2022
1 parent 809c022 commit fec11f0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 31

defaultConfig {
applicationId "com.zpj.setting.demo"
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 31
versionCode 1
versionName "1.0"

Expand All @@ -26,7 +25,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation project(':zsetting')
}
3 changes: 1 addition & 2 deletions app/src/main/java/com/zpj/setting/demo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.zpj.setting.demo;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

import com.zpj.widget.setting.CommonSettingItem;
import com.zpj.widget.setting.SwitchSettingItem;
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# 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.
android.enableJetifier=true
android.useAndroidX=true
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
Expand Down
9 changes: 4 additions & 5 deletions zsetting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 31

defaultConfig {
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 31
versionCode 6
versionName "1.0.0"
}
Expand All @@ -22,8 +21,8 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.github.Z-P-J:ZSwitcher:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.github.Z-P-J:ZSwitcher:2.0.0'
}

afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.zpj.widget.setting;

import android.content.Context;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.widget.AppCompatTextView;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.appcompat.widget.AppCompatTextView;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.Gravity;
Expand Down

0 comments on commit fec11f0

Please sign in to comment.