New dialog sample with a lot of text and thus large dialog.
Change-Id: Iaf0cba52e51f36b98a5a4a1965f0e1eb02bb8f9f
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
<Button android:id="@+id/two_buttons2"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:text="@string/alert_dialog_two_buttons2"/>
|
||||
<Button android:id="@+id/two_buttons2ultra"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:text="@string/alert_dialog_two_buttons2ultra"/>
|
||||
<Button android:id="@+id/select_button"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:text="@string/alert_dialog_select_button"/>
|
||||
|
||||
@@ -370,6 +370,7 @@
|
||||
<string name="activity_alert_dialog">App/Dialog</string>
|
||||
<string name="alert_dialog_two_buttons">OK Cancel dialog with a message</string>
|
||||
<string name="alert_dialog_two_buttons2">OK Cancel dialog with a long message</string>
|
||||
<string name="alert_dialog_two_buttons2ultra">OK Cancel dialog with ultra long message</string>
|
||||
<string name="alert_dialog_select_button">List dialog</string>
|
||||
<string name="alert_dialog_single_choice">Single choice list</string>
|
||||
<string name="alert_dialog_multi_choice">Repeat alarm</string>
|
||||
@@ -391,6 +392,44 @@
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg
|
||||
</string>
|
||||
<string name="alert_dialog_two_buttons2ultra_msg">
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
Plloaso mako nuto siwuf cakso dodtos anr koop a
|
||||
cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel
|
||||
ba mada su otrenzr.\n\nSwipontgwook proudgs hus yag su ba dagarmidad.
|
||||
Plasa maku noga wipont trenzsa schengos ent kaap zux comy.\n\nWipont trenz
|
||||
kipg naar mixent phona. Cak pwico siructiun
|
||||
ruous nust apoply tyu cak Uhex sisulutiun munityuw uw dseg\n\n
|
||||
</string>
|
||||
<string name="alert_dialog_ok">OK</string>
|
||||
<string name="alert_dialog_hide">Hide</string>
|
||||
<string name="alert_dialog_something">Something</string>
|
||||
|
||||
@@ -64,6 +64,7 @@ public class AlertDialogSamples extends Activity {
|
||||
private static final int DIALOG_MULTIPLE_CHOICE = 6;
|
||||
private static final int DIALOG_TEXT_ENTRY = 7;
|
||||
private static final int DIALOG_MULTIPLE_CHOICE_CURSOR = 8;
|
||||
private static final int DIALOG_YES_NO_ULTRA_LONG_MESSAGE = 9;
|
||||
|
||||
private static final int MAX_PROGRESS = 100;
|
||||
|
||||
@@ -115,6 +116,30 @@ public class AlertDialogSamples extends Activity {
|
||||
}
|
||||
})
|
||||
.create();
|
||||
case DIALOG_YES_NO_ULTRA_LONG_MESSAGE:
|
||||
return new AlertDialog.Builder(AlertDialogSamples.this)
|
||||
.setIcon(R.drawable.alert_dialog_icon)
|
||||
.setTitle(R.string.alert_dialog_two_buttons_msg)
|
||||
.setMessage(R.string.alert_dialog_two_buttons2ultra_msg)
|
||||
.setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
|
||||
/* User clicked OK so do some stuff */
|
||||
}
|
||||
})
|
||||
.setNeutralButton(R.string.alert_dialog_something, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
|
||||
/* User clicked Something so do some stuff */
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
|
||||
/* User clicked Cancel so do some stuff */
|
||||
}
|
||||
})
|
||||
.create();
|
||||
case DIALOG_LIST:
|
||||
return new AlertDialog.Builder(AlertDialogSamples.this)
|
||||
.setTitle(R.string.select_dialog)
|
||||
@@ -277,6 +302,15 @@ public class AlertDialogSamples extends Activity {
|
||||
});
|
||||
|
||||
|
||||
/* Display an ultra long text message with yes/no buttons and handle each message as well as the cancel action */
|
||||
Button twoButtons2UltraTitle = (Button) findViewById(R.id.two_buttons2ultra);
|
||||
twoButtons2UltraTitle.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
showDialog(DIALOG_YES_NO_ULTRA_LONG_MESSAGE);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* Display a list of items */
|
||||
Button selectButton = (Button) findViewById(R.id.select_button);
|
||||
selectButton.setOnClickListener(new OnClickListener() {
|
||||
|
||||
Reference in New Issue
Block a user