use of android.app.AlertDialog in project JamsMusicPlayer by psaravan.
the class LicensesDialog method create.
public Dialog create() {
//Get resources
final WebView webView = new WebView(mContext);
webView.loadDataWithBaseURL(null, mLicensesText, "text/html", "utf-8", null);
final AlertDialog.Builder builder = new AlertDialog.Builder(mContext).setTitle(mTitleText).setView(webView).setPositiveButton(mCloseText, new Dialog.OnClickListener() {
public void onClick(final DialogInterface dialogInterface, final int i) {
dialogInterface.dismiss();
}
});
final AlertDialog dialog = builder.create();
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(final DialogInterface dialog) {
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss(dialog);
}
}
});
return dialog;
}
use of android.app.AlertDialog in project weiciyuan by qii.
the class AddGroupDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
name = new EditText(getActivity());
name.addTextChangedListener(new WordLengthLimitWatcher(name));
if (savedInstanceState != null) {
name.append(savedInstanceState.getString("name"));
}
builder.setView(name).setTitle(getString(R.string.input_group_name)).setPositiveButton(getString(R.string.add), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String word = name.getText().toString().trim();
if (!TextUtils.isEmpty(word)) {
ManageGroupActivity.ManageGroupFragment fragment = (ManageGroupActivity.ManageGroupFragment) getTargetFragment();
fragment.addGroup(word);
}
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialog = builder.create();
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
return dialog;
}
use of android.app.AlertDialog in project weiciyuan by qii.
the class ModifyGroupDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if (savedInstanceState != null) {
idstr = savedInstanceState.getString("idstr");
oriName = savedInstanceState.getString("oriName");
}
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
name = new EditText(getActivity());
name.setHint(oriName);
name.addTextChangedListener(new WordLengthLimitWatcher(name));
if (savedInstanceState != null) {
name.append(savedInstanceState.getString("name"));
}
builder.setView(name).setTitle(getString(R.string.modify_group_name)).setPositiveButton(getString(R.string.modify), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String name = ModifyGroupDialog.this.name.getText().toString().trim();
if (!TextUtils.isEmpty(name)) {
ManageGroupActivity.ManageGroupFragment fragment = (ManageGroupActivity.ManageGroupFragment) getTargetFragment();
fragment.modifyGroupName(idstr, name);
}
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialog = builder.create();
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
return dialog;
}
use of android.app.AlertDialog in project weiciyuan by qii.
the class AddFilterDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final EditText et = new EditText(getActivity());
builder.setView(et).setTitle(getString(R.string.input_filter_word)).setPositiveButton(getString(R.string.add), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String word = et.getText().toString().trim();
if (!TextUtils.isEmpty(word)) {
AbstractFilterFragment filterFragment = (AbstractFilterFragment) getTargetFragment();
filterFragment.addFilter(word);
}
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialog = builder.create();
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
return dialog;
}
use of android.app.AlertDialog in project weiciyuan by qii.
the class FollowTopicDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final EditText et = new EditText(getActivity());
et.setHint(getString(R.string.add_topic_hint));
builder.setView(et).setTitle(getString(R.string.add_topic)).setPositiveButton(getString(R.string.add), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String word = et.getText().toString().trim();
if (!TextUtils.isEmpty(word)) {
UserTopicListFragment userTopicListFragment = (UserTopicListFragment) getTargetFragment();
userTopicListFragment.addTopic(word);
}
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialog = builder.create();
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
return dialog;
}
Aggregations