mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-19 16:30:23 +00:00
Merge pull request #177 from alexbakker/fix-175
Correctly display codes with an uneven number of digits
This commit is contained in:
commit
e962d91c77
1 changed files with 11 additions and 9 deletions
|
@ -156,17 +156,19 @@ public class EntryHolder extends RecyclerView.ViewHolder {
|
||||||
private void updateCode() {
|
private void updateCode() {
|
||||||
OtpInfo info = _entry.getInfo();
|
OtpInfo info = _entry.getInfo();
|
||||||
|
|
||||||
String text;
|
String otp = info.getOtp();
|
||||||
if (info instanceof SteamInfo) {
|
if (!(info instanceof SteamInfo)) {
|
||||||
text = info.getOtp();
|
StringBuilder sb = new StringBuilder();
|
||||||
} else {
|
for (int i = 0; i < otp.length(); i++) {
|
||||||
String otp = info.getOtp();
|
if (i != 0 && i % 3 == 0) {
|
||||||
text = otp.substring(0, (otp.length() / 2)
|
sb.append(" ");
|
||||||
+ (otp.length() % 2)) + " "
|
}
|
||||||
+ otp.substring(otp.length() / 2);
|
sb.append(otp.charAt(i));
|
||||||
|
}
|
||||||
|
otp = sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
_profileCode.setText(text);
|
_profileCode.setText(otp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void revealCode() {
|
public void revealCode() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue