Skip to content

Commit

Permalink
task(SDK-3559) - Fixes no empty message for app inbox without tabs (#528
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Anush-Shand authored Jan 15, 2024
1 parent 542bc45 commit 0f96d47
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
17 changes: 9 additions & 8 deletions clevertap-core/src/main/res/layout/inbox_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
</LinearLayout>

<TextView
android:id="@+id/no_message_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="No Message(s) to show" />
<TextView
android:id="@+id/no_message_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone"
android:text="@string/no_messages_to_show" />
</LinearLayout>
</LinearLayout>
2 changes: 1 addition & 1 deletion clevertap-core/src/main/res/layout/inbox_list_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
</LinearLayout>
</LinearLayout>
1 change: 1 addition & 0 deletions clevertap-core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<string name="notification_permission_name_for_title">Notifications</string>
<string name="notification_permission_settings_message">Notifications</string>
<string name="ct_fcm_fallback_notification_channel_label">Miscellaneous</string>
<string name="no_messages_to_show">No Message(s) to show</string>
</resources>

0 comments on commit 0f96d47

Please sign in to comment.