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
74820d6d
Commit
74820d6d
authored
Aug 24, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 扩展通用TopBar属性
parent
6d7ab05e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
CommonTopBarView.kt
...c/main/java/com/yidian/bcommon/widget/CommonTopBarView.kt
+9
-0
attrs.xml
CommonLib/BCommon/src/main/res/values/attrs.xml
+8
-0
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/widget/CommonTopBarView.kt
View file @
74820d6d
...
...
@@ -48,6 +48,15 @@ class CommonTopBarView @JvmOverloads constructor(
if
(
it
.
isNotEmpty
())
visibility
=
View
.
VISIBLE
viewBinding
.
tvAction
.
text
=
it
}
typeArray
.
getColor
(
R
.
styleable
.
CommonTopBarView_CommonTopBarView_bg_color
,
-
1
).
let
{
if
(
it
!=
-
1
)
viewBinding
.
root
.
setBackgroundColor
(
it
)
}
typeArray
.
getColor
(
R
.
styleable
.
CommonTopBarView_CommonTopBarView_title_text_color
,
-
1
).
let
{
if
(
it
!=
-
1
)
viewBinding
.
tvTitle
.
setTextColor
(
it
)
}
typeArray
.
getResourceId
(
R
.
styleable
.
CommonTopBarView_CommonTopBarView_back_img
,
-
1
).
let
{
if
(
it
!=
-
1
)
viewBinding
.
ivBack
.
setImageResource
(
it
)
}
typeArray
.
recycle
()
viewBinding
.
ivBack
.
setOnClickListener
(
this
)
...
...
CommonLib/BCommon/src/main/res/values/attrs.xml
View file @
74820d6d
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"CommonTopBarView"
>
<!--标题文字-->
<attr
name=
"CommonTopBarView_title_text"
format=
"string"
/>
<!--操作按钮文字-->
<attr
name=
"CommonTopBarView_action_text"
format=
"string"
/>
<!--整体背景色-->
<attr
name=
"CommonTopBarView_bg_color"
format=
"color"
/>
<!--标题文字颜色-->
<attr
name=
"CommonTopBarView_title_text_color"
format=
"color"
/>
<!--返回按钮图标-->
<attr
name=
"CommonTopBarView_back_img"
format=
"reference"
/>
</declare-styleable>
<declare-styleable
name=
"CommonEmptyPageView"
>
<attr
name=
"CommonEmptyPageView_place_holder_img"
format=
"reference"
/>
...
...
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