0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-28 22:13:01 +00:00

fixed version code comparison

This commit is contained in:
X1nto 2021-04-27 00:27:11 +04:00
parent 9368af2187
commit 9db254d2f2

View file

@ -89,7 +89,7 @@ open class DataModel(
return when {
int1 == 0 -> ButtonTag.INSTALL
int2 > int1 -> ButtonTag.UPDATE
int2 == int1 || int1 > int2 -> ButtonTag.REINSTALL
int1 >= int2 -> ButtonTag.REINSTALL
else -> ButtonTag.INSTALL
}
}
@ -100,8 +100,8 @@ open class DataModel(
if (int2 != null && int1 != null) {
return when {
int1 == 0 -> ContextCompat.getDrawable(context, R.drawable.ic_app_download)!!
int1 == int2 -> ContextCompat.getDrawable(context, R.drawable.ic_app_reinstall)!!
int2 > int1 -> ContextCompat.getDrawable(context, R.drawable.ic_app_update)!!
int1 >= int2 -> ContextCompat.getDrawable(context, R.drawable.ic_app_reinstall)!!
else -> ContextCompat.getDrawable(context, R.drawable.ic_app_download)!!
}
}