mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix initial selection
This commit is contained in:
@@ -82,30 +82,23 @@ public class EphemeralMessagesDialog {
|
||||
if (timespan == 0) {
|
||||
return 0; // off
|
||||
}
|
||||
|
||||
// Choose timespan close to the current one out of available options.
|
||||
if (timespan < TimeUnit.MINUTES.toSeconds(5)) {
|
||||
return 1; // 1 minute
|
||||
}
|
||||
if (timespan < TimeUnit.MINUTES.toSeconds(30)) {
|
||||
return 2; // 5 minutes
|
||||
}
|
||||
if (timespan < TimeUnit.HOURS.toSeconds(1)) {
|
||||
return 3; // 30 minutes
|
||||
return 1; // 5 minutes
|
||||
}
|
||||
if (timespan < TimeUnit.DAYS.toSeconds(1)) {
|
||||
return 4; // 1 hour
|
||||
return 2; // 1 hour
|
||||
}
|
||||
if (timespan < TimeUnit.DAYS.toSeconds(7)) {
|
||||
return 5; // 1 day
|
||||
return 3; // 1 day
|
||||
}
|
||||
if (timespan < TimeUnit.DAYS.toSeconds(35)) {
|
||||
return 6; // 1 week
|
||||
return 4; // 1 week
|
||||
}
|
||||
if (timespan < TimeUnit.DAYS.toSeconds(365)) {
|
||||
return 7; // 5 weeks
|
||||
return 5; // 5 weeks
|
||||
}
|
||||
return 8; // 1 year
|
||||
return 6; // 1 year
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user