Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdk-public
sdk-demo
Commits
fd25d4fc
Commit
fd25d4fc
authored
May 17, 2022
by
zhengyingbing
Browse files
feat(app):删除无用的类
parent
6b89a024
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/hl/account/MineItemView.java
deleted
100644 → 0
View file @
6b89a024
package
com.hl.account
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.drawable.Drawable
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.core.content.ContextCompat
;
import
com.hoolai.demo.R
;
public
class
MineItemView
extends
LinearLayout
{
//构造方法
public
MineItemView
(
Context
context
)
{
super
(
context
);
}
public
MineItemView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
initView
(
context
,
attrs
);
}
public
MineItemView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
initView
(
context
,
attrs
);
}
//初始化View
private
void
initView
(
Context
context
,
AttributeSet
attrs
)
{
LayoutInflater
inflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
hl_account_main_textview
,
this
,
true
);
ImageView
leftImg
=
view
.
findViewById
(
R
.
id
.
mine_item_img
);
ImageView
rightImgView
=
view
.
findViewById
(
R
.
id
.
mine_item_next
);
TextView
titleView
=
view
.
findViewById
(
R
.
id
.
mine_item_title
);
TypedArray
typedArray
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
MineItemView
);
String
title
=
typedArray
.
getString
(
R
.
styleable
.
MineItemView_title
);
Drawable
leftDrawable
=
typedArray
.
getDrawable
(
R
.
styleable
.
MineItemView_leftImg
);
Drawable
rightDrawable
=
typedArray
.
getDrawable
(
R
.
styleable
.
MineItemView_rightImg
);
typedArray
.
recycle
();
if
(
leftDrawable
==
null
)
{
leftDrawable
=
ContextCompat
.
getDrawable
(
context
,
R
.
mipmap
.
ic_launcher
);
}
leftImg
.
setBackground
(
leftDrawable
);
if
(
rightDrawable
==
null
)
{
rightDrawable
=
ContextCompat
.
getDrawable
(
context
,
R
.
mipmap
.
ic_launcher
);
}
rightImgView
.
setBackground
(
rightDrawable
);
titleView
.
setText
(
title
);
}
}
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