Commit 2059e3be by 王宇航

轉到androidx

parent bb8e3cd0
......@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -19,7 +19,6 @@ android {
}
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......@@ -57,11 +56,11 @@ android {
def fileName
def date = new Date()
def formattedDate = date.format('yyyy-MM-dd')
if (variant.buildType.name.equals('release')) {
if (variant.buildType.name == 'release') {
fileName = "${formattedDate}_GsAndroid_${variant.mergedFlavor.versionName}_正式版_.apk"
} else if (variant.buildType.name.equals('Test')) {
} else if (variant.buildType.name == 'Test') {
fileName = "${formattedDate}__GsAndroid_${variant.mergedFlavor.versionName}_测试版_.apk"
} else if (variant.buildType.name.equals('debug')) {
} else if (variant.buildType.name == 'debug') {
fileName = "${formattedDate}__GsAndroid_${variant.mergedFlavor.versionName}_debug_.apk"
}
outputFileName = fileName;
......@@ -74,9 +73,8 @@ dependencies {
implementation project(':mvp:arms')
addComponent 'component_login'
addComponent 'component_register'
// addComponent 'component_login'
// addComponent 'component_register'
// test
testImplementation rootProject.ext.dependencies["junit"]
......
......@@ -13,11 +13,11 @@
<activity android:name=".main.ActivityA">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.gingersoft.cloud.gsa.main;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import com.gingersoft.cloud.gsa.R;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
/**
* @author billy.qi
*/
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
buildscript {
ext.kotlin_version = '1.2.51'
ext.kotlin_version = '1.3.10'
repositories {
maven{ url rootProject.file("repo-local") }
......@@ -13,7 +13,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
......
......@@ -10,7 +10,7 @@ repositories {
mavenCentral()
}
dependencies {
compile 'com.android.tools.build:gradle:2.2.0'
compile 'com.android.tools.build:gradle:3.5.3'
}
ext {
......
......@@ -6,7 +6,7 @@
// 完成组件、拦截器及跨进程json解释器等CC库自身需要的自动注册功能
// 支持新增自定义的其它自动注册功能,参考AutoRegister,用法参考cc-settings-demo.gradle
project.apply plugin: 'cc-register'
project.dependencies.add('api', "com.billy.android:cc:2.1.5") //用最新版
project.dependencies.add('api', "com.billy.android:cc:2.1.6") //用最新版
//此文件是作为组件化配置的公共gradle脚本文件,在每个组件中都apply此文件,下载到工程根目录后,可以在下方添加一些自己工程中通用的配置
// 可参考cc-settings-demo.gradle
......
......@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......@@ -35,7 +34,7 @@ android {
dependencies {
//发布到bintray时,要写成compile才行
compile "com.billy.android:pools:0.0.6"
implementation "com.billy.android:pools:0.0.6"
compileOnly rootProject.ext.dependencies["appcompat-v7"]
compileOnly project(':android_internal')
}
......
......@@ -7,8 +7,6 @@ import android.content.Context;
import android.os.Build;
import android.os.Looper;
import android.os.SystemClock;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.text.TextUtils;
import android.util.Log;
......@@ -24,6 +22,9 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import static com.billy.cc.core.component.CCUtil.put;
import static com.billy.cc.core.component.ComponentManager.ACTION_REGISTER;
import static com.billy.cc.core.component.ComponentManager.ACTION_UNREGISTER;
......
......@@ -7,14 +7,15 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.SystemClock;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import java.lang.ref.WeakReference;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
/**
* CC监控系统
* 每个CC对象有自己的超时时间点,
......
......@@ -11,7 +11,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
......@@ -29,6 +28,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
/**
* @author billy.qi
* @since 17/7/9 18:37
......
......@@ -2,7 +2,7 @@ package com.billy.cc.core.component.remote;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
/**
* 用于跨app探索组件及唤醒app的activity
......
......@@ -4,7 +4,6 @@ import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.SparseArray;
......@@ -21,6 +20,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import androidx.annotation.NonNull;
import static com.billy.cc.core.component.CCUtil.put;
/**
......
......@@ -11,26 +11,25 @@ ext {
version = [
androidSupportSdkVersion: "28+",
retrofitSdkVersion : "2.3.0",
retrofitSdkVersion : '2.7.0',
dagger2SdkVersion : "2.14.1",
glideSdkVersion : "4.5.0",
butterknifeSdkVersion : "8.8.1",
glideSdkVersion : "4.9.0",
butterknifeSdkVersion : "10.1.0",
rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.1",
espressoSdkVersion : "3.0.1",
// fragmentationVersion : "1.1.6",
canarySdkVersion : "1.5.4"
]
dependencies = [
//support
"appcompat-v7" : "com.android.support:appcompat-v7:${version["androidSupportSdkVersion"]}",
"design" : "com.android.support:design:${version["androidSupportSdkVersion"]}",
"support-v4" : "com.android.support:support-v4:${version["androidSupportSdkVersion"]}",
"cardview-v7" : "com.android.support:cardview-v7:${version["androidSupportSdkVersion"]}",
"annotations" : "com.android.support:support-annotations:${version["androidSupportSdkVersion"]}",
"recyclerview-v7" : "com.android.support:recyclerview-v7:${version["androidSupportSdkVersion"]}",
"appcompat-v7" : 'androidx.appcompat:appcompat:1.0.0',
"design" : 'com.google.android.material:material:1.0.0',
"support-v4" : 'androidx.legacy:legacy-support-v4:1.0.0',
"cardview-v7" : 'androidx.cardview:cardview:1.0.0',
"annotations" : 'androidx.annotation:annotation:1.0.0',
"recyclerview-v7" : 'androidx.recyclerview:recyclerview:1.0.0',
//network
"retrofit" : "com.squareup.retrofit2:retrofit:${version["retrofitSdkVersion"]}",
......@@ -85,7 +84,7 @@ ext {
"androideventbus" : "org.simple:androideventbus:1.0.5.1",
"otto" : "com.squareup:otto:1.3.8",
"gson" : "com.google.code.gson:gson:2.8.2",
"multidex" : "com.android.support:multidex:1.0.1",
"multidex" : 'androidx.multidex:multidex:2.0.0',
"javax.annotation" : "javax.annotation:jsr250-api:1.0",
"arouter" : "com.alibaba:arouter-api:1.3.0",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.1.4",
......
......@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
useLibrary 'org.apache.http.legacy'
compileOptions {
......@@ -17,14 +16,14 @@ android {
versionName rootProject.ext.android["versionName"]
}
buildTypes {
Test {
buildConfigField "boolean", "LOG_DEBUG", "false"
buildConfigField "boolean", "USE_CANARY", "false"
minifyEnabled false
shrinkResources false
zipAlignEnabled false
proguardFiles 'proguard.cfg'
}
// Test {
// buildConfigField "boolean", "LOG_DEBUG", "false"
// buildConfigField "boolean", "USE_CANARY", "false"
// minifyEnabled false
// shrinkResources false
// zipAlignEnabled false
// proguardFiles 'proguard.cfg'
// }
debug {
buildConfigField "boolean", "LOG_DEBUG", "true"
......@@ -137,6 +136,9 @@ dependencies {
implementation rootProject.ext.dependencies["cardview-v7"]
//test
api rootProject.ext.dependencies["timber"]
//解决Glide找不到Android声明库问题
annotationProcessor 'androidx.annotation:annotation:1.1.0'
// testApi rootProject.ext.dependencies["junit"]
}
......
......@@ -16,13 +16,15 @@
package com.jess.arms.base;
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
/**
* ================================================
* 基类 {@link FragmentStatePagerAdapter}
......
......@@ -15,10 +15,10 @@
*/
package com.jess.arms.base;
import android.support.annotation.NonNull;
import com.jess.arms.di.component.AppComponent;
import androidx.annotation.NonNull;
/**
* ================================================
* 框架要求框架中的每个 {@link android.app.Application} 都需要实现此类,以满足规范
......
......@@ -18,9 +18,6 @@ package com.jess.arms.base;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.AttributeSet;
import android.view.View;
......@@ -34,6 +31,10 @@ import com.trello.rxlifecycle2.android.ActivityEvent;
import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.subjects.BehaviorSubject;
......@@ -125,9 +126,8 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi
public boolean useEventBus() {
return true;
}
/**
* 这个Activity是否会使用Fragment,框架会根据这个属性判断是否注册{@link android.support.v4.app.FragmentManager.FragmentLifecycleCallbacks}
* 这个Activity是否会使用Fragment,框架会根据这个属性判断是否注册{@link androidx.core.app.FragmentManager.FragmentLifecycleCallbacks}
* 如果返回false,那意味着这个Activity不需要绑定Fragment,那你再在这个Activity中绑定继承于 {@link com.jess.arms.base.BaseFragment} 的Fragment将不起任何作用
*
* @return
......
......@@ -15,13 +15,7 @@
*/
package com.jess.arms.base;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.widget.Toast;
import com.jess.arms.base.delegate.AppDelegate;
import com.jess.arms.base.delegate.AppLifecycles;
......@@ -29,6 +23,10 @@ import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.Preconditions;
import androidx.annotation.NonNull;
import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
/**
* ================================================
* 本框架由 MVP + Dagger2 + Retrofit + RxJava + Androideventbus + Butterknife 组成
......
......@@ -16,9 +16,6 @@
package com.jess.arms.base;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -33,6 +30,9 @@ import com.trello.rxlifecycle2.android.FragmentEvent;
import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import io.reactivex.subjects.BehaviorSubject;
import io.reactivex.subjects.Subject;
......
......@@ -15,12 +15,13 @@
*/
package com.jess.arms.base;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.jess.arms.utils.ThirdViewUtil;
import com.zhy.autolayout.utils.AutoUtils;
import androidx.recyclerview.widget.RecyclerView;
/**
* ================================================
* 基类 {@link RecyclerView.ViewHolder}
......
......@@ -18,10 +18,10 @@ package com.jess.arms.base;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import org.simple.eventbus.EventBus;
import androidx.annotation.Nullable;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
......
......@@ -15,14 +15,14 @@
*/
package com.jess.arms.base;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import androidx.recyclerview.widget.RecyclerView;
/**
* ================================================
* 基类 {@link RecyclerView.Adapter} ,如果需要实现非常复杂的 {@link RecyclerView} ,请尽量使用其他优秀的三方库
......
......@@ -17,7 +17,8 @@ package com.jess.arms.base.delegate;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
/**
* ================================================
......
......@@ -17,12 +17,13 @@ package com.jess.arms.base.delegate;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.jess.arms.utils.ArmsUtils;
import org.simple.eventbus.EventBus;
import androidx.annotation.Nullable;
/**
* ================================================
* {@link ActivityDelegate} 默认实现类
......
......@@ -22,8 +22,6 @@ import android.content.ComponentCallbacks2;
import android.content.ContentProvider;
import android.content.Context;
import android.content.res.Configuration;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import com.jess.arms.base.App;
import com.jess.arms.base.BaseApplication;
import com.jess.arms.di.component.AppComponent;
......@@ -38,6 +36,9 @@ import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
/**
* ================================================
* AppDelegate 可以代理 Application 的生命周期,在对应的生命周期,执行对应的逻辑,因为 Java 只能单继承
......
......@@ -17,11 +17,12 @@ package com.jess.arms.base.delegate;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
/**
* ================================================
* {@link Fragment} 代理类,用于框架内部在每个 {@link Fragment} 的对应生命周期中插入需要的逻辑
......
......@@ -17,14 +17,16 @@ package com.jess.arms.base.delegate;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import com.jess.arms.utils.ArmsUtils;
import org.simple.eventbus.EventBus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import timber.log.Timber;
......@@ -39,13 +41,13 @@ import timber.log.Timber;
* ================================================
*/
public class FragmentDelegateImpl implements FragmentDelegate {
private android.support.v4.app.FragmentManager mFragmentManager;
private android.support.v4.app.Fragment mFragment;
private FragmentManager mFragmentManager;
private Fragment mFragment;
private IFragment iFragment;
private Unbinder mUnbinder;
public FragmentDelegateImpl(android.support.v4.app.FragmentManager fragmentManager, android.support.v4.app.Fragment fragment) {
public FragmentDelegateImpl(FragmentManager fragmentManager, Fragment fragment) {
this.mFragmentManager = fragmentManager;
this.mFragment = fragment;
this.iFragment = (IFragment) fragment;
......
......@@ -18,9 +18,6 @@ package com.jess.arms.base.delegate;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.base.BaseFragment;
......@@ -28,9 +25,12 @@ import com.jess.arms.di.component.AppComponent;
import com.jess.arms.integration.ActivityLifecycle;
import com.jess.arms.integration.cache.Cache;
import com.jess.arms.integration.cache.LruCache;
import org.simple.eventbus.EventBus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
/**
* ================================================
* 框架要求框架中的每个 {@link Activity} 都需要实现此类,以满足规范
......@@ -87,7 +87,7 @@ public interface IActivity {
* 如果返回{@code false},那意味着这个 Activity 不需要绑定 Fragment,那你再在这个 Activity 中绑定继承于 {@link BaseFragment} 的 Fragment 将不起任何作用
*
* @return
* @see ActivityLifecycle#registerFragmentCallbacks (Fragment 的注册过程)
* @see ActivityLifecycle# (Fragment 的注册过程)
*/
boolean useFragment();
......
......@@ -18,9 +18,6 @@ package com.jess.arms.base.delegate;
import android.app.Activity;
import android.os.Bundle;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -32,6 +29,10 @@ import com.jess.arms.integration.cache.LruCache;
import org.simple.eventbus.EventBus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
/**
* ================================================
* 框架要求框架中的每个 {@link Fragment} 都需要实现此类,以满足规范
......
......@@ -17,8 +17,6 @@ package com.jess.arms.di.module;
import android.app.Application;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
......@@ -36,6 +34,8 @@ import java.util.List;
import javax.inject.Named;
import javax.inject.Singleton;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
......
......@@ -17,7 +17,6 @@ package com.jess.arms.di.module;
import android.app.Application;
import android.content.Context;
import android.support.annotation.Nullable;
import com.google.gson.Gson;
import com.jess.arms.http.GlobalHttpHandler;
......@@ -32,6 +31,7 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import androidx.annotation.Nullable;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
......
......@@ -16,8 +16,6 @@
package com.jess.arms.di.module;
import android.app.Application;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.bumptech.glide.Glide;
......@@ -40,6 +38,8 @@ import java.util.List;
import javax.inject.Singleton;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import dagger.Module;
import dagger.Provides;
import me.jessyan.rxerrorhandler.handler.listener.ResponseErrorListener;
......
......@@ -16,7 +16,6 @@
package com.jess.arms.http;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.Log;
import com.bumptech.glide.Priority;
......@@ -31,6 +30,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import androidx.annotation.NonNull;
import okhttp3.Call;
import okhttp3.Request;
import okhttp3.Response;
......
......@@ -15,7 +15,6 @@
*/
package com.jess.arms.http.log;
import android.support.annotation.Nullable;
import com.jess.arms.di.module.GlobalConfigModule;
import com.jess.arms.http.GlobalHttpHandler;
......@@ -32,6 +31,7 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.annotation.Nullable;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.Request;
......
......@@ -18,10 +18,6 @@ package com.jess.arms.integration;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import com.jess.arms.base.BaseFragment;
import com.jess.arms.base.delegate.ActivityDelegate;
import com.jess.arms.base.delegate.ActivityDelegateImpl;
......@@ -35,6 +31,9 @@ import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import dagger.Lazy;
......
......@@ -22,9 +22,9 @@ import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Message;
import android.support.design.widget.Snackbar;
import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import com.jess.arms.base.delegate.AppLifecycles;
import org.simple.eventbus.EventBus;
......@@ -39,6 +39,7 @@ import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.appcompat.app.AppCompatActivity;
import timber.log.Timber;
/**
......@@ -76,7 +77,6 @@ public final class AppManager {
public AppManager() {
}
@Inject
void init() {
EventBus.getDefault().register(this);
......
......@@ -17,13 +17,14 @@ package com.jess.arms.integration;
import android.app.Application;
import android.content.Context;
import android.support.v4.app.FragmentManager;
import com.jess.arms.base.delegate.AppLifecycles;
import com.jess.arms.di.module.GlobalConfigModule;
import java.util.List;
import androidx.fragment.app.FragmentManager;
/**
* ================================================
* {@link ConfigModule} 可以给框架配置一些参数,需要实现 {@link ConfigModule} 后,在 AndroidManifest 中声明该实现类
......@@ -59,7 +60,6 @@ public interface ConfigModule {
*/
void injectActivityLifecycle(Context context, List<Application.ActivityLifecycleCallbacks> lifecycles);
/**
* 使用{@link FragmentManager.FragmentLifecycleCallbacks}在Fragment的生命周期中注入一些操作
*
......
......@@ -17,9 +17,6 @@ package com.jess.arms.integration;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.View;
import com.jess.arms.base.delegate.FragmentDelegate;
......@@ -31,6 +28,9 @@ import com.jess.arms.utils.Preconditions;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import timber.log.Timber;
/**
......
......@@ -16,13 +16,14 @@
package com.jess.arms.integration.cache;
import android.app.Application;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.jess.arms.di.module.GlobalConfigModule;
import java.util.Set;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* ================================================
......
......@@ -18,11 +18,12 @@ package com.jess.arms.integration.cache;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.support.v4.app.Fragment;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.integration.RepositoryManager;
import androidx.fragment.app.Fragment;
/**
* ================================================
* 构建 {@link Cache} 时,使用 {@link CacheType} 中声明的类型,来区分不同的模块
......
......@@ -16,7 +16,6 @@
package com.jess.arms.integration.cache;
import android.app.Application;
import android.support.annotation.Nullable;
import com.jess.arms.di.module.GlobalConfigModule;
......@@ -24,6 +23,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import androidx.annotation.Nullable;
/**
* ================================================
......
......@@ -18,7 +18,6 @@ package com.jess.arms.integration.lifecycle;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.trello.rxlifecycle2.RxLifecycle;
import com.trello.rxlifecycle2.android.ActivityEvent;
......@@ -26,6 +25,7 @@ import com.trello.rxlifecycle2.android.ActivityEvent;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.fragment.app.FragmentActivity;
import dagger.Lazy;
import io.reactivex.subjects.Subject;
......
......@@ -17,8 +17,6 @@ package com.jess.arms.integration.lifecycle;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.View;
import com.trello.rxlifecycle2.RxLifecycle;
......@@ -27,6 +25,8 @@ import com.trello.rxlifecycle2.android.FragmentEvent;
import javax.inject.Inject;
import javax.inject.Singleton;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import io.reactivex.subjects.Subject;
/**
......
......@@ -15,11 +15,11 @@
*/
package com.jess.arms.integration.lifecycle;
import android.support.v4.app.Fragment;
import com.trello.rxlifecycle2.RxLifecycle;
import com.trello.rxlifecycle2.android.FragmentEvent;
import androidx.fragment.app.Fragment;
/**
* ================================================
* 让 {@link Fragment} 实现此接口,即可正常使用 {@link RxLifecycle}
......
......@@ -16,12 +16,12 @@
package com.jess.arms.integration.lifecycle;
import android.app.Activity;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import com.jess.arms.utils.RxLifecycleUtils;
import com.trello.rxlifecycle2.RxLifecycle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import io.reactivex.subjects.Subject;
/**
......
......@@ -15,13 +15,14 @@
*/
package com.jess.arms.mvp;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.OnLifecycleEvent;
import com.jess.arms.integration.IRepositoryManager;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.OnLifecycleEvent;
/**
* ================================================
* 基类 Model
......
......@@ -17,12 +17,6 @@ package com.jess.arms.mvp;
import android.app.Activity;
import android.app.Service;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.OnLifecycleEvent;
import android.support.v4.app.Fragment;
import android.support.v4.app.SupportActivity;
import android.view.View;
import com.jess.arms.utils.Preconditions;
......@@ -30,6 +24,11 @@ import com.trello.rxlifecycle2.RxLifecycle;
import org.simple.eventbus.EventBus;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.OnLifecycleEvent;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Action;
......
......@@ -17,7 +17,8 @@ package com.jess.arms.mvp;
import android.app.Activity;
import android.content.Intent;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* ================================================
......
......@@ -21,9 +21,6 @@ import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Message;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.SpannedString;
......@@ -35,12 +32,16 @@ import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.snackbar.Snackbar;
import com.jess.arms.base.App;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.integration.AppManager;
import java.security.MessageDigest;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.RecyclerView;
import static com.jess.arms.integration.AppManager.APP_EXIT;
import static com.jess.arms.integration.AppManager.KILL_ALL;
import static com.jess.arms.integration.AppManager.SHOW_SNACKBAR;
......
......@@ -15,7 +15,8 @@
*/
package com.jess.arms.utils;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
/**
* ================================================
......
......@@ -20,7 +20,6 @@ import android.app.Dialog;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
......@@ -28,6 +27,7 @@ import com.zhy.autolayout.AutoFrameLayout;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;
import androidx.annotation.Nullable;
import butterknife.ButterKnife;
import butterknife.Unbinder;
......
......@@ -16,11 +16,11 @@
package com.jess.arms.widget.autolayout;
import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.appbar.AppBarLayout;
import com.zhy.autolayout.AutoLayoutInfo;
import com.zhy.autolayout.utils.AutoLayoutHelper;
......
......@@ -16,11 +16,11 @@
package com.jess.arms.widget.autolayout;
import android.content.Context;
import android.support.design.widget.CollapsingToolbarLayout;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.zhy.autolayout.AutoLayoutInfo;
import com.zhy.autolayout.utils.AutoLayoutHelper;
......
......@@ -16,7 +16,6 @@
package com.jess.arms.widget.autolayout;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
......@@ -25,6 +24,8 @@ import android.widget.ScrollView;
import com.zhy.autolayout.AutoLayoutInfo;
import com.zhy.autolayout.utils.AutoLayoutHelper;
import androidx.annotation.Nullable;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link ScrollView}
......
......@@ -17,12 +17,13 @@ package com.jess.arms.widget.autolayout;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.design.widget.TabLayout;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.android.material.tabs.TabLayout;
import com.jess.arms.R;
import com.zhy.autolayout.utils.AutoUtils;
import com.zhy.autolayout.utils.DimenUtils;
......
......@@ -16,8 +16,6 @@
package com.jess.arms.widget.autolayout;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
......@@ -25,6 +23,9 @@ import android.view.ViewGroup;
import com.zhy.autolayout.AutoLayoutInfo;
import com.zhy.autolayout.utils.AutoLayoutHelper;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link Toolbar}
......
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
package com.gsa.cloud.order.detail;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
/**
* @author billy.qi
*/
......
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -2,5 +2,22 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gsa.cloud.login">
<application>
<!-- <provider-->
<!-- android:name=".remote.RemoteProvider"-->
<!-- android:authorities="${applicationId}.com.billy.cc.core.remote"-->
<!-- android:exported="true" />-->
<activity
android:name="com.gsa.cloud.user.login.LoginActivity"
android:excludeFromRecents="true"
android:exported="true"
android:taskAffinity="com.billy.cc.connection"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="action.com.billy.cc.connection" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
</manifest>
......@@ -29,6 +29,7 @@ public class ComponentLogin implements IComponent {
String actionName = cc.getActionName();
switch (actionName) {
case "showActivityA":
case "User.Component.Login":
openActivity(cc);
break;
case "getLifecycleFragment":
......
package com.gsa.cloud.user.login;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import com.gsa.cloud.login.R;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
TextView textView = new TextView(this);
textView.setGravity(Gravity.CENTER);
textView.setText("ActivityA\nClick to finish this activity");
setContentView(textView);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
setContentView(R.layout.gsa_user_loginactivity_login);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/login_user_state_observer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
/>
<TextView
android:id="@+id/login_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
/>
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
>
</ScrollView>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="#cccccc"
android:scrollbars="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/console"
android:padding="10dp"
/>
</ScrollView>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:text="歡迎登陸商戶端"
android:textColor="#333"
android:textSize="26dp" />
<EditText
android:id="@+id/ed_gsa_user_account"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="100dp"
android:background="#00000000"
android:hint="請輸入賬戶"
android:padding="10dp"
android:textColor="#333" />
<EditText
android:id="@+id/ed_gsa_user_login_pwd"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#00000000"
android:hint="請輸入密碼"
android:padding="10dp"
android:textColor="#333" />
<TextView
android:id="@+id/tv_gsa_user_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#AE2E45"
android:gravity="center"
android:padding="10dp"
android:text="登陸"
android:textColor="#fff"
android:textSize="16dp" />
</LinearLayout>
......@@ -2,7 +2,6 @@ apply from: rootProject.file("cc-settings.gradle")
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment