Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
component
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王涛55
component
Commits
df65cfe9
Commit
df65cfe9
authored
Sep 30, 2019
by
王涛55
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:module_bus
parent
a359cf8d
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
27 additions
and
167 deletions
+27
-167
ModuleProject/.idea/gradle.xml
+0
-2
ModuleProject/business/app_passport/src/main/java/com/hikcreate/passport/TestFragment.java
+3
-5
ModuleProject/business_base/app_base/build.gradle
+0
-1
ModuleProject/business_base/app_module_manager/build.gradle
+2
-0
ModuleProject/business_base/app_module_manager/src/main/java/com/hikcreate/module_bus/bean/GeneralMessageBean.java
+9
-24
ModuleProject/business_base/app_module_manager/src/main/java/com/hikcreate/module_bus/driver/MessageWrap.java
+11
-7
ModuleProject/business_base/app_module_manager/src/main/java/com/hikcreate/module_bus/util/ObjectUtil.java
+2
-19
ModuleProject/function/lib_data_drive/.gitignore
+0
-1
ModuleProject/function/lib_data_drive/build.gradle
+0
-35
ModuleProject/function/lib_data_drive/proguard-rules.pro
+0
-21
ModuleProject/function/lib_data_drive/src/androidTest/java/info/hook/com/lib_data_drive/ExampleInstrumentedTest.java
+0
-27
ModuleProject/function/lib_data_drive/src/main/AndroidManifest.xml
+0
-2
ModuleProject/function/lib_data_drive/src/main/res/values/strings.xml
+0
-3
ModuleProject/function/lib_data_drive/src/test/java/info/hook/com/lib_data_drive/ExampleUnitTest.java
+0
-18
ModuleProject/settings.gradle
+0
-2
No files found.
ModuleProject/.idea/gradle.xml
View file @
df65cfe9
...
...
@@ -22,8 +22,6 @@
<option
value=
"$PROJECT_DIR$/function"
/>
<option
value=
"$PROJECT_DIR$/function/lib_app_common"
/>
<option
value=
"$PROJECT_DIR$/function/lib_common_ui"
/>
<option
value=
"$PROJECT_DIR$/function/lib_data_drive"
/>
<option
value=
"$PROJECT_DIR$/function/lib_router_module"
/>
<option
value=
"$PROJECT_DIR$/function_base"
/>
<option
value=
"$PROJECT_DIR$/function_base/lib_network"
/>
</set>
...
...
ModuleProject/business/app_passport/src/main/java/com/hikcreate/passport/TestFragment.java
View file @
df65cfe9
...
...
@@ -6,10 +6,9 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.Toast
;
import
com.app.passport.R
;
import
com.
message
.bean.GeneralMessageBean
;
import
com.
message
.driver.MessageWrap
;
import
com.
hikcreate.module_bus
.bean.GeneralMessageBean
;
import
com.
hikcreate.module_bus
.driver.MessageWrap
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.greenrobot.eventbus.ThreadMode
;
...
...
@@ -38,8 +37,7 @@ public class TestFragment extends Fragment {
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
test
(
GeneralMessageBean
bean
)
{
Toast
.
makeText
(
getActivity
(),
MessageWrap
.
getMessageWrapDefault
().
getMessageInfo
(
bean
,
"tempValue"
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
(),
bean
.
getDataAction
(),
Toast
.
LENGTH_LONG
).
show
();
}
@Override
...
...
ModuleProject/business_base/app_base/build.gradle
View file @
df65cfe9
...
...
@@ -36,7 +36,6 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
api
project
(
':function:lib_app_common'
)
api
project
(
':function:lib_common_ui'
)
api
project
(
':function:lib_data_drive'
)
api
project
(
':function_base:lib_network'
)
api
project
(
':business_base:app_module_manager'
)
}
ModuleProject/business_base/app_module_manager/build.gradle
View file @
df65cfe9
...
...
@@ -35,4 +35,6 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
deps
.
multidex
implementation
deps
.
rxandroid2
implementation
deps
.
eventbus
implementation
deps
.
gson
}
ModuleProject/
function/lib_data_drive/src/main/java/com/message
/bean/GeneralMessageBean.java
→
ModuleProject/
business_base/app_module_manager/src/main/java/com/hikcreate/module_bus
/bean/GeneralMessageBean.java
View file @
df65cfe9
package
com
.
message
.
bean
;
package
com
.
hikcreate
.
module_bus
.
bean
;
import
java.util.HashMap
;
/**
* 事件驱动消息流类
...
...
@@ -10,9 +12,8 @@ package com.message.bean;
public
class
GeneralMessageBean
{
private
String
dataAction
;
//消息来自于哪个事件
private
String
moduleName
;
//消息moduleName
private
String
dataClassName
;
//用于通过反射获取类的字符串
private
String
messageJsonData
;
//message的json数据
private
String
extraJsonData
;
//额外的消息的json数据
private
HashMap
<
String
,
String
>
dataValue
;
public
String
getDataAction
()
{
return
dataAction
;
...
...
@@ -30,27 +31,11 @@ public class GeneralMessageBean {
this
.
moduleName
=
moduleName
;
}
public
String
getDataClassName
()
{
return
dataClassName
;
}
public
void
setDataClassName
(
String
dataClassName
)
{
this
.
dataClassName
=
dataClassName
;
}
public
String
getMessageJsonData
()
{
return
messageJsonData
;
}
public
void
setMessageJsonData
(
String
messageJsonData
)
{
this
.
messageJsonData
=
messageJsonData
;
}
public
String
getExtraJsonData
()
{
return
extraJsonData
;
public
HashMap
<
String
,
String
>
getDataValue
()
{
return
dataValue
;
}
public
void
set
ExtraJsonData
(
String
extraJsonData
)
{
this
.
extraJsonData
=
extraJsonData
;
public
void
set
DataValue
(
HashMap
<
String
,
String
>
dataValue
)
{
this
.
dataValue
=
dataValue
;
}
}
ModuleProject/
function/lib_data_drive/src/main/java/com/message
/driver/MessageWrap.java
→
ModuleProject/
business_base/app_module_manager/src/main/java/com/hikcreate/module_bus
/driver/MessageWrap.java
View file @
df65cfe9
package
com
.
message
.
driver
;
package
com
.
hikcreate
.
module_bus
.
driver
;
import
android.util.Log
;
import
com.
message
.bean.GeneralMessageBean
;
import
com.
message
.util.ObjectUtil
;
import
com.
hikcreate.module_bus
.bean.GeneralMessageBean
;
import
com.
hikcreate.module_bus
.util.ObjectUtil
;
import
org.greenrobot.eventbus.EventBus
;
import
info.hook.com.lib_data_drive.BuildConfig
;
import
java.util.Map
;
import
info.hook.com.lib_module_common.BuildConfig
;
/**
* author : taowang
...
...
@@ -34,7 +36,6 @@ public final class MessageWrap {
private
MessageWrap
()
{
messageEventBus
=
new
EventBus
();
}
public
void
register
(
Object
subscriber
)
{
...
...
@@ -72,8 +73,11 @@ public final class MessageWrap {
//打印消息信息
Log
.
v
(
MESSAGE_TAG
,
"moduleName-----"
+
mGeneralMessageBean
.
getModuleName
());
Log
.
v
(
MESSAGE_TAG
,
"dataAction-----"
+
mGeneralMessageBean
.
getDataAction
());
Log
.
v
(
MESSAGE_TAG
,
"dataClassName-----"
+
mGeneralMessageBean
.
getDataClassName
());
Log
.
v
(
MESSAGE_TAG
,
"messageJsonData-----"
+
mGeneralMessageBean
.
getMessageJsonData
());
if
(
mGeneralMessageBean
.
getDataValue
()
!=
null
){
for
(
Map
.
Entry
<
String
,
String
>
entry
:
mGeneralMessageBean
.
getDataValue
().
entrySet
())
{
Log
.
v
(
MESSAGE_TAG
,
"dataAction-----"
+
"key= "
+
entry
.
getKey
()
+
" and value= "
+
entry
.
getValue
());
}
}
}
}
...
...
ModuleProject/
function/lib_data_drive/src/main/java/com/message
/util/ObjectUtil.java
→
ModuleProject/
business_base/app_module_manager/src/main/java/com/hikcreate/module_bus
/util/ObjectUtil.java
View file @
df65cfe9
package
com
.
message
.
util
;
package
com
.
hikcreate
.
module_bus
.
util
;
import
com.message.bean.GeneralMessageBean
;
import
com.google.gson.Gson
;
import
com.hikcreate.module_bus.bean.GeneralMessageBean
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
...
...
@@ -105,21 +105,4 @@ public class ObjectUtil {
}
return
null
;
}
public
static
String
readAttributeValueByMethod
(
GeneralMessageBean
mGeneralMessageBean
,
String
name
)
{
Object
message
=
getObjectBean
(
mGeneralMessageBean
.
getDataClassName
(),
mGeneralMessageBean
.
getMessageJsonData
());
return
(
String
)
invokeMethod
(
message
,
name
);
}
public
static
String
readAttributeValueByName
(
GeneralMessageBean
mGeneralMessageBean
,
String
name
)
{
try
{
Class
messageClass
=
Class
.
forName
(
mGeneralMessageBean
.
getDataClassName
());
Gson
gson
=
new
Gson
();
Object
jsonObject
=
gson
.
fromJson
(
mGeneralMessageBean
.
getExtraJsonData
(),
messageClass
);
return
readAttributeValueByName
(
jsonObject
,
name
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
ModuleProject/function/lib_data_drive/.gitignore
deleted
100644 → 0
View file @
a359cf8d
/build
ModuleProject/function/lib_data_drive/build.gradle
deleted
100644 → 0
View file @
a359cf8d
apply
plugin:
'com.android.library'
android
{
compileSdkVersion
build_config
.
compile_sdk
defaultConfig
{
minSdkVersion
build_config
.
min_sdk
targetSdkVersion
build_config
.
target_sdk
resourcePrefix
build_modele_baidu_resourcePrefix
versionCode
build_config
.
version_code
versionName
build_config
.
version_name
}
buildTypes
{
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
}
compileOptions
{
encoding
=
'utf-8'
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
dexOptions
{
preDexLibraries
=
false
}
}
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
deps
.
eventbus
implementation
deps
.
gson
}
ModuleProject/function/lib_data_drive/proguard-rules.pro
deleted
100644 → 0
View file @
a359cf8d
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
ModuleProject/function/lib_data_drive/src/androidTest/java/info/hook/com/lib_data_drive/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
a359cf8d
package
info
.
hook
.
com
.
lib_data_drive
;
import
android.content.Context
;
import
androidx.test.InstrumentationRegistry
;
import
androidx.test.runner.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"info.hook.com.lib_data_drive.test"
,
appContext
.
getPackageName
());
}
}
ModuleProject/function/lib_data_drive/src/main/AndroidManifest.xml
deleted
100644 → 0
View file @
a359cf8d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"info.hook.com.lib_data_drive"
/>
ModuleProject/function/lib_data_drive/src/main/res/values/strings.xml
deleted
100644 → 0
View file @
a359cf8d
<resources>
<string
name=
"app_name"
>
lib_data_drive
</string>
</resources>
ModuleProject/function/lib_data_drive/src/test/java/info/hook/com/lib_data_drive/ExampleUnitTest.java
deleted
100644 → 0
View file @
a359cf8d
package
info
.
hook
.
com
.
lib_data_drive
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
ModuleProject/settings.gradle
View file @
df65cfe9
include
':app'
,
':function:lib_common_ui'
,
':function:lib_data_drive'
,
':function:lib_router_module'
,
':function_base:lib_network'
,
':function:lib_app_common'
,
'business:app_passport'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment