Closed silviamirandastorm closed 2 years ago
Hello, I think you forgot to update the messageCenterStyle
also with your style.
You can find an example here: https://docs.airship.com/platform/android/message-center/#styling-android-mc
If it still doesn't work, please send us your entire message center style and we'll take a look.
Hi
the three items are the part that I customized and did not apply
and here I set
<!-- Base application theme. -->
<style name="AppTheme" parent="BaseTheme">
...
<item name="messageCenterStyle">@style/AppTheme.MessageCenter</item>
</style>
<style name="AppTheme.MessageCenter" parent="MessageCenter">
<item name="messageCenterEmptyMessageText">some really long empty message string</item>
<item name="messageCenterEmptyMessageTextAppearance">@style/AppTheme.MessageCenter.EmptyMessageTextAppearance</item>
</style>
<!-- Custom message title text style -->
<style name="AppTheme.MessageCenter.EmptyMessageTextAppearance" parent="MessageCenter.EmptyMessage.TextAppearance">
<item name="android:textSize">44sp</item>
<item name="android:textColor">#ff00ff</item>
</style>
A few things, for text color you need to use textColor
not color
. And unfortunately alignment is not a text appearance attribute. We do not expose that style so you will have to override the actual layout.
Create a new layout titled ua_fragment_message_list.xml
with:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_gravity="center" />
</FrameLayout>
Ok, thanks ☺️ !
Let me know if you have any other issues!
Hi Guys.
I'm having a problem overriding the empty message style. (Android lib version 16.6.1) The style I apply doesn't work.
Dosn't center, dosn't apply color correctly
am I doing it correctly?