當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleAlertDialogSupportFragment類代碼示例

本文整理匯總了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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:24,代碼來源:SupportActivityTest.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:26,代碼來源:SupportActivityTest.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:25,代碼來源:SupportActivityTest.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:25,代碼來源:SupportActivityTest.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:26,代碼來源:SupportActivityTest.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:25,代碼來源:SupportActivityTest.java

示例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();
    }
}
 
開發者ID:app-manager,項目名稱:AppManager-for-Android,代碼行數:15,代碼來源:EditActivity.java

示例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");
}
 
開發者ID:app-manager,項目名稱:AppManager-for-Android,代碼行數:10,代碼來源:EditActivity.java

示例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");
}
 
開發者ID:app-manager,項目名稱:AppManager-for-Android,代碼行數:14,代碼來源:EditActivity.java

示例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");
}
 
開發者ID:app-manager,項目名稱:AppManager-for-Android,代碼行數:10,代碼來源:SettingsActivity.java

示例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();
}
 
開發者ID:ksoichiro,項目名稱:SimpleAlertDialog-for-Android,代碼行數:49,代碼來源:SupportActivityTest.java


注:本文中的com.simplealertdialog.SimpleAlertDialogSupportFragment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。