com.stringsandints.inventium.khlrooster
Class AlarmSettings

java.lang.Object
  extended by Activity
      extended by com.stringsandints.inventium.khlrooster.AlarmSettings

public class AlarmSettings
extends Activity


Nested Class Summary
(package private)  class AlarmSettings.UrlStreamClickListener
          Internal class so we can implement the OnItemSelectedListener on our urlStreamSpinner.
 
Field Summary
(package private)  Uri customSoundUri
           
static java.lang.String ENTER_CUSTOM_STREAM
           
static java.lang.String SELECT_CUSTOM_MEDIA
           
static java.lang.String SELECT_STREAM
           
private  Spinner spinner
           
(package private)  java.util.HashMap<java.lang.String,java.lang.String> urlStreams
           
static java.lang.String USE_DEFAULT_NOTIFICATION_SOUND
           
static java.lang.String VIBRATE
           
 
Constructor Summary
AlarmSettings()
           
 
Method Summary
private  void customUrlStreamPicker(LinearLayout ll, LayoutInflater inflater)
          Used property: selectedStreamUrl (String) This method inflates the selectStream layout.
 java.util.HashMap<java.lang.String,java.lang.String> getUrlStreams()
           
protected  void onActivityResult(int requestCode, int resultCode, Intent data)
          Used property: customMedia (String) After a custom media file is chosen, this method is called.
 void onClickEventHandler(View view)
          Used property: wakeUpMillisecondsBefore (int).
protected  void onCreate(Bundle savedInstanceState)
          Used property: alarmMode.
protected  void onDestroy()
           
 void onItemSelected( adapterView, View view, int position, long id)
          This method reacts to the selected Spinner item.
 void onNothingSelected( arg0)
           
private  void placeMediaTitleInButton(Button pickSoundButton)
          After the customMedia is chosen and written to the corresponding property, we call this function.
 void setHourInLabel()
           
private  void setListenerForValidStream(Button saveButton, EditText customStreamText)
          Here the inserted stream is checked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spinner

private Spinner spinner

urlStreams

java.util.HashMap<java.lang.String,java.lang.String> urlStreams

customSoundUri

Uri customSoundUri

USE_DEFAULT_NOTIFICATION_SOUND

public static final java.lang.String USE_DEFAULT_NOTIFICATION_SOUND
See Also:
Constant Field Values

VIBRATE

public static final java.lang.String VIBRATE
See Also:
Constant Field Values

SELECT_CUSTOM_MEDIA

public static final java.lang.String SELECT_CUSTOM_MEDIA
See Also:
Constant Field Values

SELECT_STREAM

public static final java.lang.String SELECT_STREAM
See Also:
Constant Field Values

ENTER_CUSTOM_STREAM

public static final java.lang.String ENTER_CUSTOM_STREAM
See Also:
Constant Field Values
Constructor Detail

AlarmSettings

public AlarmSettings()
Method Detail

getUrlStreams

public java.util.HashMap<java.lang.String,java.lang.String> getUrlStreams()
Returns:
HashMap with the existing urlStreams.

onCreate

protected void onCreate(Bundle savedInstanceState)
Used property: alarmMode. This method places the possible alarm modes into a spinner and inflates the alarm_settings lay-out. It also reads the previously chosen alarmMode property and indicates it as the current mode.


setHourInLabel

public void setHourInLabel()

onClickEventHandler

public void onClickEventHandler(View view)
Used property: wakeUpMillisecondsBefore (int). After clicking the 'Alarm time' option, this method is fired. It opens a TimePickerDialog and reads and sets the wakeUpMillisecondsBefore property.

Parameters:
view -

onItemSelected

public void onItemSelected( adapterView,
                           View view,
                           int position,
                           long id)
This method reacts to the selected Spinner item. In the switch we check which item was chosen and then execute the right code.


setListenerForValidStream

private void setListenerForValidStream(Button saveButton,
                                       EditText customStreamText)
Here the inserted stream is checked.

Parameters:
saveButton -
customStreamText -

onActivityResult

protected void onActivityResult(int requestCode,
                                int resultCode,
                                Intent data)
Used property: customMedia (String) After a custom media file is chosen, this method is called. This places the chosen media file into the customMedia property.


placeMediaTitleInButton

private void placeMediaTitleInButton(Button pickSoundButton)
After the customMedia is chosen and written to the corresponding property, we call this function. Here we look up the title of the chosen media file and set it as the button's text.

Parameters:
pickSoundButton -

customUrlStreamPicker

private void customUrlStreamPicker(LinearLayout ll,
                                   LayoutInflater inflater)
Used property: selectedStreamUrl (String) This method inflates the selectStream layout. It reads the default streams from the file 'streamurls' (raw) and places them in the Spinner. This also puts the previously chosen stream and uses it as the current value.

Parameters:
ll -
inflater -

onNothingSelected

public void onNothingSelected( arg0)

onDestroy

protected void onDestroy()