CatimaLoyalty / Android

Catima, a Loyalty Card & Ticket Manager for Android
https://catima.app
GNU General Public License v3.0
809 stars 146 forks source link

Option to disable the edit button on the lock screen #1857

Open ikanakova opened 4 months ago

ikanakova commented 4 months ago

It would be great if there was an option to hide the edit button on the lock screen, as I often inadvertently press it because it's where my phone has fingerprint unlock.

TheLastProject commented 4 months ago

I suppose you mean when "Prevent screen lock" is enabled in Catima settings and you turned off and on your screen again?

Probably not that hard to implement. I'm not quite sure about it. I see your point (accidental press), but I also see how other users could be confused that "the edit button disappeared". Having more opinions and pros and cons here would be useful :)

ikanakova commented 4 months ago

I have Keep screen on and Prevent screen lock enabled. But I like the option to lock the phone with the screen on and the code, but the edit button bothers me. An "edit button on locked screen" with a disable / enable option would be a cool feature. Edit: If I accidentally press the edit button when the screen is locked then after unlocking I'm in the Edit Card and I don't want that.

TheLastProject commented 4 months ago

I'm definitely not interested in adding another setting. I strongly watch out to try to have as little settings as possible in Catima to keep it easy to find the settings that matter, keep the amount of code paths down (every extra code path introduces a chance for extra bugs).

I've been thinking of this issue a bit more and I think the general issue here is not so much the edit button specifically, but the fact that drawing over the lock screen means the UI could be interacted with when people expect the device to be locked. This could either be accidental UI presses in someone's pants, but also a clumsy handover to a cashier causing a card to be unfavourited or left.

Because of this, I think it may be worth considering to, instead of just hiding the edit button, do the following:

  1. Hide all the UI elements that would change the state of the card or activate activity switches ("Edit", "Quick spend/receive", "Share", "Star", "Duplicate", "Archive", "Delete")
  2. Show some kind of message (maybe a Snackbar? Not sure) that says that some options are hidden because the device is locked and to unlock the device to get access to all options, that can be tapped to unlock. I haven't tested it, but it seems like [isKeyguardLocked](https://developer.android.com/reference/android/app/KeyguardManager#isKeyguardLocked()) and requestDismissKeyguard functions should make this possible to do.