Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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
android
android_vedio
Commits
542e90fe
Commit
542e90fe
authored
Jul 25, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b96018f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
7 deletions
+31
-7
PanelItemView.java
.../helivideo/ui/widgets/luckymonkeypanel/PanelItemView.java
+10
-1
PanelItemView2.java
...helivideo/ui/widgets/luckymonkeypanel/PanelItemView2.java
+10
-1
bg_lucky_monkey_item_overlay.xml
...pp/src/main/res/drawable/bg_lucky_monkey_item_overlay.xml
+1
-1
bg_lucky_monkey_item_overlay2.xml
...p/src/main/res/drawable/bg_lucky_monkey_item_overlay2.xml
+8
-0
view_panel_item.xml
video/app/src/main/res/layout/view_panel_item.xml
+1
-2
view_panel_item2.xml
video/app/src/main/res/layout/view_panel_item2.xml
+1
-2
No files found.
video/app/src/main/java/com/mints/helivideo/ui/widgets/luckymonkeypanel/PanelItemView.java
View file @
542e90fe
package
com
.
mints
.
helivideo
.
ui
.
widgets
.
luckymonkeypanel
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.view.View
;
...
...
@@ -8,6 +9,8 @@ import android.widget.FrameLayout;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.core.content.ContextCompat
;
import
com.mints.helivideo.R
;
/**
...
...
@@ -19,6 +22,8 @@ public class PanelItemView extends FrameLayout implements ItemView {
private
View
overlay
;
private
TextView
tv_panel_item_text
;
private
ImageView
iv_panel_item_pic
;
private
Drawable
drawable
;
private
Drawable
drawable2
;
public
PanelItemView
(
Context
context
)
{
this
(
context
,
null
);
...
...
@@ -34,6 +39,8 @@ public class PanelItemView extends FrameLayout implements ItemView {
overlay
=
findViewById
(
R
.
id
.
overlay
);
iv_panel_item_pic
=
findViewById
(
R
.
id
.
iv_panel_item_pic
);
tv_panel_item_text
=
findViewById
(
R
.
id
.
tv_panel_item_text
);
drawable
=
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
bg_lucky_monkey_item_overlay
);
drawable2
=
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
bg_lucky_monkey_item_overlay2
);
}
public
void
setStyle
(
String
type
,
String
text
)
{
...
...
@@ -50,7 +57,9 @@ public class PanelItemView extends FrameLayout implements ItemView {
@Override
public
void
setFocus
(
boolean
isFocused
)
{
if
(
overlay
!=
null
)
{
overlay
.
setVisibility
(
isFocused
?
INVISIBLE
:
VISIBLE
);
// overlay.setVisibility(isFocused ? INVISIBLE : VISIBLE);
overlay
.
setBackground
(
isFocused
?
drawable
:
drawable2
);
}
}
...
...
video/app/src/main/java/com/mints/helivideo/ui/widgets/luckymonkeypanel/PanelItemView2.java
View file @
542e90fe
package
com
.
mints
.
helivideo
.
ui
.
widgets
.
luckymonkeypanel
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.view.View
;
...
...
@@ -8,6 +9,8 @@ import android.widget.FrameLayout;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.core.content.ContextCompat
;
import
com.mints.helivideo.R
;
/**
...
...
@@ -19,6 +22,8 @@ public class PanelItemView2 extends FrameLayout implements ItemView {
private
View
overlay
;
private
TextView
tv_panel_item_text
;
private
ImageView
iv_panel_item_pic
;
private
Drawable
drawable
;
private
Drawable
drawable2
;
public
PanelItemView2
(
Context
context
)
{
this
(
context
,
null
);
...
...
@@ -34,6 +39,8 @@ public class PanelItemView2 extends FrameLayout implements ItemView {
overlay
=
findViewById
(
R
.
id
.
overlay
);
iv_panel_item_pic
=
findViewById
(
R
.
id
.
iv_panel_item_pic
);
tv_panel_item_text
=
findViewById
(
R
.
id
.
tv_panel_item_text
);
drawable
=
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
bg_lucky_monkey_item_overlay
);
drawable2
=
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
bg_lucky_monkey_item_overlay2
);
}
public
void
setStyle
(
String
type
,
String
text
)
{
...
...
@@ -50,7 +57,9 @@ public class PanelItemView2 extends FrameLayout implements ItemView {
@Override
public
void
setFocus
(
boolean
isFocused
)
{
if
(
overlay
!=
null
)
{
overlay
.
setVisibility
(
isFocused
?
INVISIBLE
:
VISIBLE
);
// overlay.setVisibility(isFocused ? INVISIBLE : VISIBLE);
overlay
.
setBackground
(
isFocused
?
drawable
:
drawable2
);
}
}
...
...
video/app/src/main/res/drawable/bg_lucky_monkey_item_overlay.xml
View file @
542e90fe
...
...
@@ -2,7 +2,7 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#
3
0000000"
/>
<solid
android:color=
"#
8
0000000"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/bg_lucky_monkey_item_overlay2.xml
0 → 100755
View file @
542e90fe
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/full_transparent"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/layout/view_panel_item.xml
View file @
542e90fe
...
...
@@ -36,8 +36,7 @@
<View
android:id=
"@+id/overlay"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/bg_lucky_monkey_item_overlay"
/>
android:layout_height=
"match_parent"
/>
</RelativeLayout>
...
...
video/app/src/main/res/layout/view_panel_item2.xml
View file @
542e90fe
...
...
@@ -35,8 +35,7 @@
<View
android:id=
"@+id/overlay"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/bg_lucky_monkey_item_overlay"
/>
android:layout_height=
"match_parent"
/>
</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