xml - Android Notification Big Layout Fix -


i trying build custom notification music player. have created h custom layout google play music , used in notification code not getting expanded view of notification. below codes:- notification_custom_expanded_layout.xml

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="128.0dip" tools:ignore="contentdescription" >  <imageview     android:id="@+id/notification_expanded_base_image"     android:layout_width="128.0dip"     android:layout_height="128.0dip"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:scaletype="fitxy" />  <linearlayout     android:id="@+id/notification_expanded_buttons"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentright="true"     android:layout_torightof="@+id/notification_expanded_base_image"     android:divider="?android:listdivider"     android:dividerpadding="12.0dip"     android:gravity="center_vertical"     android:orientation="horizontal"     android:showdividers="middle" >      <imagebutton         android:id="@+id/notification_expanded_base_previous"         android:layout_width="0dp"         android:layout_height="48.0dip"         android:layout_weight="1"         android:background="?android:selectableitembackground"         android:padding="10.0dip"         android:scaletype="fitcenter"         android:src="@drawable/btn_playback_previous_light" />      <imagebutton         android:id="@+id/notification_expanded_base_play"         android:layout_width="0dp"         android:layout_height="48.0dip"         android:layout_weight="1"         android:background="?android:selectableitembackground"         android:padding="10.0dip"         android:scaletype="fitcenter"         android:src="@drawable/btn_playback_pause_light" />      <imagebutton         android:id="@+id/notification_expanded_base_next"         android:layout_width="0dp"         android:layout_height="48.0dip"         android:layout_weight="1"         android:background="?android:selectableitembackground"         android:padding="10.0dip"         android:scaletype="fitcenter"         android:src="@drawable/btn_playback_next_light" /> </linearlayout>  <imageview     android:layout_width="wrap_content"     android:layout_height="1dp"     android:layout_above="@+id/notification_expanded_buttons"     android:layout_alignparentright="true"     android:layout_torightof="@+id/notification_expanded_base_image"     android:background="?android:dividerhorizontal" />  <imagebutton     android:id="@+id/notification_expanded_base_collapse"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentright="true"     android:layout_alignparenttop="true"     android:background="?android:selectableitembackground"     android:padding="8.0dip"     android:src="@drawable/btn_notification_collapse" />  <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparenttop="true"     android:layout_gravity="center_vertical"     android:layout_toleftof="@+id/notification_expanded_base_collapse"     android:layout_torightof="@+id/notification_expanded_base_image"     android:orientation="vertical"     android:paddingleft="8.0dip"     android:paddingtop="8.0dip" >      <textview         android:id="@+id/notification_expanded_base_line_one"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:ellipsize="end"         android:fadingedge="horizontal"         android:singleline="true"/>      <textview         android:id="@+id/notification_expanded_base_line_two"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:ellipsize="end"         android:fadingedge="horizontal"         android:singleline="true"/>      <textview         android:id="@+id/notification_expanded_base_line_three"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:ellipsize="end"         android:fadingedge="horizontal"         android:singleline="true"/> </linearlayout> 

java code

    int icon = r.drawable.ic_launcher;     long when = system.currenttimemillis();     notification notification = new notification(icon, "custom notification", when);      notificationmanager mnotificationmanager = (notificationmanager)getsystemservice(notification_service);      remoteviews contentview = new remoteviews(getpackagename(), r.layout.notification_custom_expanded_layout);     contentview.setimageviewresource(r.id.image, r.drawable.ic_launcher);     contentview.settextviewtext(r.id.notification_expanded_base_line_one, "custom notification");     contentview.settextviewtext(r.id.notification_expanded_base_line_two, "this custom layout");     notification.contentview = contentview;      intent notificationintent = new intent(this, mainactivity.class);     pendingintent contentintent = pendingintent.getactivity(this, 0, notificationintent, 0);     notification.contentintent = contentintent;      notification.flags |= notification.flag_no_clear; //do not clear notification     notification.defaults |= notification.default_lights; // led     notification.defaults |= notification.default_vibrate; //vibration     notification.defaults |= notification.default_sound; // sound      mnotificationmanager.notify(1, notification); 

but getting is:- http://i.stack.imgur.com/rosqn.png suggestions?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -