reduced lite version play time from unlimited to 30 minutes

This commit is contained in:
2011-02-12 20:18:18 +00:00
parent 2df3c3dc93
commit d9f0161b66
2 changed files with 10 additions and 11 deletions

View File

@@ -16,23 +16,16 @@
<CheckBoxPreference <CheckBoxPreference
android:title="Enable" android:title="Enable"
android:summary="Enable Timer" android:summary="Enable Timer"
android:defaultValue="false" android:key="timer_enabled" android:enabled="false" android:defaultValue="true"/>
android:key="timer_enabled"
/>
<com.TwentyCodes.android.SweetDreamsLib.TimePickerPreference <com.TwentyCodes.android.SweetDreamsLib.TimePickerPreference
android:title="Timer" android:enabled="false" android:key="timer_length"/>
android:enabled="false"
android:key="timer_length"
/>
<CheckBoxPreference <CheckBoxPreference
android:title="Exit On Finish" android:title="Exit On Finish"
android:summary="Closes Application When Timer Finishes" android:summary="Closes Application When Timer Finishes"
android:defaultValue="false" android:defaultValue="false"
android:key="timer_exit_on_finish" android:key="timer_exit_on_finish"/>
android:dependency="timer_enabled"
/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -132,7 +132,13 @@ public class SweetDreamsFull extends Activity implements OnClickListener, OnSeek
isPlaying = true; isPlaying = true;
loadSound(); loadSound();
mMediaPlayer.start(); mMediaPlayer.start();
if (mSettings.getBoolean(Settings.TIMER_ENABLED, false)){
boolean timerEnabled = mSettings.getBoolean(Settings.TIMER_ENABLED, false);
if(isFUll == false)
timerEnabled = true;
if (timerEnabled){
Log.v(TAG,"Starting timer"); Log.v(TAG,"Starting timer");
long time = + (mSettings.getInt("timer_length", 30) * 60000); long time = + (mSettings.getInt("timer_length", 30) * 60000);
Log.v(TAG,"time = " + time); Log.v(TAG,"time = " + time);