-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from steni510/feature/GAMES_012
Feature/games 012
- Loading branch information
Showing
8 changed files
with
228 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/swt20/swt_morning2/WhiteTilesSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.swt20.swt_morning2; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
public class WhiteTilesSettings { | ||
private static final String TIMER_ENABLED = "WHITE_TILES_TIMER_ENABLED"; | ||
private static final String TIMER_SETTING = "WHITE_TILES_TIMER_SETTING"; | ||
private SharedPreferences pref; | ||
|
||
public WhiteTilesSettings(Context context) { | ||
setSharedPreferences(context.getSharedPreferences("WHITE_TILES_SETTINGS", 0)); | ||
} | ||
|
||
public void setSharedPreferences(SharedPreferences pref) { | ||
this.pref = pref; | ||
} | ||
|
||
public boolean getTimerEnabled() { | ||
return pref.getBoolean(TIMER_ENABLED, false); | ||
} | ||
|
||
public int getTimerSetting() { | ||
return pref.getInt(TIMER_SETTING, 0); | ||
} | ||
|
||
public void setTimerEnabled(boolean timerEnabled) { | ||
SharedPreferences.Editor editor = this.pref.edit(); | ||
editor.putBoolean(TIMER_ENABLED, timerEnabled); | ||
editor.apply(); | ||
} | ||
|
||
public void setTimerSetting(int timerSetting) { | ||
SharedPreferences.Editor editor = this.pref.edit(); | ||
editor.putInt(TIMER_SETTING, timerSetting); | ||
editor.apply(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters