Notification text color in Galaxy S 2.3.3

I am creating a music application that has a constant notification. I encounter a color text notification problem on the Galaxy S with 2.3.3. My code is:

in layout / notification.xml

<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/notifbar_trackname" style="@style/NotificationTitle" android:focusable="true" android:singleLine="true" android:layout_gravity="left" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/notifbar_artist" style="@style/NotificationText" android:layout_gravity="left" android:scrollHorizontally="true" android:ellipsize="end" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/notifbar_queue" style="@style/NotificationText" android:layout_gravity="left" android:scrollHorizontally="true" android:ellipsize="end" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> 

in values-v9 / styles.xml

 <style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" /> <style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" /> 

I thought the text would switch to white, as the Galaxy S has a dark gray background, but it continues to show black texts. But other applications do a great job of this, so there must be a way to do it.

Does anyone know how to get the “default status bar text color” on Galaxy S? Thanks!

+4
source share
2 answers

I used

 android:textColor="@android:color/primary_text_light" 

There is another way to use android: textStyle. See Custom Notification Layouts and Text Colors

0
source

The best solution I have found so far is Gax's answer here to this question:

Custom notification layouts and text colors

However, it is not complete. It will return the title text color, but not the detail text.

0
source

Source: https://habr.com/ru/post/1383361/


All Articles