• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Screenshot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.facebook.testing.screenshot.Screenshot的典型用法代码示例。如果您正苦于以下问题:Java Screenshot类的具体用法?Java Screenshot怎么用?Java Screenshot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Screenshot类属于com.facebook.testing.screenshot包,在下文中一共展示了Screenshot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: snap

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
protected void snap(@NonNull View subject, @Nullable String... dataPoints) {
    int rtl = layoutDirection == LayoutDirection.RTL
            ? View.LAYOUT_DIRECTION_RTL
            : TextUtilsCompat.getLayoutDirectionFromLocale(locale);
    //noinspection WrongConstant
    subject.setLayoutDirection(rtl);

    ViewHelpers viewHelpers = ViewHelpers.setupView(subject).setExactWidthDp(widthDp);
    if (heightDp != null) {
        viewHelpers.setExactHeightDp(heightDp);
    }
    viewHelpers.layout();

    List<String> list = new ArrayList<>();
    String byHeight = heightDp == null ? "" : ("x" + heightDp);
    list.add(widthDp + byHeight + "dp");
    list.add(locale.toString());
    list.add(layoutDirection == LayoutDirection.RTL ? "rtl" : "ltr");
    list.add("font" + fontScale.multiplier() + "x");
    list.add(theme.toString().toLowerCase(Locale.ENGLISH));
    list.addAll(Arrays.asList(ArrayUtils.nullToEmpty(dataPoints)));
    Screenshot.snap(subject).setName(testName(list)).record();
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:24,代码来源:ViewTest.java


示例2: testDefault

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testDefault() {
  Context targetContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  LayoutInflater inflater = LayoutInflater.from(targetContext);
  LithoView view = (LithoView) inflater.inflate(R.layout.litho_view, null, false);

  view.setComponent(Example.create(view.getComponentContext()).build());

  ViewHelpers.setupView(view).setExactWidthDp(300).layout();
  Screenshot.snap(view).record();
}
 
开发者ID:facebook,项目名称:screenshot-tests-for-android,代码行数:12,代码来源:ExampleScreenshotTest.java


示例3: testRenderBlueWin

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderBlueWin() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "30", "blue", 1463883886L, VID, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例4: testRenderRedWin

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderRedWin() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "40", "30", "blue", 1463883886L, VID, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例5: testRenderTie

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderTie() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "20", "blue", 1463883886L, VID, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例6: compareScreenshot

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
protected void compareScreenshot(View view, int height) {
  Context context = getInstrumentation().getTargetContext();
  WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  DisplayMetrics metrics = new DisplayMetrics();
  windowManager.getDefaultDisplay().getMetrics(metrics);
  ViewHelpers.setupView(view)
      .setExactHeightPx(context.getResources().getDimensionPixelSize(height))
      .setExactWidthPx(metrics.widthPixels)
      .layout();
  Screenshot.snap(view).record();
}
 
开发者ID:Karumi,项目名称:Shot,代码行数:12,代码来源:ScreenshotTest.java


示例7: measureAndScreenshotView

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
public static void measureAndScreenshotView(View view, int width, int height) {
    ViewHelpers.setupView(view)
            .setExactWidthPx(width)
            .setExactHeightPx(height)
            .layout();
    Screenshot.snap(view)
            .record();
}
 
开发者ID:FabianTerhorst,项目名称:Isometric,代码行数:9,代码来源:ScreenshotHelper.java


示例8: testDefault

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testDefault() {
  Context targetContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  LayoutInflater inflater = LayoutInflater.from(targetContext);
  LithoView view = (LithoView) inflater.inflate(R.layout.litho_view, null, false);

  view.setComponent(ImageRow.create(view.getComponentContext()).build());

  ViewHelpers.setupView(view).setExactWidthDp(300).layout();
  Screenshot.snap(view).record();
}
 
开发者ID:facebook,项目名称:screenshot-tests-for-android,代码行数:12,代码来源:ImageRowScreenshotTest.java


示例9: testRenderUnplayed

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderUnplayed() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "?", "?", "blue", 1463883886L, null, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例10: testRender2Team

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRender2Team() {
    View view = createView(RED_TEAMS_2, BLUE_TEAMS_2, "20", "30", "blue", 1463883886L, VID, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例11: testRenderNoTime

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderNoTime() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "30", "blue", 0, VID, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例12: testRenderNoVideo

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderNoVideo() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "30", "blue", 1463883886L, null, MATCH_16);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例13: testNoWinnersIn2015

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testNoWinnersIn2015() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "30", "", 1463883886L, VID, MATCH_15_Q);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchViewTest.java


示例14: testWinnersIn2015Finals

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testWinnersIn2015Finals() {
    View view = createView(RED_TEAMS_3, BLUE_TEAMS_3, "20", "30", "blue", 1463883886L, VID,
                           MATCH_15_F);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:12,代码来源:MatchViewTest.java


示例15: testRenderQualMatch

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderQualMatch() throws Exception {
    View view = getView("2017week0_qm7");
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchBreakdownView2017Test.java


示例16: testRenderQualMatch

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderQualMatch() throws Exception {
    View view = getView("2016necmp_qm1");
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchBreakdownView2016Test.java


示例17: testRenderPlayoffMatch

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderPlayoffMatch() throws Exception {
    View view = getView("2016necmp_f1m1");
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchBreakdownView2016Test.java


示例18: testRenderQualMatch

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderQualMatch() throws Exception {
    View view = getView("2014necmp_qm1");
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchBreakdownView2015Test.java


示例19: testRenderPlayoffMatch

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRenderPlayoffMatch() throws Exception {
    View view = getView("2014necmp_f1m1");
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:MatchBreakdownView2015Test.java


示例20: testRender3Team

import com.facebook.testing.screenshot.Screenshot; //导入依赖的package包/类
@Test
public void testRender3Team() {
    View view = getView("2016test", "Alliance 1", 1, TEAM_LIST_3, PlayoffAdvancement.SEMI);
    ViewHelpers.setupView(view)
               .setExactWidthDp(WIDTH_DP)
               .layout();

    Screenshot.snap(view)
              .record();
}
 
开发者ID:the-blue-alliance,项目名称:the-blue-alliance-android,代码行数:11,代码来源:AllianceListElementTest.java



注:本文中的com.facebook.testing.screenshot.Screenshot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AuthFactory类代码示例发布时间:2022-05-23
下一篇:
Java ObjectDigestInfo类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap