當前位置: 首頁>>代碼示例>>Java>>正文


Java TimePickerDialog.setTitle方法代碼示例

本文整理匯總了Java中android.app.TimePickerDialog.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java TimePickerDialog.setTitle方法的具體用法?Java TimePickerDialog.setTitle怎麽用?Java TimePickerDialog.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.TimePickerDialog的用法示例。


在下文中一共展示了TimePickerDialog.setTitle方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAlarm

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Subscribe
public void setAlarm(OnAlarmClickEvent event) {
    arrivalTime = event.arrivalTime;
    alarmTime = event.arrivalTime;
    int reminder = Integer.parseInt(sharedPreferences.getString(getString(R.string.pref_key_alarm_reminder), "5"));
    alarmTime = alarmTime.minusMinutes(reminder);

    TimePickerDialog timePickerDialog = new TimePickerDialog(
            this,
            this,
            alarmTime.getHourOfDay(),
            alarmTime.getMinuteOfHour(),
            DateFormat.is24HourFormat(this)
    );
    timePickerDialog.setTitle(R.string.alarm_dialog_title);
    timePickerDialog.setMessage(getString(R.string.alarm_dialog_message_fmt, DateUtils.formatTime(arrivalTime)));
    timePickerDialog.show();
}
 
開發者ID:tjyu1040,項目名稱:GallyShuttle,代碼行數:19,代碼來源:ScheduleActivity.java

示例2: setCountDownTime

import android.app.TimePickerDialog; //導入方法依賴的package包/類
private void setCountDownTime(final CountDownTimerView countDownTimerView)
{
	TimePickerDialog timePickerDialog = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener()
	{
		//hours are taken as minutes and minutes as seconds
		@Override
		public void onTimeSet(TimePicker view, int minute, int second)
		{
			long countDownMillis = (minute * 60 + second) * 1000;
			countDownTimerView.setCountDownTime(countDownMillis);
		}
	}, 0, 0, true);
	timePickerDialog.setTitle(getString(R.string.minutes_and_seconds));

	timePickerDialog.show();
}
 
開發者ID:jraska,項目名稱:TimerViews,代碼行數:17,代碼來源:CountDownTimersActivity.java

示例3: onDialogClosed

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Override
protected void onDialogClosed(final boolean positiveResult) {
    if (positiveResult) {
        v.set(dp.getYear(), dp.getMonth(), dp.getDayOfMonth());
        cv.put(getKey(), v.getTimeInMillis());
        if (ul != null) {
            ul.onUpdateValue(this);
        }
        if (dt) {
            TimePickerDialog tpd = new TimePickerDialog(getContext(), this,
                    v.get(Calendar.HOUR_OF_DAY), v.get(Calendar.MINUTE), true);
            tpd.setTitle(getTitle());
            tpd.setCancelable(true);
            tpd.show();
        }
    }
}
 
開發者ID:felixb,項目名稱:callmeter,代碼行數:18,代碼來源:CVDatePreference.java

示例4: pickNightTime

import android.app.TimePickerDialog; //導入方法依賴的package包/類
private void pickNightTime() {
    TimePickerDialog.OnTimeSetListener startTimeListener = (view, startHourOfDay, startMinuteOfDay) -> {
        TimePickerDialog timePickerDialogEnd = new TimePickerDialog(getActivity(), (view1, endHourOfDay, endMinuteOfDay) -> storeNightModeInterval(startHourOfDay * 60 + startMinuteOfDay, endHourOfDay * 60 + endMinuteOfDay), Settings.get().ui().getNightEndTime() / 60, Settings.get().ui().getNightEndTime() % 60, true);

        timePickerDialogEnd.setTitle(R.string.title_end_time);
        timePickerDialogEnd.show();
    };

    TimePickerDialog timePickerDialogStart = new TimePickerDialog(getActivity(), startTimeListener,
            Settings.get().ui().getNightStartTime() / 60, Settings.get().ui().getNightStartTime() % 60, true);
    timePickerDialogStart.setTitle(R.string.title_start_time);
    timePickerDialogStart.show();
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:14,代碼來源:PreferencesFragment.java

示例5: openTimePickerDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
private void openTimePickerDialog(boolean is24r) {
    Calendar calendar = Calendar.getInstance();

    timePickerDialog = new TimePickerDialog(BluetoothActivity.this,
            onTimeSetListener, calendar.get(Calendar.HOUR_OF_DAY),
            calendar.get(Calendar.MINUTE), is24r);
    timePickerDialog.setTitle("Set Alarm Time");

    timePickerDialog.show();

}
 
開發者ID:bilal-rashid,項目名稱:Lazy-Switches,代碼行數:12,代碼來源:BluetoothActivity.java

示例6: onCreateDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    TimePickerDialog tp = new TimePickerDialog(getActivity(), this, this.hour, this.minute,
            DateFormat.is24HourFormat(getActivity()));
    if (title != null) tp.setTitle(title);
    return tp;
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:9,代碼來源:TimePickerFragment.java

示例7: onCreateDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    Calendar cal = DateHelper.getCalendar(defaultTime);
    int hour = cal.get(Calendar.HOUR_OF_DAY);
    int minute = cal.get(Calendar.MINUTE);

    // Create a new instance of TimePickerDialog and return it
    boolean is24HourMode = DateHelper.is24HourMode(mActivity);
    TimePickerDialog tpd = new TimePickerDialog(mActivity, R.style.Theme_AppCompat_Dialog_NoBackgroundOrDim, mListener, hour, minute, is24HourMode);
    tpd.setTitle("");
    return tpd;
}
 
開發者ID:ApplicationFactory,項目名稱:PEP---Notes,代碼行數:14,代碼來源:TimePickerFragment.java

示例8: openTimePickerDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
private void openTimePickerDialog(boolean is24r){
	Calendar calendar = Calendar.getInstance();
	
	timePickerDialog = new TimePickerDialog(getActivity(),onTimeSetListener, 
			calendar.get(Calendar.HOUR_OF_DAY), 
			calendar.get(Calendar.MINUTE), 
			is24r);
	timePickerDialog.setTitle("Set Alarm Time");  
       
	timePickerDialog.show();

}
 
開發者ID:halimbimantara,項目名稱:Arduscam,代碼行數:13,代碼來源:HomeFragment.java

示例9: onSetTime

import android.app.TimePickerDialog; //導入方法依賴的package包/類
public void onSetTime(View v) {
	TimePickerDialog picker = new TimePickerDialog(v.getContext(),
		TimePickerDialog.THEME_DEVICE_DEFAULT_LIGHT, (p, hour, minute) -> {
			App.dispatch(new CountdoneAction(CountdoneAction.Type.SET_DURATION, (hour * 60 + minute ) * 60 * 1000L));
		}, (int) App.state().currentTask().remainder()/60/60/1000,
		(int) (App.state().currentTask().remainder()/60/1000)%60, true);
	picker.setTitle(R.string.set_time_title);
	picker.show();
}
 
開發者ID:zserge,項目名稱:anvil-examples,代碼行數:10,代碼來源:CountDownView.java

示例10: onCreateDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    int hour = 0;
    int minute = 0;

    TimePickerDialog tpd = new TimePickerDialog(getActivity(), this, hour, minute, true);

    tpd.setTitle(R.string.timer_title);
    tpd.setMessage(getString(R.string.set_time_from_now));

    return tpd;
}
 
開發者ID:cartermp,項目名稱:WMB,代碼行數:13,代碼來源:TimePickerFragment.java

示例11: onCreateDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	
	Calendar cal = DateHelper.getCalendar(defaultTime);
	int hour = cal.get(Calendar.HOUR_OF_DAY);
	int minute = cal.get(Calendar.MINUTE);

	// Create a new instance of TimePickerDialog and return it
	boolean is24HourMode = DateHelper.is24HourMode(mActivity);
	TimePickerDialog tpd = new TimePickerDialog(mActivity, R.style.Theme_AppCompat_Dialog_NoBackgroundOrDim, mListener, hour, minute, is24HourMode);
	tpd.setTitle("");
	return tpd;
}
 
開發者ID:kanpol,項目名稱:omni-note,代碼行數:14,代碼來源:TimePickerFragment.java

示例12: showTimeDialog

import android.app.TimePickerDialog; //導入方法依賴的package包/類
public void showTimeDialog(View v)
  {		
//Calculates what page and position we are at
holder = projectListView.getPositionForView(v);
  	
  	//Calculate what hour and minute that we are at when we click
try 
{
	hourmin = user.getProjects().get(holder).getTimeByDate(homeFragmentCalendar).getTimeAsArray();	    	
   	newHour = hourmin[0];
   	newMin = hourmin[1];
   	
}
catch (Exception name) 		
{
	Log.d("ERROR", name + "");
}
  	
  	/**
  	 * Show the TimePickerDialog
  	 */
  	TimePickerDialog picker = new TimePickerDialog(getActivity(), timeSetListener,  newHour, newMin, true);
  	picker.setTitle("Enter hours and minutes spent on this project:");
  	picker.setButton(TimePickerDialog.BUTTON_POSITIVE, "Set", picker);
  	picker.setButton(TimePickerDialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() 
	   {
  			@Override
           public void onClick(DialogInterface dialog, int id) 
           {
           	//dialog.dismiss();
           	mIgnoreTimeSet = true;
           	Log.d("Picker", "Cancelled!");

         
           }
    });
  	
  	picker.show();
  }
 
開發者ID:Magrit,項目名稱:miniature-ninja-agile-awesomeness,代碼行數:40,代碼來源:HomeFragment.java

示例13: setCurrentTimeOnView

import android.app.TimePickerDialog; //導入方法依賴的package包/類
public void setCurrentTimeOnView() {
	 
	timeTextView = (TextView) this.findViewById(R.id.notification_time_set);
	hour = c.get(Calendar.HOUR_OF_DAY);
	minute = c.get(Calendar.MINUTE);
	
	picker = new TimePickerDialog(this, timePickerListener, hour, minute, true);
	picker.setTitle("Set time of notification (hh:mm)");
	// set current time into textview
	timeTextView.setText(hour+ ":" +minute);
	thisNotification.setNotificationHour(hour);
	thisNotification.setNotificationMinute(minute);
}
 
開發者ID:Magrit,項目名稱:miniature-ninja-agile-awesomeness,代碼行數:14,代碼來源:CreateNotificationActivity.java

示例14: setOldTimeOnView

import android.app.TimePickerDialog; //導入方法依賴的package包/類
public void setOldTimeOnView()
{
	timeTextView = (TextView) this.findViewById(R.id.notification_time_set);
	
	picker = new TimePickerDialog(this, timePickerListener, hour, minute, true);
	picker.setTitle("Set time of notification (hh:mm)");
	timeTextView.setText(hour+ ":" +minute);
}
 
開發者ID:Magrit,項目名稱:miniature-ninja-agile-awesomeness,代碼行數:9,代碼來源:CreateNotificationActivity.java

示例15: showTimePicker

import android.app.TimePickerDialog; //導入方法依賴的package包/類
private void showTimePicker() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
        TimePickerDialog timeDialog = new TimePickerDialog(getActivity(),
                (timePicker, hour, minute) -> {
                    taskCalender.set(Calendar.HOUR_OF_DAY, hour);
                    taskCalender.set(Calendar.MINUTE, minute);
                    task.setTaskDate(taskCalender);
                    presenter.addTask(task, false);
                    updateAfterAdding(task);

                    if (task.getRepeatCategory() != 0){
                        new RepeatOp().execute(task);
                    }
                },
                todayCalender.get(Calendar.HOUR_OF_DAY),
                todayCalender.get(Calendar.MINUTE), false);
        timeDialog.setTitle("Select Task Time");
        timeDialog.show();
    }else {
        TimePicker picker = new TimePicker(getActivity());
        picker.setOnTimeChangedListener((timePicker, hour, minute) -> {
            taskCalender.set(Calendar.HOUR_OF_DAY, hour);
            taskCalender.set(Calendar.MINUTE, minute);
        });

        AlertDialog dialog = new AlertDialog.Builder(getActivity())
                .setTitle("Select Task Time")
                .setView(picker)
                .setPositiveButton("Submit", (dialogInterface, i) -> {
                    dialogInterface.dismiss();
                    task.setTaskDate(taskCalender);
                    presenter.addTask(task, false);
                    updateAfterAdding(task);

                    if (task.getRepeatCategory() != 0){
                        new RepeatOp().execute(task);
                    }
                })
                .create();

        dialog.show();
    }
}
 
開發者ID:aumarbello,項目名稱:Tasks,代碼行數:44,代碼來源:TaskListFragment.java


注:本文中的android.app.TimePickerDialog.setTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。