Commit e733e5a0 by 王涛55

格式化代码

parent b35592d0
if (build_module == build_module_app) { if (build_module == build_module_app) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
} else { } else {
...@@ -59,8 +58,8 @@ android { ...@@ -59,8 +58,8 @@ android {
renderscriptDebuggable false renderscriptDebuggable false
signingConfig signingConfigs.sign signingConfig signingConfigs.sign
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("boolean","SHOW_LOG","false") buildConfigField("boolean", "SHOW_LOG", "false")
buildConfigField("boolean","SERVER_ADDRESS_ENABLE","false") buildConfigField("boolean", "SERVER_ADDRESS_ENABLE", "false")
} }
debug { debug {
minifyEnabled false minifyEnabled false
...@@ -72,8 +71,8 @@ android { ...@@ -72,8 +71,8 @@ android {
renderscriptDebuggable true renderscriptDebuggable true
signingConfig signingConfigs.sign signingConfig signingConfigs.sign
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("boolean","SHOW_LOG","true") buildConfigField("boolean", "SHOW_LOG", "true")
buildConfigField("boolean","SERVER_ADDRESS_ENABLE","true") buildConfigField("boolean", "SERVER_ADDRESS_ENABLE", "true")
} }
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.module.hikcreate"> package="com.module.hikcreate">
<application <application
android:roundIcon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false" android:allowBackup="false"
......
...@@ -3,10 +3,10 @@ package com.hikcreate.app; ...@@ -3,10 +3,10 @@ package com.hikcreate.app;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.widget.Toast; import android.widget.Toast;
import com.hikcreate.base.BaseActivityLifeLogic; import com.hikcreate.base.BaseActivityLifeLogic;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -14,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic; ...@@ -14,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic;
public class AppActivityLifeCycle extends BaseActivityLifeLogic { public class AppActivityLifeCycle extends BaseActivityLifeLogic {
@Override @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) { public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Toast.makeText(activity,"AppActivityLifeCycle",Toast.LENGTH_LONG).show(); Toast.makeText(activity, "AppActivityLifeCycle", Toast.LENGTH_LONG).show();
} }
@Override @Override
......
...@@ -7,7 +7,6 @@ import android.util.Log; ...@@ -7,7 +7,6 @@ import android.util.Log;
import com.hikcreate.base.BaseAppLogic; import com.hikcreate.base.BaseAppLogic;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -15,21 +14,21 @@ import com.hikcreate.base.BaseAppLogic; ...@@ -15,21 +14,21 @@ import com.hikcreate.base.BaseAppLogic;
public class AppAppLogic extends BaseAppLogic { public class AppAppLogic extends BaseAppLogic {
@Override @Override
public void onCreate(Context context) { public void onCreate(Context context) {
Log.v("AppAppLogic","onCreate--------------------->"); Log.v("AppAppLogic", "onCreate--------------------->");
} }
@Override @Override
public void onTerminate(Context context) { public void onTerminate(Context context) {
Log.v("AppAppLogic","onTerminate--------------------->"); Log.v("AppAppLogic", "onTerminate--------------------->");
} }
@Override @Override
public void onLowMemory(Context context) { public void onLowMemory(Context context) {
Log.v("AppAppLogic","onLowMemory--------------------->"); Log.v("AppAppLogic", "onLowMemory--------------------->");
} }
@Override @Override
public void onConfigurationChanged(Context context,Configuration newConfig) { public void onConfigurationChanged(Context context, Configuration newConfig) {
Log.v("AppAppLogic","onConfigurationChanged--------------------->"); Log.v("AppAppLogic", "onConfigurationChanged--------------------->");
} }
} }
...@@ -7,7 +7,6 @@ import com.hikcreate.data.config.ActivityLifeCycleInitConfig; ...@@ -7,7 +7,6 @@ import com.hikcreate.data.config.ActivityLifeCycleInitConfig;
import com.hikcreate.data.config.AppInitConfig; import com.hikcreate.data.config.AppInitConfig;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -22,14 +21,14 @@ public class CommonApplication extends Application { ...@@ -22,14 +21,14 @@ public class CommonApplication extends Application {
AppContext.getInstance().logicOnCreate(this); AppContext.getInstance().logicOnCreate(this);
} }
private void registerAppInit(){ private void registerAppInit() {
//登录组件 //登录组件
AppContext.getInstance().registerAppLogic(AppInitConfig.LOGIN_CONFIG); AppContext.getInstance().registerAppLogic(AppInitConfig.LOGIN_CONFIG);
//app壳组件 //app壳组件
AppContext.getInstance().registerAppLogic(AppInitConfig.APP_CONFIG); AppContext.getInstance().registerAppLogic(AppInitConfig.APP_CONFIG);
} }
private void registerActivityLife(){ private void registerActivityLife() {
//登录组件的acitivity生命周期监控 //登录组件的acitivity生命周期监控
AppContext.getInstance().registerActivityLifeLogic(ActivityLifeCycleInitConfig.LOGIN_CONFIG); AppContext.getInstance().registerActivityLifeLogic(ActivityLifeCycleInitConfig.LOGIN_CONFIG);
//app壳组件的acitivity生命周期监控 //app壳组件的acitivity生命周期监控
......
...@@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity; ...@@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity;
import android.widget.Toast; import android.widget.Toast;
import com.hikcreate.data.config.AppProvider; import com.hikcreate.data.config.AppProvider;
import com.hikcreate.library.util.LogCat;
import com.hikcreate.module_router.router.RouterResponse; import com.hikcreate.module_router.router.RouterResponse;
import com.hikcreate.module_router.tools.ModuleRouterUtil; import com.hikcreate.module_router.tools.ModuleRouterUtil;
import com.message.bean.GeneralMessageBean; import com.message.bean.GeneralMessageBean;
...@@ -36,44 +37,34 @@ public class testActivity extends AppCompatActivity { ...@@ -36,44 +37,34 @@ public class testActivity extends AppCompatActivity {
setContentView(R.layout.app_test); setContentView(R.layout.app_test);
findViewById(R.id.mBtnLogin).setOnClickListener(v -> { findViewById(R.id.mBtnLogin).setOnClickListener(v -> {
RouterResponse response = ModuleRouterUtil.getRouterResponse(getApplicationContext(), RouterResponse response = ModuleRouterUtil.getRouterResponse(getApplicationContext(),
AppProvider.LOGIN_PROVIDER,AppProvider.GET_USER_INFO_ACTION); AppProvider.LOGIN_PROVIDER, AppProvider.GET_USER_INFO_ACTION);
if (response != null) {
if(response != null){ if (response.getObject() != null) {
if(response.getObject() != null){
HashMap value = (HashMap) response.getObject(); HashMap value = (HashMap) response.getObject();
Toast.makeText(getApplicationContext(), (String) value.get("mobile"),Toast.LENGTH_LONG).show(); LogCat.d("userInfo", (String) value.get("mobile"));
Toast.makeText(getApplicationContext(),(String)value.get("name"),Toast.LENGTH_LONG).show(); LogCat.d("userInfo", (String) value.get("name"));
} }
Toast.makeText(getApplicationContext(),response.getData(),Toast.LENGTH_LONG).show(); LogCat.d("userInfo", response.getData());
} }
}); });
findViewById(R.id.mBtnPassport).setOnClickListener(v -> { findViewById(R.id.mBtnLoginSync).setOnClickListener(v -> {
new Thread(() -> { new Thread(() -> {
try { HashMap<String,String> value = new HashMap<>();
RouterResponse response = ModuleRouterUtil.getRouterResponse(getApplicationContext(), value.put("name","wangtao");
AppProvider.LOGIN_PROVIDER,AppProvider.GET_USER_INFO_ACTION); value.put("mobile","150000000000");
RouterResponse response = ModuleRouterUtil.getRouterResponse(getApplicationContext(),
final String result = response.get(); AppProvider.USER_INFO_CHANGE_PROVIDER, AppProvider.USER_INFO_CHANGE_ACTION,value);
new Handler().post(() -> { final String result = response.get();
try { runOnUiThread(() -> Toast.makeText(testActivity.this, result, Toast.LENGTH_SHORT).show());
Toast.makeText(testActivity.this, result, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
}
});
} catch (Exception e) {
e.printStackTrace();
}
}).start(); }).start();
}); });
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.test_passport,new TestFragment()); transaction.add(R.id.test_passport, new TestFragment());
transaction.commit(); transaction.commit();
} }
} }
...@@ -7,28 +7,29 @@ ...@@ -7,28 +7,29 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<Button <Button
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="获取用户信息" android:text="获取用户信息"
android:id="@+id/mBtnLogin" android:id="@+id/mBtnLogin" />
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取用户信息-异步"
android:id="@+id/mBtnLoginSync" />
<Button <Button
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="发送Message信息" android:text="发送Message信息"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:id="@+id/mBtnPassport" android:id="@+id/mBtnPassport" />
/>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:id="@+id/test_passport" android:id="@+id/test_passport"
android:layout_height="600dp"/> android:layout_height="600dp" />
</LinearLayout> </LinearLayout>
...@@ -5,7 +5,6 @@ import android.content.res.Configuration; ...@@ -5,7 +5,6 @@ import android.content.res.Configuration;
import android.util.Log; import android.util.Log;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -13,21 +12,21 @@ import android.util.Log; ...@@ -13,21 +12,21 @@ import android.util.Log;
public class AppAppLogic extends BaseAppLogic { public class AppAppLogic extends BaseAppLogic {
@Override @Override
public void onCreate(Context context) { public void onCreate(Context context) {
Log.v("AppAppLogic","onCreate--------------------->"); Log.v("AppAppLogic", "onCreate--------------------->");
} }
@Override @Override
public void onTerminate(Context context) { public void onTerminate(Context context) {
Log.v("AppAppLogic","onTerminate--------------------->"); Log.v("AppAppLogic", "onTerminate--------------------->");
} }
@Override @Override
public void onLowMemory(Context context) { public void onLowMemory(Context context) {
Log.v("AppAppLogic","onLowMemory--------------------->"); Log.v("AppAppLogic", "onLowMemory--------------------->");
} }
@Override @Override
public void onConfigurationChanged(Context context,Configuration newConfig) { public void onConfigurationChanged(Context context, Configuration newConfig) {
Log.v("AppAppLogic","onConfigurationChanged--------------------->"); Log.v("AppAppLogic", "onConfigurationChanged--------------------->");
} }
} }
...@@ -28,6 +28,7 @@ public class AppContext { ...@@ -28,6 +28,7 @@ public class AppContext {
private List<BaseActivityLifeLogic> logicActivityLifeClassList = new ArrayList<>(); private List<BaseActivityLifeLogic> logicActivityLifeClassList = new ArrayList<>();
private static AppContext mAppContext; private static AppContext mAppContext;
private AppContext() { private AppContext() {
} }
...@@ -38,63 +39,63 @@ public class AppContext { ...@@ -38,63 +39,63 @@ public class AppContext {
return mAppContext; return mAppContext;
} }
public void registerAppLogic(String logicClass){ public void registerAppLogic(String logicClass) {
logicList.add(logicClass); logicList.add(logicClass);
} }
public void registerActivityLifeLogic(String logicClass){ public void registerActivityLifeLogic(String logicClass) {
logicActivityLifeList.add(logicClass); logicActivityLifeList.add(logicClass);
} }
public void logicOnCreate(Application application){ public void logicOnCreate(Application application) {
for(String logicClass : logicList){ for (String logicClass : logicList) {
try { try {
Class appClass = Class.forName(logicClass); Class appClass = Class.forName(logicClass);
BaseAppLogic appLogic = (BaseAppLogic) appClass.newInstance(); BaseAppLogic appLogic = (BaseAppLogic) appClass.newInstance();
logicClassList.add(appLogic); logicClassList.add(appLogic);
appLogic.onCreate(application); appLogic.onCreate(application);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
for(String logicActivityClass : logicActivityLifeList){ for (String logicActivityClass : logicActivityLifeList) {
try { try {
Class appClass = Class.forName(logicActivityClass); Class appClass = Class.forName(logicActivityClass);
BaseActivityLifeLogic appLogic = (BaseActivityLifeLogic) appClass.newInstance(); BaseActivityLifeLogic appLogic = (BaseActivityLifeLogic) appClass.newInstance();
logicActivityLifeClassList.add(appLogic); logicActivityLifeClassList.add(appLogic);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
init(application); init(application);
} }
public void logicOnTerminate(Application application){ public void logicOnTerminate(Application application) {
for(BaseAppLogic logicClass : logicClassList){ for (BaseAppLogic logicClass : logicClassList) {
try { try {
logicClass.onTerminate(application); logicClass.onTerminate(application);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
public void logicOnLowMemory(Application application){ public void logicOnLowMemory(Application application) {
for(BaseAppLogic logicClass : logicClassList){ for (BaseAppLogic logicClass : logicClassList) {
try { try {
logicClass.onLowMemory(application); logicClass.onLowMemory(application);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
public void logicOnConfigurationChanged(Application application,Configuration newConfig){ public void logicOnConfigurationChanged(Application application, Configuration newConfig) {
for(BaseAppLogic logicClass : logicClassList){ for (BaseAppLogic logicClass : logicClassList) {
try { try {
logicClass.onConfigurationChanged(application,newConfig); logicClass.onConfigurationChanged(application, newConfig);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -106,14 +107,14 @@ public class AppContext { ...@@ -106,14 +107,14 @@ public class AppContext {
MultiDex.install(application); MultiDex.install(application);
} }
public void initActivityLifeCycle(Application application){ public void initActivityLifeCycle(Application application) {
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@Override @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) { public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityCreated(activity,savedInstanceState); logicClass.onActivityCreated(activity, savedInstanceState);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -121,10 +122,10 @@ public class AppContext { ...@@ -121,10 +122,10 @@ public class AppContext {
@Override @Override
public void onActivityStarted(Activity activity) { public void onActivityStarted(Activity activity) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityStarted(activity); logicClass.onActivityStarted(activity);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -132,10 +133,10 @@ public class AppContext { ...@@ -132,10 +133,10 @@ public class AppContext {
@Override @Override
public void onActivityResumed(Activity activity) { public void onActivityResumed(Activity activity) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityResumed(activity); logicClass.onActivityResumed(activity);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -143,10 +144,10 @@ public class AppContext { ...@@ -143,10 +144,10 @@ public class AppContext {
@Override @Override
public void onActivityPaused(Activity activity) { public void onActivityPaused(Activity activity) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityPaused(activity); logicClass.onActivityPaused(activity);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -154,10 +155,10 @@ public class AppContext { ...@@ -154,10 +155,10 @@ public class AppContext {
@Override @Override
public void onActivityStopped(Activity activity) { public void onActivityStopped(Activity activity) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityStopped(activity); logicClass.onActivityStopped(activity);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -165,10 +166,10 @@ public class AppContext { ...@@ -165,10 +166,10 @@ public class AppContext {
@Override @Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) { public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivitySaveInstanceState(activity,outState); logicClass.onActivitySaveInstanceState(activity, outState);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -176,10 +177,10 @@ public class AppContext { ...@@ -176,10 +177,10 @@ public class AppContext {
@Override @Override
public void onActivityDestroyed(Activity activity) { public void onActivityDestroyed(Activity activity) {
for(BaseActivityLifeLogic logicClass : logicActivityLifeClassList){ for (BaseActivityLifeLogic logicClass : logicActivityLifeClassList) {
try { try {
logicClass.onActivityDestroyed(activity); logicClass.onActivityDestroyed(activity);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
......
...@@ -11,10 +11,10 @@ public class AppProvider { ...@@ -11,10 +11,10 @@ public class AppProvider {
//登录模块 Provider //登录模块 Provider
public static final String LOGIN_PROVIDER = "login_provider"; public static final String LOGIN_PROVIDER = "login_provider";
public static final String PWD_PROVIDER = "pwd_provider"; public static final String USER_INFO_CHANGE_PROVIDER = "change_user_info_provider";
//登录模块Aciton //登录模块Aciton
public static final String GET_USER_INFO_ACTION = "user_action"; public static final String GET_USER_INFO_ACTION = "user_action";
public static final String PWD_ACTION = "pwd_action"; public static final String USER_INFO_CHANGE_ACTION = "change_user_info_action";
} }
...@@ -6,7 +6,7 @@ if (build_module == build_module_login) { ...@@ -6,7 +6,7 @@ if (build_module == build_module_login) {
android { android {
defaultConfig { defaultConfig {
if (build_module == build_module_login) { if (build_module == build_module_login) {
applicationId build_modele_app_id +"."+ project.getName() applicationId build_modele_app_id + "." + project.getName()
} }
minSdkVersion build_config.min_sdk minSdkVersion build_config.min_sdk
targetSdkVersion build_config.target_sdk targetSdkVersion build_config.target_sdk
......
...@@ -2,6 +2,7 @@ package com.hikcreate.login.moduel.router.action.change; ...@@ -2,6 +2,7 @@ package com.hikcreate.login.moduel.router.action.change;
import android.content.Context; import android.content.Context;
import com.hikcreate.library.util.LogCat;
import com.hikcreate.module_router.ModuleAction; import com.hikcreate.module_router.ModuleAction;
import com.hikcreate.module_router.ModuleActionResult; import com.hikcreate.module_router.ModuleActionResult;
...@@ -14,14 +15,26 @@ import java.util.HashMap; ...@@ -14,14 +15,26 @@ import java.util.HashMap;
* @date 2019/9/24 * @date 2019/9/24
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
*/ */
public class ChangePwd extends ModuleAction { public class ChangeUserInfo extends ModuleAction {
@Override @Override
public boolean isAsync(HashMap<String, String> requestData) { public boolean isAsync(HashMap<String, String> requestData) {
return false; return true;
} }
@Override @Override
public ModuleActionResult invoke(Context context, HashMap<String, String> requestData) { public ModuleActionResult invoke(Context context, HashMap<String, String> requestData) {
return null;
LogCat.d("userInfo", "new-->" + requestData.get("name"));
LogCat.d("userInfo", "new-->" + requestData.get("mobile"));
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("name", "newTest");
hashMap.put("mobile", "18888888888");
return new ModuleActionResult.Builder()
.code(ModuleActionResult.CODE_SUCCESS)
.msg("修改密码成功")
.data("18888888888-newTest")
.object(hashMap)
.build();
} }
} }
...@@ -23,9 +23,9 @@ public class GetUserInfoAction extends ModuleAction { ...@@ -23,9 +23,9 @@ public class GetUserInfoAction extends ModuleAction {
@Override @Override
public ModuleActionResult invoke(Context context, HashMap<String, String> requestData) { public ModuleActionResult invoke(Context context, HashMap<String, String> requestData) {
HashMap<String,String> hashMap = new HashMap<>(); HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("name","test"); hashMap.put("name", "test");
hashMap.put("mobile","15828028350"); hashMap.put("mobile", "15828028350");
return new ModuleActionResult.Builder() return new ModuleActionResult.Builder()
.code(ModuleActionResult.CODE_SUCCESS) .code(ModuleActionResult.CODE_SUCCESS)
.msg("登录成功") .msg("登录成功")
......
package com.hikcreate.login.moduel.router.provider; package com.hikcreate.login.moduel.router.provider;
import com.hikcreate.login.moduel.router.action.change.ChangePwd; import com.hikcreate.login.moduel.router.action.change.ChangeUserInfo;
import com.hikcreate.module_router.ModuleProvider; import com.hikcreate.module_router.ModuleProvider;
import static com.hikcreate.data.config.AppProvider.USER_INFO_CHANGE_ACTION;
import static com.hikcreate.data.config.AppProvider.PWD_ACTION;
/** /**
* 登录Provider * 登录Provider
...@@ -15,6 +14,6 @@ import static com.hikcreate.data.config.AppProvider.PWD_ACTION; ...@@ -15,6 +14,6 @@ import static com.hikcreate.data.config.AppProvider.PWD_ACTION;
public class ChangePwdProvider extends ModuleProvider { public class ChangePwdProvider extends ModuleProvider {
@Override @Override
protected void registerActions() { protected void registerActions() {
registerAction(PWD_ACTION,new ChangePwd()); registerAction(USER_INFO_CHANGE_ACTION, new ChangeUserInfo());
} }
} }
...@@ -2,6 +2,7 @@ package com.hikcreate.login.moduel.router.provider; ...@@ -2,6 +2,7 @@ package com.hikcreate.login.moduel.router.provider;
import com.hikcreate.login.moduel.router.action.login.GetUserInfoAction; import com.hikcreate.login.moduel.router.action.login.GetUserInfoAction;
import com.hikcreate.module_router.ModuleProvider; import com.hikcreate.module_router.ModuleProvider;
import static com.hikcreate.data.config.AppProvider.GET_USER_INFO_ACTION; import static com.hikcreate.data.config.AppProvider.GET_USER_INFO_ACTION;
...@@ -15,7 +16,7 @@ import static com.hikcreate.data.config.AppProvider.GET_USER_INFO_ACTION; ...@@ -15,7 +16,7 @@ import static com.hikcreate.data.config.AppProvider.GET_USER_INFO_ACTION;
public class LoginProvider extends ModuleProvider { public class LoginProvider extends ModuleProvider {
@Override @Override
protected void registerActions() { protected void registerActions() {
registerAction(GET_USER_INFO_ACTION,new GetUserInfoAction()); registerAction(GET_USER_INFO_ACTION, new GetUserInfoAction());
} }
} }
...@@ -30,7 +30,6 @@ public class testLoginActivity extends AppCompatActivity { ...@@ -30,7 +30,6 @@ public class testLoginActivity extends AppCompatActivity {
public void onClick(View v) { public void onClick(View v) {
} }
}); });
} }
......
...@@ -7,7 +7,6 @@ import com.hikcreate.data.config.ActivityLifeCycleInitConfig; ...@@ -7,7 +7,6 @@ import com.hikcreate.data.config.ActivityLifeCycleInitConfig;
import com.hikcreate.data.config.AppInitConfig; import com.hikcreate.data.config.AppInitConfig;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
......
...@@ -7,7 +7,6 @@ import android.widget.Toast; ...@@ -7,7 +7,6 @@ import android.widget.Toast;
import com.hikcreate.base.BaseActivityLifeLogic; import com.hikcreate.base.BaseActivityLifeLogic;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -15,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic; ...@@ -15,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic;
public class LoginActivityLifeCycle extends BaseActivityLifeLogic { public class LoginActivityLifeCycle extends BaseActivityLifeLogic {
@Override @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) { public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Toast.makeText(activity,"我来到了登录页面",Toast.LENGTH_LONG).show(); Toast.makeText(activity, "我来到了登录页面", Toast.LENGTH_LONG).show();
} }
@Override @Override
......
...@@ -22,30 +22,33 @@ import com.hikcreate.module_router.LocalRouter; ...@@ -22,30 +22,33 @@ import com.hikcreate.module_router.LocalRouter;
public class LoginAppLogic extends BaseAppLogic { public class LoginAppLogic extends BaseAppLogic {
@Override @Override
public void onCreate(Context application) { public void onCreate(Context application) {
Log.v("LoginAppLogic","onCreate--------------------->"); Log.v("LoginAppLogic", "onCreate--------------------->");
initProviderCreate(); initProviderCreate();
} }
@Override @Override
public void onTerminate(Context applicatio) { public void onTerminate(Context applicatio) {
Log.v("LoginAppLogic","onTerminate--------------------->"); Log.v("LoginAppLogic", "onTerminate--------------------->");
} }
@Override @Override
public void onLowMemory(Context applicatio) { public void onLowMemory(Context applicatio) {
Log.v("LoginAppLogic","onLowMemory--------------------->"); Log.v("LoginAppLogic", "onLowMemory--------------------->");
} }
@Override @Override
public void onConfigurationChanged(Context applicatio,Configuration newConfig) { public void onConfigurationChanged(Context applicatio, Configuration newConfig) {
Log.v("LoginAppLogic","onConfigurationChanged--------------------->"); Log.v("LoginAppLogic", "onConfigurationChanged--------------------->");
} }
private void initProviderCreate(){ private void initProviderCreate() {
LocalRouter.getInstance(AppContext. LocalRouter.getInstance(AppContext.
getInstance().getApplication()). getInstance().getApplication()).
registerProvider(AppProvider.LOGIN_PROVIDER, registerProvider(AppProvider.LOGIN_PROVIDER,
new LoginProvider()); new LoginProvider());
LocalRouter.getInstance(AppContext.
getInstance().getApplication()).
registerProvider(AppProvider.USER_INFO_CHANGE_PROVIDER,
new ChangePwdProvider());
} }
} }
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="我是登录" android:text="我是登录"
android:id="@+id/mBtnLogin" android:id="@+id/mBtnLogin" />
/>
</LinearLayout> </LinearLayout>
...@@ -7,7 +7,7 @@ if (build_module == build_module_passport) { ...@@ -7,7 +7,7 @@ if (build_module == build_module_passport) {
android { android {
defaultConfig { defaultConfig {
if (build_module == build_module_passport) { if (build_module == build_module_passport) {
applicationId build_modele_app_id +"."+ project.getName() applicationId build_modele_app_id + "." + project.getName()
} }
minSdkVersion build_config.min_sdk minSdkVersion build_config.min_sdk
targetSdkVersion build_config.target_sdk targetSdkVersion build_config.target_sdk
......
...@@ -7,7 +7,6 @@ import android.widget.Toast; ...@@ -7,7 +7,6 @@ import android.widget.Toast;
import com.hikcreate.base.BaseActivityLifeLogic; import com.hikcreate.base.BaseActivityLifeLogic;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -15,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic; ...@@ -15,7 +14,7 @@ import com.hikcreate.base.BaseActivityLifeLogic;
public class PassPortActivityLifeCycle extends BaseActivityLifeLogic { public class PassPortActivityLifeCycle extends BaseActivityLifeLogic {
@Override @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) { public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Toast.makeText(activity,"我来到了登录页面",Toast.LENGTH_LONG).show(); Toast.makeText(activity, "我来到了登录页面", Toast.LENGTH_LONG).show();
} }
@Override @Override
......
...@@ -16,21 +16,21 @@ import com.hikcreate.base.BaseAppLogic; ...@@ -16,21 +16,21 @@ import com.hikcreate.base.BaseAppLogic;
public class PassPortAppLogic extends BaseAppLogic { public class PassPortAppLogic extends BaseAppLogic {
@Override @Override
public void onCreate(Context context) { public void onCreate(Context context) {
Log.v("LoginAppLogic","onCreate--------------------->"); Log.v("LoginAppLogic", "onCreate--------------------->");
} }
@Override @Override
public void onTerminate(Context context) { public void onTerminate(Context context) {
Log.v("LoginAppLogic","onTerminate--------------------->"); Log.v("LoginAppLogic", "onTerminate--------------------->");
} }
@Override @Override
public void onLowMemory(Context context) { public void onLowMemory(Context context) {
Log.v("LoginAppLogic","onLowMemory--------------------->"); Log.v("LoginAppLogic", "onLowMemory--------------------->");
} }
@Override @Override
public void onConfigurationChanged(Context context,Configuration newConfig) { public void onConfigurationChanged(Context context, Configuration newConfig) {
Log.v("LoginAppLogic","onConfigurationChanged--------------------->"); Log.v("LoginAppLogic", "onConfigurationChanged--------------------->");
} }
} }
...@@ -29,16 +29,17 @@ public class TestFragment extends Fragment { ...@@ -29,16 +29,17 @@ public class TestFragment extends Fragment {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
MessageWrap.getMessageWrapDefault().register(this); MessageWrap.getMessageWrapDefault().register(this);
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//通过参数中的布局填充获取对应布局 //通过参数中的布局填充获取对应布局
return inflater.inflate(R.layout.passport_test_fragment,container,false); return inflater.inflate(R.layout.passport_test_fragment, container, false);
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void test(GeneralMessageBean bean){ public void test(GeneralMessageBean bean) {
Toast.makeText(getActivity(),MessageWrap.getMessageWrapDefault(). Toast.makeText(getActivity(), MessageWrap.getMessageWrapDefault().
getMessageInfo(bean,"tempValue"),Toast.LENGTH_LONG).show(); getMessageInfo(bean, "tempValue"), Toast.LENGTH_LONG).show();
} }
@Override @Override
......
...@@ -5,7 +5,6 @@ import android.app.Application; ...@@ -5,7 +5,6 @@ import android.app.Application;
import com.hikcreate.base.AppContext; import com.hikcreate.base.AppContext;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/23 * @date 2019/9/23
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.app.login"> package="com.app.login">
<application <application
android:roundIcon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false" android:allowBackup="false"
...@@ -12,6 +13,5 @@ ...@@ -12,6 +13,5 @@
tools:replace="android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"> tools:replace="android:icon,android:roundIcon,android:theme,android:label,android:allowBackup">
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -7,13 +7,11 @@ ...@@ -7,13 +7,11 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="我来自于哪里:" android:text="我来自于哪里:"
android:id="@+id/tv_from" android:id="@+id/tv_from" />
/>
<TextView <TextView
...@@ -21,16 +19,14 @@ ...@@ -21,16 +19,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="消息内容为" android:text="消息内容为"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:id="@+id/tv_message_info" android:id="@+id/tv_message_info" />
/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="name:" android:text="name:"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:id="@+id/tv_value" android:id="@+id/tv_value" />
/>
</LinearLayout> </LinearLayout>
...@@ -30,7 +30,6 @@ android { ...@@ -30,7 +30,6 @@ android {
} }
dexOptions { dexOptions {
preDexLibraries = false preDexLibraries = false
} }
...@@ -43,7 +42,7 @@ dependencies { ...@@ -43,7 +42,7 @@ dependencies {
api fileTree(dir: 'libs', include: ['*.jar']) api fileTree(dir: 'libs', include: ['*.jar'])
// App's support dependencies // App's support dependencies
api ([ api([
deps.appcompat, deps.appcompat,
deps.multidex, deps.multidex,
deps.cardview, deps.cardview,
...@@ -53,7 +52,7 @@ dependencies { ...@@ -53,7 +52,7 @@ dependencies {
deps.guava deps.guava
]) ])
// rx dependencies // rx dependencies
api ([ api([
deps.retrofit2, deps.retrofit2,
deps.retrofit2_converter_gson, deps.retrofit2_converter_gson,
deps.retrofit2_converter_scalars, deps.retrofit2_converter_scalars,
...@@ -71,6 +70,6 @@ dependencies { ...@@ -71,6 +70,6 @@ dependencies {
api deps.otto api deps.otto
api deps.gson api deps.gson
api deps.eventbus api deps.eventbus
api deps.aRouterApi,{ exclude group: 'com.android.support:appcompat-v7:25.2.0' } api deps.aRouterApi, { exclude group: 'com.android.support:appcompat-v7:25.2.0' }
annotationProcessor deps.aRouterCompiler annotationProcessor deps.aRouterCompiler
} }
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hikcreate.library"> package="com.hikcreate.library">
<application <application android:allowBackup="false"></application>
android:allowBackup="false">
</application>
</manifest> </manifest>
...@@ -10,6 +10,4 @@ package com.hikcreate.library.app; ...@@ -10,6 +10,4 @@ package com.hikcreate.library.app;
public class AppContext { public class AppContext {
} }
...@@ -3,8 +3,8 @@ package com.hikcreate.library.app; ...@@ -3,8 +3,8 @@ package com.hikcreate.library.app;
import android.app.Application; import android.app.Application;
/** /**
*
* app初始化基础类 * app初始化基础类
*
* @author wangtao * @author wangtao
* @date 2019/07/04 * @date 2019/07/04
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -18,6 +18,6 @@ public class HikApplicationCreate { ...@@ -18,6 +18,6 @@ public class HikApplicationCreate {
} }
public static void setApplication(Application mApplication) { public static void setApplication(Application mApplication) {
appContext = mApplication; appContext = mApplication;
} }
} }
...@@ -3,6 +3,7 @@ package com.hikcreate.library.app.config; ...@@ -3,6 +3,7 @@ package com.hikcreate.library.app.config;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import com.hikcreate.library.app.HikApplicationCreate; import com.hikcreate.library.app.HikApplicationCreate;
/** /**
......
...@@ -8,6 +8,7 @@ package com.hikcreate.library.app.ui.view.databindadapter; ...@@ -8,6 +8,7 @@ package com.hikcreate.library.app.ui.view.databindadapter;
public interface IRefreshViewModel { public interface IRefreshViewModel {
// 用于在ViewModel刷新数据 // 用于在ViewModel刷新数据
void refresh(); void refresh();
// 用于在ViewModel加载更多数据 // 用于在ViewModel加载更多数据
void loadMore(); void loadMore();
} }
...@@ -12,7 +12,7 @@ public class SwipeRefreshLayoutDataBinding { ...@@ -12,7 +12,7 @@ public class SwipeRefreshLayoutDataBinding {
*/ */
@BindingAdapter("android:onRefresh") @BindingAdapter("android:onRefresh")
public static void setSwipeRefreshLayoutOnRefreshListener(ScrollChildSwipeRefreshLayout view, public static void setSwipeRefreshLayoutOnRefreshListener(ScrollChildSwipeRefreshLayout view,
final IRefreshViewModel viewModel) { final IRefreshViewModel viewModel) {
view.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { view.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
......
...@@ -148,7 +148,7 @@ public class PatternLockSettingView extends android.support.constraint.Constrain ...@@ -148,7 +148,7 @@ public class PatternLockSettingView extends android.support.constraint.Constrain
if (!mFirstSetValue.equals(password)) { if (!mFirstSetValue.equals(password)) {
mTvTip.setTextColor(ContextCompat.getColor(getContext(), R.color.col_PatternLock_Sure_Error)); mTvTip.setTextColor(ContextCompat.getColor(getContext(), R.color.col_PatternLock_Sure_Error));
mTvTip.setText(R.string.lib_pattern_input_pattern_lock_no_same); mTvTip.setText(R.string.lib_pattern_input_pattern_lock_no_same);
String passwordTemp = PatternLockUtils.patternToStringLast(mPatternLockViewSettingValue, progressPattern); String passwordTemp = PatternLockUtils.patternToStringLast(mPatternLockViewSettingValue, progressPattern);
String result = passwordTemp.replace(",", ""); String result = passwordTemp.replace(",", "");
if (mPatternLockViewSetListener != null) { if (mPatternLockViewSetListener != null) {
mPatternLockViewSetListener.onDifference(result); mPatternLockViewSetListener.onDifference(result);
......
...@@ -41,7 +41,7 @@ public class PatternLockUtils { ...@@ -41,7 +41,7 @@ public class PatternLockUtils {
* 转换成String 适应业务需求每位加1 * 转换成String 适应业务需求每位加1
*/ */
public static String patternToStringLast(PatternLockView patternLockView, public static String patternToStringLast(PatternLockView patternLockView,
List<PatternLockView.Dot> pattern) { List<PatternLockView.Dot> pattern) {
if (pattern == null) { if (pattern == null) {
return ""; return "";
} }
......
...@@ -159,11 +159,11 @@ public class PatternLockView extends View { ...@@ -159,11 +159,11 @@ public class PatternLockView extends View {
} }
@SuppressLint("HandlerLeak") @SuppressLint("HandlerLeak")
private Handler handler = new Handler() { private Handler handler = new Handler() {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
super.handleMessage(msg); super.handleMessage(msg);
if(msg.what == RESET){ if (msg.what == RESET) {
resetPattern(); resetPattern();
} }
} }
...@@ -1042,9 +1042,11 @@ public class PatternLockView extends View { ...@@ -1042,9 +1042,11 @@ public class PatternLockView extends View {
public void onStarted() { public void onStarted() {
handler.removeMessages(RESET); handler.removeMessages(RESET);
} }
@Override @Override
public void onProgress(List<Dot> progressPattern) { public void onProgress(List<Dot> progressPattern) {
} }
@Override @Override
public void onComplete(List<Dot> progressPattern) { public void onComplete(List<Dot> progressPattern) {
if (progressPattern.size() <= 0) { if (progressPattern.size() <= 0) {
...@@ -1063,7 +1065,7 @@ public class PatternLockView extends View { ...@@ -1063,7 +1065,7 @@ public class PatternLockView extends View {
mPatternViewMode = PatternViewMode.CORRECT; mPatternViewMode = PatternViewMode.CORRECT;
} else { } else {
mPatternViewMode = PatternViewMode.WRONG; mPatternViewMode = PatternViewMode.WRONG;
handler.sendEmptyMessageDelayed(RESET,2000); handler.sendEmptyMessageDelayed(RESET, 2000);
} }
......
...@@ -65,14 +65,14 @@ public interface IPhotoView { ...@@ -65,14 +65,14 @@ public interface IPhotoView {
* Use {@link #getMinimumScale()} instead, this will be removed in future release * Use {@link #getMinimumScale()} instead, this will be removed in future release
* *
* @return The current minimum scale level. What this value represents depends on the current * @return The current minimum scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
@Deprecated @Deprecated
float getMinScale(); float getMinScale();
/** /**
* @return The current minimum scale level. What this value represents depends on the current * @return The current minimum scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
float getMinimumScale(); float getMinimumScale();
...@@ -80,14 +80,14 @@ public interface IPhotoView { ...@@ -80,14 +80,14 @@ public interface IPhotoView {
* Use {@link #getMediumScale()} instead, this will be removed in future release * Use {@link #getMediumScale()} instead, this will be removed in future release
* *
* @return The current middle scale level. What this value represents depends on the current * @return The current middle scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
@Deprecated @Deprecated
float getMidScale(); float getMidScale();
/** /**
* @return The current medium scale level. What this value represents depends on the current * @return The current medium scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
float getMediumScale(); float getMediumScale();
...@@ -95,14 +95,14 @@ public interface IPhotoView { ...@@ -95,14 +95,14 @@ public interface IPhotoView {
* Use {@link #getMaximumScale()} instead, this will be removed in future release * Use {@link #getMaximumScale()} instead, this will be removed in future release
* *
* @return The current maximum scale level. What this value represents depends on the current * @return The current maximum scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
@Deprecated @Deprecated
float getMaxScale(); float getMaxScale();
/** /**
* @return The current maximum scale level. What this value represents depends on the current * @return The current maximum scale level. What this value represents depends on the current
* {@link ImageView.ScaleType}. * {@link ImageView.ScaleType}.
*/ */
float getMaximumScale(); float getMaximumScale();
...@@ -258,7 +258,7 @@ public interface IPhotoView { ...@@ -258,7 +258,7 @@ public interface IPhotoView {
/** /**
* Changes the current scale to the specified value. * Changes the current scale to the specified value.
* *
* @param scale - Value to scale to * @param scale - Value to scale to
* @param animate - Whether to animate the scale * @param animate - Whether to animate the scale
*/ */
void setScale(float scale, boolean animate); void setScale(float scale, boolean animate);
...@@ -266,9 +266,9 @@ public interface IPhotoView { ...@@ -266,9 +266,9 @@ public interface IPhotoView {
/** /**
* Changes the current scale to the specified value, around the given focal point. * Changes the current scale to the specified value, around the given focal point.
* *
* @param scale - Value to scale to * @param scale - Value to scale to
* @param focalX - X Focus Point * @param focalX - X Focus Point
* @param focalY - Y Focus Point * @param focalY - Y Focus Point
* @param animate - Whether to animate the scale * @param animate - Whether to animate the scale
*/ */
void setScale(float scale, float focalX, float focalY, boolean animate); void setScale(float scale, float focalX, float focalY, boolean animate);
......
...@@ -2,6 +2,7 @@ package com.hikcreate.library.app.ui.view.recycleview; ...@@ -2,6 +2,7 @@ package com.hikcreate.library.app.ui.view.recycleview;
import android.content.Context; import android.content.Context;
import android.databinding.ViewDataBinding; import android.databinding.ViewDataBinding;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
......
...@@ -64,9 +64,7 @@ public class RoundedDrawable extends Drawable { ...@@ -64,9 +64,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param bitmap * @param bitmap
*
* @return * @return
*/ */
public static RoundedDrawable fromBitmap(Bitmap bitmap) { public static RoundedDrawable fromBitmap(Bitmap bitmap) {
...@@ -80,9 +78,7 @@ public class RoundedDrawable extends Drawable { ...@@ -80,9 +78,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param drawable * @param drawable
*
* @return * @return
*/ */
public static Drawable fromDrawable(Drawable drawable) { public static Drawable fromDrawable(Drawable drawable) {
...@@ -121,9 +117,7 @@ public class RoundedDrawable extends Drawable { ...@@ -121,9 +117,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param drawable * @param drawable
*
* @return * @return
*/ */
public static Bitmap drawableToBitmap(Drawable drawable) { public static Bitmap drawableToBitmap(Drawable drawable) {
...@@ -153,7 +147,6 @@ public class RoundedDrawable extends Drawable { ...@@ -153,7 +147,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
@Override @Override
...@@ -176,7 +169,6 @@ public class RoundedDrawable extends Drawable { ...@@ -176,7 +169,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
*
*/ */
private void updateShaderMatrix() { private void updateShaderMatrix() {
float scale; float scale;
...@@ -284,7 +276,6 @@ public class RoundedDrawable extends Drawable { ...@@ -284,7 +276,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param canvas * @param canvas
*/ */
@Override @Override
...@@ -310,7 +301,6 @@ public class RoundedDrawable extends Drawable { ...@@ -310,7 +301,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
@Override @Override
...@@ -321,7 +311,6 @@ public class RoundedDrawable extends Drawable { ...@@ -321,7 +311,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param alpha * @param alpha
*/ */
@Override @Override
...@@ -333,7 +322,6 @@ public class RoundedDrawable extends Drawable { ...@@ -333,7 +322,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param cf * @param cf
*/ */
@Override @Override
...@@ -345,7 +333,6 @@ public class RoundedDrawable extends Drawable { ...@@ -345,7 +333,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param dither * @param dither
*/ */
@Override @Override
...@@ -357,7 +344,6 @@ public class RoundedDrawable extends Drawable { ...@@ -357,7 +344,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param filter * @param filter
*/ */
@Override @Override
...@@ -369,7 +355,6 @@ public class RoundedDrawable extends Drawable { ...@@ -369,7 +355,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
@Override @Override
...@@ -380,7 +365,6 @@ public class RoundedDrawable extends Drawable { ...@@ -380,7 +365,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
@Override @Override
...@@ -391,7 +375,6 @@ public class RoundedDrawable extends Drawable { ...@@ -391,7 +375,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public float getCornerRadius() { public float getCornerRadius() {
...@@ -401,9 +384,7 @@ public class RoundedDrawable extends Drawable { ...@@ -401,9 +384,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param radius * @param radius
*
* @return * @return
*/ */
public RoundedDrawable setCornerRadius(float radius) { public RoundedDrawable setCornerRadius(float radius) {
...@@ -415,7 +396,6 @@ public class RoundedDrawable extends Drawable { ...@@ -415,7 +396,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public float getBorderWidth() { public float getBorderWidth() {
...@@ -425,9 +405,7 @@ public class RoundedDrawable extends Drawable { ...@@ -425,9 +405,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param width * @param width
*
* @return * @return
*/ */
public RoundedDrawable setBorderWidth(float width) { public RoundedDrawable setBorderWidth(float width) {
...@@ -440,7 +418,6 @@ public class RoundedDrawable extends Drawable { ...@@ -440,7 +418,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public int getBorderColor() { public int getBorderColor() {
...@@ -450,9 +427,7 @@ public class RoundedDrawable extends Drawable { ...@@ -450,9 +427,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param color * @param color
*
* @return * @return
*/ */
public RoundedDrawable setBorderColor(int color) { public RoundedDrawable setBorderColor(int color) {
...@@ -462,7 +437,6 @@ public class RoundedDrawable extends Drawable { ...@@ -462,7 +437,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public ColorStateList getBorderColors() { public ColorStateList getBorderColors() {
...@@ -472,9 +446,7 @@ public class RoundedDrawable extends Drawable { ...@@ -472,9 +446,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param colors * @param colors
*
* @return * @return
*/ */
public RoundedDrawable setBorderColor(ColorStateList colors) { public RoundedDrawable setBorderColor(ColorStateList colors) {
...@@ -487,7 +459,6 @@ public class RoundedDrawable extends Drawable { ...@@ -487,7 +459,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public boolean isOval() { public boolean isOval() {
...@@ -497,9 +468,7 @@ public class RoundedDrawable extends Drawable { ...@@ -497,9 +468,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param oval * @param oval
*
* @return * @return
*/ */
public RoundedDrawable setOval(boolean oval) { public RoundedDrawable setOval(boolean oval) {
...@@ -511,7 +480,6 @@ public class RoundedDrawable extends Drawable { ...@@ -511,7 +480,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public ScaleType getScaleType() { public ScaleType getScaleType() {
...@@ -521,9 +489,7 @@ public class RoundedDrawable extends Drawable { ...@@ -521,9 +489,7 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @param scaleType * @param scaleType
*
* @return * @return
*/ */
public RoundedDrawable setScaleType(ScaleType scaleType) { public RoundedDrawable setScaleType(ScaleType scaleType) {
...@@ -542,7 +508,6 @@ public class RoundedDrawable extends Drawable { ...@@ -542,7 +508,6 @@ public class RoundedDrawable extends Drawable {
/** /**
* Method description * Method description
* *
*
* @return * @return
*/ */
public Bitmap toBitmap() { public Bitmap toBitmap() {
......
...@@ -128,7 +128,7 @@ public class ImageEnlargeScrollView extends StretchScrollView { ...@@ -128,7 +128,7 @@ public class ImageEnlargeScrollView extends StretchScrollView {
//modify by gongwei 2019.1.22:此Scroll集成了回弹效果 //modify by gongwei 2019.1.22:此Scroll集成了回弹效果
//return true; // 返回true表示已经完成触摸事件,不再处理 //return true; // 返回true表示已经完成触摸事件,不再处理
return false; return false;
//end //end
} }
return false; return false;
} }
......
...@@ -6,6 +6,8 @@ package com.hikcreate.library.app.ui.view.scroll.detectedscroll; ...@@ -6,6 +6,8 @@ package com.hikcreate.library.app.ui.view.scroll.detectedscroll;
*/ */
public interface DetectedViewCallBack { public interface DetectedViewCallBack {
void onScrollFadeIn(int top); void onScrollFadeIn(int top);
void onScrollFadeOut(int top); void onScrollFadeOut(int top);
void fadeIn50Percent(boolean fadeIn50Percent); void fadeIn50Percent(boolean fadeIn50Percent);
} }
...@@ -146,7 +146,7 @@ public class AImage { ...@@ -146,7 +146,7 @@ public class AImage {
* *
* @param imageView * @param imageView
* @param imageUrl * @param imageUrl
* @param defaultWidth 图片显示的宽度 * @param defaultWidth 图片显示的宽度
* @param defaultHeight 图片显示的高度 * @param defaultHeight 图片显示的高度
*/ */
public static void loadKeepOriginalSize(ImageView imageView, String imageUrl, int defaultWidth, int defaultHeight) { public static void loadKeepOriginalSize(ImageView imageView, String imageUrl, int defaultWidth, int defaultHeight) {
......
...@@ -12,11 +12,11 @@ import com.hikcreate.library.plugin.netbase.exception.ApiException; ...@@ -12,11 +12,11 @@ import com.hikcreate.library.plugin.netbase.exception.ApiException;
public class RequestObserverCallbackAdapter<T> extends RequestObserverCallback<T> { public class RequestObserverCallbackAdapter<T> extends RequestObserverCallback<T> {
public RequestObserverCallbackAdapter(){ public RequestObserverCallbackAdapter() {
super(); super();
} }
public RequestObserverCallbackAdapter(int tag){ public RequestObserverCallbackAdapter(int tag) {
super(tag); super(tag);
} }
......
...@@ -24,7 +24,7 @@ public class ServiceGenerator { ...@@ -24,7 +24,7 @@ public class ServiceGenerator {
.addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(RetrofitManager.getInstance().generatorFactory()) .addConverterFactory(RetrofitManager.getInstance().generatorFactory())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); .addCallAdapterFactory(RxJava2CallAdapterFactory.create());
//.addCallAdapterFactory(LiveDataCallAdapterFactory.create()); //.addCallAdapterFactory(LiveDataCallAdapterFactory.create());
if (RetrofitManager.getInstance().getInterceptorList() != null && RetrofitManager.getInstance().getInterceptorList().size() > 0) { if (RetrofitManager.getInstance().getInterceptorList() != null && RetrofitManager.getInstance().getInterceptorList().size() > 0) {
for (Interceptor interceptor : RetrofitManager.getInstance().getInterceptorList()) { for (Interceptor interceptor : RetrofitManager.getInstance().getInterceptorList()) {
......
...@@ -38,7 +38,7 @@ public class SslUtils { ...@@ -38,7 +38,7 @@ public class SslUtils {
Certificate ca; Certificate ca;
try { try {
ca = cf.generateCertificate(caInput); ca = cf.generateCertificate(caInput);
LogCat.d(TAG, "ca=" + ((X509Certificate) ca).getSubjectDN()); LogCat.d(TAG, "ca=" + ((X509Certificate) ca).getSubjectDN());
} finally { } finally {
caInput.close(); caInput.close();
} }
......
...@@ -7,7 +7,7 @@ package com.hikcreate.library.plugin.netbase.entity; ...@@ -7,7 +7,7 @@ package com.hikcreate.library.plugin.netbase.entity;
* @data 2019/3/11 * @data 2019/3/11
* @email leiyongsheng@hikcreate.com * @email leiyongsheng@hikcreate.com
*/ */
public class ListContentResultWithExtra<T,D> extends ListContentResult<T> { public class ListContentResultWithExtra<T, D> extends ListContentResult<T> {
private D extra; private D extra;
public D getExtra() { public D getExtra() {
...@@ -21,7 +21,7 @@ public class ListContentResultWithExtra<T,D> extends ListContentResult<T> { ...@@ -21,7 +21,7 @@ public class ListContentResultWithExtra<T,D> extends ListContentResult<T> {
@Override @Override
public String toString() { public String toString() {
return "ListContentResultWithExtra{" + return "ListContentResultWithExtra{" +
"data="+super.toString()+ "data=" + super.toString() +
"extra=" + extra + "extra=" + extra +
'}'; '}';
} }
......
...@@ -10,7 +10,7 @@ import android.widget.TabHost; ...@@ -10,7 +10,7 @@ import android.widget.TabHost;
* @data 2019/3/8 * @data 2019/3/8
* @email leiyongsheng@hikcreate.com * @email leiyongsheng@hikcreate.com
*/ */
public class ApiException extends RuntimeException { public class ApiException extends RuntimeException {
private int code; private int code;
private String displayMessage; private String displayMessage;
......
...@@ -41,11 +41,11 @@ public class LiveDataCallAdapter<R> implements CallAdapter<R, Object> { ...@@ -41,11 +41,11 @@ public class LiveDataCallAdapter<R> implements CallAdapter<R, Object> {
protected void onActive() { protected void onActive() {
super.onActive(); super.onActive();
if (started.compareAndSet(false, true)) { if (started.compareAndSet(false, true)) {
LogCat.d("hik_SS","live data enqueue ----"); LogCat.d("hik_SS", "live data enqueue ----");
call.enqueue(new Callback<R>() { call.enqueue(new Callback<R>() {
@Override @Override
public void onResponse(Call<R> call, Response<R> response) { public void onResponse(Call<R> call, Response<R> response) {
LogCat.d("hik_SS","live data enqueue response ----"); LogCat.d("hik_SS", "live data enqueue response ----");
postValue(response.body()); postValue(response.body());
} }
......
...@@ -2,6 +2,7 @@ package com.hikcreate.library.plugin.otto; ...@@ -2,6 +2,7 @@ package com.hikcreate.library.plugin.otto;
/** /**
* 事件通知基类 * 事件通知基类
*
* @author 2015/9/23. * @author 2015/9/23.
*/ */
public abstract class Event { public abstract class Event {
......
...@@ -6,7 +6,7 @@ import java.text.DecimalFormat; ...@@ -6,7 +6,7 @@ import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
/** /**
* double类型计算工具类 * double类型计算工具类
* *
* @author xiongweimin * @author xiongweimin
* @time 2019/04/09 * @time 2019/04/09
...@@ -18,8 +18,7 @@ public class BigDecimalUtils { ...@@ -18,8 +18,7 @@ public class BigDecimalUtils {
* 格式化精度 * 格式化精度
* *
* @param v * @param v
* @param point * @param point 小数位数
* 小数位数
* @return double * @return double
*/ */
public static Double format(double v, int point) { public static Double format(double v, int point) {
...@@ -28,7 +27,6 @@ public class BigDecimalUtils { ...@@ -28,7 +27,6 @@ public class BigDecimalUtils {
} }
/** /**
*
* @param v * @param v
* @param point * @param point
* @return * @return
...@@ -57,6 +55,7 @@ public class BigDecimalUtils { ...@@ -57,6 +55,7 @@ public class BigDecimalUtils {
/** /**
* 带小数的显示小数。不带小数的显示整数 * 带小数的显示小数。不带小数的显示整数
*
* @param d * @param d
* @return * @return
*/ */
......
...@@ -21,8 +21,8 @@ public class ClassTypeEntity { ...@@ -21,8 +21,8 @@ public class ClassTypeEntity {
this.classType = classType; this.classType = classType;
} }
public void addClassTyep(Type type){ public void addClassTyep(Type type) {
if(classType == null){ if (classType == null) {
classType = new ArrayList<>(); classType = new ArrayList<>();
} }
classType.add(type); classType.add(type);
......
...@@ -26,13 +26,14 @@ public class DESUtil { ...@@ -26,13 +26,14 @@ public class DESUtil {
private static final String CHAR_SET = "UTF-8"; private static final String CHAR_SET = "UTF-8";
static{ static {
System.loadLibrary("getkey-lib"); System.loadLibrary("getkey-lib");
} }
/** /**
* 获取so动态库中的KEY * 获取so动态库中的KEY
*
* @param context * @param context
* @return * @return
*/ */
......
...@@ -35,8 +35,7 @@ public class DecimalDigitsInputFilter implements InputFilter { ...@@ -35,8 +35,7 @@ public class DecimalDigitsInputFilter implements InputFilter {
if (dotPos >= 0) { if (dotPos >= 0) {
// protects against many dots // protects against many dots
if (source.equals(".") || source.equals(",")) if (source.equals(".") || source.equals(",")) {
{
return ""; return "";
} }
// if the text is entered before the dot // if the text is entered before the dot
......
...@@ -10,8 +10,9 @@ import java.util.List; ...@@ -10,8 +10,9 @@ import java.util.List;
* @email leiyongsheng@hikcreate.com * @email leiyongsheng@hikcreate.com
*/ */
public class GenericsUtils { public class GenericsUtils {
private static final String TAG = "GenericsUtils"; private static final String TAG = "GenericsUtils";
/** /**
* 通过反射,获得定义Class时声明的父类的范型参数的类型. * 通过反射,获得定义Class时声明的父类的范型参数的类型.
* 如public BookManager extends GenricManager<Book> * 如public BookManager extends GenricManager<Book>
......
...@@ -64,7 +64,8 @@ public class IDCardValidateUtil { ...@@ -64,7 +64,8 @@ public class IDCardValidateUtil {
/** /**
* 检查身份证号码正确性 * 检查身份证号码正确性
*/ */
@Deprecated //Del by Gv. 2019.9.11. 因为夏令时误差,会导致checkBirthday()在校验生日时异常返回false,废弃此方法。如:1988-04-10,1989-04-16,1990-04-15,1991-04-14 @Deprecated
//Del by Gv. 2019.9.11. 因为夏令时误差,会导致checkBirthday()在校验生日时异常返回false,废弃此方法。如:1988-04-10,1989-04-16,1990-04-15,1991-04-14
public static boolean isCardNo(String card) { public static boolean isCardNo(String card) {
if (TextUtils.isEmpty(card)) return false; if (TextUtils.isEmpty(card)) return false;
card = card.replace("x", "X"); card = card.replace("x", "X");
......
...@@ -17,10 +17,10 @@ public class SVGUtils { ...@@ -17,10 +17,10 @@ public class SVGUtils {
public static void tintSVGDrawable(SVGImageItem item) { public static void tintSVGDrawable(SVGImageItem item) {
if (item != null && item.isLegal()) { if (item != null && item.isLegal()) {
//利用ContextCompat工具类获取drawable图片资源 //利用ContextCompat工具类获取drawable图片资源
Drawable drawable = ContextCompat.getDrawable(item.mImageView.getContext(),item.getImgResId()); Drawable drawable = ContextCompat.getDrawable(item.mImageView.getContext(), item.getImgResId());
//简单的使用tint改变drawable颜色 //简单的使用tint改变drawable颜色
Drawable wrap = DrawableCompat.wrap(drawable).mutate(); Drawable wrap = DrawableCompat.wrap(drawable).mutate();
DrawableCompat.setTint(wrap, ContextCompat.getColor(item.mImageView.getContext(), item.getColorId())); DrawableCompat.setTint(wrap, ContextCompat.getColor(item.mImageView.getContext(), item.getColorId()));
item.mImageView.setImageDrawable(wrap); item.mImageView.setImageDrawable(wrap);
} }
} }
......
...@@ -6,7 +6,7 @@ import java.net.HttpURLConnection; ...@@ -6,7 +6,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
/** /**
* 抓WebView的源码 * 抓WebView的源码
* *
* @author gongwei * @author gongwei
* @date 2019/3/6 * @date 2019/3/6
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<com.hikcreate.library.app.ui.view.patternlock.PatternLockView <com.hikcreate.library.app.ui.view.patternlock.PatternLockView
...@@ -27,8 +25,7 @@ ...@@ -27,8 +25,7 @@
app:correctLineStateColor="#00ffffff" app:correctLineStateColor="#00ffffff"
app:wrongLineStateColor="#00ffffff" app:wrongLineStateColor="#00ffffff"
app:wrongDotStateColor="#E95E52" app:wrongDotStateColor="#E95E52"
app:wrongDotStrokeStateColor="#E95E52" app:wrongDotStrokeStateColor="#E95E52" />
/>
<TextView <TextView
...@@ -42,7 +39,7 @@ ...@@ -42,7 +39,7 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pattern_lock_view_tip" app:layout_constraintTop_toBottomOf="@+id/pattern_lock_view_tip"
tools:text="请绘制您的手势密码" tools:text="请绘制您的手势密码"
android:id="@+id/pattern_lock_state_tv_view"/> android:id="@+id/pattern_lock_state_tv_view" />
<com.hikcreate.library.app.ui.view.patternlock.PatternLockView <com.hikcreate.library.app.ui.view.patternlock.PatternLockView
...@@ -52,8 +49,7 @@ ...@@ -52,8 +49,7 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="66dp" android:layout_marginTop="66dp"
android:layout_width="300dp" android:layout_width="300dp"
android:layout_height="300dp" android:layout_height="300dp" />
/>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg> <svg xmlns="http://www.w3.org/2000/svg"
\ No newline at end of file width="24"
height="24"
viewBox="0 0 24 24">
<path
d="M0 0h24v24H0z"
fill="none" />
<path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z" />
</svg>
\ No newline at end of file
...@@ -12,30 +12,30 @@ ...@@ -12,30 +12,30 @@
<declare-styleable name="PatternLockView"> <declare-styleable name="PatternLockView">
<!--点行 列数量--> <!--点行 列数量-->
<attr name="dotCount" format="integer"/> <attr name="dotCount" format="integer" />
<!--点默认大小--> <!--点默认大小-->
<attr name="dotNormalSize" format="dimension"/> <attr name="dotNormalSize" format="dimension" />
<!--点被选中时大小--> <!--点被选中时大小-->
<attr name="dotSelectedSize" format="dimension"/> <attr name="dotSelectedSize" format="dimension" />
<!--连接线的宽度--> <!--连接线的宽度-->
<attr name="pathWidth" format="dimension"/> <attr name="pathWidth" format="dimension" />
<!--点默认颜色--> <!--点默认颜色-->
<attr name="normalDotStateColor" format="color"/> <attr name="normalDotStateColor" format="color" />
<attr name="selectStateColor" format="color"/> <attr name="selectStateColor" format="color" />
<!--正确点的颜色--> <!--正确点的颜色-->
<attr name="correctDotStateColor" format="color"/> <attr name="correctDotStateColor" format="color" />
<!--正确点外环的颜色--> <!--正确点外环的颜色-->
<attr name="correctDotStrokeStateColor" format="color"/> <attr name="correctDotStrokeStateColor" format="color" />
<!--正确线的颜色--> <!--正确线的颜色-->
<attr name="correctLineStateColor" format="color"/> <attr name="correctLineStateColor" format="color" />
<!--错误线的颜色--> <!--错误线的颜色-->
<attr name="wrongLineStateColor" format="color"/> <attr name="wrongLineStateColor" format="color" />
<!--错误点颜色--> <!--错误点颜色-->
<attr name="wrongDotStateColor" format="color"/> <attr name="wrongDotStateColor" format="color" />
<!--错误点外环颜色--> <!--错误点外环颜色-->
<attr name="wrongDotStrokeStateColor" format="color"/> <attr name="wrongDotStrokeStateColor" format="color" />
<!--点动画执行时间--> <!--点动画执行时间-->
<attr name="dotAnimationDuration" format="integer"/> <attr name="dotAnimationDuration" format="integer" />
<attr name="checkMode" format="boolean"/> <attr name="checkMode" format="boolean" />
</declare-styleable> </declare-styleable>
</resources> </resources>
\ No newline at end of file
...@@ -13,6 +13,7 @@ public class GeneralMessageBean { ...@@ -13,6 +13,7 @@ public class GeneralMessageBean {
private String dataClassName;//用于通过反射获取类的字符串 private String dataClassName;//用于通过反射获取类的字符串
private String messageJsonData;//message的json数据 private String messageJsonData;//message的json数据
private String extraJsonData;//额外的消息的json数据 private String extraJsonData;//额外的消息的json数据
public String getDataAction() { public String getDataAction() {
return dataAction; return dataAction;
} }
......
package com.message.driver; package com.message.driver;
import android.util.Log; import android.util.Log;
import com.message.bean.GeneralMessageBean; import com.message.bean.GeneralMessageBean;
import com.message.util.ObjectUtil; import com.message.util.ObjectUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import info.hook.com.lib_data_drive.BuildConfig; import info.hook.com.lib_data_drive.BuildConfig;
/** /**
...@@ -14,8 +17,8 @@ import info.hook.com.lib_data_drive.BuildConfig; ...@@ -14,8 +17,8 @@ import info.hook.com.lib_data_drive.BuildConfig;
public final class MessageWrap { public final class MessageWrap {
private static volatile MessageWrap defaultInstance; private static volatile MessageWrap defaultInstance;
private EventBus messageEventBus; private EventBus messageEventBus;
private int messageCount; //消息数量 private int messageCount; //消息数量
private static final String MESSAGE_TAG = "HIK-MessageWrap"; private static final String MESSAGE_TAG = "HIK-MessageWrap";
public static MessageWrap getMessageWrapDefault() { public static MessageWrap getMessageWrapDefault() {
......
...@@ -29,7 +29,7 @@ public class ObjectUtil { ...@@ -29,7 +29,7 @@ public class ObjectUtil {
return messageBeanObject; return messageBeanObject;
} }
private static Object invokeMethod(Object object,String methodName){ private static Object invokeMethod(Object object, String methodName) {
try { try {
Method method = object.getClass().getMethod(methodName); Method method = object.getClass().getMethod(methodName);
return method.invoke(object); return method.invoke(object);
...@@ -39,8 +39,8 @@ public class ObjectUtil { ...@@ -39,8 +39,8 @@ public class ObjectUtil {
return null; return null;
} }
private static Object getInfoByMethod(String className, String dataContent,String methodName){ private static Object getInfoByMethod(String className, String dataContent, String methodName) {
return invokeMethod(getObjectBean(className,dataContent),methodName); return invokeMethod(getObjectBean(className, dataContent), methodName);
} }
...@@ -55,41 +55,42 @@ public class ObjectUtil { ...@@ -55,41 +55,42 @@ public class ObjectUtil {
return null; return null;
} }
public static <T> T createInstance(Class<T> checkType,String className){ public static <T> T createInstance(Class<T> checkType, String className) {
try { try {
Class<T> clz = (Class<T>)Class.forName(className); Class<T> clz = (Class<T>) Class.forName(className);
Object obj = clz.newInstance(); Object obj = clz.newInstance();
if (!checkType.isInstance(obj)) { if (!checkType.isInstance(obj)) {
throw new Exception("类型不匹配"); throw new Exception("类型不匹配");
} }
return (T)obj; return (T) obj;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
public static void readAttributeValue(Object obj){
String nameValues =""; public static void readAttributeValue(Object obj) {
String nameValues = "";
Class cls = obj.getClass(); Class cls = obj.getClass();
Field[] fields = cls.getDeclaredFields(); Field[] fields = cls.getDeclaredFields();
for (int i=0;i<fields.length;i++){ for (int i = 0; i < fields.length; i++) {
try { try {
Field field = fields[i]; Field field = fields[i];
field.setAccessible(true); field.setAccessible(true);
Object value = field.get(obj); Object value = field.get(obj);
nameValues += field.getName()+":"+value+","; nameValues += field.getName() + ":" + value + ",";
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
int lastIndex = nameValues.lastIndexOf(","); int lastIndex = nameValues.lastIndexOf(",");
String result= nameValues.substring(0,lastIndex); String result = nameValues.substring(0, lastIndex);
System.out.println(result); System.out.println(result);
} }
public static String readAttributeValueByName(Object obj,String name){ public static String readAttributeValueByName(Object obj, String name) {
Class cls = obj.getClass(); Class cls = obj.getClass();
Field[] fields = cls.getDeclaredFields(); Field[] fields = cls.getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
...@@ -102,15 +103,15 @@ public class ObjectUtil { ...@@ -102,15 +103,15 @@ public class ObjectUtil {
e.printStackTrace(); e.printStackTrace();
} }
} }
return null; return null;
} }
public static String readAttributeValueByMethod(GeneralMessageBean mGeneralMessageBean, String name){ public static String readAttributeValueByMethod(GeneralMessageBean mGeneralMessageBean, String name) {
Object message = getObjectBean(mGeneralMessageBean.getDataClassName(),mGeneralMessageBean.getMessageJsonData()); Object message = getObjectBean(mGeneralMessageBean.getDataClassName(), mGeneralMessageBean.getMessageJsonData());
return (String) invokeMethod(message,name); return (String) invokeMethod(message, name);
} }
public static String readAttributeValueByName(GeneralMessageBean mGeneralMessageBean, String name) { public static String readAttributeValueByName(GeneralMessageBean mGeneralMessageBean, String name) {
try { try {
Class messageClass = Class.forName(mGeneralMessageBean.getDataClassName()); Class messageClass = Class.forName(mGeneralMessageBean.getDataClassName());
Gson gson = new Gson(); Gson gson = new Gson();
...@@ -119,6 +120,6 @@ public class ObjectUtil { ...@@ -119,6 +120,6 @@ public class ObjectUtil {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
} }
...@@ -15,11 +15,17 @@ import android.os.Bundle; ...@@ -15,11 +15,17 @@ import android.os.Bundle;
public abstract class BaseActivityLifeLogic { public abstract class BaseActivityLifeLogic {
abstract public void onActivityCreated(Activity activity, Bundle savedInstanceState); abstract public void onActivityCreated(Activity activity, Bundle savedInstanceState);
abstract public void onActivityStarted(Activity activity); abstract public void onActivityStarted(Activity activity);
abstract public void onActivityResumed(Activity activity); abstract public void onActivityResumed(Activity activity);
abstract public void onActivityPaused(Activity activity); abstract public void onActivityPaused(Activity activity);
abstract public void onActivityStopped(Activity activity); abstract public void onActivityStopped(Activity activity);
abstract public void onActivityDestroyed(Activity activity); abstract public void onActivityDestroyed(Activity activity);
abstract public void onActivitySaveInstanceState(Activity activity, Bundle savedInstanceState); abstract public void onActivitySaveInstanceState(Activity activity, Bundle savedInstanceState);
......
...@@ -14,10 +14,14 @@ import android.content.res.Configuration; ...@@ -14,10 +14,14 @@ import android.content.res.Configuration;
public abstract class BaseAppLogic { public abstract class BaseAppLogic {
private Application mApplication; private Application mApplication;
abstract public void onCreate(Context context); abstract public void onCreate(Context context);
abstract public void onTerminate(Context context); abstract public void onTerminate(Context context);
abstract public void onLowMemory(Context context); abstract public void onLowMemory(Context context);
abstract public void onConfigurationChanged(Context context,Configuration newConfig);
abstract public void onConfigurationChanged(Context context, Configuration newConfig);
} }
...@@ -14,20 +14,21 @@ public class ErrorAction extends ModuleAction { ...@@ -14,20 +14,21 @@ public class ErrorAction extends ModuleAction {
private int mCode; private int mCode;
private String mMessage; private String mMessage;
private boolean mAsync; private boolean mAsync;
public ErrorAction() { public ErrorAction() {
mCode = ModuleActionResult.CODE_ERROR; mCode = ModuleActionResult.CODE_ERROR;
mMessage = DEFAULT_MESSAGE; mMessage = DEFAULT_MESSAGE;
mAsync = false; mAsync = false;
} }
public ErrorAction(boolean isAsync,int code, String message) { public ErrorAction(boolean isAsync, int code, String message) {
this.mCode = code; this.mCode = code;
this.mMessage = message; this.mMessage = message;
this.mAsync = isAsync; this.mAsync = isAsync;
} }
@Override @Override
public boolean isAsync( HashMap<String, String> requestData) { public boolean isAsync(HashMap<String, String> requestData) {
return mAsync; return mAsync;
} }
......
...@@ -3,10 +3,12 @@ package com.hikcreate.module_router; ...@@ -3,10 +3,12 @@ package com.hikcreate.module_router;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.hikcreate.module_router.router.RouterRequest; import com.hikcreate.module_router.router.RouterRequest;
import com.hikcreate.module_router.router.RouterResponse; import com.hikcreate.module_router.router.RouterResponse;
import com.hikcreate.module_router.tools.Logger; import com.hikcreate.module_router.tools.Logger;
import com.hikcreate.module_router.tools.ProcessUtil; import com.hikcreate.module_router.tools.ProcessUtil;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
...@@ -61,7 +63,7 @@ public class LocalRouter { ...@@ -61,7 +63,7 @@ public class LocalRouter {
} }
} }
public RouterResponse route(@NonNull RouterRequest routerRequest){ public RouterResponse route(@NonNull RouterRequest routerRequest) {
Logger.d(TAG, "Process:" + mProcessName + "\nLocal route start: " + System.currentTimeMillis()); Logger.d(TAG, "Process:" + mProcessName + "\nLocal route start: " + System.currentTimeMillis());
RouterResponse routerResponse = new RouterResponse(); RouterResponse routerResponse = new RouterResponse();
...@@ -134,7 +136,7 @@ public class LocalRouter { ...@@ -134,7 +136,7 @@ public class LocalRouter {
: mAction.invoke(mContext, mRequestData, mObject); : mAction.invoke(mContext, mRequestData, mObject);
mResponse.mObject = result.getObject(); mResponse.mObject = result.getObject();
return result.toString(); return result.toString();
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -5,19 +5,21 @@ import android.content.Context; ...@@ -5,19 +5,21 @@ import android.content.Context;
import java.util.HashMap; import java.util.HashMap;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
*/ */
public abstract class ModuleAction { public abstract class ModuleAction {
public abstract boolean isAsync(HashMap<String,String> requestData); public abstract boolean isAsync(HashMap<String, String> requestData);
public abstract ModuleActionResult invoke(Context context, HashMap<String,String> requestData);
public boolean isAsync(HashMap<String,String> requestData,Object object){ public abstract ModuleActionResult invoke(Context context, HashMap<String, String> requestData);
public boolean isAsync(HashMap<String, String> requestData, Object object) {
return false; return false;
} }
public ModuleActionResult invoke(Context context, HashMap<String,String> requestData, Object object){
public ModuleActionResult invoke(Context context, HashMap<String, String> requestData, Object object) {
return new ModuleActionResult.Builder().code(ModuleActionResult.CODE_NOT_IMPLEMENT). return new ModuleActionResult.Builder().code(ModuleActionResult.CODE_NOT_IMPLEMENT).
msg("This method has not yet been implemented.").build(); msg("This method has not yet been implemented.").build();
} }
......
...@@ -7,7 +7,6 @@ import org.json.JSONObject; ...@@ -7,7 +7,6 @@ import org.json.JSONObject;
import java.util.HashMap; import java.util.HashMap;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -35,7 +34,6 @@ public class ModuleActionResult { ...@@ -35,7 +34,6 @@ public class ModuleActionResult {
this.msg = builder.mMsg; this.msg = builder.mMsg;
this.data = builder.mData; this.data = builder.mData;
this.object = builder.mObject; this.object = builder.mObject;
} }
public Object getObject() { public Object getObject() {
...@@ -72,12 +70,14 @@ public class ModuleActionResult { ...@@ -72,12 +70,14 @@ public class ModuleActionResult {
private String mMsg; private String mMsg;
private Object mObject; private Object mObject;
private String mData; private String mData;
public Builder() { public Builder() {
mCode = CODE_ERROR; mCode = CODE_ERROR;
mMsg = ""; mMsg = "";
mObject = null; mObject = null;
mData = null; mData = null;
} }
public Builder resultString(String resultString) { public Builder resultString(String resultString) {
try { try {
JSONObject jsonObject = new JSONObject(resultString); JSONObject jsonObject = new JSONObject(resultString);
......
...@@ -3,7 +3,6 @@ package com.hikcreate.module_router; ...@@ -3,7 +3,6 @@ package com.hikcreate.module_router;
import java.util.HashMap; import java.util.HashMap;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -11,19 +10,21 @@ import java.util.HashMap; ...@@ -11,19 +10,21 @@ import java.util.HashMap;
public abstract class ModuleProvider { public abstract class ModuleProvider {
private boolean mValid = true; private boolean mValid = true;
private HashMap<String, ModuleAction> mActions; private HashMap<String, ModuleAction> mActions;
public ModuleProvider(){
public ModuleProvider() {
mActions = new HashMap<>(); mActions = new HashMap<>();
registerActions(); registerActions();
} }
protected void registerAction(String actionName, ModuleAction action){
mActions.put(actionName,action); protected void registerAction(String actionName, ModuleAction action) {
mActions.put(actionName, action);
} }
public ModuleAction findAction(String actionName){ public ModuleAction findAction(String actionName) {
return mActions.get(actionName); return mActions.get(actionName);
} }
public boolean isValid(){ public boolean isValid() {
return mValid; return mValid;
} }
......
...@@ -8,6 +8,7 @@ import com.hikcreate.module_router.tools.ProcessUtil; ...@@ -8,6 +8,7 @@ import com.hikcreate.module_router.tools.ProcessUtil;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.HashMap; import java.util.HashMap;
...@@ -17,7 +18,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -17,7 +18,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -220,8 +220,8 @@ public class RouterRequest { ...@@ -220,8 +220,8 @@ public class RouterRequest {
return this; return this;
} }
public RouterRequest data(HashMap<String,String> value) { public RouterRequest data(HashMap<String, String> value) {
if(value == null){ if (value == null) {
return this; return this;
} }
for (Map.Entry<String, String> entry : value.entrySet()) { for (Map.Entry<String, String> entry : value.entrySet()) {
...@@ -230,7 +230,6 @@ public class RouterRequest { ...@@ -230,7 +230,6 @@ public class RouterRequest {
return this; return this;
} }
public RouterRequest data(String key, String data) { public RouterRequest data(String key, String data) {
this.data.put(key, data); this.data.put(key, data);
return this; return this;
...@@ -273,7 +272,7 @@ public class RouterRequest { ...@@ -273,7 +272,7 @@ public class RouterRequest {
} }
@Deprecated @Deprecated
public class Builder { public class Builder {
private String mFrom; private String mFrom;
private String mDomain; private String mDomain;
private String mProvider; private String mProvider;
......
...@@ -8,7 +8,6 @@ import java.util.concurrent.Future; ...@@ -8,7 +8,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -16,21 +15,19 @@ import java.util.concurrent.TimeUnit; ...@@ -16,21 +15,19 @@ import java.util.concurrent.TimeUnit;
public class RouterResponse { public class RouterResponse {
/** /**
* This field is MaActionResult.toString() * This field is MaActionResult.toString()
*/ */
public String mResultString; public String mResultString;
public boolean mIsAsync = true; public boolean mIsAsync = true;
public Future<String> mAsyncResponse; public Future<String> mAsyncResponse;
public Object mObject; public Object mObject;
private static final int TIME_OUT = 30 * 1000; private static final int TIME_OUT = 30 * 1000;
private long mTimeOut; private long mTimeOut;
private boolean mHasGet = false; private boolean mHasGet = false;
int mCode = -1; private int mCode = -1;
String mMessage = ""; private String mMessage = "";
String mData; private String mData;
HashMap<String,String> keyValues; HashMap<String, String> keyValues;
public RouterResponse() { public RouterResponse() {
this(TIME_OUT); this(TIME_OUT);
...@@ -47,22 +44,21 @@ public class RouterResponse { ...@@ -47,22 +44,21 @@ public class RouterResponse {
return mIsAsync; return mIsAsync;
} }
public String get(){ public String get() {
try{ try {
if (mIsAsync) { if (mIsAsync) {
mResultString = mAsyncResponse.get(mTimeOut, TimeUnit.MILLISECONDS); mResultString = mAsyncResponse.get(mTimeOut, TimeUnit.MILLISECONDS);
parseResult(); parseResult();
}else{ } else {
parseResult(); parseResult();
} }
} catch (Exception e) {
}catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
return mResultString; return mResultString;
} }
private void parseResult(){ private void parseResult() {
if (!mHasGet) { if (!mHasGet) {
try { try {
JSONObject jsonObject = new JSONObject(mResultString); JSONObject jsonObject = new JSONObject(mResultString);
...@@ -76,14 +72,14 @@ public class RouterResponse { ...@@ -76,14 +72,14 @@ public class RouterResponse {
} }
} }
public int getCode(){ public int getCode() {
if (!mHasGet) { if (!mHasGet) {
get(); get();
} }
return mCode; return mCode;
} }
public String getMessage(){ public String getMessage() {
if (!mHasGet) { if (!mHasGet) {
get(); get();
} }
...@@ -97,13 +93,10 @@ public class RouterResponse { ...@@ -97,13 +93,10 @@ public class RouterResponse {
return mData; return mData;
} }
public Object getObject(){ public Object getObject() {
if (!mHasGet) { if (!mHasGet) {
get(); get();
} }
return mObject; return mObject;
} }
} }
...@@ -3,7 +3,6 @@ package com.hikcreate.module_router.tools; ...@@ -3,7 +3,6 @@ package com.hikcreate.module_router.tools;
import android.util.Log; import android.util.Log;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -14,10 +13,8 @@ public class Logger { ...@@ -14,10 +13,8 @@ public class Logger {
public final static int INFO = 3; public final static int INFO = 3;
public final static int DEBUG = 4; public final static int DEBUG = 4;
public final static int VERBOSE = 5; public final static int VERBOSE = 5;
public static int LOG_LEVEL = ERROR; public static int LOG_LEVEL = ERROR;
public static void e(String tag, String msg) { public static void e(String tag, String msg) {
if (LOG_LEVEL >= ERROR) if (LOG_LEVEL >= ERROR)
Log.e(tag, msg); Log.e(tag, msg);
......
...@@ -15,18 +15,13 @@ import java.util.HashMap; ...@@ -15,18 +15,13 @@ import java.util.HashMap;
**/ **/
public class ModuleRouterUtil { public class ModuleRouterUtil {
public static RouterResponse getRouterResponse(Context context,String provider,String action){ public static RouterResponse getRouterResponse(Context context, String provider, String action) {
return LocalRouter.getInstance(context).route(RouterRequest.obtain(context).provider(provider).action(action)); return LocalRouter.getInstance(context).route(RouterRequest.obtain(context).provider(provider).action(action));
} }
public static RouterResponse getRouterResponse(Context context, String provider, String action, public static RouterResponse getRouterResponse(Context context, String provider, String action,
HashMap<String,String> value){ HashMap<String, String> value) {
return LocalRouter.getInstance(context).route(RouterRequest.obtain(context).provider(provider).data(value).action(action)); return LocalRouter.getInstance(context).route(RouterRequest.obtain(context).provider(provider).data(value).action(action));
} }
public static RouterResponse startRouter(Context context,RouterRequest request){
return LocalRouter.getInstance(context).route(request);
}
} }
...@@ -10,7 +10,6 @@ import java.io.FileReader; ...@@ -10,7 +10,6 @@ import java.io.FileReader;
import java.util.List; import java.util.List;
/** /**
*
* @author wangtao55 * @author wangtao55
* @date 2019/9/19 * @date 2019/9/19
* @mail wangtao55@hikcreate.com * @mail wangtao55@hikcreate.com
...@@ -44,7 +43,7 @@ public class ProcessUtil { ...@@ -44,7 +43,7 @@ public class ProcessUtil {
public static String getProcessName(Context context, int pid) { public static String getProcessName(Context context, int pid) {
String processName = getProcessName(pid); String processName = getProcessName(pid);
if(UNKNOWN_PROCESS_NAME.equals(processName)){ if (UNKNOWN_PROCESS_NAME.equals(processName)) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> runningApps = am.getRunningAppProcesses(); List<ActivityManager.RunningAppProcessInfo> runningApps = am.getRunningAppProcesses();
if (runningApps == null) { if (runningApps == null) {
...@@ -55,7 +54,7 @@ public class ProcessUtil { ...@@ -55,7 +54,7 @@ public class ProcessUtil {
return procInfo.processName; return procInfo.processName;
} }
} }
}else{ } else {
return processName; return processName;
} }
return UNKNOWN_PROCESS_NAME; return UNKNOWN_PROCESS_NAME;
......
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