本文整理匯總了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();
}