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
288f1e3b
Commit
288f1e3b
authored
Jul 05, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否有导航栏判断
parent
247de44c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
config.gradle
config.gradle
+1
-1
ConfideBottomSheetDialogFragment.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
+5
-1
ScreenUtil.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ScreenUtil.java
+25
-1
No files found.
config.gradle
View file @
288f1e3b
ext
{
dev_mode
=
false
ydl2PublishVersion
=
"0.2.0"
ydl2PublishVersion
=
"0.2.0
.2
"
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
View file @
288f1e3b
...
...
@@ -37,6 +37,7 @@ import com.ydl.webview.ProgressWebView
import
com.ydl.webview.TellData
import
com.ydl.webview.WebModularServiceUtils
import
com.ydl.ydlcommon.modular.findRouteService
import
com.ydl.ydlcommon.utils.ScreenUtil
import
com.ydl.ydlcommon.utils.TimeUtil
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.dialog.CommonDialog
...
...
@@ -292,7 +293,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
val
layoutParams
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
).
apply
{
gravity
=
Gravity
.
BOTTOM
or
Gravity
.
CENTER_HORIZONTAL
}
).
apply
{
gravity
=
Gravity
.
BOTTOM
or
Gravity
.
CENTER_HORIZONTAL
bottomMargin
=
ScreenUtil
.
getNavBarHeight
(
context
)
}
dialog
?.
window
?.
addContentView
(
itemView
,
layoutParams
)
bottomSheet
=
(
it
as
BottomSheetDialog
).
findViewById
<
View
>(
com
.
google
.
android
.
material
.
R
.
id
.
design_bottom_sheet
)
as
FrameLayout
?
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ScreenUtil.java
View file @
288f1e3b
...
...
@@ -2,8 +2,11 @@ package com.ydl.ydlcommon.utils;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
com.ydl.ydlcommon.base.BaseApp
;
import
java.lang.reflect.Field
;
...
...
@@ -118,6 +121,7 @@ public class ScreenUtil {
}
public
static
int
getNavBarHeight
(
Context
context
)
{
if
(
hasNavBarHide
(
context
))
return
0
;
Resources
resources
=
context
.
getResources
();
int
resourceId
=
resources
.
getIdentifier
(
"navigation_bar_height"
,
"dimen"
,
"android"
);
if
(
resourceId
>
0
)
{
...
...
@@ -125,4 +129,23 @@ public class ScreenUtil {
}
return
0
;
}
}
public
static
boolean
hasNavBarHide
(
Context
context
){
return
Settings
.
Global
.
getInt
(
context
.
getContentResolver
(),
getNavBarShowKey
(),
0
)
!=
0
;
}
private
static
String
getNavBarShowKey
()
{
String
brand
=
Build
.
BRAND
;
if
(
brand
.
equalsIgnoreCase
(
"HUAWEI"
))
{
return
"navigationbar_is_min"
;
}
else
if
(
brand
.
equalsIgnoreCase
(
"XIAOMI"
))
{
return
"force_fsg_nav_bar"
;
}
else
if
(
brand
.
equalsIgnoreCase
(
"VIVO"
))
{
return
"navigation_gesture_on"
;
}
else
if
(
brand
.
equalsIgnoreCase
(
"OPPO"
))
{
return
"navigation_gesture_on"
;
}
else
{
return
"navigationbar_is_min"
;
}
}
}
\ No newline at end of file
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