Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
f7e35c52
Commit
f7e35c52
authored
Mar 17, 2020
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android10底部适配,心理咨询UI修改
parent
2d6e0797
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
207 additions
and
64 deletions
+207
-64
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+7
-2
config.gradle
config.gradle
+7
-7
CollectUserInformationView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
+1
-1
CollectFocusActivity.kt
m-user/src/main/java/com/yidianling/user/ui/collect/CollectFocusActivity.kt
+5
-3
CollectSexAndBirthActivity.kt
m-user/src/main/java/com/yidianling/user/ui/collect/CollectSexAndBirthActivity.kt
+5
-3
CollectFocusView.kt
m-user/src/main/java/com/yidianling/user/ui/collect/widget/CollectFocusView.kt
+5
-2
user_collect_select_bg.xml
m-user/src/main/res/drawable/user_collect_select_bg.xml
+2
-1
user_activity_sex_birth_layout.xml
m-user/src/main/res/layout/user_activity_sex_birth_layout.xml
+2
-1
collect_success_top_icon.png
m-user/src/xlzx/res/drawable-xhdpi/collect_success_top_icon.png
+0
-0
user_collect_bottom_btn_bg.xml
m-user/src/xlzx/res/drawable/user_collect_bottom_btn_bg.xml
+13
-0
user_collect_bottom_btn_un_bg.xml
m-user/src/xlzx/res/drawable/user_collect_bottom_btn_un_bg.xml
+13
-0
colors.xml
m-user/src/xlzx/res/values/colors.xml
+2
-0
collect_success_top_icon.png
m-user/src/ydl/res/drawable-xhdpi/collect_success_top_icon.png
+0
-0
user_collect_bottom_btn_bg.xml
m-user/src/ydl/res/drawable/user_collect_bottom_btn_bg.xml
+0
-0
user_collect_bottom_btn_un_bg.xml
m-user/src/ydl/res/drawable/user_collect_bottom_btn_un_bg.xml
+0
-0
colors.xml
m-user/src/ydl/res/values/colors.xml
+2
-0
BaseActivity.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivity.kt
+41
-5
BaseFragment.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseFragment.kt
+1
-1
StatusBarOptions.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/StatusBarOptions.kt
+2
-0
StatusBarUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
+43
-11
platform_ydl_common_dialog_sure_btn_xlzx_bg.xml
ydl-platform/src/main/res/drawable/platform_ydl_common_dialog_sure_btn_xlzx_bg.xml
+3
-2
platform_ydl_common_dialog_sure_btn_ydl_bg.xml
ydl-platform/src/main/res/drawable/platform_ydl_common_dialog_sure_btn_ydl_bg.xml
+1
-0
platform_layout_bottom_fit_root.xml
ydl-platform/src/main/res/layout/platform_layout_bottom_fit_root.xml
+23
-0
platform_layout_root.xml
ydl-platform/src/main/res/layout/platform_layout_root.xml
+16
-1
H5Params.kt
ydl-webview/src/main/java/com/ydl/webview/H5Params.kt
+8
-3
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+5
-21
No files found.
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
f7e35c52
...
...
@@ -20,7 +20,6 @@ import com.alibaba.android.arouter.launcher.ARouter
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.umeng.analytics.MobclickAgent
import
com.ydl.component.music.FragmentContainerActivity
import
com.ydl.component.mvp.DemoContract
import
com.ydl.component.mvp.DemoPresenter
import
com.ydl.media.audio.PlayService
import
com.ydl.ydlcommon.modular.ModularServiceManager
...
...
@@ -34,6 +33,13 @@ import com.yidianling.user.widget.SecretDescriptionDialog.OnSecretDescriptionDia
import
com.yidianling.user.widget.SecretDialog
import
com.yidianling.user.widget.SecretDialog.OnSecretDialogListener
import
kotlinx.android.synthetic.main.activity_main.*
import
com.ydl.ydlcommon.utils.ResUtil.getResources
import
com.alibaba.fastjson.serializer.AwtCodec.support
import
android.support.v4.app.SupportActivity
import
android.support.v4.app.SupportActivity.ExtraData
import
com.ydl.component.mvp.DemoContract
/**
* Created by haorui on 2019-09-01 .
...
...
@@ -216,7 +222,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
override
fun
reLoadData
()
{
mPresenter
.
loadHome
()
}
...
...
config.gradle
View file @
f7e35c52
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
tru
e
dev_mode
=
fals
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
...
...
@@ -45,9 +45,9 @@ ext {
"m-confide"
:
"0.0.48.6"
,
"m-consultant"
:
"0.0.57.4"
,
"m-fm"
:
"0.0.29.3"
,
"m-user"
:
"0.0.59.
18
"
,
"m-user"
:
"0.0.59.
23
"
,
"m-home"
:
"0.0.19.1"
,
"m-im"
:
"0.0.16.
6
"
,
"m-im"
:
"0.0.16.
9
"
,
"m-dynamic"
:
"0.0.6.1"
,
"m-muse"
:
"0.0.28.9"
,
...
...
@@ -69,10 +69,10 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.6"
,
"ydl-platform"
:
"0.0.39.
1
6"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.5"
,
"ydl-webview"
:
"0.0.38.
1
5"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.48.1"
,
...
...
@@ -115,10 +115,10 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.6"
,
"ydl-platform"
:
"0.0.39.
1
6"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.5"
,
"ydl-webview"
:
"0.0.38.
1
5"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.48.1"
,
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
View file @
f7e35c52
...
...
@@ -172,7 +172,7 @@ class CollectUserInformationView(
return
@setOnClickListener
}
ageStr
=
"年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
if
((
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
-
year
)
<
16
)
{
if
((
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
-
year
)
<
=
16
)
{
isNeedShowCheckAgeDialog
=
true
}
...
...
m-user/src/main/java/com/yidianling/user/ui/collect/CollectFocusActivity.kt
View file @
f7e35c52
...
...
@@ -10,6 +10,7 @@ import com.ydl.webview.NewH5Activity
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...
...
@@ -72,7 +73,7 @@ class CollectFocusActivity : BaseActivity() {
}).
setNullTitleDesc
(
"确定要退出吗?\n"
+
"很多人在这里得到了帮助哦
~
"
"很多人在这里得到了帮助哦"
).
setCancelText
(
"确定"
).
setSureText
(
"取消"
)
}
collectOutDialog
?.
show
()
...
...
@@ -94,7 +95,7 @@ class CollectFocusActivity : BaseActivity() {
userInfoBean
.
userInfoList
=
ArrayList
()
userInfoBean
.
userInfoList
.
add
(
UserInfoCollectParam
(
mList
.
filter
{
it
.
isFocus
}.
joinToString
{
it
.
id
}
,
mList
.
filter
{
it
.
isFocus
}.
map
{
it
.
id
}.
joinToString
(
","
)
,
"consultAttention"
)
)
...
...
@@ -223,6 +224,7 @@ class CollectFocusActivity : BaseActivity() {
@SuppressLint
(
"CheckResult"
)
private
fun
jumpToNewUserH5
()
{
var
cateIds
=
mList
.
filter
{
it
.
isFocus
}.
map
{
it
.
id
}.
joinToString
(
","
)
UserHttpImpl
.
getInstance
().
getNewUserJumpUrl
()
.
compose
(
RxUtils
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
newThread
())
...
...
@@ -232,7 +234,7 @@ class CollectFocusActivity : BaseActivity() {
upload_focus_info_btn
.
postDelayed
({
completeDialog
?.
dismiss
()
if
(!
isFinishing
)
{
val
h5Params
=
H5Params
(
it
,
"mainPage"
)
val
h5Params
=
H5Params
(
"$it?cateIds=$cateIds"
,
H5Params
.
BackLimit
.
NewUserBackLimit
)
NewH5Activity
.
start
(
this
,
h5Params
)
}
},
1000
)
...
...
m-user/src/main/java/com/yidianling/user/ui/collect/CollectSexAndBirthActivity.kt
View file @
f7e35c52
...
...
@@ -3,6 +3,7 @@ package com.yidianling.user.ui.collect
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.graphics.Color
import
android.support.v4.content.ContextCompat
import
android.util.Log
import
android.view.KeyEvent
import
android.widget.NumberPicker
...
...
@@ -94,7 +95,7 @@ class CollectSexAndBirthActivity : BaseActivity() {
}
}).
setNullTitleDesc
(
"确定要退出吗?\n"
+
"很多人在这里得到了帮助哦
~
"
).
setCancelText
(
"确定"
).
setSureText
(
"取消"
)
"很多人在这里得到了帮助哦"
).
setCancelText
(
"确定"
).
setSureText
(
"取消"
)
}
collectOutDialog
?.
show
()
}
...
...
@@ -166,6 +167,7 @@ class CollectSexAndBirthActivity : BaseActivity() {
})
}
@SuppressLint
(
"ResourceAsColor"
)
private
fun
checkUpSelect
()
{
if
(
selectedSex
==
1
)
{
male_rl
.
setBackgroundResource
(
R
.
drawable
.
user_collect_select_bg
)
...
...
@@ -173,7 +175,7 @@ class CollectSexAndBirthActivity : BaseActivity() {
male_img
.
setImageResource
(
R
.
drawable
.
user_male_selected
)
female_img
.
setImageResource
(
R
.
drawable
.
user_female_unselected
)
male_txt
.
setTextColor
(
Color
.
parseColor
(
"#1DA1F2"
))
female_txt
.
setTextColor
(
Co
lor
.
parseColor
(
"#242424"
))
female_txt
.
setTextColor
(
Co
ntextCompat
.
getColor
(
mContext
,
R
.
color
.
user_main_theme
))
sex_and_birth_upload_btn
.
setBackgroundResource
(
R
.
drawable
.
user_collect_bottom_btn_bg
)
}
else
if
(
selectedSex
==
2
)
{
...
...
@@ -182,7 +184,7 @@ class CollectSexAndBirthActivity : BaseActivity() {
male_img
.
setImageResource
(
R
.
drawable
.
user_male_unselected
)
female_img
.
setImageResource
(
R
.
drawable
.
user_female_selected
)
male_txt
.
setTextColor
(
Color
.
parseColor
(
"#242424"
))
female_txt
.
setTextColor
(
Co
lor
.
parseColor
(
"#1DA1F2"
))
female_txt
.
setTextColor
(
Co
ntextCompat
.
getColor
(
mContext
,
R
.
color
.
user_main_theme
))
sex_and_birth_upload_btn
.
setBackgroundResource
(
R
.
drawable
.
user_collect_bottom_btn_bg
)
}
else
{
...
...
m-user/src/main/java/com/yidianling/user/ui/collect/widget/CollectFocusView.kt
View file @
f7e35c52
package
com.yidianling.user.ui.collect.widget
import
android.annotation.SuppressLint
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Typeface
import
android.support.v4.content.ContextCompat
import
android.util.AttributeSet
import
android.view.Gravity
import
android.view.View
...
...
@@ -53,10 +55,11 @@ class CollectFocusView : LinearLayout {
}
@SuppressLint
(
"ResourceAsColor"
)
fun
setFocus
(
focus
:
Boolean
)
{
if
(
focus
)
{
user_focus_title
.
setTextColor
(
Co
lor
.
parseColor
(
"#1DA1F2"
))
user_focus_desc
.
setTextColor
(
Co
lor
.
parseColor
(
"#1DA1F2"
))
user_focus_title
.
setTextColor
(
Co
ntextCompat
.
getColor
(
mContext
,
R
.
color
.
user_main_theme
))
user_focus_desc
.
setTextColor
(
Co
ntextCompat
.
getColor
(
mContext
,
R
.
color
.
user_main_theme
))
user_focus_title
.
typeface
=
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
)
setBackgroundResource
(
R
.
drawable
.
user_collect_select_bg
)
}
else
{
...
...
m-user/src/main/res/drawable/user_collect_select_bg.xml
View file @
f7e35c52
...
...
@@ -8,6 +8,6 @@
android:color=
"@color/user_main_theme"
/>
<solid
android:color=
"
#EDF8FF
"
/>
android:color=
"
@color/user_main_theme_bright
"
/>
</shape>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_sex_birth_layout.xml
View file @
f7e35c52
...
...
@@ -139,13 +139,14 @@
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:gravity=
"center"
>
android:gravity=
"center
_horizontal
"
>
<TextView
android:id=
"@+id/sex_and_birth_upload_btn"
android:layout_marginLeft=
"17dp"
android:layout_marginRight=
"17dp"
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:text=
"确定"
android:textSize=
"17dp"
...
...
m-user/src/xlzx/res/drawable-xhdpi/collect_success_top_icon.png
0 → 100644
View file @
f7e35c52
15.9 KB
m-user/src/xlzx/res/drawable/user_collect_bottom_btn_bg.xml
0 → 100644
View file @
f7e35c52
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"22dp"
/>
<gradient
android:angle=
"180"
android:startColor=
"@color/user_main_theme"
android:endColor=
"@color/user_main_theme"
/>
</shape>
\ No newline at end of file
m-user/src/xlzx/res/drawable/user_collect_bottom_btn_un_bg.xml
0 → 100644
View file @
f7e35c52
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"22dp"
/>
<gradient
android:angle=
"180"
android:startColor=
"@color/user_main_theme_66"
android:endColor=
"@color/user_main_theme_66"
/>
</shape>
\ No newline at end of file
m-user/src/xlzx/res/values/colors.xml
View file @
f7e35c52
...
...
@@ -2,6 +2,8 @@
<resources>
<!--主题色-->
<color
name=
"user_main_theme"
>
#fdbd00
</color>
<color
name=
"user_main_theme_66"
>
#66fdbd00
</color>
<!--主题浅色-->
<color
name=
"user_main_theme_light"
>
#FFEC8C
</color>
<!--主题亮色-->
...
...
m-user/src/
main
/res/drawable-xhdpi/collect_success_top_icon.png
→
m-user/src/
ydl
/res/drawable-xhdpi/collect_success_top_icon.png
View file @
f7e35c52
File moved
m-user/src/
main
/res/drawable/user_collect_bottom_btn_bg.xml
→
m-user/src/
ydl
/res/drawable/user_collect_bottom_btn_bg.xml
View file @
f7e35c52
File moved
m-user/src/
main
/res/drawable/user_collect_bottom_btn_un_bg.xml
→
m-user/src/
ydl
/res/drawable/user_collect_bottom_btn_un_bg.xml
View file @
f7e35c52
File moved
m-user/src/ydl/res/values/colors.xml
View file @
f7e35c52
...
...
@@ -2,6 +2,8 @@
<resources>
<!--主题色-->
<color
name=
"user_main_theme"
>
#1da1f2
</color>
<color
name=
"user_main_theme_66"
>
#661da1f2
</color>
<!--主题浅色-->
<color
name=
"user_main_theme_light"
>
#60BDF5
</color>
<!--主题亮色-->
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivity.kt
View file @
f7e35c52
...
...
@@ -2,18 +2,24 @@ package com.ydl.ydlcommon.base
import
android.app.Activity
import
android.content.res.Resources
import
android.graphics.Color
import
android.os.Bundle
import
android.support.annotation.LayoutRes
import
android.support.v7.app.AppCompatActivity
import
android.util.Log
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
com.trello.rxlifecycle2.android.ActivityEvent
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.lifecycle.IActivityLifecycleable
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.ui.LoadingDialogFragment
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.AndroidSystemHelper
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.yidianling.common.tools.RxImageTool
import
io.reactivex.subjects.BehaviorSubject
import
io.reactivex.subjects.Subject
import
kotlin.properties.Delegates
...
...
@@ -24,7 +30,7 @@ import kotlin.properties.Delegates
* e-mail : zhangwch@yidianling.com
* time : 2018/01/27
*/
abstract
class
BaseActivity
:
AppCompatActivity
(),
IActivityLifecycleable
{
abstract
class
BaseActivity
:
AppCompatActivity
(),
IActivityLifecycleable
{
private
val
mLifecycleSubject
=
BehaviorSubject
.
create
<
ActivityEvent
>()
var
mContext
:
Activity
by
Delegates
.
notNull
()
...
...
@@ -57,19 +63,49 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
override
fun
setContentView
(
@LayoutRes
layoutResID
:
Int
)
{
if
(
getStatusViewOptions
()
?.
isAddStatusView
)
{
val
returnViews
=
StatusBarUtils
.
initStatusBarView
(
this
,
layoutResID
,
getStatusViewOptions
())
val
options
=
getStatusViewOptions
()
options
.
bottomStatusColor
=
getDefaultBottomColor
()
val
returnViews
=
StatusBarUtils
.
initStatusBarView
(
this
,
layoutResID
,
getStatusViewOptions
())
if
(
returnViews
.
size
>
1
)
{
if
(
returnViews
.
size
>
1
)
{
statusView
=
returnViews
[
1
];
}
super
.
setContentView
(
returnViews
[
0
])
AndroidSystemHelper
.
fixAndroidBug5497Workaround
(
this
)
}
else
{
super
.
setContentView
(
layoutResID
)
//判定是否有底部小横条
if
(
StatusBarUtils
.
hasBottomNavigatorLine
(
this
))
{
val
containerView
=
View
.
inflate
(
this
,
R
.
layout
.
platform_layout_bottom_fit_root
,
null
)
as
ViewGroup
val
rootView
=
containerView
.
findViewById
<
FrameLayout
>(
R
.
id
.
ll_bottom_fit_root
);
val
layoutView
=
View
.
inflate
(
this
,
layoutResID
,
null
)
val
params
=
ViewGroup
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
rootView
.
addView
(
layoutView
,
params
)
val
bottomView
=
containerView
.
findViewById
<
View
>(
R
.
id
.
ll_bottom_fit_v
)
bottomView
.
visibility
=
View
.
VISIBLE
bottomView
.
setBackgroundColor
(
getDefaultBottomColor
())
super
.
setContentView
(
containerView
)
}
else
{
super
.
setContentView
(
layoutResID
)
}
}
}
open
fun
getDefaultBottomColor
():
Int
{
return
Color
.
parseColor
(
"#00000000"
)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
ActivityManager
.
getInstance
().
removeStack
(
this
)
...
...
@@ -88,7 +124,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
return
AndroidSystemHelper
.
fixResourcesScale
(
res
)
}
open
fun
getStatusViewOptions
():
StatusBarOptions
{
open
fun
getStatusViewOptions
():
StatusBarOptions
{
return
StatusBarOptions
()
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseFragment.kt
View file @
f7e35c52
...
...
@@ -55,7 +55,7 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{
layoutResId
!=
0
->
{
val
childView
=
inflater
.
inflate
(
layoutResId
,
container
,
false
)
if
(
getStatusViewOptions
().
isAddStatusView
){
val
returnViews
=
StatusBarUtils
.
initStatusBarView
(
activity
!!
,
childView
,
getStatusViewOptions
())
val
returnViews
=
StatusBarUtils
.
initStatusBarView
(
activity
!!
,
childView
,
getStatusViewOptions
()
,
true
)
return
returnViews
[
0
]
}
else
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/StatusBarOptions.kt
View file @
f7e35c52
package
com.ydl.ydlcommon.bean
import
android.graphics.Color
import
android.os.Build
/**
...
...
@@ -20,6 +21,7 @@ class StatusBarOptions {
return
"#1da1f2"
}
}
var
bottomStatusColor
:
Int
=
Color
.
parseColor
(
"#00000000"
)
//底部颜色默认透明色,个别页面自己设置即可
constructor
(
isAddStatusView
:
Boolean
=
false
,
statusBarDarkMode
:
Boolean
=
false
)
{
this
.
isAddStatusView
=
isAddStatusView
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
View file @
f7e35c52
...
...
@@ -15,6 +15,7 @@ import android.support.v4.widget.DrawerLayout
import
android.view.View
import
android.view.ViewGroup
import
android.view.WindowManager
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.bean.StatusBarOptions
...
...
@@ -997,25 +998,38 @@ class StatusBarUtils {
return
initStatusBarView
(
context
,
child
,
statusBarOptions
statusBarOptions
,
false
)
}
fun
initStatusBarView
(
context
:
Activity
,
child
:
View
,
statusBarOptions
:
StatusBarOptions
context
:
Activity
,
child
:
View
,
statusBarOptions
:
StatusBarOptions
,
isFragment
:
Boolean
=
false
):
Array
<
View
>
{
var
returnView
=
arrayOfNulls
<
View
>(
2
)
val
containerView
=
View
.
inflate
(
context
,
R
.
layout
.
platform_layout_root
,
null
)
as
ViewGroup
val
rootView
=
containerView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ll_root
);
val
rootView
=
containerView
.
findViewById
<
FrameLayout
>(
R
.
id
.
ll_root
)
val
statusView
=
initStatus
(
context
,
rootView
,
statusBarOptions
);
initStatus
(
context
,
containerView
,
statusBarOptions
)
val
params
=
ViewGroup
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
ViewGroup
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
rootView
.
addView
(
child
,
params
)
if
(!
isFragment
&&
hasBottomNavigatorLine
(
context
))
{
val
bottomView
=
containerView
.
findViewById
<
View
>(
R
.
id
.
ll_bottom_v
)
bottomView
.
visibility
=
View
.
VISIBLE
bottomView
.
setBackgroundColor
(
statusBarOptions
.
bottomStatusColor
)
}
returnView
[
0
]
=
containerView
if
(
statusView
!=
null
){
...
...
@@ -1025,21 +1039,39 @@ class StatusBarUtils {
return
returnView
as
Array
<
View
>
}
/**
* 判定是否含有底部小横条,当底部导航高度像素小于50时,认为是有小横条
*/
fun
hasBottomNavigatorLine
(
context
:
Context
):
Boolean
{
return
try
{
val
clazz
=
Class
.
forName
(
"com.android.internal.R\$dimen"
)
val
`object`
=
clazz
.
newInstance
()
val
heightStr
=
clazz
.
getField
(
"navigation_bar_height"
).
get
(
`object`
).
toString
()
val
height
=
Integer
.
parseInt
(
heightStr
)
val
bottomNavigatorHeight
=
context
.
resources
.
getDimensionPixelSize
(
height
)
bottomNavigatorHeight
<
50
}
catch
(
e
:
Exception
)
{
false
}
}
fun
initStatus
(
context
:
Activity
,
root
View
:
View
,
container
View
:
View
,
statusBarOptions
:
StatusBarOptions
):
View
?
{
var
statusView
:
View
?=
null
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
statusView
=
root
View
.
findViewById
<
View
>(
R
.
id
.
view_status_place_holder
)
statusView
=
container
View
.
findViewById
<
View
>(
R
.
id
.
view_status_place_holder
)
statusView
?.
setBackgroundColor
(
Color
.
parseColor
(
statusBarOptions
.
statusColor
))
val
statusBarHeight
=
getStatusBarHeight
(
context
)
val
layoutParams
=
statusView
?.
getLayoutParams
()
as
LinearLayout
.
LayoutParams
layoutParams
.
height
=
statusBarHeight
statusView
?.
layoutParams
=
layoutParams
statusView
?.
let
{
val
layoutParams
=
statusView
?.
getLayoutParams
()
as
LinearLayout
.
LayoutParams
layoutParams
.
height
=
statusBarHeight
statusView
?.
layoutParams
=
layoutParams
}
setTransparentForImageView
(
context
,
null
)
}
if
(
statusBarOptions
.
statusBarDarkMode
)
{
...
...
ydl-platform/src/main/res/drawable/platform_ydl_common_dialog_sure_btn_xlzx_bg.xml
View file @
f7e35c52
...
...
@@ -3,8 +3,9 @@
android:shape=
"rectangle"
>
<gradient
android:endColor=
"#fdbd00"
android:startColor=
"#FFEC8C"
/>
android:angle=
"0"
android:startColor=
"#fdbd00"
android:endColor=
"#fdbd00"
/>
<corners
android:bottomRightRadius=
"8dp"
/>
...
...
ydl-platform/src/main/res/drawable/platform_ydl_common_dialog_sure_btn_ydl_bg.xml
View file @
f7e35c52
...
...
@@ -3,6 +3,7 @@
android:shape=
"rectangle"
>
<gradient
android:angle=
"180"
android:endColor=
"#1DA1F2"
android:startColor=
"#23B2FA"
/>
...
...
ydl-platform/src/main/res/layout/platform_layout_bottom_fit_root.xml
0 → 100644
View file @
f7e35c52
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/ll_bottom_fit_root"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
</FrameLayout>
<View
android:id=
"@+id/ll_bottom_fit_v"
android:layout_width=
"match_parent"
android:layout_height=
"10dp"
android:visibility=
"gone"
>
</View>
</LinearLayout>
\ No newline at end of file
ydl-platform/src/main/res/layout/platform_layout_root.xml
View file @
f7e35c52
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/ll_root"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
...
...
@@ -11,4 +10,19 @@
android:background=
"@color/platform_white"
android:layout_height=
"0dp"
/>
<FrameLayout
android:id=
"@+id/ll_root"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
</FrameLayout>
<View
android:id=
"@+id/ll_bottom_v"
android:layout_width=
"match_parent"
android:layout_height=
"10dp"
android:visibility=
"gone"
>
</View>
</LinearLayout>
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/H5Params.kt
View file @
f7e35c52
...
...
@@ -14,7 +14,7 @@ class H5Params : Serializable {
this
.
title
=
title
}
constructor
(
url
:
String
,
backLimit
:
String
,
boolean
:
Boolean
=
true
):
super
()
{
constructor
(
url
:
String
,
backLimit
:
BackLimit
,
boolean
:
Boolean
=
true
):
super
()
{
this
.
url
=
url
if
(
boolean
)
{
this
.
backLimit
=
backLimit
...
...
@@ -69,7 +69,11 @@ class H5Params : Serializable {
var
phone
:
String
?
=
null
/**
* h5页面返回按钮限制(根据传入的backLimit判断返回至哪个页面)
* mainPage -- 首页
*/
var
backLimit
:
String
=
""
var
backLimit
:
BackLimit
=
BackLimit
.
NewUserBackLimit
enum
class
BackLimit
{
NewUserBackLimit
//新用户H5页面返回拦截
}
}
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
f7e35c52
...
...
@@ -623,10 +623,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
finish
();
}
else
if
(
"mainPage"
.
equals
(
h5Params
.
getBackLimit
()))
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
{
if
(
ActivityManager
.
Companion
.
getInstance
().
getActivitys
().
size
()
==
1
)
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
...
...
@@ -823,10 +819,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title
.
setImageListener
(
v
->
{
if
(
wv_content
.
canGoBack
())
{
wv_content
.
goBack
();
}
else
if
(
"mainPage"
.
equals
(
h5Params
.
getBackLimit
()))
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
{
finish
();
}
...
...
@@ -841,12 +833,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if
(
h5Params
.
getShowUrlTitle
())
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
if
(
"mainPage"
.
equals
(
h5Params
.
getBackLimit
()))
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
{
}
else
{
if
(
ActivityManager
.
Companion
.
getInstance
().
getActivitys
().
size
()
==
1
)
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
}
...
...
@@ -1140,11 +1127,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if
(
h5Params
.
isSplash
())
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
if
(
"mainPage"
.
equals
(
h5Params
.
getBackLimit
()))
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
}
else
{
}
else
{
if
(
ActivityManager
.
Companion
.
getInstance
().
getActivitys
().
size
()
==
1
)
{
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
}
...
...
@@ -1288,8 +1271,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
/**
* 如果进行返回按钮限制,则判断限制类型
*/
if
(
"mainPage"
.
equals
(
h5Params
.
getBackLimit
()))
{
ModularServiceManager
.
INSTANCE
.
provide
(
IAppService
.
class
).
mainIntent
(
this
);
if
(
H5Params
.
BackLimit
.
NewUserBackLimit
.
equals
(
h5Params
.
getBackLimit
()))
{
callJSFunc
(
"showGuideModal"
);
return
false
;
}
...
...
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