[android] Fix copied to clipboard not showing when on lock screen #7246
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#7246
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "copy-to-clipboard-toast"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The issue stated that the app does not show any visual feedback when copied place name, description or wikipedia from lock screen.
Made code changes at three places which will fix the issue.
Fixes #6938
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
isDeviceLocked available starting from LOLLIPOP_MR1 (API 22), while Organic Maps works from LOLLIPOP (API 21). Why is TIRAMISU (API 33) check needed here?
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
Please, put braces, the conditions order is not obvious here:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU && keyguardManager.isDeviceLocked())
Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU
? It doesn't support a snack bar at all?Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU
supports a snack bar in locked mode only?@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
apologies, working on the fix.
Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU
for android version Tiramisu and higher, a copy preview pop is shown by default. see this https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#Feedback@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
the snack bar should be shown only on lockscreen for android version 13 and higher, when unlocked the preview popup is shown by default.
for android version lower than 13, the snackbar should be shown regardless of device is locked or not.
The if condition needs fixing, working on it.
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
how about this modification:
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
this is so much concise, you should create this pull request.
Please merge conditions into one
if
block.Please remove unrelated changes.
@ -88,7 +89,9 @@ public class PlacePhoneAdapter extends RecyclerView.Adapter<PlacePhoneAdapter.Vi
final String phoneNumber = mPhone.getText().toString();
final Context ctx = view.getContext();
Utils.copyTextToClipboard(ctx, phoneNumber);
Please merge conditions into one
if
block.understood, working on it.
The change on this part was done by IDE when I clicked on Reformat Code
We do not merge any random ide changes. Please learn how to amend and rebase commits to fix them. Or add newer commits on top so we can squash it into one commit later.
@ -70,2 +76,4 @@
throw new AssertionError("Unsupported state detected: " + state);
}
}
Commenting on obvious lines of code does not make any sense.
ditto
Please remove this.
ditto
Thank you for the contribution!