Skip to content

Commit

Permalink
升级AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
puy committed Jun 10, 2019
1 parent f6343e5 commit 3c1cb5c
Show file tree
Hide file tree
Showing 52 changed files with 94 additions and 70 deletions.
16 changes: 11 additions & 5 deletions app/src/main/java/com/android/puy/mvpkotlin/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.android.puy.mvpkotlin

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
import com.android.puy.puymvpjava.mvp.XActivity
import kotlinx.android.synthetic.main.activity_main.*
import persents.Pmain

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
class MainActivity : XActivity<Pmain>() {
override fun getLayoutId() = R.layout.activity_main

override fun newP() = Pmain()

override fun initData(savedInstanceState: Bundle?) {
text.text = "demo"
}

}
8 changes: 8 additions & 0 deletions app/src/main/java/persents/Pmain.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package persents

import com.android.puy.puymvpjava.mvp.XPresent
import views.IVmain

class Pmain:XPresent<IVmain>(){

}
8 changes: 8 additions & 0 deletions app/src/main/java/views/IVmain.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package views

import com.android.puy.puymvpjava.mvp.IView
import persents.Pmain

interface IVmain:IView<Pmain>{

}
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
tools:context=".MainActivity">

<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
Expand Down
4 changes: 2 additions & 2 deletions conf.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ext {
"percent" : "com.android.support:percent:${android["VSupportSdk"]}",
"constraint-layout" : 'com.android.support.constraint:constraint-layout:1.0.2',

"butterknife" : "com.jakewharton:butterknife:8.4.0",
"butterknife-apt" : "com.jakewharton:butterknife-compiler:8.4.0",
"butterknife" : "com.jakewharton:butterknife:10.1.0",
"butterknife-apt" : "com.jakewharton:butterknife-compiler:10.1.0",
"eventbus" : "org.greenrobot:eventbus:3.0.0",
"glide" : "com.github.bumptech.glide:glide:3.7.0",
"picasso" : "com.squareup.picasso:picasso:2.5.2",
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true
8 changes: 3 additions & 5 deletions puymvpjava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation rootProject.ext.dependencies["appcompat-v7"]
implementation rootProject.ext.dependencies["support-v4"]
implementation rootProject.ext.dependencies["design"]
implementation rootProject.ext.dependencies["annotations"]
implementation rootProject.ext.dependencies["recyclerview-v7"]
api 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation rootProject.ext.dependencies["xrecyclerview"]
implementation rootProject.ext.dependencies["butterknife"]
annotationProcessor rootProject.ext.dependencies["butterknife-apt"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.android.puy.puymvpjava.base;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import cn.droidlover.xrecyclerview.RecyclerAdapter;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.android.puy.puymvpjava.base;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.android.puy.puymvpjava.cache;

import android.support.v4.util.LruCache;
import android.text.TextUtils;
import androidx.collection.LruCache;


public class MemoryCache implements ICache {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.android.puy.puymvpjava.customs;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import me.imid.swipebacklayout.lib.Utils;

public class SwipeBackActivity extends AppCompatActivity implements SwipeBackActivityBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.core.view.ViewCompat;
import me.imid.swipebacklayout.lib.ViewDragHelper;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.android.puy.puymvpjava.customs.pageindicatorview;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.AnimationManager;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import android.os.Looper;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.support.v4.text.TextUtilsCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewCompat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.animation;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.AnimationController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.AnimationType;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.BaseAnimation;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.animation.data;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.*;

public class AnimationValue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import android.animation.Animator;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;

public abstract class BaseAnimation<T extends Animator> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.animation.ArgbEvaluator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.ColorAnimationValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.DropAnimationValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.animation.IntEvaluator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.FillAnimationValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.animation.IntEvaluator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.ScaleAnimationValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.animation.IntEvaluator;
import android.animation.PropertyValuesHolder;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;

public class ScaleDownAnimation extends ScaleAnimation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.animation.IntEvaluator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.SlideAnimationValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.animation.IntEvaluator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.SwapAnimationValue;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.animation.type;

import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.ThinWormAnimationValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.support.annotation.NonNull;
import android.view.animation.AccelerateDecelerateInterpolator;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.controller.ValueController;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.WormAnimationValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Pair;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.controller.AttributeController;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.controller.DrawController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.puy.puymvpjava.R;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.*;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.draw.controller;

import android.graphics.Canvas;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.AnimationType;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.draw.controller;

import android.support.annotation.NonNull;
import android.util.Pair;
import android.view.View;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.AnimationType;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Orientation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.draw.data;

import android.support.annotation.NonNull;
import android.view.View;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.AnimationType;

public class Indicator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.drawer.type.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.android.puy.puymvpjava.customs.pageindicatorview.draw.drawer.type;

import android.graphics.Paint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;

class BaseDrawer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.type.AnimationType;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.ColorAnimationValue;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.Value;
import com.android.puy.puymvpjava.customs.pageindicatorview.animation.data.type.DropAnimationValue;
import com.android.puy.puymvpjava.customs.pageindicatorview.draw.data.Indicator;
Expand Down
Loading

0 comments on commit 3c1cb5c

Please sign in to comment.