Fix clear clipboard 20 times history (#465) (#487)

This commit is contained in:
rk0n 2019-02-28 20:15:35 +01:00 committed by Mohamed Zenadi
parent 88c84e4400
commit 0b6ba542a8
2 changed files with 4 additions and 2 deletions

View File

@ -116,7 +116,9 @@ class DecryptTest {
SystemClock.sleep(4000) SystemClock.sleep(4000)
// The clipboard should be cleared!! // The clipboard should be cleared!!
assertEquals("", clipboard.primaryClip.getItemAt(0).text) for(i in 0..clipboard.primaryClip.itemCount) {
assertEquals("", clipboard.primaryClip.getItemAt(i).text)
}
// set back the timer // set back the timer
activity.settings.edit().putString("general_show_time", showTime.toString()).commit() activity.settings.edit().putString("general_show_time", showTime.toString()).commit()

View File

@ -753,7 +753,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
clipboard.primaryClip = clip clipboard.primaryClip = clip
if (settings.getBoolean("clear_clipboard_20x", false)) { if (settings.getBoolean("clear_clipboard_20x", false)) {
val handler = Handler() val handler = Handler()
for (i in 0..18) { for (i in 0..19) {
val count = i.toString() val count = i.toString()
handler.postDelayed( handler.postDelayed(
{ clipboard.primaryClip = ClipData.newPlainText(count, count) }, { clipboard.primaryClip = ClipData.newPlainText(count, count) },