Java 类android.os.Handler.Callback 实例源码

项目:FMTech    文件:SnackbarManager.java   
final void showNextSnackbarLocked()
{
  if (this.mNextSnackbar != null)
  {
    this.mCurrentSnackbar = this.mNextSnackbar;
    this.mNextSnackbar = null;
    Callback localCallback = (Callback)this.mCurrentSnackbar.callback.get();
    if (localCallback != null) {
      localCallback.show();
    }
  }
  else
  {
    return;
  }
  this.mCurrentSnackbar = null;
}
项目:FMTech    文件:Snackbar.java   
final void onViewHidden$13462e()
{
  ViewParent localViewParent = this.mView.getParent();
  if ((localViewParent instanceof ViewGroup)) {
    ((ViewGroup)localViewParent).removeView(this.mView);
  }
  SnackbarManager localSnackbarManager = SnackbarManager.getInstance();
  SnackbarManager.Callback localCallback = this.mManagerCallback;
  synchronized (localSnackbarManager.mLock)
  {
    if (localSnackbarManager.isCurrentSnackbarLocked(localCallback))
    {
      localSnackbarManager.mCurrentSnackbar = null;
      if (localSnackbarManager.mNextSnackbar != null) {
        localSnackbarManager.showNextSnackbarLocked();
      }
    }
    return;
  }
}
项目:sms-ticket    文件:GlobalHandlerService.java   
@Override
public boolean handleMessage(Message msg) {
    // proces listeners for specified type of message what
    synchronized (mListenersSpecific) {
        List<BetterWeakReference<Callback>> whatListofListeners = mListenersSpecific.get(msg.what);
        if (whatListofListeners != null) {
            handleListeners(whatListofListeners, msg);
            if (whatListofListeners.size() == 0) {
                mListenersSpecific.remove(msg.what);
            }
        }
    }

    // process universal listeners
    handleListeners(mListenersUniversal, msg);

    return true;
}
项目:otm-android    文件:TreeEditDisplay.java   
public void deleteTree(View view) {
    Callback confirm = msg -> {
        if (msg.getData().getBoolean("confirm")) {

            RequestGenerator rc = new RequestGenerator();
            try {
                rc.deleteCurrentTreeOnPlot(App.getAppInstance(), plot.getId(), deleteTreeHandler);
            } catch (JSONException e) {
                Logger.error("Error deleting tree", e);
            }
        }
        return true;
    };

    confirmDelete(R.string.confirm_delete_tree_msg, confirm);
}
项目:otm-android    文件:App.java   
/**
 * Callback to ensure the instance has been loaded, either via a loaded, pending
 * or missing instance info. This method is safe to call at any time to wait for
 * instance info before proceeding with the callback.
 *
 * @param callback
 */
public void ensureInstanceLoaded(final Callback callback) {
    if (currentInstance != null) {
        Message msg = Message.obtain();
        Bundle data = new Bundle();
        data.putBoolean("success", true);
        msg.setData(data);

        callback.handleMessage(msg);
    } else {
        // If an instance request is pending, register for a callback on completion,
        // otherwise, force an instance request
        if (loadingInstance) {
            registeredInstanceCallbacks.add(callback);
        } else {
            reloadInstanceInfo(callback);
        }
    }
}
项目:cniao5    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:cniao5    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:MyFire    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:MyFire    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = R.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:yyox    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:yyox    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:POCenter    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:POCenter    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:YiZhi    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:YiZhi    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:topnews    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:topnews    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:weex-3d-map    文件:WXThread.java   
public static Callback secure(Callback callback){
  if(callback == null || callback instanceof SafeCallback){
    return callback;
  }

  return new SafeCallback(callback);
}
项目:ucar-weex-core    文件:WXThread.java   
public static Callback secure(Callback callback){
  if(callback == null || callback instanceof SafeCallback){
    return callback;
  }

  return new SafeCallback(callback);
}
项目:Huochexing12306    文件:EditPage.java   
/** 显示平台列表 */
public void afterPlatformListGot() {
    String name = String.valueOf(reqData.get("platform"));
    int size = platformList == null ? 0 : platformList.length;
    views = new View[size];

    final int dp_24 = dipToPx(getContext(), 24);
    LinearLayout.LayoutParams lpItem = new LinearLayout.LayoutParams(dp_24, dp_24);
    final int dp_9 = dipToPx(getContext(), 9);
    lpItem.setMargins(0, 0, dp_9, 0);
    FrameLayout.LayoutParams lpMask = new FrameLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    lpMask.gravity = Gravity.LEFT | Gravity.TOP;
    int selection = 0;
    for (int i = 0; i < size; i++) {
        FrameLayout fl = new FrameLayout(getContext());
        fl.setLayoutParams(lpItem);
        if (i >= size - 1) {
            fl.setLayoutParams(new LinearLayout.LayoutParams(dp_24, dp_24));
        }
        llPlat.addView(fl);
        fl.setOnClickListener(this);

        ImageView iv = new ImageView(getContext());
        iv.setScaleType(ScaleType.CENTER_INSIDE);
        iv.setImageBitmap(getPlatLogo(platformList[i]));
        iv.setLayoutParams(new FrameLayout.LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
        fl.addView(iv);

        views[i] = new View(getContext());
        views[i].setBackgroundColor(0xcfffffff);
        views[i].setOnClickListener(this);
        if (name != null && name.equals(platformList[i].getName())) {
            views[i].setVisibility(View.INVISIBLE);
            selection = i;

            // 编辑分享内容的统计
            ShareSDK.logDemoEvent(3, platformList[i]);
        }
        views[i].setLayoutParams(lpMask);
        fl.addView(views[i]);
    }

    final int postSel = selection;
    UIHandler.sendEmptyMessageDelayed(0, 333, new Callback() {
        public boolean handleMessage(Message msg) {
            HorizontalScrollView hsv = (HorizontalScrollView)llPlat.getParent();
            hsv.scrollTo(postSel * (dp_24 + dp_9), 0);
            return false;
        }
    });
}
项目:EventScheduler    文件:EventQueueThread.java   
public boolean enqueue(T data,Callback callback) {

        if(callback == null){
            throw new EventSchedulerRuntimeException("callback must be not null");
        }

        this.mCallback = callback;
        Handler handler = getHandler();
        Message msg = Message.obtain(handler, DISPATCH);
        msg.obj = data;
        return handler.sendMessage(msg);
    }
项目:LiuAGeAndroid    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:LiuAGeAndroid    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:TextEmoji    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:TextEmoji    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:boohee_v5.6    文件:UIHandler.java   
private static void handleMessage(Message message) {
    InnerObj innerObj = (InnerObj) message.obj;
    Message message2 = innerObj.msg;
    Callback callback = innerObj.callback;
    if (callback != null) {
        callback.handleMessage(message2);
    }
}
项目:boohee_v5.6    文件:EditPage.java   
public void onCreate() {
    if (this.shareParamMap == null || this.platforms == null || this.platforms.size() < 1) {
        finish();
        return;
    }
    genBackground();
    this.activity.setContentView(getPageView());
    onTextChanged(this.etContent.getText(), 0, this.etContent.length(), 0);
    showThumb();
    new Thread() {
        public void run() {
            try {
                EditPage.this.platformList = ShareSDK.getPlatformList();
                if (EditPage.this.platformList != null) {
                    ArrayList<Platform> list = new ArrayList();
                    for (Platform plat : EditPage.this.platformList) {
                        String name = plat.getName();
                        if (!((plat instanceof CustomPlatform) || ShareCore.isUseClientToShare(name))) {
                            list.add(plat);
                        }
                    }
                    EditPage.this.platformList = new Platform[list.size()];
                    for (int i = 0; i < EditPage.this.platformList.length; i++) {
                        EditPage.this.platformList[i] = (Platform) list.get(i);
                    }
                    UIHandler.sendEmptyMessage(1, new Callback() {
                        public boolean handleMessage(Message msg) {
                            EditPage.this.afterPlatformListGot();
                            return false;
                        }
                    });
                }
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
    }.start();
}
项目:androidgithub    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:androidgithub    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = R.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:LQRWeChat-master    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:LQRWeChat-master    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:QuanMinTV    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:QuanMinTV    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:Mobike    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:Mobike    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = R.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:LQRWeChat    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:LQRWeChat    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:Mybilibili    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}
项目:Mybilibili    文件:OnekeyShareThemeImpl.java   
private void toast(final String resOrName) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            int resId = ResHelper.getStringRes(context, resOrName);
            if (resId > 0) {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
            }
            return false;
        }
    });
}
项目:lqrwechatrongcloud    文件:FriendAdapter.java   
public void onCancel(Platform plat, int action) {
    UIHandler.sendEmptyMessage(0, new Callback() {
        public boolean handleMessage(Message msg) {
            activity.finish();
            return false;
        }
    });
}