-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
32 changed files
with
716 additions
and
251 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
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
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
26 changes: 20 additions & 6 deletions
26
...va/io/horizontalsystems/bankwallet/modules/market/favorites/MarketFavoritesMenuService.kt
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 |
---|---|---|
@@ -1,25 +1,39 @@ | ||
package io.horizontalsystems.bankwallet.modules.market.favorites | ||
|
||
import io.horizontalsystems.bankwallet.core.ILocalStorage | ||
import io.horizontalsystems.bankwallet.modules.market.favorites.MarketFavoritesModule.Period | ||
import io.horizontalsystems.bankwallet.modules.market.TimeDuration | ||
import io.horizontalsystems.bankwallet.widgets.MarketWidgetManager | ||
|
||
class MarketFavoritesMenuService( | ||
private val localStorage: ILocalStorage, | ||
private val marketWidgetManager: MarketWidgetManager | ||
) { | ||
|
||
var sortDescending: Boolean | ||
get() = localStorage.marketFavoritesSortDescending | ||
var listSorting: WatchlistSorting | ||
get() = localStorage.marketFavoritesSorting ?: WatchlistSorting.Manual | ||
set(value) { | ||
localStorage.marketFavoritesSortDescending = value | ||
localStorage.marketFavoritesSorting = value | ||
marketWidgetManager.updateWatchListWidgets() | ||
} | ||
|
||
var period: Period | ||
get() = localStorage.marketFavoritesPeriod ?: Period.OneDay | ||
var timeDuration: TimeDuration | ||
get() = localStorage.marketFavoritesPeriod ?: TimeDuration.OneDay | ||
set(value) { | ||
localStorage.marketFavoritesPeriod = value | ||
marketWidgetManager.updateWatchListWidgets() | ||
} | ||
|
||
var showSignals: Boolean | ||
get() = localStorage.marketFavoritesShowSignals | ||
set(value) { | ||
localStorage.marketFavoritesShowSignals = value | ||
marketWidgetManager.updateWatchListWidgets() | ||
} | ||
|
||
var manualSortOrder: List<String> | ||
get() = localStorage.marketFavoritesManualSortingOrder | ||
set(value) { | ||
localStorage.marketFavoritesManualSortingOrder = value | ||
marketWidgetManager.updateWatchListWidgets() | ||
} | ||
} |
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
Oops, something went wrong.