From 352d9d3c926c7ac3c21c8660b4ed60b5edbe552a Mon Sep 17 00:00:00 2001 From: anush Date: Wed, 3 Jan 2024 16:54:01 +0530 Subject: [PATCH] task(SDK-3559) - Fixes no empty message for app inbox without tabs --- .../android/sdk/inbox/CTInboxActivity.java | 4 ++-- .../src/main/res/layout/inbox_activity.xml | 17 +++++++++-------- .../src/main/res/layout/inbox_list_view.xml | 2 +- clevertap-core/src/main/res/values/strings.xml | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/inbox/CTInboxActivity.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/inbox/CTInboxActivity.java index a0066d041..82440c883 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/inbox/CTInboxActivity.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/inbox/CTInboxActivity.java @@ -139,14 +139,14 @@ public void onClick(View v) { if (!styleConfig.isUsingTabs()) { viewPager.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE); - final FrameLayout listViewFragmentLayout = findViewById(R.id.list_view_fragment); - listViewFragmentLayout.setVisibility(View.VISIBLE); if (cleverTapAPI != null && cleverTapAPI.getInboxMessageCount() == 0) { noMessageView.setBackgroundColor(Color.parseColor(styleConfig.getInboxBackgroundColor())); noMessageView.setVisibility(View.VISIBLE); noMessageView.setText(styleConfig.getNoMessageViewText()); noMessageView.setTextColor(Color.parseColor(styleConfig.getNoMessageViewTextColor())); } else { + final FrameLayout listViewFragmentLayout = findViewById(R.id.list_view_fragment); + listViewFragmentLayout.setVisibility(View.VISIBLE); boolean fragmentExists = false; noMessageView.setVisibility(View.GONE); for (Fragment fragment : getSupportFragmentManager().getFragments()) { diff --git a/clevertap-core/src/main/res/layout/inbox_activity.xml b/clevertap-core/src/main/res/layout/inbox_activity.xml index 870635ff6..32b0d1a44 100644 --- a/clevertap-core/src/main/res/layout/inbox_activity.xml +++ b/clevertap-core/src/main/res/layout/inbox_activity.xml @@ -33,13 +33,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> - - + + \ No newline at end of file diff --git a/clevertap-core/src/main/res/layout/inbox_list_view.xml b/clevertap-core/src/main/res/layout/inbox_list_view.xml index 211b2396b..104805d5e 100644 --- a/clevertap-core/src/main/res/layout/inbox_list_view.xml +++ b/clevertap-core/src/main/res/layout/inbox_list_view.xml @@ -22,6 +22,6 @@ android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" - android:text="No Message(s) to show" /> + android:text="@string/no_messages_to_show" /> \ No newline at end of file diff --git a/clevertap-core/src/main/res/values/strings.xml b/clevertap-core/src/main/res/values/strings.xml index 6f9e1c51f..86a1b5a41 100644 --- a/clevertap-core/src/main/res/values/strings.xml +++ b/clevertap-core/src/main/res/values/strings.xml @@ -9,4 +9,5 @@ Notifications Notifications Miscellaneous + No Message(s) to show