本文整理匯總了Java中com.github.obsessive.simplifyreader.common.Constants類的典型用法代碼示例。如果您正苦於以下問題:Java Constants類的具體用法?Java Constants怎麽用?Java Constants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Constants類屬於com.github.obsessive.simplifyreader.common包,在下文中一共展示了Constants類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onReceive
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(MusicPlayState.ACTION_MUSIC_NEXT)) {
mPlayer.playNext();
} else if (action.equals(MusicPlayState.ACTION_MUSIC_PAUSE)) {
mPlayer.pause();
} else if (action.equals(MusicPlayState.ACTION_MUSIC_PLAY)) {
mPlayer.play();
} else if (action.equals(MusicPlayState.ACTION_MUSIC_PREV)) {
mPlayer.playPrev();
} else if (action.equals(MusicPlayState.ACTION_MUSIC_REPLAY)) {
mPlayer.replay();
} else if (action.equals(MusicPlayState.ACTION_MUSIC_STOP)) {
mPlayer.stop();
} else if (action.equals(MusicPlayState.ACTION_EXIT)) {
mPlayer.exit();
} else if (action.equals(MusicPlayState.ACTION_SEEK_TO)) {
int progress = intent.getIntExtra(Constants.KEY_PLAYER_SEEK_TO_PROGRESS, 0);
mPlayer.seekTo(progress);
}
}
示例2: onCallStateChanged
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的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;
}
}
示例3: sendPlayCurrentPosition
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
private void sendPlayCurrentPosition() {
new Thread() {
public void run() {
Intent intent = new Intent(Constants.ACTION_MUSIC_CURRENT_PROGRESS_BROADCAST);
while (mMediaPlayer.isPlaying()) {
intent.putExtra(Constants.KEY_MUSIC_CURRENT_DUTATION, getCurPosition());
mContext.sendBroadcast(intent);
try {
sleep(SLEEP_TIME);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}.start();
}
示例4: onFirstUserVisible
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
protected void onFirstUserVisible() {
mCurrentPage = 0;
mImagesListPresenter = new ImagesListPresenterImpl(mContext, this);
if (NetUtils.isNetworkConnected(mContext)) {
if (null != mSwipeRefreshLayout) {
mSwipeRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mImagesListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentImagesCategory,
mCurrentPage, false);
}
}, ApiConstants.Integers.PAGE_LAZY_LOAD_DELAY_TIME_MS);
}
} else {
toggleNetworkError(true, new View.OnClickListener() {
@Override
public void onClick(View v) {
mImagesListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentImagesCategory,
mCurrentPage, false);
}
});
}
}
示例5: onFirstUserVisible
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
protected void onFirstUserVisible() {
toggleShowLoading(true, null);
mMusicsPresenter = new MusicsPresenterImpl(mContext, this);
if (NetUtils.isNetworkConnected(mContext)) {
mMusicsPresenter.loadListData(TAG_LOG, mMusicsCollectId, Constants.EVENT_REFRESH_DATA);
} else {
toggleNetworkError(true, new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleShowLoading(true, null);
mMusicsPresenter.loadListData(TAG_LOG, mMusicsCollectId, Constants.EVENT_REFRESH_DATA);
}
});
}
}
示例6: onActivityCreated
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mBundleBroadCast = new PlayBundleBroadCast();
IntentFilter bundleFilter = new IntentFilter();
bundleFilter.addAction(Constants.ACTION_MUSIC_BUNDLE_BROADCAST);
mContext.registerReceiver(mBundleBroadCast, bundleFilter);
mPositionBroadCast = new PlayPositionBroadCast();
IntentFilter posFilter = new IntentFilter();
posFilter.addAction(Constants.ACTION_MUSIC_CURRENT_PROGRESS_BROADCAST);
mContext.registerReceiver(mPositionBroadCast, posFilter);
mSecondProgressBroadCast = new PlaySecondProgressBroadCast();
IntentFilter secondProgressFilter = new IntentFilter();
secondProgressFilter.addAction(Constants.ACTION_MUSIC_SECOND_PROGRESS_BROADCAST);
mContext.registerReceiver(mSecondProgressBroadCast, secondProgressFilter);
mContext.startService(new Intent(mContext, MusicPlayService.class));
}
示例7: onFirstUserVisible
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
protected void onFirstUserVisible() {
mCurrentPage = 1;
mVideosListPresenter = new VideosListPresenterImpl(mContext, this);
if (NetUtils.isNetworkConnected(mContext)) {
if (null != mSwipeRefreshLayout) {
mSwipeRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mVideosListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentVideosCategory,
mCurrentPage, false);
}
}, ApiConstants.Integers.PAGE_LAZY_LOAD_DELAY_TIME_MS);
}
} else {
toggleNetworkError(true, new View.OnClickListener() {
@Override
public void onClick(View v) {
mVideosListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentVideosCategory,
mCurrentPage, false);
}
});
}
}
示例8: onBufferingUpdate
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
TLog.d(TAG, "second percent --> " + percent);
if (percent < 100) {
Intent intent = new Intent();
intent.setAction(Constants.ACTION_MUSIC_SECOND_PROGRESS_BROADCAST);
intent.putExtra(Constants.KEY_MUSIC_SECOND_PROGRESS, percent);
mContext.sendBroadcast(intent);
}
}
示例9: sendPlayBundle
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
private void sendPlayBundle() {
Intent intent = new Intent(Constants.ACTION_MUSIC_BUNDLE_BROADCAST);
Bundle extras = new Bundle();
extras.putInt(Constants.KEY_MUSIC_TOTAL_DURATION, getDuration());
extras.putParcelable(Constants.KEY_MUSIC_PARCELABLE_DATA, mMusicList.get(mCurPlayIndex));
intent.putExtras(extras);
mContext.sendBroadcast(intent);
}
示例10: showError
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void showError(String msg) {
if (null != mSwipeRefreshLayout) {
mSwipeRefreshLayout.setRefreshing(false);
}
toggleShowError(true, msg, new View.OnClickListener() {
@Override
public void onClick(View v) {
mImagesListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentImagesCategory,
mCurrentPage, false);
}
});
}
示例11: onEventComming
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的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;
}
}
示例12: playNextMusic
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void playNextMusic() {
isPlaying = true;
mPlayerDiscView.next();
mPlayerCtrlBtn.setImageResource(R.drawable.btn_play_selector);
mMusicsPresenter.loadListData(TAG_LOG, mMusicsCollectId, Constants.EVENT_LOAD_MORE_DATA);
}
示例13: onReceive
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (null != action && !TextUtils.isEmpty(action)) {
if (action.equals(Constants.ACTION_MUSIC_BUNDLE_BROADCAST)) {
Bundle extras = intent.getExtras();
if (null != extras) {
MusicsListEntity entity = extras.getParcelable(Constants.KEY_MUSIC_PARCELABLE_DATA);
int totalDuration = extras.getInt(Constants.KEY_MUSIC_TOTAL_DURATION);
mMusicsPresenter.refreshPageInfo(entity, totalDuration);
}
}
}
}
示例14: showError
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void showError(String msg) {
toggleShowError(true, msg, new View.OnClickListener() {
@Override
public void onClick(View v) {
mMusicsPresenter.loadListData(TAG_LOG, mMusicsCollectId, Constants.EVENT_REFRESH_DATA);
}
});
}
示例15: showError
import com.github.obsessive.simplifyreader.common.Constants; //導入依賴的package包/類
@Override
public void showError(String msg) {
if (null != mSwipeRefreshLayout) {
mSwipeRefreshLayout.setRefreshing(false);
}
toggleShowError(true, msg, new View.OnClickListener() {
@Override
public void onClick(View v) {
mVideosListPresenter.loadListData(TAG_LOG, Constants.EVENT_REFRESH_DATA, mCurrentVideosCategory,
mCurrentPage, false);
}
});
}