Java 类android.support.v4.util.SimpleArrayMap 实例源码

项目:GitHub    文件:FreeFlowContainer.java   
/**
 * Defines the choice behavior for the Container allowing multi-select etc.
 * 
 * @see <a href=
 *      "http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:choiceMode"
 *      >List View's Choice Mode</a>
 */
public void setChoiceMode(int choiceMode) {
    mChoiceMode = choiceMode;
    if (mChoiceActionMode != null) {
        mChoiceActionMode.finish();
        mChoiceActionMode = null;
    }
    if (mChoiceMode != CHOICE_MODE_NONE) {
        if (mCheckStates == null) {
            mCheckStates = new SimpleArrayMap<IndexPath, Boolean>();
        }
        if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
            clearChoices();
            setLongClickable(true);
        }
    }
}
项目:GitHub    文件:RangeStyle.java   
/**
 * @param start offset relative to its parent
 * @param end offset relative to its parent
 */
public void setRange(int start, int end) {
    mRange = Range.create(start, end);
    if (!mChildren.isEmpty()) {
        SimpleArrayMap<Range<Integer>, T> newMap = new SimpleArrayMap<>();
        for (int i = 0, size = mChildren.size(); i < size; i++) {
            T rangeStyle = mChildren.valueAt(i);
            int newStart = rangeStyle.getOriginStartOffset() + start;
            int newEnd = rangeStyle.getOriginEndOffset() + start;
            Range<Integer> newRange = Range.create(newStart, newEnd);
            newMap.put(newRange, rangeStyle);
            rangeStyle.setRange(newStart, newEnd);
        }
        mChildren.clear();
        mChildren.putAll(newMap);
    }
}
项目:GitHub    文件:RangeStyle.java   
/**
 * @param start offset relative to its parent
 * @param end offset relative to its parent
 */
public void setRange(int start, int end) {
    mRange = Range.create(start, end);
    if (!mChildren.isEmpty()) {
        SimpleArrayMap<Range<Integer>, T> newMap = new SimpleArrayMap<>();
        for (int i = 0, size = mChildren.size(); i < size; i++) {
            T rangeStyle = mChildren.valueAt(i);
            int newStart = rangeStyle.getOriginStartOffset() + start;
            int newEnd = rangeStyle.getOriginEndOffset() + start;
            Range<Integer> newRange = Range.create(newStart, newEnd);
            newMap.put(newRange, rangeStyle);
            rangeStyle.setRange(newStart, newEnd);
        }
        mChildren.clear();
        mChildren.putAll(newMap);
    }
}
项目:vlayout    文件:RangeStyle.java   
/**
 * @param start offset relative to its parent
 * @param end offset relative to its parent
 */
public void setRange(int start, int end) {
    mRange = Range.create(start, end);
    if (!mChildren.isEmpty()) {
        SimpleArrayMap<Range<Integer>, T> newMap = new SimpleArrayMap<>();
        for (int i = 0, size = mChildren.size(); i < size; i++) {
            T rangeStyle = mChildren.valueAt(i);
            int newStart = rangeStyle.getOriginStartOffset() + start;
            int newEnd = rangeStyle.getOriginEndOffset() + start;
            Range<Integer> newRange = Range.create(newStart, newEnd);
            newMap.put(newRange, rangeStyle);
            rangeStyle.setRange(newStart, newEnd);
        }
        mChildren.clear();
        mChildren.putAll(newMap);
    }
}
项目:letv    文件:FragmentHostCallback.java   
LoaderManagerImpl getLoaderManager(String who, boolean started, boolean create) {
    if (this.mAllLoaderManagers == null) {
        this.mAllLoaderManagers = new SimpleArrayMap();
    }
    LoaderManagerImpl lm = (LoaderManagerImpl) this.mAllLoaderManagers.get(who);
    if (lm != null) {
        lm.updateHostController(this);
        return lm;
    } else if (!create) {
        return lm;
    } else {
        lm = new LoaderManagerImpl(who, this, started);
        this.mAllLoaderManagers.put(who, lm);
        return lm;
    }
}
项目:letv    文件:FragmentHostCallback.java   
SimpleArrayMap<String, LoaderManager> retainLoaderNonConfig() {
    boolean retainLoaders = false;
    if (this.mAllLoaderManagers != null) {
        int i;
        int N = this.mAllLoaderManagers.size();
        LoaderManagerImpl[] loaders = new LoaderManagerImpl[N];
        for (i = N - 1; i >= 0; i--) {
            loaders[i] = (LoaderManagerImpl) this.mAllLoaderManagers.valueAt(i);
        }
        for (i = 0; i < N; i++) {
            LoaderManagerImpl lm = loaders[i];
            if (lm.mRetaining) {
                retainLoaders = true;
            } else {
                lm.doDestroy();
                this.mAllLoaderManagers.remove(lm.mWho);
            }
        }
    }
    if (retainLoaders) {
        return this.mAllLoaderManagers;
    }
    return null;
}
项目:letv    文件:FragmentActivity.java   
public final Object onRetainNonConfigurationInstance() {
    if (this.mStopped) {
        doReallyStop(true);
    }
    Object custom = onRetainCustomNonConfigurationInstance();
    List<Fragment> fragments = this.mFragments.retainNonConfig();
    SimpleArrayMap<String, LoaderManager> loaders = this.mFragments.retainLoaderNonConfig();
    if (fragments == null && loaders == null && custom == null) {
        return null;
    }
    Object nci = new NonConfigurationInstances();
    nci.custom = custom;
    nci.fragments = fragments;
    nci.loaders = loaders;
    return nci;
}
项目:boohee_v5.6    文件:FragmentHostCallback.java   
LoaderManagerImpl getLoaderManager(String who, boolean started, boolean create) {
    if (this.mAllLoaderManagers == null) {
        this.mAllLoaderManagers = new SimpleArrayMap();
    }
    LoaderManagerImpl lm = (LoaderManagerImpl) this.mAllLoaderManagers.get(who);
    if (lm != null) {
        lm.updateHostController(this);
        return lm;
    } else if (!create) {
        return lm;
    } else {
        lm = new LoaderManagerImpl(who, this, started);
        this.mAllLoaderManagers.put(who, lm);
        return lm;
    }
}
项目:boohee_v5.6    文件:FragmentHostCallback.java   
SimpleArrayMap<String, LoaderManager> retainLoaderNonConfig() {
    boolean retainLoaders = false;
    if (this.mAllLoaderManagers != null) {
        int i;
        int N = this.mAllLoaderManagers.size();
        LoaderManagerImpl[] loaders = new LoaderManagerImpl[N];
        for (i = N - 1; i >= 0; i--) {
            loaders[i] = (LoaderManagerImpl) this.mAllLoaderManagers.valueAt(i);
        }
        for (i = 0; i < N; i++) {
            LoaderManagerImpl lm = loaders[i];
            if (lm.mRetaining) {
                retainLoaders = true;
            } else {
                lm.doDestroy();
                this.mAllLoaderManagers.remove(lm.mWho);
            }
        }
    }
    if (retainLoaders) {
        return this.mAllLoaderManagers;
    }
    return null;
}
项目:boohee_v5.6    文件:FragmentActivity.java   
public final Object onRetainNonConfigurationInstance() {
    if (this.mStopped) {
        doReallyStop(true);
    }
    Object custom = onRetainCustomNonConfigurationInstance();
    List<Fragment> fragments = this.mFragments.retainNonConfig();
    SimpleArrayMap<String, LoaderManager> loaders = this.mFragments.retainLoaderNonConfig();
    if (fragments == null && loaders == null && custom == null) {
        return null;
    }
    Object nci = new NonConfigurationInstances();
    nci.custom = custom;
    nci.fragments = fragments;
    nci.loaders = loaders;
    return nci;
}
项目:firebase-jobdispatcher-android    文件:GooglePlayReceiver.java   
@Nullable
JobInvocation prepareJob(JobCallback callback, Bundle bundle) {
  JobInvocation job = prefixedCoder.decodeIntentBundle(bundle);
  if (job == null) {
    Log.e(TAG, "unable to decode job");
    sendResultSafely(callback, JobService.RESULT_FAIL_NORETRY);
    return null;
  }
  synchronized (callbacks) {
    SimpleArrayMap<String, JobCallback> map = callbacks.get(job.getService());
    if (map == null) {
      map = new SimpleArrayMap<>(1);
      callbacks.put(job.getService(), map);
    }

    map.put(job.getTag(), callback);
  }
  return job;
}
项目:firebase-jobdispatcher-android    文件:GooglePlayReceiver.java   
/**
 * Stops the job if it is running.
 *
 * <p>Needed to avoid possibility of sending job result before the reschedule request is received
 * by Google Play services.
 */
static void onSchedule(Job job) {
  // Stop if running
  synchronized (callbacks) {
    SimpleArrayMap<String, JobCallback> jobs = callbacks.get(job.getService());
    if (jobs == null) { // not running
      return;
    }
    JobCallback jobCallback = jobs.get(job.getTag());
    if (jobCallback == null) { // not running
      return;
    }
    JobInvocation key =
        new JobInvocation.Builder()
            .setTag(job.getTag())
            .setService(job.getService())
            .setTrigger(job.getTrigger())
            .build();
    ExecutionDelegator.stopJob(key, false /* must not send the result */);
  }
}
项目:tomate    文件:Facade.java   
@Nullable
@WorkerThread
public static SimpleArrayMap<String, Task> getTasks(Context context) {
    LogUtils.d(TAG, "Loading tasks");

    try {
        SimpleArrayMap<String, Task> ret;
        String json = getString(context, KEY_TASKS);

        if (TextUtils.isEmpty(json)) {
            ret = new SimpleArrayMap<>();
        } else {
            ret = TasksPersistence.fromJson(json);
        }

        LogUtils.d(TAG, "Loaded tasks " + ret);
        return ret;
    } catch (JSONException e) {
        LogUtils.e(TAG, e);
        return null;
    }
}
项目:tomate    文件:TasksPersistence.java   
public static String toJson(SimpleArrayMap<String, Task> tasks)
        throws JSONException {
    JSONObject root = new JSONObject();
    JSONObject jsonTasks = new JSONObject();

    for (int i = 0; i < tasks.size(); ++i) {
        String cardId = tasks.keyAt(i);
        Task task = tasks.valueAt(i);
        jsonTasks.put(cardId, toJson(task));
    }

    root.put(KEY_TASKS, jsonTasks);
    String json = root.toString();
    LogUtils.d(TAG, "Generated tasks JSON " + json);
    return json;
}
项目:tomate    文件:TasksPersistence.java   
public static SimpleArrayMap<String, Task> fromJson(String json)
        throws JSONException {
    LogUtils.d(TAG, "Parsing " + json);
    JSONObject root = new JSONObject(json);
    JSONObject jsonTasks = root.getJSONObject(KEY_TASKS);
    SimpleArrayMap<String, Task> tasks = new SimpleArrayMap<>();
    Iterator<String> iterator = jsonTasks.keys();

    while (iterator.hasNext()) {
        String cardId = iterator.next();
        JSONObject jsonTask = jsonTasks.getJSONObject(cardId);
        tasks.put(cardId, fromJson(cardId, jsonTask));
    }

    return tasks;
}
项目:material-components-android    文件:ExtendableSavedState.java   
private ExtendableSavedState(Parcel in, ClassLoader loader) {
  super(in, loader);

  int size = in.readInt();

  String[] keys = new String[size];
  in.readStringArray(keys);

  Bundle[] states = new Bundle[size];
  in.readTypedArray(states, Bundle.CREATOR);

  extendableStates = new SimpleArrayMap<>(size);
  for (int i = 0; i < size; i++) {
    extendableStates.put(keys[i], states[i]);
  }
}
项目:Decouplex    文件:Handlers.java   
Method forName(String methodName) {
    Method handler = immediateHandlers.get(methodName);
    if (handler != null) {
        return handler;
    }

    SimpleArrayMap<String, Method> wildcardHandlers = this.wildcardHandlers;
    int size = wildcardHandlers.size();
    for (int i = 0; i < size; i++) {
        String wildcard = wildcardHandlers.keyAt(i);
        if (methodName.matches(wildcard.replace("*", ".*?"))) {
            return wildcardHandlers.get(wildcard);
        }
    }

    return fallback;
}
项目:FMTech    文件:FragmentHostCallback.java   
final LoaderManagerImpl getLoaderManager(String paramString, boolean paramBoolean1, boolean paramBoolean2)
{
  if (this.mAllLoaderManagers == null) {
    this.mAllLoaderManagers = new SimpleArrayMap();
  }
  LoaderManagerImpl localLoaderManagerImpl = (LoaderManagerImpl)this.mAllLoaderManagers.get(paramString);
  if (localLoaderManagerImpl == null)
  {
    if (paramBoolean2)
    {
      localLoaderManagerImpl = new LoaderManagerImpl(paramString, this, paramBoolean1);
      this.mAllLoaderManagers.put(paramString, localLoaderManagerImpl);
    }
    return localLoaderManagerImpl;
  }
  localLoaderManagerImpl.mHost = this;
  return localLoaderManagerImpl;
}
项目:FMTech    文件:FragmentActivity.java   
public void onCreate(Bundle paramBundle)
{
  FragmentController localFragmentController1 = this.mFragments;
  localFragmentController1.mHost.mFragmentManager.attachController(localFragmentController1.mHost, localFragmentController1.mHost, null);
  super.onCreate(paramBundle);
  NonConfigurationInstances localNonConfigurationInstances = (NonConfigurationInstances)getLastNonConfigurationInstance();
  if (localNonConfigurationInstances != null)
  {
    FragmentController localFragmentController3 = this.mFragments;
    SimpleArrayMap localSimpleArrayMap = localNonConfigurationInstances.loaders;
    localFragmentController3.mHost.mAllLoaderManagers = localSimpleArrayMap;
  }
  if (paramBundle != null)
  {
    Parcelable localParcelable = paramBundle.getParcelable("android:support:fragments");
    FragmentController localFragmentController2 = this.mFragments;
    List localList = null;
    if (localNonConfigurationInstances != null) {
      localList = localNonConfigurationInstances.fragments;
    }
    localFragmentController2.mHost.mFragmentManager.restoreAllState(localParcelable, localList);
  }
  this.mFragments.mHost.mFragmentManager.dispatchCreate();
}
项目:VCL-Android    文件:VideoGridFragment.java   
@Override
protected Void doInBackground(Void... params) {
    int size;
    MediaWrapper MediaWrapper;

    ArrayList<MediaWrapper> mediaList = mMediaLibrary.getVideoItems();
    size = mediaList == null ? 0 : mediaList.size();
    mMediaIndex = new SimpleArrayMap<String, Integer>(size);

    for (int i = 0 ; i < size ; ++i){
        MediaWrapper = mediaList.get(i);
        mMediaIndex.put(MediaWrapper.getLocation(), Integer.valueOf(i));
        publishProgress(MediaWrapper);
    }
    return null;
}
项目:MyCTFWriteUps    文件:FragmentActivity.java   
public final Object onRetainNonConfigurationInstance()
{
    if (mStopped)
    {
        doReallyStop(true);
    }
    Object obj = onRetainCustomNonConfigurationInstance();
    List list = mFragments.retainNonConfig();
    SimpleArrayMap simplearraymap = mFragments.retainLoaderNonConfig();
    if (list == null && simplearraymap == null && obj == null)
    {
        return null;
    } else
    {
        NonConfigurationInstances nonconfigurationinstances = new NonConfigurationInstances();
        nonconfigurationinstances.custom = obj;
        nonconfigurationinstances.fragments = list;
        nonconfigurationinstances.loaders = simplearraymap;
        return nonconfigurationinstances;
    }
}
项目:UltimateAndroid    文件:FreeFlowContainer.java   
/**
 * Defines the choice behavior for the Container allowing multi-select etc.
 * 
 * @see <a href=
 *      "http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:choiceMode"
 *      >List View's Choice Mode</a>
 */
public void setChoiceMode(int choiceMode) {
    mChoiceMode = choiceMode;
    if (mChoiceActionMode != null) {
        mChoiceActionMode.finish();
        mChoiceActionMode = null;
    }
    if (mChoiceMode != CHOICE_MODE_NONE) {
        if (mCheckStates == null) {
            mCheckStates = new SimpleArrayMap<IndexPath, Boolean>();
        }
        if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
            clearChoices();
            setLongClickable(true);
        }
    }
}
项目:UltimateAndroid    文件:FreeFlowContainer.java   
/**
 * Defines the choice behavior for the Container allowing multi-select etc.
 * 
 * @see <a href=
 *      "http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:choiceMode"
 *      >List View's Choice Mode</a>
 */
public void setChoiceMode(int choiceMode) {
    mChoiceMode = choiceMode;
    if (mChoiceActionMode != null) {
        mChoiceActionMode.finish();
        mChoiceActionMode = null;
    }
    if (mChoiceMode != CHOICE_MODE_NONE) {
        if (mCheckStates == null) {
            mCheckStates = new SimpleArrayMap<IndexPath, Boolean>();
        }
        if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
            clearChoices();
            setLongClickable(true);
        }
    }
}
项目:FreeFlow    文件:FreeFlowContainer.java   
/**
 * Defines the choice behavior for the Container allowing multi-select etc.
 * 
 * @see <a href=
 *      "http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:choiceMode"
 *      >List View's Choice Mode</a>
 */
public void setChoiceMode(int choiceMode) {
    mChoiceMode = choiceMode;
    if (mChoiceActionMode != null) {
        mChoiceActionMode.finish();
        mChoiceActionMode = null;
    }
    if (mChoiceMode != CHOICE_MODE_NONE) {
        if (mCheckStates == null) {
            mCheckStates = new SimpleArrayMap<IndexPath, Boolean>();
        }
        if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
            clearChoices();
            setLongClickable(true);
        }
    }
}
项目:GitHub    文件:FreeFlowContainer.java   
@Override
public void setOnItemLongClickListener(OnItemLongClickListener listener) {
    super.setOnItemLongClickListener(listener);
    if (mCheckStates==null) {
        mCheckStates = new SimpleArrayMap<IndexPath, Boolean>(); 
    }
}
项目:eBread    文件:SettingManager.java   
public ArrayMap<String, String> getSettings() {
    ArrayMap<String, String> allSetts= new ArrayMap<>();
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(0).getSpecs());
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(1).getSpecs());
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(2).getSpecs());
    return allSetts;
}
项目:Virtualview-Android    文件:ViewBase.java   
private void setTag(String key, Object tag) {
    if (mKeyedTags == null) {
        mKeyedTags = new SimpleArrayMap<>();
    }

    mKeyedTags.put(key, tag);
}
项目:BWS-Android    文件:AsynchronousBackgroundHandler.java   
private <T> int getTaskId(SimpleArrayMap<Integer, T> taskList) {
    for (int i = 0; i < Integer.MAX_VALUE; i++) {
        if (!taskList.containsKey(i)) {
            return i;
        }
    }
    throw new IllegalStateException("no more task ids available");
}
项目:Brevent    文件:BreventResponse.java   
public BreventResponse(Collection<String> brevent, Collection<String> priority,
                       SimpleArrayMap<String, SparseIntArray> processes,
                       Collection<String> trustAgents, boolean supportStopped,
                       boolean supportStandby, long daemonTime, long serverTime, boolean granted,
                       Collection<String> androidProcesses,
                       Collection<String> fullPowerList, boolean supportUpgrade,
                       String alipaySum, String vpn, Collection<String> packages,
                       boolean supportAppops, boolean alipaySin, boolean promotion,
                       boolean forceStopped) {
    super(BreventProtocol.STATUS_RESPONSE);
    mBrevent = brevent;
    mPriority = priority;
    mProcesses = processes;
    mTrustAgents = trustAgents;
    mSupportStopped = supportStopped;
    mSupportStandby = supportStandby;
    mDaemonTime = daemonTime;
    mServerTime = serverTime;
    mGranted = granted;
    mAndroidProcesses = androidProcesses;
    mFullPowerList = fullPowerList;
    mSupportUpgrade = supportUpgrade;
    mAlipaySum = alipaySum;
    mVpn = vpn;
    mPackages = packages;
    mSupportAppops = supportAppops;
    mAlipaySin = alipaySin;
    mPromotion = promotion;
    mForceStopped = forceStopped;
}
项目:Brevent    文件:ParcelUtils.java   
@NonNull
static SimpleArrayMap<String, SparseIntArray> readSimpleArrayMap(Parcel in) {
    int size = in.readInt();
    if (size <= 0) {
        return new SimpleArrayMap<>();
    }
    SimpleArrayMap<String, SparseIntArray> map = new SimpleArrayMap<>(size);
    for (int i = 0; i < size; ++i) {
        map.put(in.readString(), readSparseIntArray(in));
    }
    return map;
}
项目:Brevent    文件:ParcelUtils.java   
static void writeSimpleArrayMap(Parcel dest,
                                @Nullable SimpleArrayMap<String, SparseIntArray> map) {
    if (map == null) {
        dest.writeInt(-1);
    } else {
        int size = map.size();
        dest.writeInt(size);
        for (int i = 0; i < size; ++i) {
            dest.writeString(map.keyAt(i));
            writeSparseIntArray(dest, map.valueAt(i));
        }
    }
}
项目:firebase-jobdispatcher-android    文件:GooglePlayReceiver.java   
@Override
public void onJobFinished(@NonNull JobInvocation js, @JobResult int result) {
  synchronized (callbacks) {
    try {
      SimpleArrayMap<String, JobCallback> map = callbacks.get(js.getService());
      if (map == null) {
        return;
      }
      JobCallback callback = map.remove(js.getTag());
      if (callback == null) {
        return;
      }
      if (map.isEmpty()) {
        callbacks.remove(js.getService());
      }

      if (needsToBeRescheduled(js, result)) {
        reschedule(js);
      } else {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
          Log.v(TAG, "sending jobFinished for " + js.getTag() + " = " + result);
        }
        sendResultSafely(callback, result);
      }
    } finally {
      if (callbacks.isEmpty()) {
        // Safe to call stopSelf, even if we're being bound to
        stopSelf(latestStartId);
      }
    }
  }
}
项目:prayer-times-android    文件:Sounds.java   
@NonNull
public static List<Sound> getAllSounds() {
    List<Sound> sounds = new ArrayList<>();
    SimpleArrayMap<String, List<Sound>> map = getSounds();
    for (int i = 0; i < map.size(); i++) {
        sounds.addAll(getSounds().get(map.valueAt(i)));
    }
    return sounds;
}
项目:CustomViewSets    文件:ZoomHoverView.java   
/**
 * 设置需要横跨的下标和跨度
 *
 * @param map key代表下标
 *            value代表跨度
 */
public void setSpan(SimpleArrayMap<Integer, Integer> map) {
    this.mNeedSpanMap.clear();
    this.mNeedSpanMap.putAll(map);
    if (this.mZoomHoverAdapter != null) {
        changeAdapter();
    }
}
项目:CustomViewSets    文件:ZoomHoverGridView.java   
/**
 * 设置跨度列表信息
 *
 * @param map
 */
public void setSpanList(SimpleArrayMap<Integer, ZoomHoverSpan> map) {
    this.mSpanMap.clear();
    this.mSpanMap.putAll(map);
    if (mZoomHoverAdapter != null) {
        //如果adapter不为null重新布局
        changeAdapter();
    }
}
项目:StraaS-android-sdk-sample    文件:ECommerceActivity.java   
@Override
public void onAggregatedDataAdded(SimpleArrayMap<String, Integer> map) {
    if (map.containsKey(XD)) {
        startAnimation(R.drawable.ic_emoji_xd, map.get(XD));
    }
    if (map.containsKey(LIKE)) {
        startAnimation(R.drawable.ic_emoji_like, map.get(LIKE));
    }
    if (map.containsKey(LOVE)) {
        startAnimation(R.drawable.ic_emoji_heart, map.get(LOVE));
    }
}
项目:tomate    文件:Facade.java   
@CheckResult
public static boolean saveTasks(Context context, SimpleArrayMap<String, Task> tasks) {
    try {
        return saveString(context, KEY_TASKS, TasksPersistence.toJson(tasks));
    } catch (JSONException e) {
        LogUtils.e(TAG, e);
        return false;
    }
}
项目:tomate    文件:UpdateTaskLoader.java   
@Override
public Boolean loadInBackground() {
    SimpleArrayMap<String, Task> tasks = Facade.getTasks(getContext());

    if (tasks != null) {
        Task task = tasks.get(mCardId);

        if (task == null) {
            tasks.put(mCardId, new Task(
                    mCardId,
                    mIncPomodoros ? 1 : 0,
                    mTime
            ));
        } else {
            int pomodoros = task.getPodomoros();

            if (mIncPomodoros) {
                ++pomodoros;
            }

            tasks.put(mCardId, new Task(
                    task.getCardId(),
                    pomodoros,
                    task.getTotalTime() + mTime
            ));
        }

        TomateApp.get().getTaskCache().setTasks(tasks);
        return Facade.saveTasks(getContext(), tasks);
    }

    return Boolean.FALSE;
}
项目:tomate    文件:SplashActivity.java   
@Override
public void onLoadFinished(Loader<SimpleArrayMap<String, Task>> loader, SimpleArrayMap<String, Task> tasks) {
    if (tasks != null) {
        TomateApp.get().getTaskCache().setTasks(tasks);
    }

    mTasksLoaded = true;

    if (mRemaining < 0L) {
        goNext(this);
    }
}
项目:gcm    文件:HomeFragment.java   
private void doExecuteSelectedTest() {
    QuickTest test = mQuickTests.get(getValue(R.id.home_quick_test));
    SimpleArrayMap<Integer, String> params = new SimpleArrayMap<>();
    for (Integer paramsId : test.getRequiredParameters()) {
        params.put(paramsId, getValue(paramsId));
    }
    test.execute(mLogger, getActivity(), params);
}