コード例 #1
0
 public TimePickerDialog(
     Context context,
     int theme,
     OnTimeSetListener callBack,
     int hourOfDay,
     int minute,
     boolean is24HourView) {
   super(context, theme);
   mCallback = callBack;
   mInitialHourOfDay = hourOfDay;
   mInitialMinute = minute;
   mIs24HourView = is24HourView;
   setIcon(0);
   setTitle(R.string.time_picker_dialog_title);
   Context themeContext = getContext();
   setButton(DialogInterface.BUTTON_POSITIVE, themeContext.getText(R.string.date_time_set), this);
   setButton(
       DialogInterface.BUTTON_NEGATIVE,
       themeContext.getText(android.R.string.cancel),
       (OnClickListener) null);
   View view = LayoutInflater.inflate(themeContext, R.layout.time_picker_dialog);
   setView(view);
   mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
   mTimePicker.setIs24HourView(mIs24HourView);
   mTimePicker.setCurrentHour(mInitialHourOfDay);
   mTimePicker.setCurrentMinute(mInitialMinute);
   mTimePicker.setOnTimeChangedListener(this);
 }
コード例 #2
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   View v = inflater.inflate(R.layout.fragment_gallery, container, false);
   if (savedInstanceState != null) {
     mTags = savedInstanceState.getString(EXTRA_TAG);
     mAlbum = savedInstanceState.getString(EXTRA_ALBUM);
   } else {
     mTags = null;
     mAlbum = null;
   }
   refresh(v);
   return v;
 }
コード例 #3
0
 protected SeekBar onCreateSeekBar() {
   return (SeekBar)
       LayoutInflater.inflate(getContext(), R.layout.preference_dialog_seekbar_widget);
 }