标签: countdowntimer

在倒数计时器中跟踪每一分钟

我希望在每分钟完成后显示一个Toast消息.我正在使用倒计时器并在文本视图中显示计时器.请帮我解决这个问题.以下是我的代码.

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.track_me_mode);
    counter = new MyCount (length,10);
    counter.start();
    }
    });
         public class MyCount extends CountDownTimer {
        Context mContext;

        public MyCount(long millisInFuture, long countDownInterval) {
          super(millisInFuture, countDownInterval);
        }


        public void onTick (long millisUntilFinished) {
            timerView.setText ( formatTime(millisUntilFinished));


          }

        public void onFinish() {


              }

            }
public String formatTime(long millis) {
    output = "";
    long seconds = millis / 1000;
    long minutes = seconds / 60;
    long hours=minutes/ 60;

    seconds = seconds % 60;
    minutes = …
Run Code Online (Sandbox Code Playgroud)

android countdowntimer

1
推荐指数
1
解决办法
3779
查看次数

Android 定时器正在服务中

您好,计划为该活动开发带有开始和停止按钮的 Android 倒数计时器应用程序,当用户单击开始按钮时显示计时器倒计时,并且即使计时器在后台运行,如果用户单击停止,则仅停止计时器,用户也会转到剩余的活动。

我如何在服务中运行计时器并将时间更新到活动android中的textview。

android timer stopwatch timertask countdowntimer

1
推荐指数
1
解决办法
5315
查看次数

在textview Android中显示秒数倒计时

我有一个定时器,有一个秒数从一直到0倒数,所以如果我把5个textview标签,我希望它显示5,4,3,2,1,0,我已经有了计时器停止.我传入用户选择的随机数,所以我将变量S传递给计时器

我的观点:

 mSeconds = (TextView)findViewById(R.id.secondsLabel);
Run Code Online (Sandbox Code Playgroud)

我的计时器:

int s = //int taken from on spinner in another class

Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                finish();
            }
        }, s * 1000);
Run Code Online (Sandbox Code Playgroud)

所以当我把mSeconds.setText(//what should i add here);数字显示为0时

java int android textview countdowntimer

1
推荐指数
1
解决办法
1184
查看次数

如何在视图上创建带动画的倒数计时器

如何创建View这样的

在此输入图像描述

在测验游戏中,每个级别,这View将倒计时,选择的答案越快,得分就越高.所以,第一件事就是如何把时间花在这上面View.

android countdowntimer

1
推荐指数
1
解决办法
3044
查看次数

如何使颤动倒数?

我如何获得一个计时器小部件,该计时器小部件在时间到期后导航到另一个屏幕,或者在滑动手势后重新启动?

timer dart countdowntimer flutter

1
推荐指数
1
解决办法
2684
查看次数

how to fill a 100% progress bar according to the time specified by the user

I'm creating a progress bar to use in a pomodoro. The idea is that this bar is filled 100% according to the time specified in the pomodoro. Example if it is 30 min then at 30 minutes it must reach 100%.

let progressBar = document.getElementById("progressBar");
let value = 30
let seconds = 120

let dataValue = progressBar.setAttribute("data-value", `${value}`)

dataAttribute = progressBar.getAttribute('data-value');
console.log(dataAttribute)

let bar = 0


progressBar.style.width = bar;

let id = setInterval(function(){
    bar++;
    progressBar.style.width = bar + "%"
    if …
Run Code Online (Sandbox Code Playgroud)

html javascript css countdowntimer progress-bar

1
推荐指数
1
解决办法
6217
查看次数

Flutter :显示天、小时、分钟和秒的倒计时小部件

我正在尝试构建一个扩展的小部件,它将显示剩余的天数、小时数、分钟数和秒数(参见屏幕截图)。

我怎样才能实现这个目标?

我已经阅读了一大堆颤振文档,但仍无法正确创建它。

我正在尝试构建的小部件的屏幕截图

谢谢您的帮助!

dart countdowntimer flutter

1
推荐指数
1
解决办法
5057
查看次数

Javascript JQuery倒计时器

我正在尝试为日期/时间创建一个简单的倒数计时器.

我目前只有以下几天去脚本工作正常:

<div id="countdown">

today = new Date();
BigDay = new Date("March 29, 2013");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
document.write(daysLeft + " days to go!");

</div>
Run Code Online (Sandbox Code Playgroud)

我现在正在尝试创建一个完整的倒数计时器(包括小时,分钟和秒),并创建了以下脚本.html没有显示在页面上.

var today = new Date();
var BigDay = new Date("29 03 2013, 14:30:00");
var msPerDay = 24 * 60 * 60 * 1000 ;
var timeLeft = (BigDay.getTime() - today.getTime());
var e_daysLeft = timeLeft / …
Run Code Online (Sandbox Code Playgroud)

html jquery countdowntimer

0
推荐指数
1
解决办法
7226
查看次数

TimeSpan倒数计时器

我正在尝试通过以下方式在我的应用程序中显示倒计时:

private TimeSpan ts = new TimeSpan()


ts = ts.Subtract(TimeSpan.FromSeconds(1));
label4.Text = ts.ToString(@"hh\:mm\:ss");
Run Code Online (Sandbox Code Playgroud)

但是,它不显示倒计时,但实际上会增加时间。如果我移除@"hh\:mm\:ss"零件,那么我会在数秒内倒数,但不是真正的倒数。它所-1, -2, -3,要做的就是在秒之前添加一个减号,所以它确实如此...我希望它在10 to 0 so -9, -8, -7,等时说出来...

如何才能以的形式进行真正的倒计时hh:mm:ss

c# timer countdown countdowntimer

0
推荐指数
1
解决办法
4280
查看次数

如何在 HH:MM:SS(小时:分钟:秒)中显示倒数计时器

如何从我制作的 XMl android 中倒计时 'HH: mm: ss',当 24 小时内没有交互时,则无法再次进行交易或无法再次访问

此代码是倒数计时器的设计 UI。

倒计时器

<androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/constrainlayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="20dp"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="18dp"
        android:layout_marginEnd="20dp"
        android:layout_marginRight="20dp"
        android:background="@drawable/bg_color_orange"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/app_bar">

        <TextView
            android:id="@+id/textView_Title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="18dp"
            android:text="Please make a payment Immediatelly"
            android:textColor="@android:color/black"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/constrainlayout" />

        <TextView
            android:id="@+id/textView_TimeCountDown"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="18dp"
            android:text="13 Hour: 59 Minute: 21 Second"
            android:textColor="@android:color/black"
            android:textSize="22sp"
            app:layout_constraintEnd_toEndOf="@+id/textView_Title"
            app:layout_constraintStart_toStartOf="@+id/textView_Title"
            app:layout_constraintTop_toBottomOf="@+id/textView_Title" />

        <TextView
            android:id="@+id/textView_Day"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="18dp"
            android:layout_marginBottom="18dp"
            android:text="(Before Thursday, 16 January 2020, 13:33 WIB)"
            android:textColor="@android:color/black"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="@+id/textView_Title"
            app:layout_constraintStart_toStartOf="@+id/textView_Title"
            app:layout_constraintTop_toBottomOf="@id/textView_TimeCountDown" />

    </androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

该代码将像这样显示

倒计时器

java android countdown countdowntimer kotlin

0
推荐指数
1
解决办法
4270
查看次数