-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3098529
commit fcdeb9f
Showing
14 changed files
with
190 additions
and
263 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
15 changes: 7 additions & 8 deletions
15
...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,26 +1,25 @@ | ||
package io.horizontalsystems.bankwallet.modules.market.favorites | ||
|
||
import io.horizontalsystems.bankwallet.core.ILocalStorage | ||
import io.horizontalsystems.bankwallet.modules.market.MarketField | ||
import io.horizontalsystems.bankwallet.modules.market.SortingField | ||
import io.horizontalsystems.bankwallet.modules.market.favorites.MarketFavoritesModule.Period | ||
import io.horizontalsystems.bankwallet.widgets.MarketWidgetManager | ||
|
||
class MarketFavoritesMenuService( | ||
private val localStorage: ILocalStorage, | ||
private val marketWidgetManager: MarketWidgetManager | ||
) { | ||
|
||
var sortingField: SortingField | ||
get() = localStorage.marketFavoritesSortingField ?: SortingField.HighestCap | ||
var sortDescending: Boolean | ||
get() = localStorage.marketFavoritesSortDescending | ||
set(value) { | ||
localStorage.marketFavoritesSortingField = value | ||
localStorage.marketFavoritesSortDescending = value | ||
marketWidgetManager.updateWatchListWidgets() | ||
} | ||
|
||
var marketField: MarketField | ||
get() = localStorage.marketFavoritesMarketField ?: MarketField.PriceDiff | ||
var period: Period | ||
get() = localStorage.marketFavoritesPeriod ?: Period.OneDay | ||
set(value) { | ||
localStorage.marketFavoritesMarketField = value | ||
localStorage.marketFavoritesPeriod = 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
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.