-1
Ich habe ein Problem mit ProgressBar, weil es nicht richtig angezeigt wird.Progressbar wird nicht korrekt angezeigt
Code:
private void setTimer() {
if(np3.getValue() == 0){
time_one = (np1.getValue()) + (np2.getValue() * 60);
totalTimeCountInMilliseconds = time_one * 1000;
} else {
time_two = (np1.getValue()) + (np2.getValue() * 60) + ((np3.getValue() * 3600)-3600);
totalTimeCountInMilliseconds = time_two * 1000;
}
np1.setVisibility(View.GONE);
np2.setVisibility(View.GONE);
np3.setVisibility(View.GONE);
textViewShowTime.setVisibility(View.VISIBLE);
timeseconds = 10 * 1000;
}
private void startTimer() {
countDownTimer = new CountDownTimer(totalTimeCountInMilliseconds, 500) {
@Override
public void onTick(long leftTimeInMilliseconds) {
if (leftTimeInMilliseconds <= timeseconds) {
if(change == false){
textViewShowTime.setVisibility(View.VISIBLE);
textViewShowTime.setTextSize(20);
textViewShowTime.setTextAppearance(getApplicationContext(),
R.style.RedText);
change = true;
} else{
textViewShowTime.setVisibility(View.GONE);
change = false;
}
}
if(np3.getValue() == 0){
Date date = new Date(leftTimeInMilliseconds);
DateFormat formatter = new SimpleDateFormat("mm:ss");
String dateFormatted = formatter.format(date);
textViewShowTime.setText(String.format(dateFormatted));
textViewShowTime.setTextSize(40);
pb.setVisibility(View.VISIBLE);
if(progressStatus <100){
int end_time = 100/time_one;
progressStatus += end_time;
pb.setProgress(progressStatus);
}
änderte ich schon, aber dann hatte ich ein Problem mit dem blinkenden Text zu sagen, dass es nicht das, was ich wollte:/ – tomecki
ich geändert und jetzt gibt es so etwas https://drive.google.com/file/d/0B3LWRfNDCNdBSHB6RGRxTUYydXc/view?usp=sharing – tomecki
können Sie Ihre Frage aktualisieren. –