This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make toast vibration length configurable
- Loading branch information
Showing
8 changed files
with
99 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import android.util.Log; | ||
|
||
import java.util.HashSet; | ||
|
@@ -16,15 +18,17 @@ | |
* To read settings you can replace | ||
* <pre>PreferenceManager.getDefaultSharedPreferences(context).getBoolean(MY_PREFERENCE.getKey(), false);</pre> | ||
* with <pre>new Pref<Boolean>(MY_PREFERENCE).getValue();</pre>. | ||
* | ||
* <p> | ||
* To write settings you can replace | ||
* <pre>PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(MY_PREFERENCE.getKey(), false).apply();</pre> | ||
* with <pre>new Pref<Boolean;>(MY_PREFERENCE).setValue(false);</pre> | ||
* <p> | ||
* Apparently androidx/Android Q introduces Integers as valid preference type. | ||
* Since {@link SharedPreferences} (afaik) don't support that, they should be handled as Strings. | ||
* | ||
* @param <T> The type of preference to use. Currently {@link Boolean}, {@link String}, {@link HashSet}. | ||
* @author Lukas Fülling ([email protected]) | ||
* @see PreferenceEntity | ||
* | ||
* @param <T> The type of preference to use. Currently {@link Boolean}, {@link String}, {@link HashSet}. | ||
*/ | ||
public class Pref<T> { | ||
|
||
|
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
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