List of usage examples for android.util SparseArray SparseArray
public SparseArray()
From source file:api.viewpage.CBLoopPagerAdapterWrapper.java
@Override public void notifyDataSetChanged() { mToDestroy = new SparseArray<ToDestroy>(); super.notifyDataSetChanged(); }
From source file:org.akvo.caddisfly.test.helper.ResultsTest.java
@Test public void testColorimetryResult() { TestInfo testInfo = TestConfigHelper.loadTestByUuid(SensorConstants.FLUORIDE_ID); assert testInfo != null; SparseArray<String> results = new SparseArray<>(); results.put(1, "> 2.0"); JSONObject resultJson = TestConfigHelper.getJsonResult(testInfo, results, -1, "", null); // Replace items that cannot be tested (e.g. currentTime) String json = resultJson.toString().replaceAll("(\"testDate\":\").*?\"", "$1today\""); json = json.replaceAll("(\"appVersion\":\").*?\"", "$1version\""); String expectedJson = "{\"type\":\"caddisfly\",\"name\":\"Water - Fluoride\",\"uuid\":\"f0f3c1dd-89af-49f1-83e7-bcc31c3006cf\",\"result\":[{\"name\":\"Fluoride\",\"unit\":\"ppm\",\"id\":1,\"value\":\"> 2.0\"}],\"testDate\":\"today\",\"user\":{\"backDropDetection\":true,\"language\":\"\"},\"app\":{\"appVersion\":\"version\",\"language\":\"en\"},\"device\":{\"model\":\"unknown\",\"product\":\"unknown\",\"manufacturer\":\"unknown\",\"os\":\"Android - 6.0.1_r3 (23)\",\"country\":\"US\",\"language\":\"en\"}}"; assertEquals(expectedJson, json);//w ww .j av a 2 s .c o m }
From source file:com.justwayward.reader.view.pdfview.PDFPagerAdapter.java
public PDFPagerAdapter(Context context, String pdfPath) { super(context, pdfPath); attachers = new SparseArray<>(); }
From source file:com.vp9.plugin.WebSocket.java
/** * {@inheritDoc}/*w w w. j av a 2 s. c om*/ */ @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); _factory = new WebSocketClientFactory(); _factory.setBufferSize(4096000); _conn = new SparseArray<Connection>(); try { start(); } catch (Exception e) { } }
From source file:org.apache.cordova.plugin.WebSocket.java
/** * {@inheritDoc}//from w w w. jav a2 s .c o m */ @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); _factory = new WebSocketClientFactory(); _factory.setBufferSize(4096); _conn = new SparseArray<Connection>(); try { start(); } catch (Exception e) { } }
From source file:com.idrv.coach.ui.view.LoopPagerAdapterWrapper.java
@Override public void notifyDataSetChanged() { if (mToDestroy != null) { mToDestroy.clear();//w ww. j a v a 2 s .c o m } else { mToDestroy = new SparseArray<>(); } super.notifyDataSetChanged(); }
From source file:com.SecUpwN.AIMSICD.AppAIMSICD.java
public AppAIMSICD() { mActivityTaskMap = new SparseArray<>(); }
From source file:tw.com.ischool.dominator.util.ViewPagerAdapter.java
public ViewPagerAdapter(FragmentManager fm) { mFragmentManager = fm; mRegisteredFragments = new SparseArray<Fragment>(); }
From source file:nz.ac.otago.psyanlab.common.designer.util.HashMapFragmentMapAdapter.java
public HashMapFragmentMapAdapter(FragmentManager fm, Factory<V> factory, HashMap<String, V> items) { super(fm);/* w ww . j a v a2 s . co m*/ mFactory = factory; mItems = items; Set<String> keySet = mItems.keySet(); mKeys = keySet.toArray(new String[mItems.size()]); Arrays.sort(mKeys); mFragments = new SparseArray<Fragment>(); }
From source file:cc.shawn.zzj.widget.LoopPagerAdapterWrapper.java
@Override public void notifyDataSetChanged() { mToDestroy = new SparseArray<>(); super.notifyDataSetChanged(); }