Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
X
xxsq
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
xxsq
Commits
a056df77
Commit
a056df77
authored
May 31, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :小象省钱 [实现方案] :调整UI
parent
9be26765
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
117 deletions
+139
-117
H5Activity.kt
cms/src/main/java/com/zxhl/cms/common/H5Activity.kt
+11
-8
HomeFragment.kt
...rc/main/java/com/zxbw/modulemain/fragment/HomeFragment.kt
+4
-1
icon_kefu.png
moduleMain/src/main/res/drawable-xhdpi/icon_kefu.png
+0
-0
img_rights_title_bg.png
...eMain/src/main/res/drawable-xhdpi/img_rights_title_bg.png
+0
-0
activity_layout_rights_detail.xml
...ain/src/main/res/layout/activity_layout_rights_detail.xml
+1
-1
fragment_layout_home.xml
moduleMain/src/main/res/layout/fragment_layout_home.xml
+123
-107
No files found.
cms/src/main/java/com/zxhl/cms/common/H5Activity.kt
View file @
a056df77
...
...
@@ -29,7 +29,8 @@ class H5Activity : AppCompatActivity() {
id_activity_web_view
?.
loadUrl
(
url
)
initWebView
()
}
fun
initWebView
(){
fun
initWebView
()
{
val
webSettings
=
mWebView
!!
.
getSettings
()
//如果访问的页面中要与Javascript交互,则webview必须设置支持Javascript
webSettings
.
javaScriptEnabled
=
true
...
...
@@ -73,9 +74,9 @@ class H5Activity : AppCompatActivity() {
override
fun
onProgressChanged
(
view
:
WebView
?,
newProgress
:
Int
)
{
super
.
onProgressChanged
(
view
,
newProgress
)
if
(
newProgress
==
100
)
{
if
(
newProgress
==
100
)
{
id_webview_progress_view
.
visibility
=
View
.
GONE
}
else
{
}
else
{
id_webview_progress_view
.
visibility
=
View
.
VISIBLE
id_webview_progress_view
.
progress
=
newProgress
}
...
...
@@ -84,7 +85,7 @@ class H5Activity : AppCompatActivity() {
mWebView
?.
setWebViewClient
(
object
:
WebViewClient
()
{
override
fun
shouldOverrideUrlLoading
(
wv
:
WebView
,
url
:
String
):
Boolean
{
Log
.
e
(
"MXL"
,
"URL"
+
url
)
Log
.
e
(
"MXL"
,
"URL"
+
url
)
if
(
url
==
null
)
return
false
try
{
if
(
url
.
startsWith
(
"weixin://"
)
//微信
...
...
@@ -96,6 +97,7 @@ class H5Activity : AppCompatActivity() {
||
url
.
startsWith
(
"openapp.jdmobile://"
)
//淘宝
||
url
.
startsWith
(
"tmast://"
)
//淘宝
||
url
.
startsWith
(
"pinduoduo://"
)
//拼多多
||
url
.
startsWith
(
"imeituan://"
)
//美团
//其他自定义的scheme
)
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url
))
...
...
@@ -133,17 +135,18 @@ class H5Activity : AppCompatActivity() {
}
})
}
var
firstLoad
:
Boolean
=
false
var
firstLoad
:
Boolean
=
false
override
fun
onPause
()
{
super
.
onPause
()
firstLoad
=
true
firstLoad
=
true
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
firstLoad
)
{
if
(
firstLoad
)
{
//从支付宝回来
Log
.
e
(
"MXL"
,
"从支付宝回来"
)
Log
.
e
(
"MXL"
,
"从支付宝回来"
)
finish
()
}
}
...
...
moduleMain/src/main/java/com/zxbw/modulemain/fragment/HomeFragment.kt
View file @
a056df77
...
...
@@ -60,6 +60,9 @@ class HomeFragment : BaseFragment(), HomeContract.View {
id_rl_search_view
.
setOnClickListener
{
showToast
(
"搜索"
)
}
id_img_kefu
.
setOnClickListener
{
showToast
(
"客服"
)
}
val
config
=
SettingPreference
.
getConfig
();
if
(
config
!=
null
&&
!
config
.
tabs
.
isNullOrEmpty
())
{
...
...
@@ -104,7 +107,7 @@ class HomeFragment : BaseFragment(), HomeContract.View {
indicator_view
.
setupWithViewPager
(
id_home_top_banner
)
}
private
fun
setHomeTabColor
(
bannerType
:
String
)
{
private
fun
setHomeTabColor
(
bannerType
:
String
)
{
if
(
bannerType
.
equals
(
"blindBox"
))
{
id_fragment_home_tab
.
textSelectColor
=
Color
.
parseColor
(
"#FFFFFF"
)
id_fragment_home_tab
.
textUnselectColor
=
Color
.
parseColor
(
"#FCFFFFFF"
)
...
...
moduleMain/src/main/res/drawable-xhdpi/icon_kefu.png
0 → 100644
View file @
a056df77
4.59 KB
moduleMain/src/main/res/drawable-xhdpi/img_rights_title_bg.png
View replaced file @
9be26765
View file @
a056df77
232 KB
|
W:
|
H:
249 KB
|
W:
|
H:
2-up
Swipe
Onion skin
moduleMain/src/main/res/layout/activity_layout_rights_detail.xml
View file @
a056df77
...
...
@@ -14,7 +14,7 @@
android:id=
"@+id/id_rights_detail_title_sys_bar_view"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginBottom=
"
5
dp"
/>
android:layout_marginBottom=
"
10
dp"
/>
<ImageView
android:id=
"@+id/id_img_back"
...
...
moduleMain/src/main/res/layout/fragment_layout_home.xml
View file @
a056df77
<?xml version="1.0" encoding="utf-8"?>
<
androidx.coordinatorlayout.widget.Coordinator
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tl=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#F6F6F6"
>
...
...
@@ -131,4 +135,16 @@
android:layout_height=
"match_parent"
tl:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<ImageView
android:id=
"@+id/id_img_kefu"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
android:layout_marginRight=
"16dp"
android:layout_marginBottom=
"10dp"
android:src=
"@drawable/icon_kefu"
/>
</RelativeLayout>
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