Search in sources :

Example 1 with Action

use of com.nextcloud.android.lib.resources.profile.Action in project android by nextcloud.

the class DialogFragmentIT method testProfileBottomSheet.

@Test
@ScreenshotTest
public void testProfileBottomSheet() {
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    // Fixed values for HoverCard
    List<Action> actions = new ArrayList<>();
    actions.add(new Action("profile", "View profile", "https://dev.nextcloud.com/core/img/actions/profile.svg", "https://dev.nextcloud.com/index.php/u/christine"));
    actions.add(new Action("core", "christine.scott@nextcloud.com", "https://dev.nextcloud.com/core/img/actions/mail.svg", "mailto:christine.scott@nextcloud.com"));
    actions.add(new Action("spreed", "Talk to Christine", "https://dev.nextcloud.com/apps/spreed/img/app-dark.svg", "https://dev.nextcloud.com/apps/spreed/?callUser=christine"));
    HoverCard hoverCard = new HoverCard("christine", "Christine Scott", actions);
    // show dialog
    Intent intent = new Intent(targetContext, FileDisplayActivity.class);
    FileDisplayActivity fda = activityRule.launchActivity(intent);
    ProfileBottomSheetDialog sut = new ProfileBottomSheetDialog(fda, user, hoverCard);
    fda.runOnUiThread(sut::show);
    waitForIdleSync();
    screenshot(sut.getWindow().getDecorView());
}
Also used : FileDisplayActivity(com.owncloud.android.ui.activity.FileDisplayActivity) Action(com.nextcloud.android.lib.resources.profile.Action) ArrayList(java.util.ArrayList) Intent(android.content.Intent) HoverCard(com.nextcloud.android.lib.resources.profile.HoverCard) ProfileBottomSheetDialog(com.owncloud.android.ui.fragment.ProfileBottomSheetDialog) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Aggregations

Intent (android.content.Intent)1 Action (com.nextcloud.android.lib.resources.profile.Action)1 HoverCard (com.nextcloud.android.lib.resources.profile.HoverCard)1 FileDisplayActivity (com.owncloud.android.ui.activity.FileDisplayActivity)1 ProfileBottomSheetDialog (com.owncloud.android.ui.fragment.ProfileBottomSheetDialog)1 ScreenshotTest (com.owncloud.android.utils.ScreenshotTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1