Skip to content

Commit

Permalink
fix: solving conflits after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SamilaRuane committed Apr 4, 2018
1 parent 3fd464e commit d7ad674
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@ import javax.inject.Singleton
* Created by samila on 18/12/17.
*/
@Singleton
class BritaCoin @Inject constructor(val service: Service<BancoCentralResponse>, val preferences: SharedPreferencesHelper) : Coin, EventResponseListener<BancoCentralResponse> {
class BritaCoin @Inject constructor(private val service: Service<BancoCentralResponse>, private val preferences: SharedPreferencesHelper) : Coin, EventResponseListener<BancoCentralResponse> {

private lateinit var mListener : EventResponseListener<String>
private lateinit var mCalendar : Calendar
private val mCalendar : Calendar = Calendar.getInstance()

val service : Service<BancoCentralResponse>
val preferences : SharedPreferencesHelper



@Inject
constructor(service: Service<BancoCentralResponse>, preferences : SharedPreferencesHelper) {
this.service = service
this.preferences = preferences
mCalendar = Calendar.getInstance()
}


override fun loadCoin(listener: EventResponseListener<String>) {

mCalendar.addDays(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ import br.com.samilaruane.carteiravirtual.utils.EventResponseListener
* Created by samila on 25/03/18.
*/
interface Service<out T> {
fun getCoinQuotation(listener : EventResponseListener<T>)
interface Service<T> {
fun getCoinQuotation(listener : EventResponseListener<T>, date:String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MainFragment : Fragment(), OnDatabaseAccessListener<List<Account>> {
txt_brl_account_balance.text = accounts[2].getAccountBalance().roundTo(2).toString()
// txt_brl_initials.text = accounts[2].getCoin().getCoinInitials()

val preferences = SharedPreferencesHelper (activity)
val preferences = SharedPreferencesHelper (this?.activity)
if(preferences.getBitcoinQuotation().isNotEmpty() && preferences.getBritaQuotation().isNotEmpty()) {
txt_brita_salePrice.text = JSONObject(preferences.getBritaQuotation()).get(BaseConstants.SALE_PRICE).toString().toDouble().roundTo(2).toString()
txt_brita_purchase_quot.text = JSONObject(preferences.getBritaQuotation()).get(BaseConstants.PURCHASE_QUOTATION).toString().toDouble().roundTo(2).toString()
Expand Down

0 comments on commit d7ad674

Please sign in to comment.