public class AlertController extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AlertController.AlertParams |
static class |
AlertController.RecycleListView |
Modifier and Type | Field and Description |
---|---|
static int |
MICRO |
protected ListView |
mListView |
protected CharSequence |
mMessage |
protected TextView |
mMessageView |
protected ScrollView |
mScrollView |
protected Window |
mWindow |
Modifier | Constructor and Description |
---|---|
protected |
AlertController(Context context,
DialogInterface di,
Window window) |
Modifier and Type | Method and Description |
---|---|
static AlertController |
create(Context context,
DialogInterface di,
Window window) |
Button |
getButton(int whichButton) |
int |
getIconAttributeResId(int attrId) |
ListView |
getListView() |
void |
installContent() |
boolean |
onKeyDown(int keyCode,
KeyEvent event) |
boolean |
onKeyUp(int keyCode,
KeyEvent event) |
void |
setButton(int whichButton,
CharSequence text,
DialogInterface.OnClickListener listener,
Message msg)
Sets a click listener or a message to be sent when the button is clicked.
|
void |
setButtonPanelLayoutHint(int layoutHint)
Sets a hint for the best button panel layout.
|
void |
setCustomTitle(View customTitleView) |
void |
setIcon(Drawable icon)
Specifies the icon to display next to the alert title.
|
void |
setIcon(int resId)
Specifies the icon to display next to the alert title.
|
void |
setInverseBackgroundForced(boolean forceInverseBackground) |
void |
setMessage(CharSequence message) |
void |
setTitle(CharSequence title) |
protected void |
setupButtons(ViewGroup buttonPanel) |
protected void |
setupContent(ViewGroup contentPanel) |
protected void |
setupTitle(ViewGroup topPanel) |
void |
setView(int layoutResId)
Set the view resource to display in the dialog.
|
void |
setView(View view)
Set the view to display in the dialog.
|
void |
setView(View view,
int viewSpacingLeft,
int viewSpacingTop,
int viewSpacingRight,
int viewSpacingBottom)
Set the view to display in the dialog along with the spacing around that view
|
public static final int MICRO
protected final Window mWindow
protected CharSequence mMessage
protected ListView mListView
protected ScrollView mScrollView
protected TextView mMessageView
protected AlertController(Context context, DialogInterface di, Window window)
public static final AlertController create(Context context, DialogInterface di, Window window)
public void installContent()
public void setTitle(CharSequence title)
public void setCustomTitle(View customTitleView)
AlertDialog.Builder#setCustomTitle(View)
public void setMessage(CharSequence message)
public void setView(int layoutResId)
public void setView(View view)
public void setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom)
public void setButtonPanelLayoutHint(int layoutHint)
public void setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener, Message msg)
listener
or msg
.whichButton
- Which button, can be one of
DialogInterface.BUTTON_POSITIVE
,
DialogInterface.BUTTON_NEGATIVE
, or
DialogInterface.BUTTON_NEUTRAL
text
- The text to display in positive button.listener
- The DialogInterface.OnClickListener
to use.msg
- The Message
to be sent when clicked.public void setIcon(int resId)
resId
- the resource identifier of the drawable to use as the icon,
or 0 for no iconpublic void setIcon(Drawable icon)
icon
- the drawable to use as the icon or null for no iconpublic int getIconAttributeResId(int attrId)
attrId
- the attributeId of the theme-specific drawable
to resolve the resourceId for.public void setInverseBackgroundForced(boolean forceInverseBackground)
public ListView getListView()
public Button getButton(int whichButton)
public boolean onKeyDown(int keyCode, KeyEvent event)
public boolean onKeyUp(int keyCode, KeyEvent event)
protected void setupTitle(ViewGroup topPanel)
protected void setupContent(ViewGroup contentPanel)
protected void setupButtons(ViewGroup buttonPanel)