本文整理汇总了Java中org.videolan.vlc.VLCApplication.sPlayerSleepTime方法的典型用法代码示例。如果您正苦于以下问题:Java VLCApplication.sPlayerSleepTime方法的具体用法?Java VLCApplication.sPlayerSleepTime怎么用?Java VLCApplication.sPlayerSleepTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.vlc.VLCApplication
的用法示例。
在下文中一共展示了VLCApplication.sPlayerSleepTime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (VLCApplication.sPlayerSleepTime != null && VLCApplication.sPlayerSleepTime.before(Calendar.getInstance()))
VLCApplication.sPlayerSleepTime = null;
if (getArguments() != null && getArguments().containsKey(MODE_KEY))
mMode = getArguments().getInt(MODE_KEY);
else
mMode = MODE_VIDEO;
mTheme = (mMode == MODE_VIDEO || Util.isBlackThemeEnabled()) ?
R.style.Theme_VLC_Black :
R.style.Theme_VLC;
setStyle(DialogFragment.STYLE_NO_FRAME, mTheme);
}
示例2: setSleep
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
public static void setSleep(Calendar time) {
AlarmManager alarmMgr = (AlarmManager) VLCApplication.getAppContext().getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(VLCApplication.SLEEP_INTENT);
PendingIntent sleepPendingIntent = PendingIntent.getBroadcast(VLCApplication.getAppContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
if (time != null) {
alarmMgr.set(AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), sleepPendingIntent);
}
else {
alarmMgr.cancel(sleepPendingIntent);
}
VLCApplication.sPlayerSleepTime = time;
}
示例3: onClick
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.sleep_icon:
if (VLCApplication.sPlayerSleepTime == null)
showTimePickerFragment(ACTION_SLEEP_TIMER);
else {
setSleep(null);
mHandler.sendEmptyMessage(TOGGLE_CANCEL);
}
break;
case R.id.playback_speed_icon:
showPlayBackSpeedDialog();
break;
case R.id.jump_chapter_title:
showSelectChapterDialog();
break;
case R.id.audio_delay:
showAudioSpuDelayControls(ACTION_AUDIO_DELAY);
break;
case R.id.spu_delay:
showAudioSpuDelayControls(ACTION_SPU_DELAY);
break;
case R.id.jump_title:
showTimePickerFragment(ACTION_JUMP_TO_TIME);
break;
case R.id.play_as_audio_icon:
((VideoPlayerActivity)getActivity()).switchToAudioMode(true);
break;
case R.id.opt_equalizer:
Intent i = new Intent(getActivity(), SecondaryActivity.class);
i.putExtra("fragment", SecondaryActivity.EQUALIZER);
startActivity(i);
dismiss();
break;
}
}
示例4: initSleep
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
public void initSleep () {
String text = null;
if (VLCApplication.sPlayerSleepTime == null) {
mSleep.setCompoundDrawablesWithIntrinsicBounds(0,
Util.getResourceFromAttribute(mActivity, R.attr.ic_sleep_normal_style),
0, 0);
} else {
mSleep.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_sleep_on, 0, 0);
text = DateFormat.getTimeFormat(mActivity).format(VLCApplication.sPlayerSleepTime.getTime());
}
mSleep.setText(text);
}
示例5: onClick
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.sleep:
if (VLCApplication.sPlayerSleepTime == null)
showTimePickerFragment(ACTION_SLEEP_TIMER);
else {
setSleep(null);
initSleep();
}
break;
case R.id.playback_speed:
showPlayBackSpeedDialog();
break;
case R.id.jump_chapter_title:
showSelectChapterDialog();
break;
case R.id.audio_delay:
showAudioSpuDelayControls(ACTION_AUDIO_DELAY);
break;
case R.id.spu_delay:
showAudioSpuDelayControls(ACTION_SPU_DELAY);
break;
case R.id.jump_title:
showTimePickerFragment(ACTION_JUMP_TO_TIME);
break;
case R.id.play_as_audio_icon:
((VideoPlayerActivity)getActivity()).switchToAudioMode(true);
break;
case R.id.opt_equalizer:
Intent i = new Intent(getActivity(), SecondaryActivity.class);
i.putExtra("fragment", SecondaryActivity.EQUALIZER);
startActivity(i);
dismiss();
break;
}
}
示例6: handleMessage
import org.videolan.vlc.VLCApplication; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
String text = null;
AdvOptionsDialog owner = getOwner();
if (owner == null || owner.isDetached())
return;
switch (msg.what) {
case SPEED_TEXT:
text = (String) msg.obj;
owner.mPlaybackSpeedValue.setText(text);
owner.mPlaybackSpeedIcon.setImageResource(VLCApplication.sPlayerSleepTime == null ?
Util.getResourceFromAttribute(owner.getActivity(), R.attr.ic_speed_normal_style) :
R.drawable.ic_speed_on);
break;
case TOGGLE_CANCEL:
owner.mSleepIcon.setImageResource(VLCApplication.sPlayerSleepTime == null ?
Util.getResourceFromAttribute(owner.getActivity(), R.attr.ic_sleep_normal_style):
R.drawable.ic_sleep_on);
case SLEEP_TEXT:
if (VLCApplication.sPlayerSleepTime != null)
text = DateFormat.getTimeFormat(owner.mSleepValue.getContext()).format(VLCApplication.sPlayerSleepTime.getTime());
owner.mSleepValue.setText(text);
break;
case DIALOG_LISTENER:
DialogFragment newFragment = (DialogFragment) msg.obj;
if (newFragment.getShowsDialog()) {
newFragment.getDialog().setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
obtainMessage(TOGGLE_CANCEL).sendToTarget();
}
});
} else if (retry) {
retry = false;
sendMessageDelayed(msg, 300);
}
break;
case RESET_RETRY:
retry = true;
break;
}
}