Rewrite layout of EditEntryActivity to not use TableLayout

This prevents excessive overdraw and fixes the UI tests
This commit is contained in:
Alexander Bakker 2021-01-24 12:53:29 +01:00
parent 44ff321f8f
commit 68436fba9c
8 changed files with 130 additions and 135 deletions

View file

@ -39,7 +39,7 @@ public class HotpInfo extends OtpInfo {
}
@Override
public String getType() {
public String getTypeId() {
return ID;
}

View file

@ -26,7 +26,11 @@ public abstract class OtpInfo implements Serializable {
public abstract String getOtp();
public abstract String getType();
public abstract String getTypeId();
public String getType() {
return getType().toUpperCase();
}
public JSONObject toJson() {
JSONObject obj = new JSONObject();
@ -127,7 +131,7 @@ public abstract class OtpInfo implements Serializable {
}
OtpInfo info = (OtpInfo) o;
return getType().equals(info.getType())
return getTypeId().equals(info.getTypeId())
&& Arrays.equals(getSecret(), info.getSecret())
&& getAlgorithm(false).equals(info.getAlgorithm(false))
&& getDigits() == info.getDigits();

View file

@ -28,7 +28,13 @@ public class SteamInfo extends TotpInfo {
}
@Override
public String getType() {
public String getTypeId() {
return ID;
}
@Override
public String getType() {
String id = getTypeId();
return id.substring(0, 1).toUpperCase() + id.substring(1);
}
}

View file

@ -44,7 +44,7 @@ public class TotpInfo extends OtpInfo {
}
@Override
public String getType() {
public String getTypeId() {
return ID;
}

View file

@ -172,7 +172,7 @@ public class EditEntryActivity extends AegisActivity {
_textSecret.setText(secretString);
}
_dropdownType.setText(_origEntry.getInfo().getType().toUpperCase(), false);
_dropdownType.setText(_origEntry.getInfo().getTypeId().toUpperCase(), false);
_dropdownAlgo.setText(_origEntry.getInfo().getAlgorithm(false), false);
String group = _origEntry.getGroup();

View file

@ -53,7 +53,7 @@ public class VaultEntry extends UUIDMap.Value {
JSONObject obj = new JSONObject();
try {
obj.put("type", _info.getType());
obj.put("type", _info.getTypeId());
obj.put("uuid", getUUID().toString());
obj.put("name", _name);
obj.put("issuer", _issuer);