本文整理匯總了Java中com.github.obsessive.library.eventbus.EventCenter類的典型用法代碼示例。如果您正苦於以下問題:Java EventCenter類的具體用法?Java EventCenter怎麽用?Java EventCenter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EventCenter類屬於com.github.obsessive.library.eventbus包,在下文中一共展示了EventCenter類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCallStateChanged
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
public void onCallStateChanged(int state, String incomingNumber) {
super.onCallStateChanged(state, incomingNumber);
switch (state) {
case TelephonyManager.CALL_STATE_OFFHOOK:
case TelephonyManager.CALL_STATE_RINGING:
EventBus.getDefault().post(new EventCenter(Constants.EVENT_STOP_PLAY_MUSIC));
break;
case TelephonyManager.CALL_STATE_IDLE:
EventBus.getDefault().post(new EventCenter(Constants.EVENT_START_PLAY_MUSIC));
break;
}
}
示例2: onReceive
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
public void onReceive(Context context, Intent intent) {
if (null == intent) {
return;
}
String action = intent.getAction();
if (action.equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
EventBus.getDefault().post(new EventCenter(Constants.EVENT_STOP_PLAY_MUSIC));
}
}
示例3: onEventComming
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
protected void onEventComming(EventCenter eventCenter) {
if (null == mMusicsPresenter) {
return;
}
int eventCode = eventCenter.getEventCode();
switch (eventCode) {
case Constants.EVENT_START_PLAY_MUSIC:
mMusicsPresenter.onRePlay();
break;
case Constants.EVENT_STOP_PLAY_MUSIC:
mMusicsPresenter.onPausePlay();
break;
}
}
示例4: onReceive
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
public void onReceive(Context context, Intent intent) {
if (null == intent) {
return;
}
String action = intent.getAction();
if (action.equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
EventBus.getDefault().post(new EventCenter(Constants.EVENT_STOP_PLAY_MUSIC));
} else {
final TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(new PhoneStateListener() {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
super.onCallStateChanged(state, incomingNumber);
switch (state) {
case TelephonyManager.CALL_STATE_OFFHOOK:
case TelephonyManager.CALL_STATE_RINGING:
EventBus.getDefault().post(new EventCenter(Constants.EVENT_STOP_PLAY_MUSIC));
break;
case TelephonyManager.CALL_STATE_IDLE:
EventBus.getDefault().post(new EventCenter(Constants.EVENT_START_PLAY_MUSIC));
break;
}
}
}, PhoneStateListener.LISTEN_CALL_STATE);
}
}
示例5: onEventMainThread
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
public void onEventMainThread(EventCenter eventCenter) {
if (null == mVaryViewHelperController) {
throw new IllegalArgumentException("You must return a right target view for loading");
}
if (null != eventCenter) {
onEventComming(eventCenter);
}
}
示例6: onResume
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
protected void onResume() {
super.onResume();
EventBus.getDefault().post(new EventCenter(Constants.EVENT_STOP_PLAY_MUSIC));
}
示例7: onPause
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
protected void onPause() {
super.onPause();
EventBus.getDefault().post(new EventCenter(Constants.EVENT_START_PLAY_MUSIC));
}
示例8: onEventMainThread
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
public void onEventMainThread(EventCenter eventCenter) {
if (null != eventCenter) {
onEventComming(eventCenter);
}
}
示例9: onEventComming
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
@Override
protected void onEventComming(EventCenter eventCenter) {
}
示例10: onEventComming
import com.github.obsessive.library.eventbus.EventCenter; //導入依賴的package包/類
/**
* when event comming
*
* @param eventCenter
*/
protected abstract void onEventComming(EventCenter eventCenter);