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
android:title="Enable"
android:summary="Enable Timer"
android:defaultValue="false"
android:key="timer_enabled"
/>
android:key="timer_enabled" android:enabled="false" android:defaultValue="true"/>
<com.TwentyCodes.android.SweetDreamsLib.TimePickerPreference
android:title="Timer"
android:enabled="false"
android:key="timer_length"
/>
android:enabled="false" android:key="timer_length"/>
<CheckBoxPreference
android:title="Exit On Finish"
android:summary="Closes Application When Timer Finishes"
android:defaultValue="false"
android:key="timer_exit_on_finish"
android:dependency="timer_enabled"
/>
android:key="timer_exit_on_finish"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -132,7 +132,13 @@ public class SweetDreamsFull extends Activity implements OnClickListener, OnSeek
isPlaying = true;
loadSound();
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");
long time = + (mSettings.getInt("timer_length", 30) * 60000);
Log.v(TAG,"time = " + time);