Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task android x #85

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ android {
versionNameSuffix rootProject.ext.app.versionNameSuffix
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
//是否清理无用资源
shrinkResources false
//是否启用zipAlign压缩
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.myConfig
versionNameSuffix rootProject.ext.app.versionNameSuffix
}
// debug {
// minifyEnabled true
// //是否清理无用资源
// shrinkResources false
// //是否启用zipAlign压缩
// zipAlignEnabled false
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.myConfig
// versionNameSuffix rootProject.ext.app.versionNameSuffix
// }
}

lintOptions {
Expand All @@ -60,6 +60,6 @@ android {
dependencies {
implementation rootProject.ext.dependencies.design
implementation rootProject.ext.dependencies.appcompatV7
// implementation project(':rigger')
implementation "com.justkiddingbaby:fragment-rigger:${rigger.publishVersion}"
implementation project(':rigger')
// implementation "com.justkiddingbaby:fragment-rigger:${rigger.publishVersion}"
}
8 changes: 5 additions & 3 deletions app/src/main/java/com/yj/app/base/BaseActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.yj.app.base;

import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.jkb.fragment.rigger.annotation.Puppet;
import com.yj.app.R;

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/yj/app/base/BaseFragment.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.yj.app.base;

import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/yj/app/test/ContainerFragment.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.yj.app.test;

import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.animation.Animation;
import android.widget.ImageView;

import androidx.core.content.ContextCompat;

import com.jkb.fragment.rigger.annotation.LazyLoad;
import com.jkb.fragment.rigger.utils.Logger;
import com.yj.app.R;
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/com/yj/app/test/lazyload/LazyLoadAdapter.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.yj.app.test.lazyload;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentManager;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.core.content.ContextCompat;

import com.yj.app.R;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.yj.app.test.lazyload;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.widget.Toast;

import androidx.viewpager.widget.ViewPager;

import com.google.android.material.tabs.TabLayout;
import com.yj.app.R;
import com.yj.app.base.BaseFragment;
import java.util.Timer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import com.yj.app.R;
import com.yj.app.base.BaseFragment;
import com.yj.app.test.ContainerFragment;
import com.yj.app.utils.Rotate3d;
import java.util.Random;
import java.util.UUID;

/**
* @author JingYeoh
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/yj/app/test/show/ShowFragment.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.yj.app.test.show;

import androidx.fragment.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;
import com.jkb.fragment.rigger.rigger.Rigger;
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/yj/app/test/start/StartFragment.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.yj.app.test.start;

import android.os.Bundle;
import android.support.annotation.Nullable;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.jkb.fragment.rigger.annotation.Animator;
import com.jkb.fragment.rigger.annotation.Puppet;
import com.jkb.fragment.rigger.rigger.Rigger;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/yj/app/utils/Rotate3d.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import android.graphics.Camera;
import android.graphics.Matrix;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;

import androidx.annotation.NonNull;

/**
* @author JingYeoh
* <a href="mailto:[email protected]">Email me</a>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/frg_lazyload.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/fl_vp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/fl_tab"
android:layout_width="match_parent"
android:layout_height="50dp"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {

classpath 'com.novoda:bintray-release:0.8.1'
classpath 'org.aspectj:aspectjtools:1.8.13'
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.1'
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
6 changes: 3 additions & 3 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ ext {
android = [
minSdkVersion : 14,
targetSdkVersion : 27,
compileSdkVersion : 27,
compileSdkVersion : 28,
buildToolsVersion : "27.0.3",
sourceCompatibilityVersion: JavaVersion.VERSION_1_8,
targetCompatibilityVersion: JavaVersion.VERSION_1_8
]

dependencies = [
appcompatV7 : 'com.android.support:appcompat-v7:27.1.1',
design : 'com.android.support:design:27.1.1',
appcompatV7 : 'androidx.appcompat:appcompat:1.0.0',
design : 'com.google.android.material:material:1.0.0',
aspectJ : 'org.aspectj:aspectjrt:1.8.9',
javapoet : 'com.squareup:javapoet:1.11.1',
autoSerivice: 'com.google.auto.service:auto-service:1.0-rc3'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jkb.fragment.rigger.annotation;

import android.support.annotation.AnimRes;

import androidx.annotation.AnimRes;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Used to mark a fragment is using lazy load.
* Lazy load:fragment's container view will be created and init the data when the fragment is showed.
* Annotation class that can only used on {@link android.support.v4.app.Fragment}.
* Annotation class that can only used on {@link androidx.fragment.app.Fragment}.
*
* @author JingYeoh
* <a href="mailto:[email protected]">Email me</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.jkb.fragment.rigger.annotation;

import android.app.Activity;
import android.support.annotation.IdRes;
import android.support.v4.app.Fragment;

import androidx.annotation.IdRes;

import com.jkb.fragment.rigger.rigger.Rigger;

Expand All @@ -13,7 +13,7 @@
import java.lang.annotation.Target;

/**
* Annotation class that can only be used on {@link Activity} or {@link Fragment}, a
* Annotation class that can only be used on {@link Activity} or {@link androidx.fragment.app.Fragment}, a
* Activity/Fragment class that marked by this annotation can be rigged by {@link Rigger}.
*
* @author JingYeoh
Expand All @@ -35,7 +35,7 @@
int containerViewId() default 0;

/**
* Allow or not exit the host {@link android.app.Activity}/{@link android.support.v4.app.Fragment} as the
* Allow or not exit the host {@link android.app.Activity}/{@link androidx.fragment.app.Fragment} as the
* stack size = 1 .
* <p>
* If the value is true , the host object(Activity/Fragment) will be exit as the stack size = 1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@ public class ActivityInjection extends RiggerInjection {

//****************PointCut***********************************

@Pointcut("execution(android.support.v4.app.FragmentActivity+.new()) && annotatedWithPuppet()")
@Pointcut("execution(androidx.fragment.app.FragmentActivity+.new()) && annotatedWithPuppet()")
public void construct() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onCreate(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onCreate(..)) && annotatedWithPuppet()")
public void onCreate() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onResumeFragments(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onResumeFragments(..)) && annotatedWithPuppet()")
public void onResumeFragments() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onPause(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onPause(..)) && annotatedWithPuppet()")
public void onPause() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onResume(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onResume(..)) && annotatedWithPuppet()")
public void onResume() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onSaveInstanceState(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onSaveInstanceState(..)) && annotatedWithPuppet()")
public void onSaveInstanceState() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onDestroy(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onDestroy(..)) && annotatedWithPuppet()")
public void onDestroy() {
}

@Pointcut("execution(* android.support.v4.app.FragmentActivity+.onBackPressed(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.FragmentActivity+.onBackPressed(..)) && annotatedWithPuppet()")
public void onBackPressed() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,43 @@ public class FragmentInjection extends RiggerInjection {

//****************PointCut***********************************

@Pointcut("execution(android.support.v4.app.Fragment+.new()) && annotatedWithPuppet()")
@Pointcut("execution(androidx.fragment.app.Fragment+.new()) && annotatedWithPuppet()")
public void constructor() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onAttach(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onAttach(..)) && annotatedWithPuppet()")
public void onAttach() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onCreate(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onCreate(..)) && annotatedWithPuppet()")
public void onCreate() {
}

@Pointcut("call(* android.support.v4.app.Fragment+.onViewCreated(..)) && annotatedWithPuppet()")
@Pointcut("call(* androidx.fragment.app.Fragment+.onViewCreated(..)) && annotatedWithPuppet()")
public void onViewCreated() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onCreateView(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onCreateView(..)) && annotatedWithPuppet()")
public void onCreateView() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onResume(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onResume(..)) && annotatedWithPuppet()")
public void onResume() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onSaveInstanceState(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onSaveInstanceState(..)) && annotatedWithPuppet()")
public void onSaveInstanceState() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onDestroy(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onDestroy(..)) && annotatedWithPuppet()")
public void onDestroy() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.onDetach(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.onDetach(..)) && annotatedWithPuppet()")
public void onDetach() {
}

@Pointcut("execution(* android.support.v4.app.Fragment+.setUserVisibleHint(..)) && annotatedWithPuppet()")
@Pointcut("execution(* androidx.fragment.app.Fragment+.setUserVisibleHint(..)) && annotatedWithPuppet()")
public void setUserVisibleHint() {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.jkb.fragment.rigger.helper;

import androidx.fragment.app.FragmentManager;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;
import android.text.TextUtils;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.jkb.fragment.rigger.rigger;

import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.jkb.fragment.rigger.annotation.Puppet;
import com.jkb.fragment.rigger.exception.AlreadyExistException;
Expand Down
Loading