本文整理汇总了Java中com.simplealertdialog.SimpleAlertDialogSupportFragment类的典型用法代码示例。如果您正苦于以下问题:Java SimpleAlertDialogSupportFragment类的具体用法?Java SimpleAlertDialogSupportFragment怎么用?Java SimpleAlertDialogSupportFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleAlertDialogSupportFragment类属于com.simplealertdialog包,在下文中一共展示了SimpleAlertDialogSupportFragment类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMessage
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testMessage() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_message).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final View positive = d.findViewById(R.id.button_positive);
assertNotNull(positive);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
positive.performClick();
}
});
getInstrumentation().waitForIdleSync();
}
示例2: testButtons
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testButtons() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_buttons).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
View positive = d.findViewById(R.id.button_positive);
assertNotNull(positive);
final View negative = d.findViewById(R.id.button_negative);
assertNotNull(negative);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
negative.performClick();
}
});
getInstrumentation().waitForIdleSync();
}
示例3: testItems
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testItems() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_items).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final ListView lv = (ListView) d.findViewById(R.id.list);
assertNotNull(lv);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
lv.performItemClick(lv, 0, 0);
}
});
getInstrumentation().waitForIdleSync();
}
示例4: testItemsWithIcons
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testItemsWithIcons() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_icon_items).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final ListView lv = (ListView) d.findViewById(R.id.list);
assertNotNull(lv);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
lv.performItemClick(lv, 0, 0);
}
});
getInstrumentation().waitForIdleSync();
}
示例5: testAdapter
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testAdapter() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(com.simplealertdialog.test.R.id.btn_adapter).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final ListView lv = (ListView) d.findViewById(R.id.list);
assertNotNull(lv);
assertTrue(lv.getAdapter() instanceof SweetsAdapter);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
lv.performItemClick(lv, 0, 0);
}
});
getInstrumentation().waitForIdleSync();
}
示例6: testSingleChoiceItems
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void testSingleChoiceItems() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_single_choice_list).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final ListView lv = (ListView) d.findViewById(R.id.list);
assertNotNull(lv);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
lv.performItemClick(lv, 0, 0);
}
});
getInstrumentation().waitForIdleSync();
}
示例7: confirmShowPassword
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
private void confirmShowPassword() {
if (adminPasswordIsSet()) {
new SimpleAlertDialogSupportFragment.Builder()
.setTitle(R.string.label_permission_required)
.setPositiveButton(android.R.string.ok)
.setNegativeButton(android.R.string.cancel)
.setRequestCode(DIALOG_REQUEST_CODE_SHOW_PASSWORD)
.setUseView(true)
.create()
.show(getSupportFragmentManager(), "dialog");
} else {
showPassword();
}
}
示例8: confirmDelete
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
private void confirmDelete() {
new SimpleAlertDialogSupportFragment.Builder()
.setMessage(R.string.msg_confirm_file_entry_delete)
.setPositiveButton(android.R.string.ok)
.setNegativeButton(android.R.string.cancel)
.setRequestCode(DIALOG_REQUEST_CODE_DELETE)
.create()
.show(getSupportFragmentManager(), "dialog");
}
示例9: confirmFinish
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
private void confirmFinish() {
if (!contentChanged()) {
finish();
return;
}
new SimpleAlertDialogSupportFragment.Builder()
.setMessage(R.string.msg_confirm_file_entry_finish)
.setPositiveButton(android.R.string.ok)
.setNegativeButton(android.R.string.cancel)
.setRequestCode(DIALOG_REQUEST_CODE_FINISH)
.create()
.show(getSupportFragmentManager(), "dialog");
}
示例10: setAdminPassword
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
private void setAdminPassword() {
new SimpleAlertDialogSupportFragment.Builder()
.setUseView(true)
.setRequestCode(DIALOG_REQUEST_CODE_ADMIN_PASSWORD)
.setTitle(R.string.pref_category_general_title_admin_password)
.setPositiveButton(android.R.string.ok)
.setNegativeButton(android.R.string.cancel)
.create().show(getSupportFragmentManager(), "dialog");
}
示例11: test3Buttons
import com.simplealertdialog.SimpleAlertDialogSupportFragment; //导入依赖的package包/类
public void test3Buttons() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
activity.findViewById(R.id.btn_3_buttons).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
Fragment f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
Dialog d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
View positive = d.findViewById(R.id.button_positive);
assertNotNull(positive);
final View negative = d.findViewById(R.id.button_negative);
assertNotNull(negative);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
negative.performClick();
}
});
getInstrumentation().waitForIdleSync();
runTestOnUiThread(new Runnable() {
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void run() {
activity.findViewById(R.id.btn_3_buttons).performClick();
activity.getSupportFragmentManager().executePendingTransactions();
}
});
getInstrumentation().waitForIdleSync();
f = getActivity().getSupportFragmentManager().findFragmentByTag("dialog");
assertNotNull(f);
d = ((SimpleAlertDialogSupportFragment) f).getDialog();
assertNotNull(d);
final View neutral = d.findViewById(R.id.button_neutral);
assertNotNull(neutral);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
neutral.performClick();
}
});
getInstrumentation().waitForIdleSync();
}