Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
0bbc12e5
Commit
0bbc12e5
authored
Jul 01, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试业务组件和app单独运行
parent
b1cf49ea
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
415 additions
and
266 deletions
+415
-266
build.gradle
CommonLib/Common/build.gradle
+9
-8
YdBaseApplication.kt
...mmon/src/main/java/com/yidian/common/YdBaseApplication.kt
+167
-3
BaseMvvmActivity.kt
.../src/main/java/com/yidian/common/mvvm/BaseMvvmActivity.kt
+1
-3
BindingAdapter.kt
...ain/java/com/yidian/common/mvvm/binding/BindingAdapter.kt
+37
-37
JVerificationUtils.kt
...c/main/java/com/yidian/common/utils/JVerificationUtils.kt
+0
-15
colors.xml
CommonLib/Common/src/main/res/values/colors.xml
+4
-0
styles.xml
CommonLib/Common/src/main/res/values/styles.xml
+15
-0
build.gradle
Components/commodity/build.gradle
+3
-6
AndroidManifest.xml
Components/commodity/src/main/manifest/AndroidManifest.xml
+14
-2
AndroidManifest.xml
Components/newscontent/src/main/manifest/AndroidManifest.xml
+160
-0
styles.xml
Components/newscontent/src/main/res/values/styles.xml
+0
-6
build.gradle
Components/userinfo/build.gradle
+2
-2
build.gradle
app/build.gradle
+3
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-2
YdSubwayApplication.kt
...ain/java/com/shenghuoquan/business/YdSubwayApplication.kt
+0
-165
styles.xml
app/src/main/res/values/styles.xml
+0
-7
config.gradle
config/config.gradle
+0
-3
No files found.
CommonLib/Common/build.gradle
View file @
0bbc12e5
...
...
@@ -21,12 +21,10 @@ android {
buildConfigField
(
"String"
,
"SERVICE_VERSION"
,
rootProject
.
ext
.
android
.
serviceVersion
)
buildConfigField
(
"boolean"
,
"IS_ENCRYPT"
,
rootProject
.
ext
.
android
.
isEncrypt
)
buildConfigField
(
"boolean"
,
"IS_UMENG_RELEASE"
,
rootProject
.
ext
.
android
.
isUmengRelease
)
javaCompileOptions
{
annotationProcessorOptions
{
arguments
=
[
setAttributeClassName:
'YdSubwaySetAttributeMethodProvider'
,
bindingDataClassName
:
'YdSubwayBindingDataMethodProvider'
]
}
}
buildConfigField
(
"boolean"
,
"IS_ENCRYPT_DEBUG_KEY"
,
rootProject
.
ext
.
android
.
isEncryptDebugKey
)
manifestPlaceholders
=
[
qqappid:
"101923771"
]
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles
"consumer-rules.pro"
...
...
@@ -34,7 +32,9 @@ android {
buildTypes
{
debug
{
// applicationIdSuffix ".debug"
buildConfigField
"boolean"
,
"ENV_DEBUG"
,
"true"
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
debug
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".debug.fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"商家版测试"
,
...
...
@@ -43,6 +43,7 @@ android {
}
release
{
buildConfigField
"boolean"
,
"ENV_DEBUG"
,
"false"
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
release
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"生活圈商家版"
,
...
...
@@ -76,7 +77,7 @@ dependencies {
compile
fileTree
(
include:
'*.jar'
,
dir:
'libs'
)
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// kotlin实现MVVM框架之使用DataBinding之unresolved reference: BR解决办法
kapt
"com.android.databinding:compiler:4.0.1"
kapt
"com.android.databinding:compiler:4.0.1"
implementation
rootProject
.
ext
.
dependencies
.
publicImplementation
testImplementation
rootProject
.
ext
.
dependencies
.
testImplementation
androidTestImplementation
rootProject
.
ext
.
dependencies
.
androidTestImplementation
...
...
@@ -87,7 +88,7 @@ dependencies {
//https://github.com/CymChad/BaseRecyclerViewAdapterHelper
api
"com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4"
implementation
(
'com.yidian.android:CommonComponent:0.0.88'
)
{
implementation
(
'com.yidian.android:CommonComponent:0.0.88'
)
{
exclude
(
group:
'com.yidian.android'
,
module:
'NetworkImageLib'
)
}
...
...
CommonLib/Common/src/main/java/com/yidian/common/YdBaseApplication.kt
View file @
0bbc12e5
...
...
@@ -2,16 +2,71 @@ package com.yidian.common
import
android.app.Activity
import
android.app.Application
import
android.content.Context
import
android.content.res.Configuration
import
android.os.Bundle
import
android.util.Log
import
com.orhanobut.hawk.Hawk
import
com.scwang.smart.refresh.footer.ClassicsFooter
import
com.scwang.smart.refresh.header.ClassicsHeader
import
com.scwang.smart.refresh.layout.SmartRefreshLayout
import
com.scwang.smart.refresh.layout.constant.SpinnerStyle
import
com.yidian.common.http.ApiSaveCookiesInterceptor
import
com.yidian.common.http.ApiSetCookiesInterceptor
import
com.yidian.common.services.XEventService
import
com.yidian.common.services.XPageService
import
com.yidian.common.utils.UMConfigUtils
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.framework.mobile.xdiamond.SecretUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.news.util.ProcessUtil
import
com.yidian.xarc.xbrid.*
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.core.zap.Zap
import
com.yidian.yac.core.zap.ZapTicket
import
com.yidian.yac.ftdevicefinger.core.FtDeviceFingerManager
import
org.json.JSONObject
import
timber.log.Timber
open
class
YdBaseApplication
:
Application
()
{
companion
object
{
lateinit
var
context
:
Application
var
activityList
=
ArrayList
<
Activity
>()
private
val
module
:
CommonUtilLifecycleModule
by
lazy
{
CommonUtilLifecycleModule
(
com
.
yidian
.
xarc
.
xbrid
.
BuildConfig
.
DEBUG
,
this
,
".CommonInfrastructure"
)
}
private
val
activityLifecycle
=
object
:
ActivityLifecycleCallbacks
{
override
fun
onActivityCreated
(
activity
:
Activity
,
savedInstanceState
:
Bundle
?)
{
activityList
.
add
(
activity
)
}
override
fun
onActivityStarted
(
activity
:
Activity
)
{
}
override
fun
onActivityResumed
(
activity
:
Activity
)
{
}
override
fun
onActivityPaused
(
activity
:
Activity
)
{
}
override
fun
onActivityStopped
(
activity
:
Activity
)
{
}
override
fun
onActivitySaveInstanceState
(
activity
:
Activity
,
outState
:
Bundle
)
{
}
override
fun
onActivityDestroyed
(
activity
:
Activity
)
{
activityList
.
remove
(
activity
)
}
}
override
fun
onCreate
()
{
...
...
@@ -20,6 +75,19 @@ open class YdBaseApplication : Application() {
if
(
BuildConfig
.
DEBUG
)
{
Timber
.
plant
(
Timber
.
DebugTree
())
}
UMConfigUtils
.
init
(
this
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
context
=
this
FtDeviceFingerManager
.
init
(
this
)
initCommonUtils
()
Zap
.
init
(
this
)
{}
XPageManager
.
init
(
this
)
initXBridManager
()
loadService
()
registerActivityLifecycleCallbacks
(
activityLifecycle
)
// 初始化磐石SDK
SecretUtil
.
init
(
BuildConfig
.
IS_ENCRYPT_DEBUG_KEY
)
}
initSmartRefreshLayout
()
}
...
...
@@ -43,4 +111,100 @@ open class YdBaseApplication : Application() {
}
}
override
fun
attachBaseContext
(
base
:
Context
?)
{
super
.
attachBaseContext
(
base
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
module
.
onBaseContextAttached
(
base
)
}
}
override
fun
onConfigurationChanged
(
newConfig
:
Configuration
)
{
super
.
onConfigurationChanged
(
newConfig
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
module
.
onConfigurationChanged
(
newConfig
)
}
}
private
fun
initCommonUtils
()
{
module
.
onCreate
()
Hawk
.
init
(
this
).
build
()
initHttp
()
}
private
fun
initHttp
()
{
// val header = HashMap<String, String>()
// header["Content-Type"] = "application/json"
// header["charset"] = "UTF-8"
// ServiceFactory.getInstance().addInterceptor(HttpInterceptor(header))
// ServiceFactory.getInstance().init(true, URLs.BASE_URL, 10, 10)
ServiceFactory
.
getInstance
().
init
(
true
,
BuildConfig
.
API_URL
,
10
,
10
)
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSaveCookiesInterceptor
())
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSetCookiesInterceptor
())
}
private
fun
initXBridManager
()
{
XBridManager
.
init
(
XBridApp
(
applicationContext
)
{
assetRoot
=
"www"
//对应assets目录下存放xbrid资源对应的目录名
appId
=
"com.yidian.subway"
//当前应用包名
platformId
=
16
//需要去平台申请
appVersion
=
AppConfig
.
cv
//当前应用版本号
deviceFinger
=
FtDeviceFingerManager
.
getDeviceFinger
()
//设备指纹
androidChannel
=
AppConfig
.
distribution
//对应渠道名
},
20
//webview缓存池数量,默认不缓存
)
XBridManager
.
registerServiceInvoker
(
object
:
OnServiceInvoke
{
override
fun
onCall
(
identifier
:
String
,
// the identifier assigned when webview created
xWebView
:
XWebView
,
// webivew 加载的 js 发起的服务调用请求
request
:
Request
,
// 具体的服务请求参数,分为 name 和 params 两个部分
response
:
Response
// 业务方需要借助 response 来回应服务调用结果
)
{
val
data
=
request
.
params
as
JSONObject
Log
.
e
(
"zhb-yd"
,
"服务名:"
+
request
.
name
)
Log
.
e
(
"zhb-yd"
,
"JS传递参数:$data"
)
val
action
=
data
.
optString
(
"action"
)
val
params
=
data
.
optJSONObject
(
"params"
)
val
options
=
data
.
optJSONObject
(
"options"
)
ZapTicket
(
request
.
name
).
withAction
(
action
).
withServiceParams
(
params
).
withServiceOptions
(
options
).
withIdentifier
(
identifier
)
.
onResult
{
result
->
response
.
result
(
result
.
code
,
result
.
result
!!
,
""
)
}.
onLost
{
result
->
response
.
result
(
result
.
code
,
""
,
result
.
mesg
)
}.
ship
()
}
})
XBridManager
.
registerXPageInvoker
(
object
:
OnXPageInvoke
{
override
fun
onCall
(
identifier
:
String
,
xWebView
:
XWebView
,
request
:
XPageRequest
)
{
val
params
=
mutableMapOf
<
String
,
Any
>()
(
request
.
params
as
JSONObject
).
let
{
reParams
->
reParams
.
keys
().
forEach
{
params
[
it
]
=
reParams
[
it
]
}
}
when
(
request
.
action
)
{
"push"
->
XPageManager
.
push
(
request
.
name
,
params
)
"pop"
->
XPageManager
.
pop
(
params
)
"popTo"
->
XPageManager
.
popTo
(
request
.
name
,
params
)
"popToRoot"
->
XPageManager
.
popToRoot
(
params
)
}
}
})
}
private
fun
loadService
()
{
Zap
.
addService
(
XPageService
.
name
,
XPageService
())
Zap
.
addService
(
XEventService
.
name
,
XEventService
())
}
companion
object
{
lateinit
var
context
:
Application
var
activityList
=
ArrayList
<
Activity
>()
}
}
CommonLib/Common/src/main/java/com/yidian/common/mvvm/BaseMvvmActivity.kt
View file @
0bbc12e5
...
...
@@ -61,9 +61,7 @@ abstract class BaseMvvmActivity<V : ViewDataBinding, VM : BaseViewModel> : AppCo
private
fun
initStatusBar
()
{
SystemBarUtils
.
setStatusBarTransparent
(
this
.
window
)
if
(
allowChangeStatusBarTextColor
())
{
setStatusBarTextColor
(
NightModeConfig
.
getInstance
().
nightMode
)
}
SystemBarUtils
.
setStatusBarTextColorBlack
(
this
)
}
open
fun
setStatusBarTextColor
(
isNight
:
Boolean
)
{
...
...
CommonLib/Common/src/main/java/com/yidian/common/mvvm/binding/BindingAdapter.kt
View file @
0bbc12e5
...
...
@@ -98,40 +98,40 @@ fun clickable(view: View, boolean: Boolean) {
view
.
isClickable
=
boolean
}
data class
IconState
(
val
state
:
Int
=
1
,
)
{
fun
isSelected
():
Boolean
{
return
(
state
and
SELECTED
)
==
1
}
fun
isChecked
():
Boolean
{
return
(
state
and
CHECKED
)
==
1
}
companion
object
{
private
const
val
BASELINE
:
Int
=
1
private
const
val
SELECTED
:
Int
=
BASELINE
shr
1
private
const
val
CHECKED
:
Int
=
BASELINE
shr
2
fun
newState
(
vararg
state
:
IconState
):
IconState
{
return
state
.
reduce
{
a
,
b
->
return
IconState
(
a
.
state
or
b
.
state
)
}
}
}
}
@BindingAdapter
(
"iconState"
)
fun
View
.
bindIconState
(
state
:
IconState
)
{
this
.
isSelected
=
state
.
isSelected
()
}
@BindingAdapter
(
"iconState"
)
fun
CheckBox
.
bindIconState
(
state
:
IconState
)
{
this
.
isSelected
=
state
.
isSelected
()
this
.
isChecked
=
state
.
isChecked
()
}
//
data class IconState(
//
val state: Int = 1,
//
) {
//
//
fun isSelected(): Boolean {
//
return (state and SELECTED) == 1
//
}
//
//
fun isChecked(): Boolean {
//
return (state and CHECKED) == 1
//
}
//
//
companion object {
//
private const val BASELINE: Int = 1
//
//
private const val SELECTED: Int = BASELINE shr 1
//
private const val CHECKED: Int = BASELINE shr 2
//
//
fun newState(vararg state: IconState): IconState {
//
return state.reduce { a, b ->
//
return IconState(a.state or b.state)
//
}
//
}
//
}
//
//
}
//
//
@BindingAdapter("iconState")
//
fun View.bindIconState(state: IconState) {
//
this.isSelected = state.isSelected()
//
}
//
//
@BindingAdapter("iconState")
//
fun CheckBox.bindIconState(state: IconState) {
//
this.isSelected = state.isSelected()
//
this.isChecked = state.isChecked()
//
}
CommonLib/Common/src/main/java/com/yidian/common/utils/JVerificationUtils.kt
deleted
100644 → 0
View file @
b1cf49ea
package
com.yidian.common.utils
import
android.content.Context
import
cn.jiguang.verifysdk.api.JVerificationInterface
import
com.yidian.common.BuildConfig
class
JVerificationUtils
{
companion
object
{
fun
init
(
context
:
Context
)
{
JVerificationInterface
.
setDebugMode
(
BuildConfig
.
DEBUG
)
JVerificationInterface
.
init
(
context
)
}
}
}
CommonLib/Common/src/main/res/values/colors.xml
View file @
0bbc12e5
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"colorPrimary"
>
#6200EE
</color>
<color
name=
"colorPrimaryDark"
>
#3700B3
</color>
<color
name=
"colorAccent"
>
#03DAC5
</color>
<color
name=
"white"
>
#ffffff
</color>
<color
name=
"black"
>
#000000
</color>
<color
name=
"transparent"
>
#00000000
</color>
...
...
CommonLib/Common/src/main/res/values/styles.xml
View file @
0bbc12e5
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/transparent
</item>
<item
name=
"colorPrimaryDark"
>
@color/transparent
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<!-- Base application theme. -->
<style
name=
"FlashTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<item
name=
"android:windowIsTranslucent"
>
false
</item>
<item
name=
"android:windowFullscreen"
>
false
</item>
<item
name=
"android:windowBackground"
>
@drawable/icon_launcher_bg
</item>
</style>
<style
name=
"right_anim_style"
>
<item
name=
"android:activityOpenEnterAnimation"
>
@anim/slide_right_in
</item>
<item
name=
"android:activityCloseExitAnimation"
>
@anim/slide_right_out
</item>
...
...
Components/commodity/build.gradle
View file @
0bbc12e5
...
...
@@ -19,12 +19,9 @@ android {
targetSdkVersion
build_versions
.
targetSdkVersion
versionCode
rootProject
.
ext
.
android
.
versionCode
versionName
rootProject
.
ext
.
android
.
versionName
javaCompileOptions
{
annotationProcessorOptions
{
arguments
=
[
setAttributeClassName:
'YdNewsSetAttributeMethodProvider'
,
bindingDataClassName
:
'YdNewsBindingDataMethodProvider'
]
}
}
manifestPlaceholders
=
[
qqappid:
"101923771"
]
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles
"consumer-rules.pro"
}
...
...
Components/commodity/src/main/manifest/AndroidManifest.xml
View file @
0bbc12e5
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.yidian.shenghuoquan.commodity"
>
<application>
<application
android:name=
".app.CommodityApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"商品组件"
android:networkSecurityConfig=
"@xml/network_security_config"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:theme=
"@style/AppTheme"
tools:replace=
"android:allowBackup,android:label"
tools:targetApi=
"n"
>
<activity
android:name=
".ui.coupon.ChooseCategoryActivity"
>
<activity
android:name=
".ui.coupon.ChooseCategoryActivity"
android:theme=
"@style/FlashTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
Components/newscontent/src/main/manifest/AndroidManifest.xml
0 → 100644
View file @
0bbc12e5
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.yidian.shenghuoquan.newscontent"
>
<application>
<activity
android:name=
".ui.FlashActivity"
android:theme=
"@style/FlashTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.MainActivity"
android:launchMode=
"singleTask"
/>
<activity
android:name=
".ui.DeepLinkActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:host=
"link_news"
android:scheme=
"ydsubway"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.NewsContentActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
/>
<service
android:name=
".audio.AudioService"
android:enabled=
"true"
android:exported=
"true"
/>
<activity
android:name=
".ui.alive.AliveTestActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.idcard.IDCardTestActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountEnterpriseAuthCompleteActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountPersonalAuthCompleteActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountCreateCompleteActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.idcard.IDCardResultActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.ProtocolActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.ProductSupportActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.LoginLifeCircleActivity"
/>
<activity
android:name=
".ui.StoreManagementActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.EditStoreActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.SelectAddressActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.SearchAddActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountIdentityActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountAuthActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.LifeAccountEnterpriseCertificationActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountCreateActivity"
android:theme=
"@style/Transparent"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.auth.LifeAccountPersonalAuthActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.LifeAccountEnterpriseAuthActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.MyStaffActivity"
android:launchMode=
"singleTask"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.ManagerInfoActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.ManagerChangeActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.StaffInfoActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.StaffManageActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".personnel.ui.AddStaffActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.setting.SystemSettingActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.center.MerchantCenterActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.center.MerchantInfoActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.center.LifeAccountModifyNameActivity"
android:theme=
"@style/Transparent"
android:windowSoftInputMode=
"stateVisible"
/>
<activity
android:name=
".ui.center.MerchantAuthInfoActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.ChooseCareerActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".wallet.ui.MyWalletActivity"
/>
<activity
android:name=
".wallet.ui.VerifyIdentityActivity"
/>
<activity
android:name=
".wallet.ui.WeChatAuthActivity"
/>
<activity
android:name=
".wallet.ui.WithdrawActivity"
/>
<activity
android:name=
".wallet.ui.TransactionListActivity"
/>
<activity
android:name=
".wallet.ui.TransactionDetailsActivity"
/>
</application>
</manifest>
\ No newline at end of file
Components/newscontent/src/main/res/values/styles.xml
View file @
0bbc12e5
<resources>
<!-- Base application theme. -->
<style
name=
"FlashTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<item
name=
"android:windowIsTranslucent"
>
false
</item>
<item
name=
"android:windowFullscreen"
>
false
</item>
<item
name=
"android:windowBackground"
>
@drawable/icon_launcher_bg
</item>
</style>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
...
...
Components/userinfo/build.gradle
View file @
0bbc12e5
...
...
@@ -44,8 +44,8 @@ android {
}
}
}
viewBinding
{
enabled
=
true
buildFeatures
{
viewBinding
true
}
repositories
{
flatDir
{
...
...
app/build.gradle
View file @
0bbc12e5
...
...
@@ -13,12 +13,10 @@ android {
targetSdkVersion
build_versions
.
targetSdkVersion
versionCode
rootProject
.
ext
.
android
.
versionCode
versionName
rootProject
.
ext
.
android
.
versionName
buildConfigField
(
"boolean"
,
"IS_ENCRYPT_DEBUG_KEY"
,
rootProject
.
ext
.
android
.
isEncryptDebugKey
)
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders
=
[
qqappid
:
"101923771"
,
JPUSH_PKGNAME:
applicationId
,
JPUSH_APPKEY
:
"2e1d0f48bc1ebeae360a9cc5"
,
JPUSH_CHANNEL:
"developer-default"
,]
manifestPlaceholders
=
[
qqappid:
"101923771"
]
ndk
{
abiFilters
'armeabi-v7a'
}
...
...
@@ -36,7 +34,6 @@ android {
buildTypes
{
debug
{
applicationIdSuffix
".debug"
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
debug
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".debug.fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"商家版测试"
,
...
...
@@ -50,7 +47,6 @@ android {
signingConfig
signingConfigs
.
production
}
release
{
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
release
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"生活圈商家版"
,
...
...
app/src/main/AndroidManifest.xml
View file @
0bbc12e5
...
...
@@ -38,7 +38,6 @@
android:icon=
"@mipmap/ic_launcher"
android:label=
"${app_name}"
android:networkSecurityConfig=
"@xml/network_security_config"
android:requestLegacyExternalStorage=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
...
...
@@ -77,7 +76,6 @@
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"tencent101923771"
/>
</intent-filter>
</activity>
...
...
app/src/main/java/com/shenghuoquan/business/YdSubwayApplication.kt
View file @
0bbc12e5
package
com.shenghuoquan.business
import
android.app.Activity
import
android.content.Context
import
android.content.res.Configuration
import
android.os.Bundle
import
android.util.Log
import
com.orhanobut.hawk.Hawk
import
com.yidian.common.AppConfig
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.http.ApiSaveCookiesInterceptor
import
com.yidian.common.http.ApiSetCookiesInterceptor
import
com.yidian.common.services.XEventService
import
com.yidian.common.services.XPageService
import
com.yidian.common.utils.JVerificationUtils
import
com.yidian.common.utils.UMConfigUtils
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.framework.mobile.xdiamond.SecretUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.news.util.ProcessUtil
import
com.yidian.xarc.xbrid.*
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.core.core.YacAppSpec
import
com.yidian.yac.core.zap.Zap
import
com.yidian.yac.core.zap.ZapTicket
import
com.yidian.yac.ftdevicefinger.core.FtDeviceFingerManager
import
org.json.JSONObject
@YacAppSpec
class
YdSubwayApplication
:
YdBaseApplication
()
{
private
val
module
:
CommonUtilLifecycleModule
by
lazy
{
CommonUtilLifecycleModule
(
BuildConfig
.
DEBUG
,
this
,
".CommonInfrastructure"
)
}
private
val
activityLifecycle
=
object
:
ActivityLifecycleCallbacks
{
override
fun
onActivityCreated
(
activity
:
Activity
,
savedInstanceState
:
Bundle
?)
{
activityList
.
add
(
activity
)
}
override
fun
onActivityStarted
(
activity
:
Activity
)
{
}
override
fun
onActivityResumed
(
activity
:
Activity
)
{
}
override
fun
onActivityPaused
(
activity
:
Activity
)
{
}
override
fun
onActivityStopped
(
activity
:
Activity
)
{
}
override
fun
onActivitySaveInstanceState
(
activity
:
Activity
,
outState
:
Bundle
)
{
}
override
fun
onActivityDestroyed
(
activity
:
Activity
)
{
activityList
.
remove
(
activity
)
}
}
override
fun
onCreate
()
{
super
.
onCreate
()
UMConfigUtils
.
init
(
this
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
context
=
this
FtDeviceFingerManager
.
init
(
this
)
initCommonUtils
()
Zap
.
init
(
this
)
{}
XPageManager
.
init
(
this
)
initXBridManager
()
loadService
()
JVerificationUtils
.
init
(
this
)
registerActivityLifecycleCallbacks
(
activityLifecycle
)
// 初始化磐石SDK
SecretUtil
.
init
(
BuildConfig
.
IS_ENCRYPT_DEBUG_KEY
)
}
}
override
fun
attachBaseContext
(
base
:
Context
?)
{
super
.
attachBaseContext
(
base
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
module
.
onBaseContextAttached
(
base
)
}
}
override
fun
onConfigurationChanged
(
newConfig
:
Configuration
)
{
super
.
onConfigurationChanged
(
newConfig
)
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
module
.
onConfigurationChanged
(
newConfig
)
}
}
private
fun
initCommonUtils
()
{
module
.
onCreate
()
Hawk
.
init
(
this
).
build
()
initHttp
()
}
private
fun
initHttp
()
{
// val header = HashMap<String, String>()
// header["Content-Type"] = "application/json"
// header["charset"] = "UTF-8"
// ServiceFactory.getInstance().addInterceptor(HttpInterceptor(header))
// ServiceFactory.getInstance().init(true, URLs.BASE_URL, 10, 10)
ServiceFactory
.
getInstance
().
init
(
true
,
BuildConfig
.
API_URL
,
10
,
10
)
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSaveCookiesInterceptor
())
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSetCookiesInterceptor
())
}
private
fun
initXBridManager
()
{
XBridManager
.
init
(
XBridApp
(
applicationContext
)
{
assetRoot
=
"www"
//对应assets目录下存放xbrid资源对应的目录名
appId
=
"com.yidian.subway"
//当前应用包名
platformId
=
16
//需要去平台申请
appVersion
=
AppConfig
.
cv
//当前应用版本号
deviceFinger
=
FtDeviceFingerManager
.
getDeviceFinger
()
//设备指纹
androidChannel
=
AppConfig
.
distribution
//对应渠道名
},
20
//webview缓存池数量,默认不缓存
)
XBridManager
.
registerServiceInvoker
(
object
:
OnServiceInvoke
{
override
fun
onCall
(
identifier
:
String
,
// the identifier assigned when webview created
xWebView
:
XWebView
,
// webivew 加载的 js 发起的服务调用请求
request
:
Request
,
// 具体的服务请求参数,分为 name 和 params 两个部分
response
:
Response
// 业务方需要借助 response 来回应服务调用结果
)
{
val
data
=
request
.
params
as
JSONObject
Log
.
e
(
"zhb-yd"
,
"服务名:"
+
request
.
name
)
Log
.
e
(
"zhb-yd"
,
"JS传递参数:$data"
)
val
action
=
data
.
optString
(
"action"
)
val
params
=
data
.
optJSONObject
(
"params"
)
val
options
=
data
.
optJSONObject
(
"options"
)
ZapTicket
(
request
.
name
).
withAction
(
action
).
withServiceParams
(
params
).
withServiceOptions
(
options
).
withIdentifier
(
identifier
)
.
onResult
{
result
->
response
.
result
(
result
.
code
,
result
.
result
!!
,
""
)
}.
onLost
{
result
->
response
.
result
(
result
.
code
,
""
,
result
.
mesg
)
}.
ship
()
}
})
XBridManager
.
registerXPageInvoker
(
object
:
OnXPageInvoke
{
override
fun
onCall
(
identifier
:
String
,
xWebView
:
XWebView
,
request
:
XPageRequest
)
{
val
params
=
mutableMapOf
<
String
,
Any
>()
(
request
.
params
as
JSONObject
).
let
{
reParams
->
reParams
.
keys
().
forEach
{
params
[
it
]
=
reParams
[
it
]
}
}
when
(
request
.
action
)
{
"push"
->
XPageManager
.
push
(
request
.
name
,
params
)
"pop"
->
XPageManager
.
pop
(
params
)
"popTo"
->
XPageManager
.
popTo
(
request
.
name
,
params
)
"popToRoot"
->
XPageManager
.
popToRoot
(
params
)
}
}
})
}
private
fun
loadService
()
{
Zap
.
addService
(
XPageService
.
name
,
XPageService
())
Zap
.
addService
(
XEventService
.
name
,
XEventService
())
}
}
app/src/main/res/values/styles.xml
View file @
0bbc12e5
<resources>
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/transparent
</item>
<item
name=
"colorPrimaryDark"
>
@color/transparent
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
...
...
config/config.gradle
View file @
0bbc12e5
...
...
@@ -88,9 +88,6 @@ ext.dependencies = [
// 消息推送网络核心库,必须添加
'com.umeng.umsdk:agoo_tnet4android:3.1.14.10'
,
'cn.jiguang.sdk:jverification:2.6.4'
,
'cn.jiguang.sdk:jcore:2.3.4'
,
'com.github.tbruyelle:rxpermissions:0.12'
,
'io.reactivex.rxjava3:rxandroid:3.0.0'
,
'io.reactivex.rxjava3:rxjava:3.0.9'
,
...
...
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