In my app there is a custom notification, with the following layout. My problem is that the marquee doesn't working. plz help me. Thanks in advance
> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notification_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp" >
<ImageView
android:id="@+id/notification_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:background="@drawable/icon" />
<TextView
android:id="@+id/notification_title"
style="@style/NotificationTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/notification_image"
android:text="asaadsadad" />
<TextView
android:id="@+id/notification_message"
style="@style/NotificationText"
android:layout_width="wrap_content"
android:ellipsize="marquee"
android:lines="1"
android:marqueeRepeatLimit="marquee_forever"
android:layout_height="wrap_content"
android:layout_below="@+id/notification_title"
android:layout_toRightOf="@+id/notification_image"
android:text="@string/four_day_delay_msg"
android:focusable="true" />
</RelativeLayout>
Can add scroll in notification??
Well, I've spent quite a bit of time researching this and I think it's safe to say there are some major hurdles to overcome in order to accomplish this. It's worth noting that there are some examples of Google Apps using marquee in their custom notifications, however it's in their HoneyComb Android 4.0 release, so perhaps they fixed the issues I'm about to address. Also I haven't seen marquee implemented in Google Apps like Google Music which should marquee long song names or artists.
I love numbered lists...
Resources...
Custom Component - AutoScrolling Marquee TextView - http://androidbears.stellarpc.net/?p=185
Custom Component - Relative Layout onFinishInflate() - Android : how to create custom component - http://www.devdaily.com/java/jwarehouse/android/core/java/android/widget/TwoLineListItem.java.shtml
Google App with example of Marquee in custom notification (TextView titled: notification_title) - http://developer.android.com/resources/samples/HoneycombGallery/res/layout/notification.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With