android - Dialog displays differently on ICS devices that it does with older versions -
when display dialog on ics device in landscape mode dialog shows in same width did in portrait mode.

but on device running gingerbread when dialog in landscape mode displays width across screen not having compact

did change how dialog display's in ics not display across screen in second picture? how can show second picture not compact first one?
also targeted api application 2.2 cant use ics api's or anything
edit
this how call dialogs
incdialog = new messagedialog(this, r.style.fullheightdialog); incdialog.popupmessage(this, omessage); dialogs in separate class extends dialog
this popupmessage method shows daialog
public void popupmessage(final context context, clsmessagerecord omessage) { mainactivity.lastmessageclicked = omessage; mocallingcontext = context; momessage = omessage; mainactivity.mishowndialogtype = dialogid; mainactivity.setshownmessage(momessage); mainactivity.mbintentwasshown = true; log.i(classname + "::popupmessage", "new message dialog show...."); if (omessage != null) { if (omessage.getisstation() == true) { // incident message dialog this.setcontentview(r.layout.message_st); clsstatusrecord ostation = controlservice.db.statuslist.getmessagebyecm2id(omessage.ecm2id); if (ostation != null) { if (ostation.allowmapping()) { imagebutton cmdmapping = (imagebutton) this.findviewbyid(r.id.cmdmapping); cmdmapping.setvisibility(imagebutton.visible); cmdmapping.setonclicklistener(new view.onclicklistener() { public void onclick(view view) { mainactivity.loaded = false; handlemapping(); } }); } else { imagebutton cmdmapping = (imagebutton) this.findviewbyid(r.id.cmdmapping); cmdmapping.setvisibility(imagebutton.gone); } if (ostation.ischief()) { imagebutton cmdchief = (imagebutton) this.findviewbyid(r.id.cmdchieflist); cmdchief.setvisibility(imagebutton.visible); cmdchief.setonclicklistener(new view.onclicklistener() { public void onclick(view view) { mainactivity.loaded = false; handleresponders(); } }); } else { imagebutton cmdchief = (imagebutton) this.findviewbyid(r.id.cmdchieflist); cmdchief.setvisibility(imagebutton.gone); } } mstationid = momessage.ecm2id; mmessageid = momessage.messageid; textview txtheader = (textview) this.findviewbyid(r.id.txtdialogheader); textview txttoc = (textview) this.findviewbyid(r.id.txtdialogtoc); textview txtmessage = (textview) this.findviewbyid(r.id.lblmessage); txtheader.settext(omessage.ecm2name); txttoc.settext(omessage.toc); txtmessage.settext(omessage.messagetext); if(omessage.messagetext.touppercase().startswith("update")) { imagebutton cmdresp = (imagebutton) this.findviewbyid(r.id.cmdresponding); cmdresp.setenabled(false); cmdresp.setimageresource(r.drawable.responding_disabled); imagebutton cmddecl = (imagebutton) this.findviewbyid(r.id.cmddeclining); cmddecl.setenabled(false); cmddecl.setimageresource(r.drawable.declining_disabled); imagebutton cmdchief = (imagebutton) this.findviewbyid(r.id.cmdchieflist); cmdchief.setenabled(false); cmdchief.setimageresource(r.drawable.chief_disabled); } imageview imgicon = (imageview) this.findviewbyid(r.id.imgicon); switch (omessage.state) { case etmsnewmessage: imgicon.setbackgrounddrawable(context.getresources().getdrawable(imgstnew)); break; case etmsresponded: imgicon.setbackgrounddrawable(context.getresources().getdrawable(imgstresponded)); break; case etmsdeclined: imgicon.setbackgrounddrawable(context.getresources().getdrawable(imgstunavailable)); break; } button cmdexit = (button) this.findviewbyid(r.id.cmdexit); cmdexit.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { mainactivity.messageshown=false; closepopup(); } }); imagebutton cmddeclining = (imagebutton) this.findviewbyid(r.id.cmddeclining); cmddeclining.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { handledeclining(context); } }); imagebutton cmdresponding = (imagebutton) this.findviewbyid(r.id.cmdresponding); cmdresponding.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { handleresponding(context); } }); log.e(classname + "::popupmessage", "message view shown (incident)"); this.show(); } else { // distribution list dialog this.setcontentview(r.layout.message_dl); log.e(classname + "::popupmessage", "message content filling (dist)"); textview txtheader = (textview) this.findviewbyid(r.id.txtdialogheader); textview txttoc = (textview) this.findviewbyid(r.id.txtdialogtoc); textview txtmessage = (textview) this.findviewbyid(r.id.lblmessage); txtheader.settext(omessage.ecm2name); txttoc.settext(omessage.toc); txtmessage.settext(omessage.messagetext); imageview imgicon = (imageview) this.findviewbyid(r.id.imgicon); imgicon.setbackgrounddrawable(context.getresources().getdrawable(imgdlread)); button cmdexit = (button) this.findviewbyid(r.id.cmdexit); cmdexit.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { mainactivity.messageshown=false; mainactivity.dismessageshown=false; handlecancel(); messagetype = false; } }); imagebutton cmdreplytosender = (imagebutton) this.findviewbyid(r.id.cmdreplytosender); cmdreplytosender.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { handlereplytosender(); } }); clsstatusrecord orec = omessage.getstatusrecord(); if (orec != null) { imagebutton cmdreplytodl = (imagebutton) this.findviewbyid(r.id.cmdreplytodl); if (orec.allowwrite()) { // imagebutton cmdreplytodl = (imagebutton) this.findviewbyid(r.id.cmdreplytodl); cmdreplytodl.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { handlereplytodl(); } }); }else{ cmdreplytodl.setenabled(false); cmdreplytodl.setimageresource(r.drawable.replytodistlist_up_disabled); } } log.e(classname + "::popupmessage", "message view shown (dist)"); messagetype = true; this.show(); } } else { } } here xml layout
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_height="match_parent" android:padding="2dip" android:paddingtop="2dip" android:layout_width="fill_parent"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="match_parent" android:padding="0dip" android:layout_width="fill_parent"> <relativelayout android:id="@+id/contentlayout2" android:orientation="vertical" android:padding="0dip" android:layout_height="wrap_content" android:layout_gravity="top|left" android:background="#000000" android:layout_weight="0" android:layout_width="fill_parent"> <imageview android:id="@+id/imgicon" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="top|left" android:contentdescription="@string/desc"> </imageview> <textview android:layout_height="wrap_content" android:text="" android:id="@+id/txtdialogheader" android:layout_width="match_parent" android:textstyle="bold" android:layout_torightof="@id/imgicon" android:paddingleft="5dip" android:textcolor="#ff2525" android:textsize="18dip"> </textview> <textview android:layout_height="wrap_content" android:text="" android:id="@+id/txtdialogtoc" android:layout_width="match_parent" android:layout_torightof="@id/imgicon" android:layout_below="@id/txtdialogheader" android:paddingleft="5dip" android:textsize="19dip" android:textstyle="bold"> </textview> </relativelayout> <scrollview android:id="@+id/scrollmessageframe" android:layout_height="match_parent" android:padding="0dip" android:background="#aa0000" android:layout_weight="1" android:layout_width="fill_parent"> <textview android:layout_height="wrap_content" android:layout_width="match_parent" android:text="" android:id="@+id/lblmessage" android:padding="5dip" android:background="#000000" android:minheight="140dip" android:textcolor="#f2f2f2" android:textsize="20dip"> </textview> </scrollview> <relativelayout android:id="@+id/contentlayout3" android:orientation="vertical" android:background="#000000" android:layout_height="wrap_content" android:layout_gravity="bottom|center_horizontal" android:gravity="center_horizontal" android:layout_width="match_parent"> <imagebutton android:id="@+id/cmdresponding" android:layout_width="62dip" android:layout_height="62dip" android:layout_marginright="10dip" android:contentdescription="@string/desc" android:src="@drawable/responding_ref" android:background="@drawable/responding_up" android:layout_margintop="5dip" android:layout_marginleft="5dip"> </imagebutton> <imagebutton android:id="@+id/cmddeclining" android:src="@drawable/declining_ref" android:background="@drawable/declining_up" android:layout_aligntop="@+id/cmdresponding" android:layout_alignbottom="@+id/cmdresponding" android:layout_height="62dip" android:layout_width="62dip" android:layout_marginleft="3dip" android:layout_torightof="@+id/cmdresponding" android:layout_marginright="10dip" android:contentdescription="@string/desc"></imagebutton> <imagebutton android:id="@+id/cmdchieflist" android:layout_width="62dip" android:layout_height="62dip" android:layout_torightof="@+id/cmddeclining" android:background="@drawable/chief_up" android:layout_marginright="10dip" android:src="@drawable/chief_ref" android:contentdescription="@string/desc" android:layout_margintop="5dip" android:layout_marginleft="6dip"/> <imagebutton android:id="@+id/cmdmapping" android:background="@drawable/globe_up" android:src="@drawable/mapping_ref" android:layout_height="60dip" android:layout_width="60dip" android:layout_marginleft="2dip" android:layout_torightof="@+id/cmdchieflist" android:layout_margintop="5dip" android:contentdescription="@string/desc"></imagebutton> </relativelayout> </linearlayout> <button android:text="" android:textsize="16dip" android:layout_height="40dip" android:layout_width="40dip" android:id="@+id/cmdexit" android:background="@drawable/closepopup" android:layout_gravity="top|right" android:contentdescription="@string/desc"> </button> </framelayout>
yes, api 11 targeted tablets , large screens, , alertdialog designed not cover entire screen in holo theme. default size depends on screen size (is expressed percentual width of screen width).
it's not clear base class of messagedialog. assuming inherits alertdialog, theme sets size of dialog.
assuming have android:targetsdkversion>=11 in manifest, app uses theme.holo.dialog.alert theme dialog, sets android:windowminwidthmajor , android:windowminwidthminor specify width of dialog.
you can fix either setting android:targetsdkversion=10, or making , using own theme dialog parent theme theme.holo.dialog.alert , you'd overwrite mentioned width items.
Comments
Post a Comment