From d974df0573d53e1ee4b4bb79348a9cef256837fa Mon Sep 17 00:00:00 2001 From: Josh Kasten Date: Wed, 27 Oct 2021 21:41:57 -0700 Subject: [PATCH 1/2] Add text direction locale to BGR img layout notifs Render OneSignal's custom background image notfications in RTL (right-to-left) for those devices that have set a language that renders in this direction. This does not account for some spacing issues however the next commit will cover this. --- .../src/main/res/layout/onesignal_bgimage_notif_layout.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml b/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml index b89e7b330b..46c1c10f34 100644 --- a/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml +++ b/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml @@ -30,13 +30,12 @@ + android:layout_height="64dp" + android:textDirection="locale" + > Date: Wed, 27 Oct 2021 21:55:15 -0700 Subject: [PATCH 2/2] Fix padding on BGR IMG notifications for RTL Correct the title and body 4dp padding from "left" to "start" to support both RTL and LTR languages. This panding is important so there is a bit of room between the large icon or the edge of the screen depending on if the text is LTR or RTL, in that order . Changed `layout_marginStart` to `left` since the SDK does not support a different image based on if the device is RTL or LTR. Along with this change the documenation should instruct developers to always put their app icon on the left side. --- .../src/main/res/layout/onesignal_bgimage_notif_layout.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml b/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml index 46c1c10f34..83520b18b0 100644 --- a/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml +++ b/OneSignalSDK/onesignal/src/main/res/layout/onesignal_bgimage_notif_layout.xml @@ -31,7 +31,7 @@ + android:paddingStart="4dp"/> \ No newline at end of file