本文整理汇总了Java中com.jakewharton.scalpel.ScalpelFrameLayout.setId方法的典型用法代码示例。如果您正苦于以下问题:Java ScalpelFrameLayout.setId方法的具体用法?Java ScalpelFrameLayout.setId怎么用?Java ScalpelFrameLayout.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jakewharton.scalpel.ScalpelFrameLayout
的用法示例。
在下文中一共展示了ScalpelFrameLayout.setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWrapsActivity
import com.jakewharton.scalpel.ScalpelFrameLayout; //导入方法依赖的package包/类
@Test
public void testWrapsActivity() throws Exception {
Activity activity = Robolectric.buildActivity(Activity.class).create().get();
ScalpelFrameLayout scalpel = ScalpelUtil.wrapWithScalpel(activity);
@IdRes
int id = 0x11;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
id = View.generateViewId();
}
scalpel.setId(id);
View viewFromActivity = activity.findViewById(id);
Assert.assertThat(viewFromActivity, instanceOf(ScalpelFrameLayout.class));
Assert.assertThat((ScalpelFrameLayout) viewFromActivity, equalTo(scalpel));
}
示例2: testUnwrapsActivityOnThreeTaps
import com.jakewharton.scalpel.ScalpelFrameLayout; //导入方法依赖的package包/类
@Test
public void testUnwrapsActivityOnThreeTaps() throws Exception {
Activity activity = Robolectric.buildActivity(Activity.class).create().get();
ScalpelFrameLayout scalpel = ScalpelUtil.wrapWithScalpel(activity);
@IdRes
int id = 0x11;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
id = View.generateViewId();
}
scalpel.setId(id);
dispatchThreeDowns(scalpel);
View nextViewFromActivity = activity.findViewById(id);
Assert.assertThat(nextViewFromActivity, is(CoreMatchers.<View>nullValue()));
}
示例3: wrapItemWithScalpel
import com.jakewharton.scalpel.ScalpelFrameLayout; //导入方法依赖的package包/类
@OnClick(R.id.item_container) void wrapItemWithScalpel(View view){
ScalpelFrameLayout scalpel = ScalpelUtil.wrapWithScalpel(view);
scalpel.setId(R.id.scalpel_layout);
}