当前位置: 首页>>代码示例>>Java>>正文


Java Lists类代码示例

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


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

示例1: reset

import com.google.android.collect.Lists; //导入依赖的package包/类
public static void reset(Config config) {
  Robolectric.application = null;
  Robolectric.packageManager = null;
  Robolectric.activityThread = null;

  ShadowLooper.resetThreadLoopers();
  ShadowChoreographer.resetThreadLoopers();

  List<Class<?>> klasses = Lists.newArrayList();
  klasses.addAll(Arrays.asList(Robolectric.DEFAULT_SHADOW_CLASSES));
  klasses.addAll(Arrays.asList(config.shadows()));

  for (Class<?> klass : klasses) {
    if (klass.getAnnotation(Implements.class).resetStaticState()) {
      staticMethod("reset").in(klass).invoke();
    }
  }
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:19,代码来源:Robolectric.java

示例2: stringToPattern

import com.google.android.collect.Lists; //导入依赖的package包/类
/**
 * Deserialize a pattern.
 * 
 * @param string
 *            The pattern serialized with {@link #patternToString}
 * @return The pattern.
 */
public static List<LockPatternViewEx.Cell> stringToPattern(String string) {
    List<LockPatternViewEx.Cell> result = Lists.newArrayList();

    final byte[] bytes = string.getBytes();
    for (int i = 0; i < bytes.length; i++) {
        byte b = bytes[i];
        result.add(LockPatternViewEx.Cell.of(b / 3, b % 3));
    }
    return result;
}
 
开发者ID:ycdev-fork,项目名称:android-lockpattern,代码行数:18,代码来源:LockPatternUtils.java

示例3: stringSplitterTestHelper

import com.google.android.collect.Lists; //导入依赖的package包/类
private void stringSplitterTestHelper(String string, String[] expectedStrings) {
    TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
    splitter.setString(string);
    List<String> strings = Lists.newArrayList();
    for (String s : splitter) {
        strings.add(s);
    }
    MoreAsserts.assertEquals(expectedStrings, strings.toArray(new String[]{}));
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:10,代码来源:TextUtilsTest.java

示例4: performFiltering

import com.google.android.collect.Lists; //导入依赖的package包/类
@Override
protected FilterResults performFiltering(CharSequence text) {
  FilterResults results = new FilterResults();
  if (text != null) {
    results.count = 2;
    results.values = Lists.newArrayList("Foo", "Bar");
  }
  return results;
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:10,代码来源:AutoCompleteTextViewTest.java

示例5: shouldReturnExpectedEnabledServiceList

import com.google.android.collect.Lists; //导入依赖的package包/类
@Test
public void shouldReturnExpectedEnabledServiceList() {
  List<AccessibilityServiceInfo> expected = Lists.newArrayList(new AccessibilityServiceInfo());
  shadowAccessibilityManager.setEnabledAccessibilityServiceList(expected);
  assertThat(accessibilityManager.getEnabledAccessibilityServiceList(0)).isEqualTo(expected);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:7,代码来源:AccessibilityManagerTest.java

示例6: shouldReturnExpectedInstalledServiceList

import com.google.android.collect.Lists; //导入依赖的package包/类
@Test
public void shouldReturnExpectedInstalledServiceList() {
  List<AccessibilityServiceInfo> expected = Lists.newArrayList(new AccessibilityServiceInfo());
  shadowAccessibilityManager.setInstalledAccessibilityServiceList(expected);
  assertThat(accessibilityManager.getInstalledAccessibilityServiceList()).isEqualTo(expected);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:7,代码来源:AccessibilityManagerTest.java

示例7: shouldReturnExpectedAccessibilityServiceList

import com.google.android.collect.Lists; //导入依赖的package包/类
@Test
public void shouldReturnExpectedAccessibilityServiceList() {
  List<ServiceInfo> expected = Lists.newArrayList(new ServiceInfo());
  shadowAccessibilityManager.setAccessibilityServiceList(expected);
  assertThat(accessibilityManager.getAccessibilityServiceList()).isEqualTo(expected);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:7,代码来源:AccessibilityManagerTest.java


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