mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-08 15:47:47 +00:00
Progressbars now go the other way
This commit is contained in:
parent
5c0b3177a6
commit
016cbd9ebc
1 changed files with 6 additions and 6 deletions
|
@ -59,7 +59,7 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
|
||||||
ProgressBar progressBar;
|
ProgressBar progressBar;
|
||||||
|
|
||||||
CountDownTimer mCountDownTimer;
|
CountDownTimer mCountDownTimer;
|
||||||
int i = 0;
|
int i = 100;
|
||||||
|
|
||||||
KeyProfileHolder(final View itemView) {
|
KeyProfileHolder(final View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
@ -90,24 +90,24 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
|
||||||
this.keyProfile.Code = otp;
|
this.keyProfile.Code = otp;
|
||||||
profileCode.setText(otp.substring(0, 3) + " " + otp.substring(3));
|
profileCode.setText(otp.substring(0, 3) + " " + otp.substring(3));
|
||||||
|
|
||||||
i = Math.round((float)keyProfile.Info.getMillisTillNextRotation() / (float)((keyProfile.Info.getPeriod() * 1000)) * 100);
|
i = Math.round(100 - ((float)keyProfile.Info.getMillisTillNextRotation() / (float)((keyProfile.Info.getPeriod() * 1000)) * 100));
|
||||||
if(i == 100)
|
if(i == 0)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 100;
|
||||||
}
|
}
|
||||||
progressBar.setProgress(i);
|
progressBar.setProgress(i);
|
||||||
|
|
||||||
mCountDownTimer = new CountDownTimer(keyProfile.Info.getMillisTillNextRotation(), (keyProfile.Info.getPeriod() * 1000 / 100)) {
|
mCountDownTimer = new CountDownTimer(keyProfile.Info.getMillisTillNextRotation(), (keyProfile.Info.getPeriod() * 1000 / 100)) {
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long millisUntilFinished) {
|
public void onTick(long millisUntilFinished) {
|
||||||
i++;
|
i--;
|
||||||
progressBar.setProgress(i);
|
progressBar.setProgress(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
//Do what you want
|
//Do what you want
|
||||||
i = 0;
|
i = 100;
|
||||||
progressBar.setProgress(i);
|
progressBar.setProgress(i);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue