Commit f8f769c8 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 319242ee
......@@ -9,7 +9,6 @@ import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.loveplayletu.R
import com.duben.loveplayletu.mvp.model.OrderRecordBean
import com.duben.loveplayletu.ui.activitys.base.BaseActivity
import com.duben.loveplayletu.ui.widgets.SimpleCountDownTimer
import kotlinx.android.synthetic.main.activity_alipaytime.*
......@@ -46,7 +45,7 @@ class AlipayTimeActivity : BaseActivity(), View.OnClickListener {
ivBack.setOnClickListener(this)
countDownTimer = SimpleCountDownTimer(
((alipaytime) * 60 * 1000).toLong(),
((alipaytime)).toLong(),
tv_alipaytime
).setOnFinishListener {
finish()
......
......@@ -45,11 +45,12 @@ public class SimpleCountDownTimer extends CountDownTimer {
}
/**
* @param millisInFuture 倒计时总时间 单位:毫秒
* The number of millis in the future from the call
* to {@link #start()} until the countdown is done and {@link #onFinish()}
* is called.
* @param tvDisplay 显示时间的视图
* @param millisInFuture 倒计时总时间 单位:毫秒
* The number of millis in the future from the call
* to {@link #start()} until the countdown is done and {@link #onFinish()}
* is called.
*
* @param tvDisplay 显示时间的视图
*/
public SimpleCountDownTimer(long millisInFuture, TextView tvDisplay) {
super(millisInFuture, DEFAULT_INTERVAL);
......@@ -68,12 +69,13 @@ public class SimpleCountDownTimer extends CountDownTimer {
long lMin = (millisUntilFinished - lHr * hr) / min;
long lSec = (millisUntilFinished - lHr * hr - lMin * min) / sec;
long lMs = millisUntilFinished - lHr * hr - lMin * min - lSec * sec;
String strLHr = getTime(lHr);
String strLMin = getTime(lMin);
String strLSec = getTime(lSec);
String strLMs = getMs(lMs);
// 依次拼接时间 时:分:秒:毫秒
// tvDisplay.setText(strLHr + ":" + strLMin + ":" + strLSec + ":" + strLMs);
tvDisplay.setText(strLMin + ":" + strLSec + ":" + strLMs);
tvDisplay.setText( strLMin + ":" + strLSec + ":" + strLMs);
}
......
......@@ -35,8 +35,8 @@
<TextView
android:id="@+id/tv_alipaytime"
android:layout_width="130dp"
android:layout_height="42dp"
android:layout_width="140dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/shape_bg_write"
android:gravity="center"
......@@ -51,6 +51,6 @@
android:gravity="center_horizontal"
android:layout_marginTop="20dp"
android:textSize="15sp"
android:textColor="@color/order_color"
android:textColor="@color/white"
android:text="请耐心等待~\n注意:若取消开通,默认不参与返现活动"></TextView>
</LinearLayout>
......@@ -245,10 +245,10 @@
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/iv_kefu_main"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="100dp"
android:layout_marginBottom="120dp"
android:visibility="gone"
app:lottie_fileName="main_alipay.json"
app:lottie_autoPlay="true"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment