-
-
Notifications
You must be signed in to change notification settings - Fork 580
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 #2310 from marunjar/history_mode
make history mode an enum
- Loading branch information
Showing
8 changed files
with
88 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package fr.neamar.kiss.db; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
public enum HistoryMode { | ||
RECENCY("recency"), | ||
FRECENCY("frecency"), | ||
FREQUENCY("frequency"), | ||
ADAPTIVE("adaptive"), | ||
TIME("time"), | ||
ALPHABETICALLY("alphabetically"); | ||
|
||
private final String id; | ||
|
||
HistoryMode(String id) { | ||
this.id = id; | ||
} | ||
|
||
@NonNull | ||
public static HistoryMode valueById(String id) { | ||
for (HistoryMode historyMode : values()) { | ||
if (historyMode.id.equals(id)) { | ||
return historyMode; | ||
} | ||
} | ||
return RECENCY; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,5 +5,4 @@ public enum SearchPojoType { | |
URL_QUERY, | ||
CALCULATOR_QUERY, | ||
URI_QUERY | ||
; | ||
} |
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