当前位置: 首页>>代码示例>>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;未经允许,请勿转载。