Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
ae828bf1
Commit
ae828bf1
authored
Dec 18, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改福袋大小
parent
82b27af0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
6 deletions
+43
-6
HorizonChannelFragment.kt
...com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
+2
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+9
-1
TimeRender.java
...p/src/main/java/com/mints/goodmoney/utils/TimeRender.java
+28
-0
layout_red_bag.xml
GoodMoney/app/src/main/res/layout/layout_red_bag.xml
+4
-4
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
View file @
ae828bf1
...
...
@@ -230,6 +230,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
cdvvYilanTime
.
layoutParams
=
params
cdvvYilanTime
.
setOnClickListener
(
this
)
rl_fragment_main_redbox
.
setOnClickListener
(
this
)
rl_fragment_main_redbox
.
isClickable
=
false
}
private
fun
initChannelFragment
()
{
...
...
@@ -303,7 +304,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
if
(!
requireActivity
().
isFinishing
)
{
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2
H
MS
(
millisUntilFinished
.
toInt
())
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
ae828bf1
...
...
@@ -4,7 +4,9 @@ import android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.View
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
androidx.fragment.app.FragmentTransaction
import
com.daimajia.androidanimations.library.Techniques
...
...
@@ -358,8 +360,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
val
params
=
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
)
params
.
setMargins
(
0
,
0
,
0
,
BubbleUtils
.
dp2px
(
270
))
cdvvYilanTime
.
layoutParams
=
params
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
60
),
0
,
0
)
paramsRedBox
.
gravity
=
Gravity
.
END
rl_fragment_main_redbox
.
layoutParams
=
paramsRedBox
cdvvYilanTime
.
setOnClickListener
(
this
)
rl_fragment_main_redbox
.
setOnClickListener
(
this
)
rl_fragment_main_redbox
.
isClickable
=
false
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
...
...
@@ -598,7 +606,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
if
(!
requireActivity
().
isFinishing
)
{
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2
H
MS
(
millisUntilFinished
.
toInt
())
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/TimeRender.java
View file @
ae828bf1
...
...
@@ -248,4 +248,32 @@ public class TimeRender {
HMStime
=
hourStr
+
":"
+
mintStr
+
":"
+
sedStr
;
return
HMStime
;
}
/**
* 时间格式化
*
* @param _ms
* @return
*/
public
static
String
ms2MS
(
int
_ms
)
{
String
HMStime
;
_ms
/=
1000
;
int
hour
=
_ms
/
3600
;
int
mint
=
(
_ms
%
3600
)
/
60
+
hour
*
60
;
int
sed
=
_ms
%
60
;
// String hourStr = String.valueOf(hour);
// if (hour < 10) {
// hourStr = "0" + hourStr;
// }
String
mintStr
=
String
.
valueOf
(
mint
);
if
(
mint
<
10
)
{
mintStr
=
"0"
+
mintStr
;
}
String
sedStr
=
String
.
valueOf
(
sed
);
if
(
sed
<
10
)
{
sedStr
=
"0"
+
sedStr
;
}
HMStime
=
mintStr
+
":"
+
sedStr
;
return
HMStime
;
}
}
GoodMoney/app/src/main/res/layout/layout_red_bag.xml
View file @
ae828bf1
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/rl_fragment_main_redbox"
android:layout_width=
"
75
dp"
android:layout_height=
"
75
dp"
android:layout_width=
"
50
dp"
android:layout_height=
"
50
dp"
android:layout_gravity=
"end"
android:layout_marginTop=
"100dp"
android:layout_marginEnd=
"10dp"
...
...
@@ -13,12 +13,12 @@
android:layout_width=
"wrap_content"
android:layout_height=
"12dp"
android:layout_gravity=
"center|bottom"
android:layout_marginBottom=
"
10
dp"
android:layout_marginBottom=
"
8
dp"
android:background=
"@drawable/shape_redbox_red"
android:gravity=
"center"
android:paddingStart=
"2dp"
android:paddingEnd=
"2dp"
android:text=
"可拆开"
android:textColor=
"@color/color_F28335"
android:textSize=
"
6
sp"
/>
android:textSize=
"
8
sp"
/>
</FrameLayout>
\ 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