From 767f5e96566d87ae64445aed99adccbe813d15e9 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 25 Apr 2022 22:49:28 +0200 Subject: [PATCH 01/18] [#673] Add huawei market option to readme (#674) --- README.md | 11 ++++++----- art/appgallery.png | Bin 0 -> 10810 bytes art/play_store.png | Bin 0 -> 7371 bytes 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 art/appgallery.png create mode 100644 art/play_store.png diff --git a/README.md b/README.md index 17059efaf1..d624fbb4af 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A currency converter application for most of the currencies used in the world. You can quickly convert and make mathematical operations between currencies. - + + @@ -106,17 +107,17 @@ Library ## Android Preview - + - + ## iOS Preview - + ## Included Currencies -[![currencies.png](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png)](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png) +[![currencies.png](https://github.com/CurrencyConverterCalculator/CCC/raw/develop/art/currencies.png)](https://github.com/CurrencyConverterCalculator/CCC/raw/develop/art/currencies.png) ## License diff --git a/art/appgallery.png b/art/appgallery.png new file mode 100644 index 0000000000000000000000000000000000000000..d66acd98cf7aa5b8363f65939d2aa118c62dc6ff GIT binary patch literal 10810 zcmV-AD#g`_P)YX8zrXjKY&I(%dF0WyLxJ2c?zrO)aU4g2!Js4( ziGZPzp-||nrKP0@neS@MZvg}Jj5l;1dDJ8F87yU!$>j2;rl#lO@%Y{8bo$juBoa%d zQWA^Bd)Wsce6Y(u|M^dO;e{7u-MV%5 zW*%rg@~G#a1w#h3GI{dkfqU=0_m>RbCNE#U{9^OlpUi2=E`ipl>77T89C@7q>h{0? z{qN;}|N9@`d86%-N4-EVzx=X1`skxFefsp8Y15`%X%r>6oDCG)(x|yoz!@}X&+mPTDbpH&wlXz{w>gC6oX7 z$3NPJJo3n+%|i_h4Kj1)Oo_+i6_H3}MyEk*Z0wWJuFpREtT&1td9;~n!GZucOszJ$j3>z4Q>|)v!R^d1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cYp1QkXSBYR3{ykb2p@NCtk(;#DgEnPe^i8o<#yn2T zNs<0C&H%T{7|9imw1$LQ_R}e(pQ|}xTkW(F#E#uF7oj*eZX~(^?32m$vNe#dZr~1b zsSn%Lb&$}A1f!Ip3$cz;ciYHa_o+*K)4_Ee?K0oh^E&&U^u5p~W#1gWB2h1k(p%S#1nzuUq%+s5iKe@=e_D1z-<*UWO%xyCB2);1;r9b(%x-2d zb*7+Wn*goq)ORycSs0H=andIPjbAyy2}vboV;h%#DU7~t**c^pN(^8(n7@{%60*vG zwz+j@`mKooEB>t(WaxgkoqloVT#btA6grOzO9(=$z}Uc>;1;0OG!bq93#*f&>y34w zwiswPnmrU<7*n|+(<}=Ngg&bO?H!*sD_j3ImS{!YL>VcLAE~vvogsWg{5%3W1X0`( zS&s_)j_}oqQtLu_M5D>LE51!)igwA z$*}@dBE^8%TNAjjL~xLZKj|=?156a0MdCJBdZ)9X4Vahjc>Yl@3$E5FV;tQfjr4ld zyYC3#l5*?mbh|EDrY!-vHUa3%V-lo{zm@e&Ess3fa%OqHxz%lgwz;{vmU6Uw)5JXT z$fMq;)^t*$)1WmD_uUgFOmL_r^~fWSHZM^>O~l%`KCg8ew8>=h8e@VvWERtk6)S$9&1Roz z>)gC4ALGy7V}M&WefsoEjhWn+VshOMLDzZp$Rm$>P84vUSy|y^>eQ*}L?UsSaZ!I| zFqZ5RXoV$;9p{#1%a+wonl$OVW5Gx?0J!Pn#NwzF)c^nh07*qoM6N<$ Ef()gmbpQYW literal 0 HcmV?d00001 diff --git a/art/play_store.png b/art/play_store.png new file mode 100644 index 0000000000000000000000000000000000000000..7edd6087a8edaaa902e0c2b3343c62ba94d08a35 GIT binary patch literal 7371 zcmaKRcRZVK_kXIW)?QVL#@-`l#U?hbEuu!mND#62E=6s%YEx>jQdJ}Ns;yeJsomNX zHR_i>-{sagZ40ogVP=R_FVC+1+;cm77MH`H@El>jux3|@|h1>YL4%*590JqsthENZvjy4#9 zK?}nF(g^yXU2xn0fQ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}j`xDrtA>ItLCY>kwHd zNvqST5csO`)VUZ3p*;|7&(gzT9$AeJecqScKy6_(fk_c5IeEICq1`fgxkg)Ez1B2= zj8{x-YPIOS_loJq)p?HHotgUj9kVvSUjYzUIB0K}-Kk`~CA`$HhC+OgcHg){C^ItL z-@Nw>7m(({CBa>XtNrW5TLa{p)5vzZ)6Vbkmyv1zn?jM{NV$-Q^h%b$+U`G6=?;z!? z@z!;ehXl!Nk8j@)z`AgS6#L4;M>;03N8-($7&eVfC&k3@=Ds>azuipyO~?%*VSOll zi0pn(-^U3o>hs&Q%?{n}N>dg*fty6Ha~aAWE{2x9#B;84?1TOE_RYk*WMubkKc#^B z8fQ#}?VjT+gj~jDKSYmE1>&IDKCNhl%N=HNgy|KXH#oi(O7R}ws2P_Z3vmU)jKk%u zW6cbSx!W<=Jn8Fk&@2Iho1Z5wK;BeId=Sm2ZhMAISLB zo(LU5wW~j1Vt{@G>=HI~hlhu5hsMBx@2YI+!-`xPs$v*f!Q8Y4zr%CuJcmZ>-g^&+ zM2p_cyo)=m3Y2jTvcMs5a8bL)Oy7gAX$=g_cUV((MecZ30>bT;+<@Z%tbO>#>%eh! zJ<*cOb?=PTF&rfI(-o5kITAmF|pPpUWFv;*a)t_XFuf3cdEwg5@q6u_Mw8wj@m2CyDVV? zZDWOqNV;j1*cU*^bv59smeHgxydblI!55F68n~<7E!C>{uK5k~hx8 zTAN~|z9wsAe@|H({WkV|B_0=pc6*W=EphN@(im-8QqoF=MnyrAs8uvWUP_7wKN#%C rbMtIx)bO<&I8jM?b)zeo-~oVRQGPz`_4$jxpBFV$o Date: Thu, 28 Apr 2022 21:45:42 +0200 Subject: [PATCH 02/18] [#678] Change ChangeBase to SelectCurrency (#679) --- .../ui/calculator/CalculatorFragment.kt | 2 +- .../SelectCurrencyAdapter.kt} | 16 +++---- .../SelectCurrencyBottomSheet.kt} | 47 ++++++++++--------- ...e.xml => bottom_sheet_select_currency.xml} | 4 +- ...ange_base.xml => item_select_currency.xml} | 6 +-- .../src/main/res/navigation/main_graph.xml | 14 +++--- android/src/main/res/values/styles.xml | 7 ++- .../ccc/client/di/module/ClientModule.kt | 4 +- .../SelectCurrencySEED.kt} | 14 +++--- .../SelectCurrencyViewModel.kt} | 20 ++++---- ...Test.kt => SelectCurrencyViewModelTest.kt} | 20 ++++---- ios/CCC.xcodeproj/project.pbxproj | 30 ++++++------ ios/CCC/DI/Koin.swift | 8 ++-- ios/CCC/UI/Calculator/CalculatorView.swift | 4 +- ios/CCC/UI/Currencies/CurrenciesView.swift | 2 +- .../SelectCurrencyItemView.swift} | 4 +- .../SelectCurrencyView.swift} | 28 +++++------ ...swift => SelectCurrenciesBottomView.swift} | 4 +- .../commonMain/resources/MR/base/strings.xml | 4 +- 19 files changed, 119 insertions(+), 119 deletions(-) rename android/src/main/kotlin/com/oztechan/ccc/android/ui/{changebase/ChangeBaseAdapter.kt => selectcurrency/SelectCurrencyAdapter.kt} (71%) rename android/src/main/kotlin/com/oztechan/ccc/android/ui/{changebase/ChangeBaseBottomSheet.kt => selectcurrency/SelectCurrencyBottomSheet.kt} (62%) rename android/src/main/res/layout/{bottom_sheet_change_base.xml => bottom_sheet_select_currency.xml} (96%) rename android/src/main/res/layout/{item_change_base.xml => item_select_currency.xml} (86%) rename client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/{changebase/BarSEED.kt => selectcurrency/SelectCurrencySEED.kt} (68%) rename client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/{changebase/ChangeBaseViewModel.kt => selectcurrency/SelectCurrencyViewModel.kt} (72%) rename client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/{ChangeBaseViewModelTest.kt => SelectCurrencyViewModelTest.kt} (84%) rename ios/CCC/UI/{ChangeBase/ChangeBaseItemView.swift => SelectCurrency/SelectCurrencyItemView.swift} (92%) rename ios/CCC/UI/{ChangeBase/ChangeBaseView.swift => SelectCurrency/SelectCurrencyView.swift} (72%) rename ios/CCC/UI/SubView/{SelectCurrencyView.swift => SelectCurrenciesBottomView.swift} (91%) diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt index 8e539f125f..64947a15da 100755 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt @@ -152,7 +152,7 @@ class CalculatorFragment : BaseVBFragment() { ) CalculatorEffect.OpenBar -> navigate( R.id.calculatorFragment, - CalculatorFragmentDirections.actionCalculatorFragmentToChangeBaseBottomSheet() + CalculatorFragmentDirections.actionCalculatorFragmentToSelectCurrencyBottomSheet() ) CalculatorEffect.OpenSettings -> navigate( R.id.calculatorFragment, diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseAdapter.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt similarity index 71% rename from android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseAdapter.kt rename to android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt index 3b4e891a9e..11508fb09b 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseAdapter.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt @@ -1,4 +1,4 @@ -package com.oztechan.ccc.android.ui.changebase +package com.oztechan.ccc.android.ui.selectcurrency import android.view.LayoutInflater import android.view.ViewGroup @@ -6,31 +6,31 @@ import androidx.recyclerview.widget.DiffUtil import com.github.submob.basemob.adapter.BaseVBRecyclerViewAdapter import com.oztechan.ccc.android.util.setBackgroundByName import com.oztechan.ccc.client.model.Currency -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseEvent -import mustafaozhan.github.com.mycurrencies.databinding.ItemChangeBaseBinding +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyEvent +import mustafaozhan.github.com.mycurrencies.databinding.ItemSelectCurrencyBinding -class ChangeBaseAdapter( - private val changeBaseEvent: ChangeBaseEvent +class SelectCurrencyAdapter( + private val selectCurrencyEvent: SelectCurrencyEvent ) : BaseVBRecyclerViewAdapter(CalculatorDiffer()) { override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ) = CalculatorVBViewHolder( - ItemChangeBaseBinding.inflate( + ItemSelectCurrencyBinding.inflate( LayoutInflater.from(parent.context), parent, false ) ) - inner class CalculatorVBViewHolder(private val itemBinding: ItemChangeBaseBinding) : + inner class CalculatorVBViewHolder(private val itemBinding: ItemSelectCurrencyBinding) : BaseVBViewHolder(itemBinding) { override fun onItemBind(item: Currency) = with(itemBinding) { imgIcon.setBackgroundByName(item.name) txtSettingItem.text = item.getVariablesOneLine() - root.setOnClickListener { changeBaseEvent.onItemClick(item) } + root.setOnClickListener { selectCurrencyEvent.onItemClick(item) } } } diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseBottomSheet.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyBottomSheet.kt similarity index 62% rename from android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseBottomSheet.kt rename to android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyBottomSheet.kt index afe666a80d..0b0c20064e 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/changebase/ChangeBaseBottomSheet.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyBottomSheet.kt @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Mustafa Ozhan. All rights reserved. */ -package com.oztechan.ccc.android.ui.changebase +package com.oztechan.ccc.android.ui.selectcurrency import android.os.Bundle import android.view.View @@ -16,29 +16,30 @@ import com.oztechan.ccc.android.ui.calculator.CalculatorFragment.Companion.CHANG import com.oztechan.ccc.android.util.setNavigationResult import com.oztechan.ccc.android.util.showLoading import com.oztechan.ccc.android.util.visibleIf -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseEffect -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseViewModel +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyEffect +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyViewModel import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import mustafaozhan.github.com.mycurrencies.R -import mustafaozhan.github.com.mycurrencies.databinding.BottomSheetChangeBaseBinding +import mustafaozhan.github.com.mycurrencies.databinding.BottomSheetSelectCurrencyBinding import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.viewModel -class ChangeBaseBottomSheet : BaseVBBottomSheetDialogFragment() { +class SelectCurrencyBottomSheet : + BaseVBBottomSheetDialogFragment() { private val analyticsManager: AnalyticsManager by inject() - private val changeBaseViewModel: ChangeBaseViewModel by viewModel() + private val selectCurrencyViewModel: SelectCurrencyViewModel by viewModel() - private val changeBaseAdapter: ChangeBaseAdapter by lazy { - ChangeBaseAdapter(changeBaseViewModel.event) + private val selectCurrencyAdapter: SelectCurrencyAdapter by lazy { + SelectCurrencyAdapter(selectCurrencyViewModel.event) } - override fun getViewBinding() = BottomSheetChangeBaseBinding.inflate(layoutInflater) + override fun getViewBinding() = BottomSheetSelectCurrencyBinding.inflate(layoutInflater) override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - Logger.i { "ChangeBaserBottomSheet onViewCreated" } + Logger.i { "SelectCurrencyBottomSheet onViewCreated" } initViews() observeStates() observeEffects() @@ -46,8 +47,8 @@ class ChangeBaseBottomSheet : BaseVBBottomSheetDialogFragment - Logger.i { "ChangeBaseBottomSheet observeEffects ${viewEffect::class.simpleName}" } + Logger.i { "SelectCurrencyBottomSheet observeEffects ${viewEffect::class.simpleName}" } when (viewEffect) { - is ChangeBaseEffect.BaseChange -> { + is SelectCurrencyEffect.CurrencyChange -> { analyticsManager.trackEvent( FirebaseEvent.BASE_CHANGE, mapOf(EventParam.BASE to viewEffect.newBase) @@ -93,14 +94,14 @@ class ChangeBaseBottomSheet : BaseVBBottomSheetDialogFragment navigate( - R.id.changeBaseBottomSheet, - ChangeBaseBottomSheetDirections.actionChangeBaseBottomSheetToCurrenciesFragment() + SelectCurrencyEffect.OpenCurrencies -> navigate( + R.id.selectCurrencyBottomSheet, + SelectCurrencyBottomSheetDirections.actionSelectCurrencyBottomSheetToCurrenciesFragment() ) } }.launchIn(viewLifecycleOwner.lifecycleScope) private fun setListeners() = binding.btnSelect.setOnClickListener { - changeBaseViewModel.event.onSelectClick() + selectCurrencyViewModel.event.onSelectClick() } } diff --git a/android/src/main/res/layout/bottom_sheet_change_base.xml b/android/src/main/res/layout/bottom_sheet_select_currency.xml similarity index 96% rename from android/src/main/res/layout/bottom_sheet_change_base.xml rename to android/src/main/res/layout/bottom_sheet_select_currency.xml index 70c97e8ef4..0c0add0ede 100644 --- a/android/src/main/res/layout/bottom_sheet_change_base.xml +++ b/android/src/main/res/layout/bottom_sheet_select_currency.xml @@ -21,7 +21,7 @@ app:layout_constraintTop_toBottomOf="@+id/txt_current_base" /> + app:layout_constraintTop_toBottomOf="@+id/recycler_view_select_currency" /> \ No newline at end of file diff --git a/android/src/main/res/layout/item_change_base.xml b/android/src/main/res/layout/item_select_currency.xml similarity index 86% rename from android/src/main/res/layout/item_change_base.xml rename to android/src/main/res/layout/item_select_currency.xml index a6ca0f9c2c..64bc63235a 100755 --- a/android/src/main/res/layout/item_change_base.xml +++ b/android/src/main/res/layout/item_select_currency.xml @@ -4,11 +4,11 @@ + style="@style/SelectCurrencyItemLayout"> + android:id="@+id/action_calculatorFragment_to_selectCurrencyBottomSheet" + app:destination="@id/selectCurrencyBottomSheet" /> + android:id="@+id/selectCurrencyBottomSheet" + android:name="com.oztechan.ccc.android.ui.selectcurrency.SelectCurrencyBottomSheet" + android:label="SelectCurrencyBottomSheet" + tools:layout="@layout/bottom_sheet_select_currency"> diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml index 16aed207cd..45286785e6 100755 --- a/android/src/main/res/values/styles.xml +++ b/android/src/main/res/values/styles.xml @@ -290,7 +290,6 @@ @dimen/margin_eight - - @@ -505,13 +504,13 @@ - - diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt index a80f2e80c6..12fd97a1eb 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt @@ -5,9 +5,9 @@ import com.oztechan.ccc.client.helper.SessionManager import com.oztechan.ccc.client.helper.SessionManagerImpl import com.oztechan.ccc.client.viewmodel.adremove.AdRemoveViewModel import com.oztechan.ccc.client.viewmodel.calculator.CalculatorViewModel -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseViewModel import com.oztechan.ccc.client.viewmodel.currencies.CurrenciesViewModel import com.oztechan.ccc.client.viewmodel.main.MainViewModel +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyViewModel import com.oztechan.ccc.client.viewmodel.settings.SettingsViewModel import com.oztechan.ccc.config.ConfigManager import com.oztechan.ccc.config.ConfigManagerImpl @@ -18,7 +18,7 @@ var clientModule = module { viewModelDefinition { MainViewModel(get(), get(), get()) } viewModelDefinition { CurrenciesViewModel(get(), get(), get()) } viewModelDefinition { CalculatorViewModel(get(), get(), get(), get(), get()) } - viewModelDefinition { ChangeBaseViewModel(get()) } + viewModelDefinition { SelectCurrencyViewModel(get()) } viewModelDefinition { AdRemoveViewModel(get()) } single { ConfigManagerImpl() } diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/BarSEED.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt similarity index 68% rename from client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/BarSEED.kt rename to client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt index 659eabd3c8..d03a3af21c 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/BarSEED.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt @@ -1,4 +1,4 @@ -package com.oztechan.ccc.client.viewmodel.changebase +package com.oztechan.ccc.client.viewmodel.selectcurrency import com.oztechan.ccc.client.base.BaseEffect import com.oztechan.ccc.client.base.BaseEvent @@ -7,26 +7,26 @@ import com.oztechan.ccc.client.model.Currency import kotlinx.coroutines.flow.MutableStateFlow // State -data class ChangeBaseState( +data class SelectCurrencyState( val loading: Boolean = true, val enoughCurrency: Boolean = false, val currencyList: List = listOf(), ) : BaseState() // Event -interface ChangeBaseEvent : BaseEvent { +interface SelectCurrencyEvent : BaseEvent { fun onItemClick(currency: Currency) fun onSelectClick() } // Effect -sealed class ChangeBaseEffect : BaseEffect() { - data class BaseChange(val newBase: String) : ChangeBaseEffect() - object OpenCurrencies : ChangeBaseEffect() +sealed class SelectCurrencyEffect : BaseEffect() { + data class CurrencyChange(val newBase: String) : SelectCurrencyEffect() + object OpenCurrencies : SelectCurrencyEffect() } // Extension -fun MutableStateFlow.update( +fun MutableStateFlow.update( loading: Boolean = value.loading, enoughCurrency: Boolean = value.enoughCurrency, currencyList: List = value.currencyList diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/ChangeBaseViewModel.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencyViewModel.kt similarity index 72% rename from client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/ChangeBaseViewModel.kt rename to client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencyViewModel.kt index 6b68cfbf53..f6cb1cf293 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/changebase/ChangeBaseViewModel.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencyViewModel.kt @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Mustafa Ozhan. All rights reserved. */ -package com.oztechan.ccc.client.viewmodel.changebase +package com.oztechan.ccc.client.viewmodel.selectcurrency import co.touchlab.kermit.Logger import com.oztechan.ccc.client.base.BaseData @@ -18,17 +18,17 @@ import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach -class ChangeBaseViewModel( +class SelectCurrencyViewModel( currencyRepository: CurrencyRepository -) : BaseSEEDViewModel(), ChangeBaseEvent { +) : BaseSEEDViewModel(), SelectCurrencyEvent { // region SEED - private val _state = MutableStateFlow(ChangeBaseState()) + private val _state = MutableStateFlow(SelectCurrencyState()) override val state = _state.asStateFlow() - private val _effect = MutableSharedFlow() + private val _effect = MutableSharedFlow() override val effect = _effect.asSharedFlow() - override val event = this as ChangeBaseEvent + override val event = this as SelectCurrencyEvent override val data: BaseData? = null // endregion @@ -46,13 +46,13 @@ class ChangeBaseViewModel( // region Event override fun onItemClick(currency: Currency) = clientScope.launchIgnored { - Logger.d { "ChangeBaseViewModel onItemClick ${currency.name}" } - _effect.emit(ChangeBaseEffect.BaseChange(currency.name)) + Logger.d { "SelectCurrencyViewModel onItemClick ${currency.name}" } + _effect.emit(SelectCurrencyEffect.CurrencyChange(currency.name)) } override fun onSelectClick() = clientScope.launchIgnored { - Logger.d { "ChangeBaseViewModel onSelectClick" } - _effect.emit(ChangeBaseEffect.OpenCurrencies) + Logger.d { "SelectCurrencyViewModel onSelectClick" } + _effect.emit(SelectCurrencyEffect.OpenCurrencies) } // endregion } diff --git a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/ChangeBaseViewModelTest.kt b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SelectCurrencyViewModelTest.kt similarity index 84% rename from client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/ChangeBaseViewModelTest.kt rename to client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SelectCurrencyViewModelTest.kt index 34949c977c..770f478532 100644 --- a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/ChangeBaseViewModelTest.kt +++ b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SelectCurrencyViewModelTest.kt @@ -8,10 +8,10 @@ import com.oztechan.ccc.client.mapper.toUIModel import com.oztechan.ccc.client.mapper.toUIModelList import com.oztechan.ccc.client.util.after import com.oztechan.ccc.client.util.before -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseEffect -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseState -import com.oztechan.ccc.client.viewmodel.changebase.ChangeBaseViewModel -import com.oztechan.ccc.client.viewmodel.changebase.update +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyEffect +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyState +import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyViewModel +import com.oztechan.ccc.client.viewmodel.selectcurrency.update import com.oztechan.ccc.common.db.currency.CurrencyRepository import com.oztechan.ccc.common.runTest import io.mockative.Mock @@ -28,13 +28,13 @@ import kotlin.test.assertEquals import kotlin.test.assertNull import com.oztechan.ccc.common.model.Currency as CurrencyCommon -class ChangeBaseViewModelTest { +class SelectCurrencyViewModelTest { @Mock private val currencyRepository = mock(classOf()) - private val viewModel: ChangeBaseViewModel by lazy { - ChangeBaseViewModel(currencyRepository) + private val viewModel: SelectCurrencyViewModel by lazy { + SelectCurrencyViewModel(currencyRepository) } private val currencyDollar = CurrencyCommon("USD", "Dollar", "$", 0.0, true) private val currencyEuro = CurrencyCommon("Eur", "Euro", "", 0.0, true) @@ -62,7 +62,7 @@ class ChangeBaseViewModelTest { @Test fun states_updates_correctly() { val currencyList = listOf(currencyUIModel) - val state = MutableStateFlow(ChangeBaseState()) + val state = MutableStateFlow(SelectCurrencyState()) state.before { state.update( @@ -115,7 +115,7 @@ class ChangeBaseViewModelTest { viewModel.effect.before { viewModel.event.onItemClick(currencyUIModel) }.after { - assertEquals(ChangeBaseEffect.BaseChange(currencyUIModel.name), it) + assertEquals(SelectCurrencyEffect.CurrencyChange(currencyUIModel.name), it) } } @@ -124,7 +124,7 @@ class ChangeBaseViewModelTest { viewModel.effect.before { viewModel.event.onSelectClick() }.after { - assertEquals(ChangeBaseEffect.OpenCurrencies, it) + assertEquals(SelectCurrencyEffect.OpenCurrencies, it) } } } diff --git a/ios/CCC.xcodeproj/project.pbxproj b/ios/CCC.xcodeproj/project.pbxproj index b9e5f68443..018399a9df 100644 --- a/ios/CCC.xcodeproj/project.pbxproj +++ b/ios/CCC.xcodeproj/project.pbxproj @@ -22,13 +22,13 @@ 5C31E43128142110008C42B9 /* CurrenciesItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E43028142110008C42B9 /* CurrenciesItemView.swift */; }; 5C31E4342814306D008C42B9 /* SettingsToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E4332814306D008C42B9 /* SettingsToolbarView.swift */; }; 5C31E4362814308B008C42B9 /* SettingsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E4352814308B008C42B9 /* SettingsItemView.swift */; }; - 5C31E439281431A3008C42B9 /* ChangeBaseItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E438281431A3008C42B9 /* ChangeBaseItemView.swift */; }; + 5C31E439281431A3008C42B9 /* SelectCurrencyItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */; }; 5C31E43F28145D32008C42B9 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */; }; 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09322562EB9E00DA9C4A /* Application.swift */; }; 5C5D09362562EBDE00DA9C4A /* Koin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09352562EBDE00DA9C4A /* Koin.swift */; }; 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09382562EC0100DA9C4A /* Extensions.swift */; }; 5C5D093C2562EC2D00DA9C4A /* CalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */; }; - 5C693EBA25C4AFF800C9373E /* SelectCurrencyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C693EB925C4AFF800C9373E /* SelectCurrencyView.swift */; }; + 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */; }; 5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E673F25C5A711001CC0D6 /* SliderView.swift */; }; 5C6E674D25C602BE001CC0D6 /* SnackBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */; }; 5C8EB4A9260CB5E200DC4A90 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5C8EB4A8260CB5E200DC4A90 /* GoogleService-Info.plist */; }; @@ -36,7 +36,7 @@ 5C9A59BB25C350DE006745B0 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9A59BA25C350DE006745B0 /* MainView.swift */; }; 5C9C75C82603A36A00D66FDD /* ToolbarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */; }; 5CB954BF26932408007632DC /* BannerAdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB954BE26932408007632DC /* BannerAdView.swift */; }; - 5CDE468425BC3B2000CA0FB1 /* ChangeBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDE468325BC3B2000CA0FB1 /* ChangeBaseView.swift */; }; + 5CDE468425BC3B2000CA0FB1 /* SelectCurrencyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDE468325BC3B2000CA0FB1 /* SelectCurrencyView.swift */; }; 5CF57E3A269588060081E4BB /* RewardedAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF57E39269588060081E4BB /* RewardedAd.swift */; }; 5CF57E3C2695A3B20081E4BB /* InterstitialAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF57E3B2695A3B20081E4BB /* InterstitialAd.swift */; }; 5CF8BE4227DE205B00E441F5 /* MailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8BE4127DE205B00E441F5 /* MailView.swift */; }; @@ -74,13 +74,13 @@ 5C31E43028142110008C42B9 /* CurrenciesItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrenciesItemView.swift; sourceTree = ""; }; 5C31E4332814306D008C42B9 /* SettingsToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsToolbarView.swift; sourceTree = ""; }; 5C31E4352814308B008C42B9 /* SettingsItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsItemView.swift; sourceTree = ""; }; - 5C31E438281431A3008C42B9 /* ChangeBaseItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeBaseItemView.swift; sourceTree = ""; }; + 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyItemView.swift; sourceTree = ""; }; 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 5C5D09322562EB9E00DA9C4A /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; 5C5D09352562EBDE00DA9C4A /* Koin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Koin.swift; sourceTree = ""; }; 5C5D09382562EC0100DA9C4A /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorView.swift; sourceTree = ""; }; - 5C693EB925C4AFF800C9373E /* SelectCurrencyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyView.swift; sourceTree = ""; }; + 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrenciesBottomView.swift; sourceTree = ""; }; 5C6E673F25C5A711001CC0D6 /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = ""; }; 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnackBar.swift; sourceTree = ""; }; 5C8EB4A8260CB5E200DC4A90 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -90,7 +90,7 @@ 5CB954BE26932408007632DC /* BannerAdView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerAdView.swift; sourceTree = ""; }; 5CB954C526934EFC007632DC /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 5CB954CD269362E2007632DC /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - 5CDE468325BC3B2000CA0FB1 /* ChangeBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeBaseView.swift; sourceTree = ""; }; + 5CDE468325BC3B2000CA0FB1 /* SelectCurrencyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyView.swift; sourceTree = ""; }; 5CF57E39269588060081E4BB /* RewardedAd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RewardedAd.swift; sourceTree = ""; }; 5CF57E3B2695A3B20081E4BB /* InterstitialAd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterstitialAd.swift; sourceTree = ""; }; 5CF8BE4127DE205B00E441F5 /* MailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailView.swift; sourceTree = ""; }; @@ -120,7 +120,7 @@ children = ( 5CB954BE26932408007632DC /* BannerAdView.swift */, 5C039FD525C1B705008350A3 /* FormProgressView.swift */, - 5C693EB925C4AFF800C9373E /* SelectCurrencyView.swift */, + 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */, 5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */, 5CF8BE4127DE205B00E441F5 /* MailView.swift */, 5CF8BE4527DE334100E441F5 /* WebView.swift */, @@ -179,13 +179,13 @@ path = Settings; sourceTree = ""; }; - 5C31E4372814315D008C42B9 /* ChangeBase */ = { + 5C4B536E28184AEA00D10185 /* SelectCurrency */ = { isa = PBXGroup; children = ( - 5CDE468325BC3B2000CA0FB1 /* ChangeBaseView.swift */, - 5C31E438281431A3008C42B9 /* ChangeBaseItemView.swift */, + 5CDE468325BC3B2000CA0FB1 /* SelectCurrencyView.swift */, + 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */, ); - path = ChangeBase; + path = SelectCurrency; sourceTree = ""; }; 5C5D09342562EBCA00DA9C4A /* DI */ = { @@ -204,7 +204,7 @@ 5C31E41C28141C61008C42B9 /* Calculator */, 5C31E42B28142033008C42B9 /* Currencies */, 5C31E4322814304F008C42B9 /* Settings */, - 5C31E4372814315D008C42B9 /* ChangeBase */, + 5C4B536E28184AEA00D10185 /* SelectCurrency */, 5C039FD425C1B6A2008350A3 /* SubView */, ); path = UI; @@ -459,7 +459,7 @@ 5C039FD625C1B705008350A3 /* FormProgressView.swift in Sources */, 5C8FDBDD25BF3FBE00F280FF /* ObservableSEED.swift in Sources */, 5C6E674D25C602BE001CC0D6 /* SnackBar.swift in Sources */, - 5CDE468425BC3B2000CA0FB1 /* ChangeBaseView.swift in Sources */, + 5CDE468425BC3B2000CA0FB1 /* SelectCurrencyView.swift in Sources */, 5C31E43128142110008C42B9 /* CurrenciesItemView.swift in Sources */, 5C31E42028141CA4008C42B9 /* OutputView.swift in Sources */, 5C9A59BB25C350DE006745B0 /* MainView.swift in Sources */, @@ -473,10 +473,10 @@ 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */, 5C17581A25BC74BD00D16BD9 /* SettingsView.swift in Sources */, 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */, - 5C693EBA25C4AFF800C9373E /* SelectCurrencyView.swift in Sources */, + 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */, 5C31E41E28141C7B008C42B9 /* InputView.swift in Sources */, 5C31E42A28141F1B008C42B9 /* SlideView.swift in Sources */, - 5C31E439281431A3008C42B9 /* ChangeBaseItemView.swift in Sources */, + 5C31E439281431A3008C42B9 /* SelectCurrencyItemView.swift in Sources */, 5C31E42F281420BC008C42B9 /* CurrenciesToolbarView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/ios/CCC/DI/Koin.swift b/ios/CCC/DI/Koin.swift index 1d0de29fce..9f60fc32a9 100644 --- a/ios/CCC/DI/Koin.swift +++ b/ios/CCC/DI/Koin.swift @@ -39,8 +39,8 @@ extension Koin_coreKoin { return koin.getDependency(objCClass: CurrenciesViewModel.self) as! CurrenciesViewModel } - func get() -> ChangeBaseViewModel { - return koin.getDependency(objCClass: ChangeBaseViewModel.self) as! ChangeBaseViewModel + func get() -> SelectCurrencyViewModel { + return koin.getDependency(objCClass: SelectCurrencyViewModel.self) as! SelectCurrencyViewModel } func get() -> SettingsViewModel { @@ -56,8 +56,8 @@ extension Koin_coreKoin { return CalculatorObservable(viewModel: get()) } - func get() -> ChangeBaseObservable { - return ChangeBaseObservable(viewModel: get()) + func get() -> SelectCurrencyObservable { + return SelectCurrencyObservable(viewModel: get()) } func get() -> SettingsObservable { diff --git a/ios/CCC/UI/Calculator/CalculatorView.swift b/ios/CCC/UI/Calculator/CalculatorView.swift index 2ee3420a01..554d4b8b41 100644 --- a/ios/CCC/UI/Calculator/CalculatorView.swift +++ b/ios/CCC/UI/Calculator/CalculatorView.swift @@ -88,9 +88,9 @@ struct CalculatorView: View { .sheet( isPresented: $isBarShown, content: { - ChangeBaseView( + SelectCurrencyView( isBarShown: $isBarShown, - onBaseChange: { observable.event.onBaseChange(base: $0)} + onSelectCurrency: { observable.event.onBaseChange(base: $0)} ).environmentObject(navigationStack) } ) diff --git a/ios/CCC/UI/Currencies/CurrenciesView.swift b/ios/CCC/UI/Currencies/CurrenciesView.swift index 6684e78990..2afb866b68 100644 --- a/ios/CCC/UI/Currencies/CurrenciesView.swift +++ b/ios/CCC/UI/Currencies/CurrenciesView.swift @@ -60,7 +60,7 @@ struct CurrenciesView: View { .background(MR.colors().background.get()) if observable.viewModel.isFirstRun() { - SelectCurrencyView( + SelectCurrenciesBottomView( text: MR.strings().txt_select_currencies.get(), buttonText: MR.strings().btn_done.get(), onButtonClick: observable.event.onDoneClick diff --git a/ios/CCC/UI/ChangeBase/ChangeBaseItemView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift similarity index 92% rename from ios/CCC/UI/ChangeBase/ChangeBaseItemView.swift rename to ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift index 678069c916..94a7432654 100644 --- a/ios/CCC/UI/ChangeBase/ChangeBaseItemView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift @@ -1,5 +1,5 @@ // -// ChangeBaseItemView.swift +// SelectCurrencyItemView.swift // CCC // // Created by Mustafa Ozhan on 23.04.22. @@ -10,7 +10,7 @@ import SwiftUI import Resources import Client -struct ChangeBaseItemView: View { +struct SelectCurrencyItemView: View { @Environment(\.colorScheme) var colorScheme var item: Currency diff --git a/ios/CCC/UI/ChangeBase/ChangeBaseView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift similarity index 72% rename from ios/CCC/UI/ChangeBase/ChangeBaseView.swift rename to ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift index e4b2bbda28..114474bb48 100644 --- a/ios/CCC/UI/ChangeBase/ChangeBaseView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift @@ -1,5 +1,5 @@ // -// BarView.swift +// SelectCurrencyObservable.swift // CCC // // Created by Mustafa Ozhan on 23/01/2021. @@ -11,17 +11,17 @@ import Resources import Client import NavigationStack -typealias ChangeBaseObservable = ObservableSEED - +typealias SelectCurrencyObservable = ObservableSEED + -struct ChangeBaseView: View { +struct SelectCurrencyView: View { @Environment(\.colorScheme) var colorScheme @EnvironmentObject private var navigationStack: NavigationStack - @StateObject var observable: ChangeBaseObservable = koin.get() + @StateObject var observable: SelectCurrencyObservable = koin.get() @Binding var isBarShown: Bool - var onBaseChange: (String) -> Void + var onSelectCurrency: (String) -> Void var body: some View { @@ -33,7 +33,7 @@ struct ChangeBaseView: View { if observable.state.currencyList.count < 2 { - SelectCurrencyView( + SelectCurrenciesBottomView( text: MR.strings().choose_at_least_two_currency.get(), buttonText: MR.strings().select.get(), onButtonClick: observable.event.onSelectClick @@ -48,7 +48,7 @@ struct ChangeBaseView: View { List(observable.state.currencyList, id: \.name) { currency in - ChangeBaseItemView(item: currency) + SelectCurrencyItemView(item: currency) .onTapGesture { observable.event.onItemClick(currency: currency) } .frame(minWidth: 0, maxWidth: .infinity, alignment: .center) @@ -66,15 +66,15 @@ struct ChangeBaseView: View { .onReceive(observable.effect) { onEffect(effect: $0) } } - private func onEffect(effect: ChangeBaseEffect) { - logger.i(message: {"ChangeBaseView onEffect \(effect.description)"}) + private func onEffect(effect: SelectCurrencyEffect) { + logger.i(message: {"SelectCurrencyView onEffect \(effect.description)"}) switch effect { // swiftlint:disable force_cast - case is ChangeBaseEffect.BaseChange: - onBaseChange((effect as! ChangeBaseEffect.BaseChange).newBase) + case is SelectCurrencyEffect.CurrencyChange: + onSelectCurrency((effect as! SelectCurrencyEffect.CurrencyChange).newBase) isBarShown = false - case is ChangeBaseEffect.OpenCurrencies: - navigationStack.push(CurrenciesView(onBaseChange: onBaseChange)) + case is SelectCurrencyEffect.OpenCurrencies: + navigationStack.push(CurrenciesView(onBaseChange: onSelectCurrency)) default: logger.i(message: {"BarView unknown effect"}) } diff --git a/ios/CCC/UI/SubView/SelectCurrencyView.swift b/ios/CCC/UI/SubView/SelectCurrenciesBottomView.swift similarity index 91% rename from ios/CCC/UI/SubView/SelectCurrencyView.swift rename to ios/CCC/UI/SubView/SelectCurrenciesBottomView.swift index d972e49240..b779c630b3 100644 --- a/ios/CCC/UI/SubView/SelectCurrencyView.swift +++ b/ios/CCC/UI/SubView/SelectCurrenciesBottomView.swift @@ -1,5 +1,5 @@ // -// CurrencySelectionView.swift +// SelectCurrenciesBottomView.swift // CCC // // Created by Mustafa Ozhan on 29/01/2021. @@ -9,7 +9,7 @@ import SwiftUI import Resources -struct SelectCurrencyView: View { +struct SelectCurrenciesBottomView: View { @Environment(\.colorScheme) var colorScheme var text: String diff --git a/resources/src/commonMain/resources/MR/base/strings.xml b/resources/src/commonMain/resources/MR/base/strings.xml index 83c4aa95bf..14aa40125c 100644 --- a/resources/src/commonMain/resources/MR/base/strings.xml +++ b/resources/src/commonMain/resources/MR/base/strings.xml @@ -80,8 +80,8 @@ If you want to change the app theme Click on settings icon > Theme\nThen chose your theme! - - Select base currency + + Select currency Settings From 36046763cde9b067dfd636d527ec6faf4d9e8d2f Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Fri, 29 Apr 2022 00:08:15 +0200 Subject: [PATCH 03/18] [#681] Add Unknown icon (#682) * [#681] Add Unknown icon --- .../oztechan/ccc/android/util/ViewExtensions.kt | 2 +- ios/CCC/UI/Calculator/OutputView.swift | 12 +++++------- .../resources/MR/images/transparent@2x.png | Bin 210 -> 0 bytes .../resources/MR/images/unknown@2x.png | Bin 0 -> 12542 bytes .../com/oztechan/ccc/resources/Resources.kt | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) delete mode 100755 resources/src/commonMain/resources/MR/images/transparent@2x.png create mode 100644 resources/src/commonMain/resources/MR/images/unknown@2x.png diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt b/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt index ecc9ba24fe..dccc87f6a1 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt @@ -41,7 +41,7 @@ fun Context.getImageResourceByName(name: String): Int = try { ) } catch (e: FileNotFoundException) { Logger.e(e) - R.drawable.transparent + R.drawable.unknown } fun View.hideKeyboard() = context?.getSystemService(Context.INPUT_METHOD_SERVICE) diff --git a/ios/CCC/UI/Calculator/OutputView.swift b/ios/CCC/UI/Calculator/OutputView.swift index b1b408bb37..9a3cb2717f 100644 --- a/ios/CCC/UI/Calculator/OutputView.swift +++ b/ios/CCC/UI/Calculator/OutputView.swift @@ -20,12 +20,10 @@ struct OutputView: View { VStack(alignment: .leading) { HStack { - if baseCurrency != "" { - Image(uiImage: baseCurrency.getImage()) - .resizable() - .frame(width: 36, height: 36, alignment: .center) - .shadow(radius: 3) - } + Image(uiImage: baseCurrency.getImage()) + .resizable() + .frame(width: 36, height: 36, alignment: .center) + .shadow(radius: 3) Text(baseCurrency).foregroundColor(MR.colors().text.get()) @@ -36,7 +34,7 @@ struct OutputView: View { Text(symbol).foregroundColor(MR.colors().text.get()) } .frame(minWidth: 0, maxWidth: .infinity, alignment: .bottomLeading) - .padding(EdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 20)) + .padding(EdgeInsets(top: 2, leading: 20, bottom: 2, trailing: 20)) .animation(.default) } diff --git a/resources/src/commonMain/resources/MR/images/transparent@2x.png b/resources/src/commonMain/resources/MR/images/transparent@2x.png deleted file mode 100755 index bb99aad04b5e8ee6722ad4f275abfc4d65f897d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I#=yXMH_y=n$YDu$^mSxl*x1kgCy^D%XG`*S zcVYMsf(!O8p9~b?Ebxdd2AXgkgc+SQW>)|O*-JcqUD+RU3koaA?@BhE02GqV42dXl z&d<$F%_{+N85o?4QWHy3QxwWGOEMJPJ$(aG^itV@;%c5Qjv*Dd-X3IR1oD~`{;$vT dZ~!rp!Fo1_3I@hiT>au8QBPMtmvv4FO#nZhG5`Po diff --git a/resources/src/commonMain/resources/MR/images/unknown@2x.png b/resources/src/commonMain/resources/MR/images/unknown@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..227f959042d4db35478d71f8dffb2c91c0a7d69e GIT binary patch literal 12542 zcmeHrbySpJ*Y-_!N%t@yA>AR}-HieRGjubwbeFV%bW2I2(ny063P`6)gGfrgqrWHD z_x|&&^}YW+v(~-lKIiOx?Y*zF&$-XpvD%tSc-U0f007{rD9h_2{-u9EnCJk2wCp0I z3;;w7{`$snU5F3J&BN8k-U$YR`?nzjSPd63(4z(U9 zonvhs-$Yz+-rcRY{d(5tK60{uRPeC#BKXOh0+gkS!RpIpX;_ErDgElJBiz?F0+WwZ zzQoaRe}AkUi1G8V3$lu|usoaQFtX}eRCg^d<*j=tRT3@nWTs{AC_w6-mTxL2#jnG2 z%*7d(DB7~fNJGM}f`(JFaD(HUSQD;-2yF+pE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Z!7 z4$sKT)3wT}54qPrZP&9p$)+OEg`9*a)+mXF4szY?#~_fh%& zdHl_|XXISqT0i3>iWu|k9nN~C65;0R$0Uh;&Wv54@F|gP6O&&DO5l#bScB14#YDq8 z)X6^N!sv$T^0J1zQV|g+e#Lif!3@_ZAJm`sCa}fwWcw!@8RIHcT&18sz22=BTjVaO zXh#Z}O3MH2)Ib!J8q%{vlMnK3US99*<63(AG(Km>V;i?zrdmGX{U|Y@92S8%d>I)9 z?s1cqw9&GWu z${Vlmu-=eG{H$^=Evug@-0AYEup;MtMoke-`dV@s7ZBO0+`(CS@tijEyIRz5U*AP@ z@jTeQwd-2b3faL1W~39`Ue%rZ0^pL3iY^+WoaW~&g!lKM1FYESd8SiOEY98xF66uu zkah^kxmW6Ck^;c>C>292EOm6ml0m#$pwzo9hWEE&If+rP$DhyMEIu5-fEZ=~la`n< zOHWmd0aO57j6f!#% zC=yqhLnRyI<`58fV76e@-0=8S^gg7}?Nh=H}b;a#C z8jNe4qYhi!w+GI>+{D?=RRVdayfAvT6K=OKwhCZ8BdYft2?fs0yG{2f=8|j{5m?x` Rh!O&zqM#}NTGle`e*mQN6!riB literal 0 HcmV?d00001 diff --git a/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt b/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt index 427fda853f..aa3ce89f4f 100644 --- a/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt +++ b/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt @@ -20,7 +20,7 @@ import platform.UIKit.UIScreen fun getDrawableByFileName(name: String): ImageResource { return MR.images.getImageByFileName( name.lowercase().replace("try", "tryy") - ) ?: MR.images.transparent + ) ?: MR.images.unknown } fun getString(stringResource: StringResource): StringDesc { From e466ab5f2febd2aab99df98e1c1bc78298d9a76c Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Fri, 29 Apr 2022 14:54:36 +0200 Subject: [PATCH 04/18] [#689] Fix Dependency CI task (#691) --- .../{dependencies.yml => dependency.yml} | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) rename .github/workflows/{dependencies.yml => dependency.yml} (68%) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependency.yml similarity index 68% rename from .github/workflows/dependencies.yml rename to .github/workflows/dependency.yml index ff3e8b01fc..b628cbc9b7 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependency.yml @@ -1,4 +1,4 @@ -name: Dependency Check +name: Dependency on: schedule: @@ -22,20 +22,8 @@ jobs: with: java-version: 11 - - name: Run dependency updates task - run: ./gradlew dependencyUpdates -DoutputFormatter=plain - - - name: Extract dependencies from report file - id: deps - run: | - export DEPENDENCIES="$(sed -n '/.*milestone versions:/,/^$/p' build/dependencyUpdates/report.txt)" - DEPENDENCIES="${DEPENDENCIES//$'\n'/'%0A'}" - DEPENDENCIES="${DEPENDENCIES//$'\r'/'%0D'}" - echo "OUTPUT:" - echo $DEPENDENCIES - echo "depss=$DEPENDENCIES" >> $GITHUB_ENV - echo "::set-output name=dependencies::$(echo "$DEPENDENCIES")" - shell: bash + - name: Run dependencyUpdates Task + run: ./gradlew dependencyUpdates --parallel - name: Upload dependencies report uses: actions/upload-artifact@v2 From 68f03a181c3ae6eb641c5bce7776d0b87ac1a35f Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sat, 30 Apr 2022 16:25:30 +0200 Subject: [PATCH 05/18] [#683] move Resource utils into resources module (#684) --- .../ui/calculator/CalculatorAdapter.kt | 2 +- .../ui/calculator/CalculatorFragment.kt | 6 +++--- .../ui/currencies/CurrenciesAdapter.kt | 2 +- .../selectcurrency/SelectCurrencyAdapter.kt | 2 +- .../ccc/android/util/ViewExtensions.kt | 19 ------------------- ios/CCC/Util/Extensions.swift | 8 ++++---- .../ccc/resources/AndroidResources.kt | 12 ++++++++++++ .../com/oztechan/ccc/resources/Resources.kt | 10 ++++++++++ .../{Resources.kt => IOSResources.kt} | 8 -------- 9 files changed, 32 insertions(+), 37 deletions(-) create mode 100644 resources/src/androidMain/kotlin/com/oztechan/ccc/resources/AndroidResources.kt create mode 100644 resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt rename resources/src/iosMain/kotlin/com/oztechan/ccc/resources/{Resources.kt => IOSResources.kt} (77%) diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorAdapter.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorAdapter.kt index a88ca49646..2a23b4a3fd 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorAdapter.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorAdapter.kt @@ -7,11 +7,11 @@ import com.github.submob.basemob.adapter.BaseVBRecyclerViewAdapter import com.oztechan.ccc.analytics.AnalyticsManager import com.oztechan.ccc.analytics.model.EventParam import com.oztechan.ccc.analytics.model.FirebaseEvent -import com.oztechan.ccc.android.util.setBackgroundByName import com.oztechan.ccc.client.model.Currency import com.oztechan.ccc.client.util.getFormatted import com.oztechan.ccc.client.util.toStandardDigits import com.oztechan.ccc.client.viewmodel.calculator.CalculatorEvent +import com.oztechan.ccc.resources.setBackgroundByName import mustafaozhan.github.com.mycurrencies.databinding.ItemCalculatorBinding class CalculatorAdapter( diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt index 64947a15da..973a84372b 100755 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/calculator/CalculatorFragment.kt @@ -16,15 +16,15 @@ import com.oztechan.ccc.analytics.AnalyticsManager import com.oztechan.ccc.analytics.model.UserProperty import com.oztechan.ccc.android.util.copyToClipBoard import com.oztechan.ccc.android.util.dataState -import com.oztechan.ccc.android.util.getImageResourceByName import com.oztechan.ccc.android.util.getNavigationResult -import com.oztechan.ccc.android.util.setBackgroundByName import com.oztechan.ccc.android.util.setBannerAd import com.oztechan.ccc.android.util.showLoading import com.oztechan.ccc.android.util.showSnack import com.oztechan.ccc.client.util.toValidList import com.oztechan.ccc.client.viewmodel.calculator.CalculatorEffect import com.oztechan.ccc.client.viewmodel.calculator.CalculatorViewModel +import com.oztechan.ccc.resources.getDrawableIdByFileName +import com.oztechan.ccc.resources.setBackgroundByName import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import mustafaozhan.github.com.mycurrencies.R @@ -162,7 +162,7 @@ class CalculatorFragment : BaseVBFragment() { is CalculatorEffect.ShowRate -> showSnack( requireView(), viewEffect.text, - icon = requireContext().getImageResourceByName(viewEffect.name) + icon = getDrawableIdByFileName(viewEffect.name) ) } }.launchIn(viewLifecycleOwner.lifecycleScope) diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/currencies/CurrenciesAdapter.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/currencies/CurrenciesAdapter.kt index a1dc7b9d73..57689652c2 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/currencies/CurrenciesAdapter.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/currencies/CurrenciesAdapter.kt @@ -5,9 +5,9 @@ import android.view.ViewGroup import android.view.animation.AnimationUtils import androidx.recyclerview.widget.DiffUtil import com.github.submob.basemob.adapter.BaseVBRecyclerViewAdapter -import com.oztechan.ccc.android.util.setBackgroundByName import com.oztechan.ccc.client.model.Currency import com.oztechan.ccc.client.viewmodel.currencies.CurrenciesEvent +import com.oztechan.ccc.resources.setBackgroundByName import mustafaozhan.github.com.mycurrencies.R import mustafaozhan.github.com.mycurrencies.databinding.ItemCurrenciesBinding diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt index 11508fb09b..f9ce9ce1a6 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/selectcurrency/SelectCurrencyAdapter.kt @@ -4,9 +4,9 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import com.github.submob.basemob.adapter.BaseVBRecyclerViewAdapter -import com.oztechan.ccc.android.util.setBackgroundByName import com.oztechan.ccc.client.model.Currency import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyEvent +import com.oztechan.ccc.resources.setBackgroundByName import mustafaozhan.github.com.mycurrencies.databinding.ItemSelectCurrencyBinding class SelectCurrencyAdapter( diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt b/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt index dccc87f6a1..6dcc1641f7 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/util/ViewExtensions.kt @@ -14,36 +14,17 @@ import android.view.animation.Animation import android.view.animation.Transformation import android.view.inputmethod.InputMethodManager import android.widget.FrameLayout -import android.widget.ImageView import android.widget.TextView import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.navigation.fragment.findNavController -import co.touchlab.kermit.Logger -import com.github.submob.logmob.e import com.github.submob.scopemob.castTo import com.oztechan.ccc.ad.AdManager import com.oztechan.ccc.client.model.RateState import mustafaozhan.github.com.mycurrencies.R -import java.io.FileNotFoundException private const val ANIMATION_DURATION = 500L -fun ImageView.setBackgroundByName( - name: String -) = setImageResource(context.getImageResourceByName(name)) - -fun Context.getImageResourceByName(name: String): Int = try { - resources.getIdentifier( - name.lowercase().replace("try", "tryy"), - "drawable", - packageName - ) -} catch (e: FileNotFoundException) { - Logger.e(e) - R.drawable.unknown -} - fun View.hideKeyboard() = context?.getSystemService(Context.INPUT_METHOD_SERVICE) ?.castTo() ?.hideSoftInputFromWindow(windowToken, 0) diff --git a/ios/CCC/Util/Extensions.swift b/ios/CCC/Util/Extensions.swift index e7e57589e3..04d41a1392 100644 --- a/ios/CCC/Util/Extensions.swift +++ b/ios/CCC/Util/Extensions.swift @@ -12,10 +12,10 @@ import SwiftUI extension ResourcesStringResource { func get() -> String { - return ResourcesKt.getString(stringResource: self).localized() + return IOSResourcesKt.getString(stringResource: self).localized() } func get(parameter: Any) -> String { - return ResourcesKt.getString(stringResource: self, parameter: parameter).localized() + return IOSResourcesKt.getString(stringResource: self, parameter: parameter).localized() } } @@ -24,7 +24,7 @@ extension ResourcesColorResource { return Color(get()) } func get() -> UIColor { - return ResourcesKt.getColor(colorResource: self) + return IOSResourcesKt.getColor(colorResource: self) } } @@ -36,7 +36,7 @@ extension ResourcesImageResource { extension String { func getImage() -> UIImage { - return ResourcesKt.getDrawableByFileName(name: self).toUIImage()! + return ResourcesKt.getImageByFileName(name: self).toUIImage()! } } diff --git a/resources/src/androidMain/kotlin/com/oztechan/ccc/resources/AndroidResources.kt b/resources/src/androidMain/kotlin/com/oztechan/ccc/resources/AndroidResources.kt new file mode 100644 index 0000000000..88ec0c1b99 --- /dev/null +++ b/resources/src/androidMain/kotlin/com/oztechan/ccc/resources/AndroidResources.kt @@ -0,0 +1,12 @@ +package com.oztechan.ccc.resources + +import android.widget.ImageView + +fun getDrawableIdByFileName( + name: String +): Int = getImageByFileName(name.toImageFileName()).drawableResId + +fun ImageView.setBackgroundByName( + name: String +) = setImageResource(getDrawableIdByFileName(name)) + diff --git a/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt b/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt new file mode 100644 index 0000000000..7e105f0146 --- /dev/null +++ b/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt @@ -0,0 +1,10 @@ +package com.oztechan.ccc.resources + +import dev.icerock.moko.resources.ImageResource +import dev.icerock.moko.resources.getImageByFileName + +fun getImageByFileName( + name: String +): ImageResource = MR.images.getImageByFileName(name.toImageFileName()) ?: MR.images.unknown + +fun String.toImageFileName() = lowercase().replace("try", "tryy") diff --git a/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt b/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/IOSResources.kt similarity index 77% rename from resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt rename to resources/src/iosMain/kotlin/com/oztechan/ccc/resources/IOSResources.kt index aa3ce89f4f..3343cbca9c 100644 --- a/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/Resources.kt +++ b/resources/src/iosMain/kotlin/com/oztechan/ccc/resources/IOSResources.kt @@ -7,22 +7,14 @@ package com.oztechan.ccc.resources import dev.icerock.moko.graphics.toUIColor import dev.icerock.moko.resources.ColorResource -import dev.icerock.moko.resources.ImageResource import dev.icerock.moko.resources.StringResource import dev.icerock.moko.resources.desc.Resource import dev.icerock.moko.resources.desc.ResourceFormatted import dev.icerock.moko.resources.desc.StringDesc import dev.icerock.moko.resources.getColor -import dev.icerock.moko.resources.getImageByFileName import platform.UIKit.UIColor import platform.UIKit.UIScreen -fun getDrawableByFileName(name: String): ImageResource { - return MR.images.getImageByFileName( - name.lowercase().replace("try", "tryy") - ) ?: MR.images.unknown -} - fun getString(stringResource: StringResource): StringDesc { return StringDesc.Resource(stringResource) } From 8d958d8eb4d62a5458cd7afb5f280b87354bb899 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 1 May 2022 16:58:49 +0200 Subject: [PATCH 06/18] [#694] Gradle update (#696) --- buildSrc/src/main/kotlin/Versions.kt | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index ee34595e65..44d592e1e0 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -5,7 +5,7 @@ @Suppress("SpellCheckingInspection") object Versions { const val KOTLIN = "1.6.10" - const val ANDROID_GRADLE_PLUGIN = "7.1.2" + const val ANDROID_GRADLE_PLUGIN = "7.1.3" const val ANDROID_MATERIAL = "1.4.0" const val CONSTRAINT_LAYOUT = "2.1.3" const val KTOR = "1.6.8" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 96eb38f12c..e09bbcb5a5 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,4 +5,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip From 8949391b5cdda352c80bef2e86df797cd3fee87e Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 1 May 2022 17:24:06 +0200 Subject: [PATCH 07/18] [#695] Library Updates (#702) --- buildSrc/src/main/kotlin/Versions.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 44d592e1e0..76cc007ad3 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -10,7 +10,7 @@ object Versions { const val CONSTRAINT_LAYOUT = "2.1.3" const val KTOR = "1.6.8" const val LOG_BACK = "1.2.11" - const val KOIN = "3.1.5" + const val KOIN = "3.1.6" const val MULTIPLATFORM_SETTINGS = "0.8.1" const val FIREBASE_ANALYTICS = "20.1.2" const val FIREBASE_REMOTE_CONFIG = "21.0.2" @@ -23,12 +23,12 @@ object Versions { const val KOTLIN_X_DATE_TIME = "0.3.2" const val COROUTINES = "1.5.2-native-mt" const val BILLING = "4.1.0" - const val LEAK_CANARY = "2.8.1" + const val LEAK_CANARY = "2.9.1" const val SQL_DELIGHT = "1.5.3" const val LIFECYCLE = "2.4.1" - const val MOKO_RESOURCES = "0.19.0" + const val MOKO_RESOURCES = "0.19.1" const val DEPENDENCY_UPDATES = "0.42.0" - const val BUILD_HEALTH = "0.80.0" + const val BUILD_HEALTH = "1.1.0" const val BUILD_KONFIG = "0.11.0" const val WORK_RUNTIME = "2.7.1" const val SPLASH_SCREEN = "1.0.0-alpha02" From a9bc8739925937d398e4e55301c6851bd520f259 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 2 May 2022 16:29:06 +0200 Subject: [PATCH 08/18] [#699] Invalid asset name fix (#700) * [#694] Gradle update * [#699] Invalid asset name fix --- .../commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt b/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt index 7e105f0146..370e24f5e5 100644 --- a/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt +++ b/resources/src/commonMain/kotlin/com/oztechan/ccc/resources/Resources.kt @@ -7,4 +7,6 @@ fun getImageByFileName( name: String ): ImageResource = MR.images.getImageByFileName(name.toImageFileName()) ?: MR.images.unknown -fun String.toImageFileName() = lowercase().replace("try", "tryy") +fun String.toImageFileName() = lowercase() + .replace("try", "tryy") + .ifEmpty { "unknown" } From 92610d0b287dad8bc490a6eedfbbbf7907977e33 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Tue, 3 May 2022 09:03:47 +0200 Subject: [PATCH 09/18] [#703] Reorganise README.md (#704) --- README.md | 76 ++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index d624fbb4af..57edd4a97b 100755 --- a/README.md +++ b/README.md @@ -22,15 +22,39 @@ You can quickly convert and make mathematical operations between currencies. Buy Me a Coffee at ko-fi.com -Main Modules | Completed | State | Tech | -:------------ | :-------------| :-------------| :-------------| -![badge-android](https://img.shields.io/badge/app-android-green) | :white_check_mark:| in production :muscle: | ViewBinding (State/Shared)Flow -![badge-backend](https://img.shields.io/badge/app-backend-blue) | :white_check_mark: | in production :muscle: | Ktor (server/client) Sqldelight -![badge-ios](https://img.shields.io/badge/app-ios-orange) || in progress :bow: | SwiftUI Combine -![badge-web](https://img.shields.io/badge/app-web-yellow) || coming soon :eyes: | :grey_question: -![badge-desktop](https://img.shields.io/badge/app-desktop-red) || coming soon :eyes: | :grey_question: -![badge-client](https://img.shields.io/badge/shared-client-white) | :white_check_mark: | used in FE targets :recycle: | KMP (android/ios) -![badge-common](https://img.shields.io/badge/shared-common-darkgrey) | :white_check_mark: | used in all targets :recycle: | KMP (android/ios/jvm) +## Module Graph + +```mermaid +graph TD; + +billing-->android + +ad-->android + +analytics-->android + +resources{resources}-->android +resources-->ios + +client{client}-->android +client-->ios + +config{config}-->client + +common{common}-->client +common-->backend + +android(android) +ios(ios) +backend(backend) +``` + +```mermaid +graph TD; +KMP_Library{KMP_Library} +Target(Target) +Library +``` @@ -71,40 +95,6 @@ override suspend fun methodXYZ(base: String) = client.getandroid - -ad-->android - -analytics-->android - -resources{resources}-->android -resources-->ios - -client{client}-->android -client-->ios - -config{config}-->client - -common{common}-->client -common-->backend - -android(android) -ios(ios) -backend(backend) -``` - -```mermaid -graph TD; -KMP_Library{KMP_Library} -Target(Target) -Library -``` - ## Android Preview From 86be303b1a4ffdcd7ccebd5a82eb69587f07f41e Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Wed, 4 May 2022 23:39:17 +0300 Subject: [PATCH 10/18] [#675] Remove stale (#680) --- .github/stale.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 45fac5581b..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 3 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false From 1f1a01b494f9aba1c1b2a0eee7ca9c2b145bc1f3 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Thu, 5 May 2022 14:16:48 +0300 Subject: [PATCH 11/18] [#697] Notifications screen implementation (#698) --- .../android/ui/settings/SettingsFragment.kt | 1 + .../ccc/client/di/module/ClientModule.kt | 2 + .../notifications/NotificationsSEED.kt | 41 ++++++ .../notifications/NotificationsViewModel.kt | 71 ++++++++++ .../client/viewmodel/settings/SettingsSEED.kt | 2 + .../viewmodel/settings/SettingsViewModel.kt | 6 + .../client/viewmodel/SettingsViewModelTest.kt | 8 ++ ios/CCC.xcodeproj/project.pbxproj | 24 ++++ ios/CCC/DI/Koin.swift | 8 ++ ios/CCC/UI/Calculator/CalculatorView.swift | 2 +- .../NotificationCurrencyItem.swift | 28 ++++ .../Notifications/NotificationStateView.swift | 37 ++++++ .../NotificationsToolbarView.swift | 27 ++++ .../UI/Notifications/NotificationsView.swift | 124 ++++++++++++++++++ .../SelectCurrency/SelectCurrencyView.swift | 6 +- ios/CCC/UI/Settings/SettingsView.swift | 11 ++ .../commonMain/resources/MR/base/strings.xml | 15 ++- 17 files changed, 407 insertions(+), 6 deletions(-) create mode 100644 client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt create mode 100644 client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt create mode 100644 ios/CCC/UI/Notifications/NotificationCurrencyItem.swift create mode 100644 ios/CCC/UI/Notifications/NotificationStateView.swift create mode 100644 ios/CCC/UI/Notifications/NotificationsToolbarView.swift create mode 100644 ios/CCC/UI/Notifications/NotificationsView.swift diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt index 7f5367ca91..e67cc7dbb6 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt @@ -183,6 +183,7 @@ class SettingsFragment : BaseVBFragment() { requireView(), R.string.txt_ads_already_disabled ) + SettingsEffect.OpenNotifications -> TODO("No Android implementation yet") } }.launchIn(viewLifecycleOwner.lifecycleScope) diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt index 12fd97a1eb..bcde53945d 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt @@ -7,6 +7,7 @@ import com.oztechan.ccc.client.viewmodel.adremove.AdRemoveViewModel import com.oztechan.ccc.client.viewmodel.calculator.CalculatorViewModel import com.oztechan.ccc.client.viewmodel.currencies.CurrenciesViewModel import com.oztechan.ccc.client.viewmodel.main.MainViewModel +import com.oztechan.ccc.client.viewmodel.notifications.NotificationsViewModel import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyViewModel import com.oztechan.ccc.client.viewmodel.settings.SettingsViewModel import com.oztechan.ccc.config.ConfigManager @@ -20,6 +21,7 @@ var clientModule = module { viewModelDefinition { CalculatorViewModel(get(), get(), get(), get(), get()) } viewModelDefinition { SelectCurrencyViewModel(get()) } viewModelDefinition { AdRemoveViewModel(get()) } + viewModelDefinition { NotificationsViewModel(get()) } single { ConfigManagerImpl() } single { SessionManagerImpl(get(), get()) } diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt new file mode 100644 index 0000000000..7d33e1f5c9 --- /dev/null +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt @@ -0,0 +1,41 @@ +package com.oztechan.ccc.client.viewmodel.notifications + + +import com.oztechan.ccc.client.base.BaseEffect +import com.oztechan.ccc.client.base.BaseEvent +import com.oztechan.ccc.client.base.BaseState +import kotlinx.coroutines.flow.MutableStateFlow + +data class NotificationsState( + val isEnabled: Boolean = false, + val base: String = "", + val target: String = "" +) : BaseState() + +sealed class NotificationsEffect : BaseEffect() { + object Back : NotificationsEffect() + object SelectBase : NotificationsEffect() + object SelectTarget : NotificationsEffect() +} + +interface NotificationsEvent : BaseEvent { + fun onBackClick() + fun onBaseChange(base: String) + fun onTargetChange(target: String) + fun onBaseClick() + fun onTargetClick() + fun onStateClick() +} + +// Extension +fun MutableStateFlow.update( + isEnabled: Boolean = value.isEnabled, + base: String = value.base, + target: String = value.target +) { + value = value.copy( + isEnabled = isEnabled, + base = base, + target = target + ) +} \ No newline at end of file diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt new file mode 100644 index 0000000000..21992faa07 --- /dev/null +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt @@ -0,0 +1,71 @@ +package com.oztechan.ccc.client.viewmodel.notifications + +import co.touchlab.kermit.Logger +import com.oztechan.ccc.client.base.BaseData +import com.oztechan.ccc.client.base.BaseSEEDViewModel +import com.oztechan.ccc.client.util.launchIgnored +import com.oztechan.ccc.common.db.currency.CurrencyRepository +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asSharedFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach + +class NotificationsViewModel( + currencyRepository: CurrencyRepository +) : BaseSEEDViewModel(), NotificationsEvent { + // region SEED + private val _state = MutableStateFlow(NotificationsState()) + override val state = _state.asStateFlow() + + override val event = this as NotificationsEvent + + private val _effect = MutableSharedFlow() + override val effect = _effect.asSharedFlow() + + override val data: BaseData? = null + + init { + currencyRepository.collectActiveCurrencies() + .onEach { + Logger.d { "NotificationsViewModel currencyList changed\n${it.joinToString("\n")}" } + _state.update( + base = it.firstOrNull()?.name ?: "", + target = it.lastOrNull()?.name ?: "" + ) + } + .launchIn(clientScope) + } + + override fun onBackClick() = clientScope.launchIgnored { + Logger.d { "NotificationsViewModel onBackClick" } + _effect.emit(NotificationsEffect.Back) + } + + override fun onBaseChange(base: String) { + Logger.d { "NotificationsViewModel onBaseClick $base" } + _state.update(base = base) + } + + override fun onTargetChange(target: String) { + Logger.d { "NotificationsViewModel onTargetChange $target" } + _state.update(target = target) + } + + override fun onBaseClick() = clientScope.launchIgnored { + Logger.d { "NotificationsViewModel onBaseClick" } + _effect.emit(NotificationsEffect.SelectBase) + } + + override fun onTargetClick() = clientScope.launchIgnored { + Logger.d { "NotificationsViewModel onTargetClick" } + _effect.emit(NotificationsEffect.SelectTarget) + } + + override fun onStateClick() { + Logger.d { "NotificationsViewModel onStateClick ${!state.value.isEnabled}" } + _state.update(isEnabled = !state.value.isEnabled) + } + // endregion +} diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt index 2629ce3a26..3df0f58554 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt @@ -19,6 +19,7 @@ data class SettingsState( interface SettingsEvent : BaseEvent { fun onBackClick() fun onCurrenciesClick() + fun onNotificationsClicked() fun onFeedBackClick() fun onShareClick() fun onSupportUsClick() @@ -32,6 +33,7 @@ interface SettingsEvent : BaseEvent { sealed class SettingsEffect : BaseEffect() { object Back : SettingsEffect() object OpenCurrencies : SettingsEffect() + object OpenNotifications : SettingsEffect() object FeedBack : SettingsEffect() object Share : SettingsEffect() object SupportUs : SettingsEffect() diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt index e8cb5a7c84..f21c696462 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt @@ -111,6 +111,12 @@ class SettingsViewModel( _effect.emit(SettingsEffect.OpenCurrencies) } + + override fun onNotificationsClicked() = clientScope.launchIgnored { + Logger.d { "SettingsViewModel onNotificationsClicked" } + _effect.emit(SettingsEffect.OpenNotifications) + } + override fun onFeedBackClick() = clientScope.launchIgnored { Logger.d { "SettingsViewModel onFeedBackClick" } _effect.emit(SettingsEffect.FeedBack) diff --git a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt index 8869b00af4..b33220eb73 100644 --- a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt +++ b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt @@ -248,6 +248,14 @@ class SettingsViewModelTest { assertTrue { it is SettingsEffect.OpenCurrencies } } + + @Test + fun onNotificationsClicked() = viewModel.effect.before { + viewModel.event.onNotificationsClicked() + }.after { + assertEquals(SettingsEffect.OpenNotifications, it) + } + @Test fun onFeedBackClick() = viewModel.effect.before { viewModel.event.onFeedBackClick() diff --git a/ios/CCC.xcodeproj/project.pbxproj b/ios/CCC.xcodeproj/project.pbxproj index 018399a9df..63bf906848 100644 --- a/ios/CCC.xcodeproj/project.pbxproj +++ b/ios/CCC.xcodeproj/project.pbxproj @@ -24,10 +24,14 @@ 5C31E4362814308B008C42B9 /* SettingsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E4352814308B008C42B9 /* SettingsItemView.swift */; }; 5C31E439281431A3008C42B9 /* SelectCurrencyItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */; }; 5C31E43F28145D32008C42B9 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */; }; + 5C4B53692818057F00D10185 /* NotificationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B53682818057F00D10185 /* NotificationsView.swift */; }; + 5C4B536B2818066000D10185 /* NotificationsToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */; }; + 5C4B536D28183B4900D10185 /* NotificationCurrencyItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */; }; 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09322562EB9E00DA9C4A /* Application.swift */; }; 5C5D09362562EBDE00DA9C4A /* Koin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09352562EBDE00DA9C4A /* Koin.swift */; }; 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09382562EC0100DA9C4A /* Extensions.swift */; }; 5C5D093C2562EC2D00DA9C4A /* CalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */; }; + 5C662D38281D644F00B65C2F /* NotificationStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C662D37281D644F00B65C2F /* NotificationStateView.swift */; }; 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */; }; 5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E673F25C5A711001CC0D6 /* SliderView.swift */; }; 5C6E674D25C602BE001CC0D6 /* SnackBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */; }; @@ -76,10 +80,14 @@ 5C31E4352814308B008C42B9 /* SettingsItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsItemView.swift; sourceTree = ""; }; 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyItemView.swift; sourceTree = ""; }; 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; + 5C4B53682818057F00D10185 /* NotificationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsView.swift; sourceTree = ""; }; + 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsToolbarView.swift; sourceTree = ""; }; + 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationCurrencyItem.swift; sourceTree = ""; }; 5C5D09322562EB9E00DA9C4A /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; 5C5D09352562EBDE00DA9C4A /* Koin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Koin.swift; sourceTree = ""; }; 5C5D09382562EC0100DA9C4A /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorView.swift; sourceTree = ""; }; + 5C662D37281D644F00B65C2F /* NotificationStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationStateView.swift; sourceTree = ""; }; 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrenciesBottomView.swift; sourceTree = ""; }; 5C6E673F25C5A711001CC0D6 /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = ""; }; 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnackBar.swift; sourceTree = ""; }; @@ -179,6 +187,17 @@ path = Settings; sourceTree = ""; }; + 5C4B53652818053E00D10185 /* Notifications */ = { + isa = PBXGroup; + children = ( + 5C4B53682818057F00D10185 /* NotificationsView.swift */, + 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */, + 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */, + 5C662D37281D644F00B65C2F /* NotificationStateView.swift */, + ); + path = Notifications; + sourceTree = ""; + }; 5C4B536E28184AEA00D10185 /* SelectCurrency */ = { isa = PBXGroup; children = ( @@ -204,6 +223,7 @@ 5C31E41C28141C61008C42B9 /* Calculator */, 5C31E42B28142033008C42B9 /* Currencies */, 5C31E4322814304F008C42B9 /* Settings */, + 5C4B53652818053E00D10185 /* Notifications */, 5C4B536E28184AEA00D10185 /* SelectCurrency */, 5C039FD425C1B6A2008350A3 /* SubView */, ); @@ -448,12 +468,15 @@ buildActionMask = 2147483647; files = ( 5C314CBE25BA0AC0007B22D8 /* CurrenciesView.swift in Sources */, + 5C4B536B2818066000D10185 /* NotificationsToolbarView.swift in Sources */, 5CB954BF26932408007632DC /* BannerAdView.swift in Sources */, 5C31E42428141D1B008C42B9 /* RateStateView.swift in Sources */, + 5C4B536D28183B4900D10185 /* NotificationCurrencyItem.swift in Sources */, 5CF57E3A269588060081E4BB /* RewardedAd.swift in Sources */, 5C9C75C82603A36A00D66FDD /* ToolbarButton.swift in Sources */, 5CF8BE4227DE205B00E441F5 /* MailView.swift in Sources */, 5C31E4362814308B008C42B9 /* SettingsItemView.swift in Sources */, + 5C4B53692818057F00D10185 /* NotificationsView.swift in Sources */, 5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */, 5C31E42628141D3E008C42B9 /* CalculatorItemView.swift in Sources */, 5C039FD625C1B705008350A3 /* FormProgressView.swift in Sources */, @@ -471,6 +494,7 @@ 5C31E4342814306D008C42B9 /* SettingsToolbarView.swift in Sources */, 5CF57E3C2695A3B20081E4BB /* InterstitialAd.swift in Sources */, 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */, + 5C662D38281D644F00B65C2F /* NotificationStateView.swift in Sources */, 5C17581A25BC74BD00D16BD9 /* SettingsView.swift in Sources */, 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */, 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */, diff --git a/ios/CCC/DI/Koin.swift b/ios/CCC/DI/Koin.swift index 9f60fc32a9..d90d935ff9 100644 --- a/ios/CCC/DI/Koin.swift +++ b/ios/CCC/DI/Koin.swift @@ -47,6 +47,10 @@ extension Koin_coreKoin { return koin.getDependency(objCClass: SettingsViewModel.self) as! SettingsViewModel } + func get() -> NotificationsViewModel { + return koin.getDependency(objCClass: NotificationsViewModel.self) as! NotificationsViewModel + } + // Observable func get() -> MainObservable { return MainObservable(viewModel: get()) @@ -64,6 +68,10 @@ extension Koin_coreKoin { return SettingsObservable(viewModel: get()) } + func get() -> NotificationsObservable { + return NotificationsObservable(viewModel: get()) + } + func get() -> CurrenciesObservable { return CurrenciesObservable(viewModel: get()) } diff --git a/ios/CCC/UI/Calculator/CalculatorView.swift b/ios/CCC/UI/Calculator/CalculatorView.swift index 554d4b8b41..85e8d2ce7f 100644 --- a/ios/CCC/UI/Calculator/CalculatorView.swift +++ b/ios/CCC/UI/Calculator/CalculatorView.swift @@ -90,7 +90,7 @@ struct CalculatorView: View { content: { SelectCurrencyView( isBarShown: $isBarShown, - onSelectCurrency: { observable.event.onBaseChange(base: $0)} + onCurrencySelected: { observable.event.onBaseChange(base: $0)} ).environmentObject(navigationStack) } ) diff --git a/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift b/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift new file mode 100644 index 0000000000..b4f8d1ede4 --- /dev/null +++ b/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift @@ -0,0 +1,28 @@ +// +// NotificationCurrencyItem.swift +// CCC +// +// Created by Mustafa Ozhan on 26.04.22. +// Copyright © 2022 orgName. All rights reserved. +// + +import SwiftUI + +struct NotificationCurrencyItem: View { + let currencyName: String + let clickAction: () -> Void + + var body: some View { + HStack { + Image(uiImage: currencyName.getImage()) + .resizable() + .frame(width: 36, height: 36, alignment: .center) + .shadow(radius: 3) + + Text(currencyName) + + }.onTapGesture { + clickAction() + } + } +} diff --git a/ios/CCC/UI/Notifications/NotificationStateView.swift b/ios/CCC/UI/Notifications/NotificationStateView.swift new file mode 100644 index 0000000000..4eb9d25471 --- /dev/null +++ b/ios/CCC/UI/Notifications/NotificationStateView.swift @@ -0,0 +1,37 @@ +// +// NotificationStateView.swift +// CCC +// +// Created by Mustafa Ozhan on 30.04.22. +// Copyright © 2022 orgName. All rights reserved. +// + +import SwiftUI +import Resources + +struct NotificationStateView: View { + var isEnabled: Bool + var onClick: () -> Void + + var body: some View { + HStack { + + Text( + isEnabled + ? MR.strings().txt_notifications_enabled.get() + : MR.strings().txt_notifications_disabled.get() + ) + .font(.body) + .foregroundColor(MR.colors().text.get()) + + Spacer() + Image(systemName: isEnabled ? "checkmark.circle.fill" : "circle") + .foregroundColor(MR.colors().accent.get()) + + } + .padding(25) + .contentShape(Rectangle()) + .onTapGesture { onClick() } + .lineLimit(1) + } +} diff --git a/ios/CCC/UI/Notifications/NotificationsToolbarView.swift b/ios/CCC/UI/Notifications/NotificationsToolbarView.swift new file mode 100644 index 0000000000..5d6d302838 --- /dev/null +++ b/ios/CCC/UI/Notifications/NotificationsToolbarView.swift @@ -0,0 +1,27 @@ +// +// NotificationsToolbarView.swift +// CCC +// +// Created by Mustafa Ozhan on 26.04.22. +// Copyright © 2022 orgName. All rights reserved. +// + +import SwiftUI +import Resources + +struct NotificationsToolbarView: View { + var backEvent: () -> Void + + var body: some View { + HStack { + ToolbarButton(clickEvent: backEvent, imgName: "chevron.left") + + Text(MR.strings().txt_notifications.get()) + .font(.title3) + + Spacer() + } + .frame(width: .infinity, height: 36) + .padding(EdgeInsets(top: 15, leading: 10, bottom: 6, trailing: 20)) + } +} diff --git a/ios/CCC/UI/Notifications/NotificationsView.swift b/ios/CCC/UI/Notifications/NotificationsView.swift new file mode 100644 index 0000000000..6bf3b1b45d --- /dev/null +++ b/ios/CCC/UI/Notifications/NotificationsView.swift @@ -0,0 +1,124 @@ +// +// NotificationsView.swift +// CCC +// +// Created by Mustafa Ozhan on 26.04.22. +// Copyright © 2022 orgName. All rights reserved. +// + +import SwiftUI +import Client +import Resources +import NavigationStack + +typealias NotificationsObservable = ObservableSEED + + +struct NotificationsView: View { + + @State var tootleStatus = false + @State var isBaseBarShown = false + @State var isTargetBarShown = false + @State var amount = "" + @State private var favoriteColor = 0 + + @EnvironmentObject private var navigationStack: NavigationStack + @StateObject var observable: NotificationsObservable = koin.get() + + var body: some View { + ZStack { + MR.colors().background_strong.get().edgesIgnoringSafeArea(.all) + + VStack { + + NotificationsToolbarView(backEvent: observable.event.onBackClick) + .background(MR.colors().background_strong.get()) + + HStack { + Text(MR.strings().one.get()) + .font(.title2) + + NotificationCurrencyItem( + currencyName: observable.state.base, + clickAction: observable.event.onBaseClick + ) + } + + Picker("", selection: $favoriteColor) { + Text(MR.strings().txt_smaller.get()) + .font(.title2) + .tag(0) + Text(MR.strings().txt_grater.get()) + .font(.title2) + .tag(1) + } + .pickerStyle(.segmented) + .frame(maxWidth: 120) + + HStack { + TextField(MR.strings().txt_rate.get(), text: $amount) + .keyboardType(.decimalPad) + .multilineTextAlignment(TextAlignment.center) + .fixedSize() + .lineLimit(1) + + NotificationCurrencyItem( + currencyName: observable.state.target, + clickAction: observable.event.onTargetClick + ) + } + + NotificationStateView( + isEnabled: observable.state.isEnabled, + onClick: observable.event.onStateClick + ) + + Spacer() + + } + .background(MR.colors().background.get()) + .edgesIgnoringSafeArea(.bottom) + } + .sheet( + isPresented: $isBaseBarShown, + content: { + SelectCurrencyView( + isBarShown: $isBaseBarShown, + onCurrencySelected: { observable.event.onBaseChange(base: $0)} + ).environmentObject(navigationStack) + } + ) + .sheet( + isPresented: $isTargetBarShown, + content: { + SelectCurrencyView( + isBarShown: $isTargetBarShown, + onCurrencySelected: { observable.event.onTargetChange(target: $0)} + ).environmentObject(navigationStack) + } + ) + .onAppear { observable.startObserving() } + .onDisappear { observable.stopObserving() } + .onReceive(observable.effect) { onEffect(effect: $0) } + } + + private func onEffect(effect: NotificationsEffect) { + logger.i(message: {"NotificationsView onEffect \(effect.description)"}) + switch effect { + case is NotificationsEffect.Back: + navigationStack.pop() + case is NotificationsEffect.SelectBase: + isBaseBarShown.toggle() + case is NotificationsEffect.SelectTarget: + isTargetBarShown.toggle() + default: + logger.i(message: {"NotificationsView unknown effect"}) + } + } +} + +struct NotificationsView_Previews: PreviewProvider { + static var previews: some View { + NotificationsView() + } +} diff --git a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift index 114474bb48..001cc0c1a0 100644 --- a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift @@ -21,7 +21,7 @@ struct SelectCurrencyView: View { @StateObject var observable: SelectCurrencyObservable = koin.get() @Binding var isBarShown: Bool - var onSelectCurrency: (String) -> Void + var onCurrencySelected: (String) -> Void var body: some View { @@ -71,10 +71,10 @@ struct SelectCurrencyView: View { switch effect { // swiftlint:disable force_cast case is SelectCurrencyEffect.CurrencyChange: - onSelectCurrency((effect as! SelectCurrencyEffect.CurrencyChange).newBase) + onCurrencySelected((effect as! SelectCurrencyEffect.CurrencyChange).newBase) isBarShown = false case is SelectCurrencyEffect.OpenCurrencies: - navigationStack.push(CurrenciesView(onBaseChange: onSelectCurrency)) + navigationStack.push(CurrenciesView(onBaseChange: onCurrencySelected)) default: logger.i(message: {"BarView unknown effect"}) } diff --git a/ios/CCC/UI/Settings/SettingsView.swift b/ios/CCC/UI/Settings/SettingsView.swift index cb28ec2512..3318870f59 100644 --- a/ios/CCC/UI/Settings/SettingsView.swift +++ b/ios/CCC/UI/Settings/SettingsView.swift @@ -50,6 +50,14 @@ struct SettingsView: View { onClick: observable.event.onCurrenciesClick ) + SettingsItemView( + imgName: "bell", + title: MR.strings().settings_item_notifications_title.get(), + subTitle: MR.strings().settings_item_notifications_sub_title.get(), + value: MR.strings().settings_item_notifications_value_disabled.get(), + onClick: observable.event.onNotificationsClicked + ) + // SettingsItemView( // imgName: "eye.slash.fill", // title: MR.strings().settings_item_remove_ads_title.get(), @@ -131,6 +139,7 @@ struct SettingsView: View { .onReceive(observable.effect) { onEffect(effect: $0) } } + // swiftlint:disable cyclomatic_complexity private func onEffect(effect: SettingsEffect) { logger.i(message: {"SettingsView onEffect \(effect.description)"}) switch effect { @@ -138,6 +147,8 @@ struct SettingsView: View { navigationStack.pop() case is SettingsEffect.OpenCurrencies: navigationStack.push(CurrenciesView(onBaseChange: onBaseChange)) + case is SettingsEffect.OpenNotifications: + navigationStack.push(NotificationsView()) case is SettingsEffect.FeedBack: emailViewVisibility.toggle() case is SettingsEffect.OnGitHub: diff --git a/resources/src/commonMain/resources/MR/base/strings.xml b/resources/src/commonMain/resources/MR/base/strings.xml index 14aa40125c..de8a0fd0c0 100644 --- a/resources/src/commonMain/resources/MR/base/strings.xml +++ b/resources/src/commonMain/resources/MR/base/strings.xml @@ -90,6 +90,11 @@ Set your currencies %d active + Notifications + Set a rate watcher + Enabled + Disabled + Theme Change app theme Choose app theme @@ -98,8 +103,6 @@ Disable ads Expired\n Will expire\n%s - Active - Not active Ads are already disabled Synchronise @@ -123,6 +126,14 @@ Currencies + + Notifications + Rate + > + < + Notifications enabled + Notifications disabled + Remove Ads Would you like to watch a video to stop ads for 2 days ? From 74fef2fb6f7c727805f28c454a2670813f53dd5e Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Fri, 6 May 2022 16:20:31 +0300 Subject: [PATCH 12/18] [#687] Add huawei and google userproperty for filtering analytics (#688) --- .../kotlin/com/oztechan/ccc/analytics/model/UserProperty.kt | 3 ++- .../kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/analytics/src/main/kotlin/com/oztechan/ccc/analytics/model/UserProperty.kt b/analytics/src/main/kotlin/com/oztechan/ccc/analytics/model/UserProperty.kt index 12c07f67d8..1f7d2e76b2 100644 --- a/analytics/src/main/kotlin/com/oztechan/ccc/analytics/model/UserProperty.kt +++ b/analytics/src/main/kotlin/com/oztechan/ccc/analytics/model/UserProperty.kt @@ -7,5 +7,6 @@ enum class UserProperty(val key: String) { IS_ROOTED("is_rooted"), APP_THEME("app_theme"), IS_AD_FREE("is_ad_free"), - SESSION_COUNT("session_count") + SESSION_COUNT("session_count"), + DEVICE_PLATFORM("device_platform") } diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt index 1001867c80..d1a4e3ba5d 100755 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt @@ -20,6 +20,7 @@ import com.oztechan.ccc.android.util.requestAppReview import com.oztechan.ccc.android.util.showDialog import com.oztechan.ccc.android.util.updateAppTheme import com.oztechan.ccc.android.util.updateBaseContextLocale +import com.oztechan.ccc.client.device import com.oztechan.ccc.client.model.AppTheme import com.oztechan.ccc.client.viewmodel.main.MainEffect import com.oztechan.ccc.client.viewmodel.main.MainViewModel @@ -97,6 +98,7 @@ class MainActivity : BaseActivity() { UserProperty.SESSION_COUNT, mainViewModel.getSessionCount().toString() ) + analyticsManager.setUserProperty(UserProperty.DEVICE_PLATFORM, device.name) } override fun onResume() { From 33d0e91a13cf4e0f58cb3645db291f4200a760a9 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sat, 7 May 2022 20:27:51 +0300 Subject: [PATCH 13/18] [#712] Kotlin Update (#713) --- buildSrc/src/main/kotlin/Versions.kt | 4 ++-- .../com/oztechan/ccc/common/entity/CurrencyResponseEntity.kt | 2 +- .../kotlin/com/oztechan/ccc/common/entity/RatesEntity.kt | 2 +- .../com/oztechan/ccc/common/di/modules/JVMSettingsModule.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 76cc007ad3..6e6979b846 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -4,7 +4,8 @@ @Suppress("SpellCheckingInspection") object Versions { - const val KOTLIN = "1.6.10" + const val KOTLIN = "1.6.21" + const val KSP = "$KOTLIN-1.0.5" const val ANDROID_GRADLE_PLUGIN = "7.1.3" const val ANDROID_MATERIAL = "1.4.0" const val CONSTRAINT_LAYOUT = "2.1.3" @@ -35,7 +36,6 @@ object Versions { const val KOVER = "0.5.0" const val ROOT_BEER = "0.1.0" const val MOCKATIVE = "1.1.4" - const val KSP = "1.6.10-1.0.4" const val SCOPE_MOB = "2.1.4" const val PARSER_MOB = "1.1.5" const val BASE_MOB = "2.1.3" diff --git a/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/CurrencyResponseEntity.kt b/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/CurrencyResponseEntity.kt index b28d52fae8..064dab17d3 100755 --- a/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/CurrencyResponseEntity.kt +++ b/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/CurrencyResponseEntity.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonNames -@Suppress("EXPERIMENTAL_API_USAGE") +@Suppress("OPT_IN_USAGE") @Serializable internal data class CurrencyResponseEntity( @JsonNames("base", "base_code") var base: String, diff --git a/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/RatesEntity.kt b/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/RatesEntity.kt index ebdbde9670..20926967ad 100755 --- a/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/RatesEntity.kt +++ b/common/src/commonMain/kotlin/com/oztechan/ccc/common/entity/RatesEntity.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonNames -@Suppress("ConstructorParameterNaming", "EXPERIMENTAL_API_USAGE") +@Suppress("ConstructorParameterNaming", "OPT_IN_USAGE") @Serializable internal data class RatesEntity( @SerialName("base") var base: String = "", diff --git a/common/src/jvmMain/kotlin/com/oztechan/ccc/common/di/modules/JVMSettingsModule.kt b/common/src/jvmMain/kotlin/com/oztechan/ccc/common/di/modules/JVMSettingsModule.kt index 8874e0914b..805d6e6211 100644 --- a/common/src/jvmMain/kotlin/com/oztechan/ccc/common/di/modules/JVMSettingsModule.kt +++ b/common/src/jvmMain/kotlin/com/oztechan/ccc/common/di/modules/JVMSettingsModule.kt @@ -4,5 +4,5 @@ import com.russhwolf.settings.JvmPreferencesSettings import com.russhwolf.settings.Settings import org.koin.core.scope.Scope -@Suppress("EXPERIMENTAL_API_USAGE") +@Suppress("OPT_IN_USAGE") actual fun Scope.provideSettings(): Settings = JvmPreferencesSettings(get()) From 1a825a12b440f46a6eaab2838daf46ab11c2d967 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sat, 7 May 2022 23:26:36 +0300 Subject: [PATCH 14/18] [#705] ad applicationId and versionName suffix to debug builds (#706) --- .github/workflows/main.yml | 10 ++++++++-- .github/workflows/release.yml | 5 ++++- .github/workflows/testing.yml | 5 ++++- android/build.gradle.kts | 2 ++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4042cc7e5c..f596800173 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,8 +49,11 @@ jobs: echo "${{ secrets.ANDROID_GPG_RELEASE_KEYSTORE }}" > release.keystore.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch release.keystore.asc > android/release.keystore mkdir android/src/release - echo "${{ secrets.GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + echo "${{ secrets.RELEASE_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/release/google-services.json + mkdir android/src/debug + echo "${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/debug/google-services.json echo "${{ secrets.AG_CONNECT_SERVICES_JSON_ASC }}" > agconnect-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/src/release/agconnect-services.json echo "${{ secrets.IOS_GPG_FIREBASE_CONFIG }}" > GoogleService-Info.plist.asc @@ -96,8 +99,11 @@ jobs: echo "${{ secrets.ANDROID_GPG_RELEASE_KEYSTORE }}" > release.keystore.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch release.keystore.asc > android/release.keystore mkdir android/src/release - echo "${{ secrets.GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + echo "${{ secrets.RELEASE_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/release/google-services.json + mkdir android/src/debug + echo "${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/debug/google-services.json echo "${{ secrets.AG_CONNECT_SERVICES_JSON_ASC }}" > agconnect-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/src/release/agconnect-services.json echo "${{ secrets.IOS_GPG_FIREBASE_CONFIG }}" > GoogleService-Info.plist.asc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62c9fba475..225164f1ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,8 +46,11 @@ jobs: echo "${{ secrets.ANDROID_GPG_RELEASE_KEYSTORE }}" > release.keystore.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch release.keystore.asc > android/release.keystore mkdir android/src/release - echo "${{ secrets.GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + echo "${{ secrets.RELEASE_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/release/google-services.json + mkdir android/src/debug + echo "${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/debug/google-services.json echo "${{ secrets.AG_CONNECT_SERVICES_JSON_ASC }}" > agconnect-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/src/release/agconnect-services.json echo "${{ secrets.IOS_GPG_FIREBASE_CONFIG }}" > GoogleService-Info.plist.asc diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2cd551fac3..bd6a3613f7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -50,8 +50,11 @@ jobs: echo "${{ secrets.ANDROID_GPG_RELEASE_KEYSTORE }}" > release.keystore.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch release.keystore.asc > android/release.keystore mkdir android/src/release - echo "${{ secrets.GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + echo "${{ secrets.RELEASE_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/release/google-services.json + mkdir android/src/debug + echo "${{ secrets.DEBUG_GOOGLE_SERVICES_JSON_ASC }}" > google-services.json.asc + gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch google-services.json.asc > android/src/debug/google-services.json echo "${{ secrets.AG_CONNECT_SERVICES_JSON_ASC }}" > agconnect-services.json.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/src/release/agconnect-services.json diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 32d996b3c0..b13fe96f65 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -86,6 +86,8 @@ android { } getByName(BuildType.debug) { + applicationIdSuffix = ".debug" + versionNameSuffix = "-debug" with(Keys(project, BuildType.DEBUG)) { resValue(typeString, admobAppId.resourceKey, admobAppId.value) resValue(typeString, bannerAdIdCalculator.resourceKey, bannerAdIdCalculator.value) From 14286027eb709a2c73ae53479f769d74eb384400 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 8 May 2022 00:11:22 +0300 Subject: [PATCH 15/18] [#715] Revert Notification Screen for Android release (#717) --- .../android/ui/settings/SettingsFragment.kt | 1 - .../ccc/client/di/module/ClientModule.kt | 2 - .../notifications/NotificationsSEED.kt | 41 ------ .../notifications/NotificationsViewModel.kt | 71 ---------- .../client/viewmodel/settings/SettingsSEED.kt | 2 - .../viewmodel/settings/SettingsViewModel.kt | 6 - .../client/viewmodel/SettingsViewModelTest.kt | 8 -- ios/CCC.xcodeproj/project.pbxproj | 24 ---- ios/CCC/DI/Koin.swift | 8 -- ios/CCC/UI/Calculator/CalculatorView.swift | 2 +- .../NotificationCurrencyItem.swift | 28 ---- .../Notifications/NotificationStateView.swift | 37 ------ .../NotificationsToolbarView.swift | 27 ---- .../UI/Notifications/NotificationsView.swift | 124 ------------------ .../SelectCurrency/SelectCurrencyView.swift | 6 +- ios/CCC/UI/Settings/SettingsView.swift | 11 -- .../commonMain/resources/MR/base/strings.xml | 15 +-- 17 files changed, 6 insertions(+), 407 deletions(-) delete mode 100644 client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt delete mode 100644 client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt delete mode 100644 ios/CCC/UI/Notifications/NotificationCurrencyItem.swift delete mode 100644 ios/CCC/UI/Notifications/NotificationStateView.swift delete mode 100644 ios/CCC/UI/Notifications/NotificationsToolbarView.swift delete mode 100644 ios/CCC/UI/Notifications/NotificationsView.swift diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt index e67cc7dbb6..7f5367ca91 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt @@ -183,7 +183,6 @@ class SettingsFragment : BaseVBFragment() { requireView(), R.string.txt_ads_already_disabled ) - SettingsEffect.OpenNotifications -> TODO("No Android implementation yet") } }.launchIn(viewLifecycleOwner.lifecycleScope) diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt index bcde53945d..12fd97a1eb 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/di/module/ClientModule.kt @@ -7,7 +7,6 @@ import com.oztechan.ccc.client.viewmodel.adremove.AdRemoveViewModel import com.oztechan.ccc.client.viewmodel.calculator.CalculatorViewModel import com.oztechan.ccc.client.viewmodel.currencies.CurrenciesViewModel import com.oztechan.ccc.client.viewmodel.main.MainViewModel -import com.oztechan.ccc.client.viewmodel.notifications.NotificationsViewModel import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyViewModel import com.oztechan.ccc.client.viewmodel.settings.SettingsViewModel import com.oztechan.ccc.config.ConfigManager @@ -21,7 +20,6 @@ var clientModule = module { viewModelDefinition { CalculatorViewModel(get(), get(), get(), get(), get()) } viewModelDefinition { SelectCurrencyViewModel(get()) } viewModelDefinition { AdRemoveViewModel(get()) } - viewModelDefinition { NotificationsViewModel(get()) } single { ConfigManagerImpl() } single { SessionManagerImpl(get(), get()) } diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt deleted file mode 100644 index 7d33e1f5c9..0000000000 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsSEED.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.oztechan.ccc.client.viewmodel.notifications - - -import com.oztechan.ccc.client.base.BaseEffect -import com.oztechan.ccc.client.base.BaseEvent -import com.oztechan.ccc.client.base.BaseState -import kotlinx.coroutines.flow.MutableStateFlow - -data class NotificationsState( - val isEnabled: Boolean = false, - val base: String = "", - val target: String = "" -) : BaseState() - -sealed class NotificationsEffect : BaseEffect() { - object Back : NotificationsEffect() - object SelectBase : NotificationsEffect() - object SelectTarget : NotificationsEffect() -} - -interface NotificationsEvent : BaseEvent { - fun onBackClick() - fun onBaseChange(base: String) - fun onTargetChange(target: String) - fun onBaseClick() - fun onTargetClick() - fun onStateClick() -} - -// Extension -fun MutableStateFlow.update( - isEnabled: Boolean = value.isEnabled, - base: String = value.base, - target: String = value.target -) { - value = value.copy( - isEnabled = isEnabled, - base = base, - target = target - ) -} \ No newline at end of file diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt deleted file mode 100644 index 21992faa07..0000000000 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/notifications/NotificationsViewModel.kt +++ /dev/null @@ -1,71 +0,0 @@ -package com.oztechan.ccc.client.viewmodel.notifications - -import co.touchlab.kermit.Logger -import com.oztechan.ccc.client.base.BaseData -import com.oztechan.ccc.client.base.BaseSEEDViewModel -import com.oztechan.ccc.client.util.launchIgnored -import com.oztechan.ccc.common.db.currency.CurrencyRepository -import kotlinx.coroutines.flow.MutableSharedFlow -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asSharedFlow -import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.launchIn -import kotlinx.coroutines.flow.onEach - -class NotificationsViewModel( - currencyRepository: CurrencyRepository -) : BaseSEEDViewModel(), NotificationsEvent { - // region SEED - private val _state = MutableStateFlow(NotificationsState()) - override val state = _state.asStateFlow() - - override val event = this as NotificationsEvent - - private val _effect = MutableSharedFlow() - override val effect = _effect.asSharedFlow() - - override val data: BaseData? = null - - init { - currencyRepository.collectActiveCurrencies() - .onEach { - Logger.d { "NotificationsViewModel currencyList changed\n${it.joinToString("\n")}" } - _state.update( - base = it.firstOrNull()?.name ?: "", - target = it.lastOrNull()?.name ?: "" - ) - } - .launchIn(clientScope) - } - - override fun onBackClick() = clientScope.launchIgnored { - Logger.d { "NotificationsViewModel onBackClick" } - _effect.emit(NotificationsEffect.Back) - } - - override fun onBaseChange(base: String) { - Logger.d { "NotificationsViewModel onBaseClick $base" } - _state.update(base = base) - } - - override fun onTargetChange(target: String) { - Logger.d { "NotificationsViewModel onTargetChange $target" } - _state.update(target = target) - } - - override fun onBaseClick() = clientScope.launchIgnored { - Logger.d { "NotificationsViewModel onBaseClick" } - _effect.emit(NotificationsEffect.SelectBase) - } - - override fun onTargetClick() = clientScope.launchIgnored { - Logger.d { "NotificationsViewModel onTargetClick" } - _effect.emit(NotificationsEffect.SelectTarget) - } - - override fun onStateClick() { - Logger.d { "NotificationsViewModel onStateClick ${!state.value.isEnabled}" } - _state.update(isEnabled = !state.value.isEnabled) - } - // endregion -} diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt index 3df0f58554..2629ce3a26 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt @@ -19,7 +19,6 @@ data class SettingsState( interface SettingsEvent : BaseEvent { fun onBackClick() fun onCurrenciesClick() - fun onNotificationsClicked() fun onFeedBackClick() fun onShareClick() fun onSupportUsClick() @@ -33,7 +32,6 @@ interface SettingsEvent : BaseEvent { sealed class SettingsEffect : BaseEffect() { object Back : SettingsEffect() object OpenCurrencies : SettingsEffect() - object OpenNotifications : SettingsEffect() object FeedBack : SettingsEffect() object Share : SettingsEffect() object SupportUs : SettingsEffect() diff --git a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt index f21c696462..e8cb5a7c84 100644 --- a/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt +++ b/client/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsViewModel.kt @@ -111,12 +111,6 @@ class SettingsViewModel( _effect.emit(SettingsEffect.OpenCurrencies) } - - override fun onNotificationsClicked() = clientScope.launchIgnored { - Logger.d { "SettingsViewModel onNotificationsClicked" } - _effect.emit(SettingsEffect.OpenNotifications) - } - override fun onFeedBackClick() = clientScope.launchIgnored { Logger.d { "SettingsViewModel onFeedBackClick" } _effect.emit(SettingsEffect.FeedBack) diff --git a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt index b33220eb73..8869b00af4 100644 --- a/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt +++ b/client/src/commonTest/kotlin/com/oztechan/ccc/client/viewmodel/SettingsViewModelTest.kt @@ -248,14 +248,6 @@ class SettingsViewModelTest { assertTrue { it is SettingsEffect.OpenCurrencies } } - - @Test - fun onNotificationsClicked() = viewModel.effect.before { - viewModel.event.onNotificationsClicked() - }.after { - assertEquals(SettingsEffect.OpenNotifications, it) - } - @Test fun onFeedBackClick() = viewModel.effect.before { viewModel.event.onFeedBackClick() diff --git a/ios/CCC.xcodeproj/project.pbxproj b/ios/CCC.xcodeproj/project.pbxproj index 63bf906848..018399a9df 100644 --- a/ios/CCC.xcodeproj/project.pbxproj +++ b/ios/CCC.xcodeproj/project.pbxproj @@ -24,14 +24,10 @@ 5C31E4362814308B008C42B9 /* SettingsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E4352814308B008C42B9 /* SettingsItemView.swift */; }; 5C31E439281431A3008C42B9 /* SelectCurrencyItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */; }; 5C31E43F28145D32008C42B9 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */; }; - 5C4B53692818057F00D10185 /* NotificationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B53682818057F00D10185 /* NotificationsView.swift */; }; - 5C4B536B2818066000D10185 /* NotificationsToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */; }; - 5C4B536D28183B4900D10185 /* NotificationCurrencyItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */; }; 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09322562EB9E00DA9C4A /* Application.swift */; }; 5C5D09362562EBDE00DA9C4A /* Koin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09352562EBDE00DA9C4A /* Koin.swift */; }; 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D09382562EC0100DA9C4A /* Extensions.swift */; }; 5C5D093C2562EC2D00DA9C4A /* CalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */; }; - 5C662D38281D644F00B65C2F /* NotificationStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C662D37281D644F00B65C2F /* NotificationStateView.swift */; }; 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */; }; 5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E673F25C5A711001CC0D6 /* SliderView.swift */; }; 5C6E674D25C602BE001CC0D6 /* SnackBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */; }; @@ -80,14 +76,10 @@ 5C31E4352814308B008C42B9 /* SettingsItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsItemView.swift; sourceTree = ""; }; 5C31E438281431A3008C42B9 /* SelectCurrencyItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyItemView.swift; sourceTree = ""; }; 5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; - 5C4B53682818057F00D10185 /* NotificationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsView.swift; sourceTree = ""; }; - 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsToolbarView.swift; sourceTree = ""; }; - 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationCurrencyItem.swift; sourceTree = ""; }; 5C5D09322562EB9E00DA9C4A /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; 5C5D09352562EBDE00DA9C4A /* Koin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Koin.swift; sourceTree = ""; }; 5C5D09382562EC0100DA9C4A /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 5C5D093B2562EC2D00DA9C4A /* CalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorView.swift; sourceTree = ""; }; - 5C662D37281D644F00B65C2F /* NotificationStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationStateView.swift; sourceTree = ""; }; 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrenciesBottomView.swift; sourceTree = ""; }; 5C6E673F25C5A711001CC0D6 /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = ""; }; 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnackBar.swift; sourceTree = ""; }; @@ -187,17 +179,6 @@ path = Settings; sourceTree = ""; }; - 5C4B53652818053E00D10185 /* Notifications */ = { - isa = PBXGroup; - children = ( - 5C4B53682818057F00D10185 /* NotificationsView.swift */, - 5C4B536A2818066000D10185 /* NotificationsToolbarView.swift */, - 5C4B536C28183B4900D10185 /* NotificationCurrencyItem.swift */, - 5C662D37281D644F00B65C2F /* NotificationStateView.swift */, - ); - path = Notifications; - sourceTree = ""; - }; 5C4B536E28184AEA00D10185 /* SelectCurrency */ = { isa = PBXGroup; children = ( @@ -223,7 +204,6 @@ 5C31E41C28141C61008C42B9 /* Calculator */, 5C31E42B28142033008C42B9 /* Currencies */, 5C31E4322814304F008C42B9 /* Settings */, - 5C4B53652818053E00D10185 /* Notifications */, 5C4B536E28184AEA00D10185 /* SelectCurrency */, 5C039FD425C1B6A2008350A3 /* SubView */, ); @@ -468,15 +448,12 @@ buildActionMask = 2147483647; files = ( 5C314CBE25BA0AC0007B22D8 /* CurrenciesView.swift in Sources */, - 5C4B536B2818066000D10185 /* NotificationsToolbarView.swift in Sources */, 5CB954BF26932408007632DC /* BannerAdView.swift in Sources */, 5C31E42428141D1B008C42B9 /* RateStateView.swift in Sources */, - 5C4B536D28183B4900D10185 /* NotificationCurrencyItem.swift in Sources */, 5CF57E3A269588060081E4BB /* RewardedAd.swift in Sources */, 5C9C75C82603A36A00D66FDD /* ToolbarButton.swift in Sources */, 5CF8BE4227DE205B00E441F5 /* MailView.swift in Sources */, 5C31E4362814308B008C42B9 /* SettingsItemView.swift in Sources */, - 5C4B53692818057F00D10185 /* NotificationsView.swift in Sources */, 5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */, 5C31E42628141D3E008C42B9 /* CalculatorItemView.swift in Sources */, 5C039FD625C1B705008350A3 /* FormProgressView.swift in Sources */, @@ -494,7 +471,6 @@ 5C31E4342814306D008C42B9 /* SettingsToolbarView.swift in Sources */, 5CF57E3C2695A3B20081E4BB /* InterstitialAd.swift in Sources */, 5C5D09392562EC0100DA9C4A /* Extensions.swift in Sources */, - 5C662D38281D644F00B65C2F /* NotificationStateView.swift in Sources */, 5C17581A25BC74BD00D16BD9 /* SettingsView.swift in Sources */, 5C5D09332562EB9E00DA9C4A /* Application.swift in Sources */, 5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */, diff --git a/ios/CCC/DI/Koin.swift b/ios/CCC/DI/Koin.swift index d90d935ff9..9f60fc32a9 100644 --- a/ios/CCC/DI/Koin.swift +++ b/ios/CCC/DI/Koin.swift @@ -47,10 +47,6 @@ extension Koin_coreKoin { return koin.getDependency(objCClass: SettingsViewModel.self) as! SettingsViewModel } - func get() -> NotificationsViewModel { - return koin.getDependency(objCClass: NotificationsViewModel.self) as! NotificationsViewModel - } - // Observable func get() -> MainObservable { return MainObservable(viewModel: get()) @@ -68,10 +64,6 @@ extension Koin_coreKoin { return SettingsObservable(viewModel: get()) } - func get() -> NotificationsObservable { - return NotificationsObservable(viewModel: get()) - } - func get() -> CurrenciesObservable { return CurrenciesObservable(viewModel: get()) } diff --git a/ios/CCC/UI/Calculator/CalculatorView.swift b/ios/CCC/UI/Calculator/CalculatorView.swift index 85e8d2ce7f..554d4b8b41 100644 --- a/ios/CCC/UI/Calculator/CalculatorView.swift +++ b/ios/CCC/UI/Calculator/CalculatorView.swift @@ -90,7 +90,7 @@ struct CalculatorView: View { content: { SelectCurrencyView( isBarShown: $isBarShown, - onCurrencySelected: { observable.event.onBaseChange(base: $0)} + onSelectCurrency: { observable.event.onBaseChange(base: $0)} ).environmentObject(navigationStack) } ) diff --git a/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift b/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift deleted file mode 100644 index b4f8d1ede4..0000000000 --- a/ios/CCC/UI/Notifications/NotificationCurrencyItem.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// NotificationCurrencyItem.swift -// CCC -// -// Created by Mustafa Ozhan on 26.04.22. -// Copyright © 2022 orgName. All rights reserved. -// - -import SwiftUI - -struct NotificationCurrencyItem: View { - let currencyName: String - let clickAction: () -> Void - - var body: some View { - HStack { - Image(uiImage: currencyName.getImage()) - .resizable() - .frame(width: 36, height: 36, alignment: .center) - .shadow(radius: 3) - - Text(currencyName) - - }.onTapGesture { - clickAction() - } - } -} diff --git a/ios/CCC/UI/Notifications/NotificationStateView.swift b/ios/CCC/UI/Notifications/NotificationStateView.swift deleted file mode 100644 index 4eb9d25471..0000000000 --- a/ios/CCC/UI/Notifications/NotificationStateView.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// NotificationStateView.swift -// CCC -// -// Created by Mustafa Ozhan on 30.04.22. -// Copyright © 2022 orgName. All rights reserved. -// - -import SwiftUI -import Resources - -struct NotificationStateView: View { - var isEnabled: Bool - var onClick: () -> Void - - var body: some View { - HStack { - - Text( - isEnabled - ? MR.strings().txt_notifications_enabled.get() - : MR.strings().txt_notifications_disabled.get() - ) - .font(.body) - .foregroundColor(MR.colors().text.get()) - - Spacer() - Image(systemName: isEnabled ? "checkmark.circle.fill" : "circle") - .foregroundColor(MR.colors().accent.get()) - - } - .padding(25) - .contentShape(Rectangle()) - .onTapGesture { onClick() } - .lineLimit(1) - } -} diff --git a/ios/CCC/UI/Notifications/NotificationsToolbarView.swift b/ios/CCC/UI/Notifications/NotificationsToolbarView.swift deleted file mode 100644 index 5d6d302838..0000000000 --- a/ios/CCC/UI/Notifications/NotificationsToolbarView.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// NotificationsToolbarView.swift -// CCC -// -// Created by Mustafa Ozhan on 26.04.22. -// Copyright © 2022 orgName. All rights reserved. -// - -import SwiftUI -import Resources - -struct NotificationsToolbarView: View { - var backEvent: () -> Void - - var body: some View { - HStack { - ToolbarButton(clickEvent: backEvent, imgName: "chevron.left") - - Text(MR.strings().txt_notifications.get()) - .font(.title3) - - Spacer() - } - .frame(width: .infinity, height: 36) - .padding(EdgeInsets(top: 15, leading: 10, bottom: 6, trailing: 20)) - } -} diff --git a/ios/CCC/UI/Notifications/NotificationsView.swift b/ios/CCC/UI/Notifications/NotificationsView.swift deleted file mode 100644 index 6bf3b1b45d..0000000000 --- a/ios/CCC/UI/Notifications/NotificationsView.swift +++ /dev/null @@ -1,124 +0,0 @@ -// -// NotificationsView.swift -// CCC -// -// Created by Mustafa Ozhan on 26.04.22. -// Copyright © 2022 orgName. All rights reserved. -// - -import SwiftUI -import Client -import Resources -import NavigationStack - -typealias NotificationsObservable = ObservableSEED - - -struct NotificationsView: View { - - @State var tootleStatus = false - @State var isBaseBarShown = false - @State var isTargetBarShown = false - @State var amount = "" - @State private var favoriteColor = 0 - - @EnvironmentObject private var navigationStack: NavigationStack - @StateObject var observable: NotificationsObservable = koin.get() - - var body: some View { - ZStack { - MR.colors().background_strong.get().edgesIgnoringSafeArea(.all) - - VStack { - - NotificationsToolbarView(backEvent: observable.event.onBackClick) - .background(MR.colors().background_strong.get()) - - HStack { - Text(MR.strings().one.get()) - .font(.title2) - - NotificationCurrencyItem( - currencyName: observable.state.base, - clickAction: observable.event.onBaseClick - ) - } - - Picker("", selection: $favoriteColor) { - Text(MR.strings().txt_smaller.get()) - .font(.title2) - .tag(0) - Text(MR.strings().txt_grater.get()) - .font(.title2) - .tag(1) - } - .pickerStyle(.segmented) - .frame(maxWidth: 120) - - HStack { - TextField(MR.strings().txt_rate.get(), text: $amount) - .keyboardType(.decimalPad) - .multilineTextAlignment(TextAlignment.center) - .fixedSize() - .lineLimit(1) - - NotificationCurrencyItem( - currencyName: observable.state.target, - clickAction: observable.event.onTargetClick - ) - } - - NotificationStateView( - isEnabled: observable.state.isEnabled, - onClick: observable.event.onStateClick - ) - - Spacer() - - } - .background(MR.colors().background.get()) - .edgesIgnoringSafeArea(.bottom) - } - .sheet( - isPresented: $isBaseBarShown, - content: { - SelectCurrencyView( - isBarShown: $isBaseBarShown, - onCurrencySelected: { observable.event.onBaseChange(base: $0)} - ).environmentObject(navigationStack) - } - ) - .sheet( - isPresented: $isTargetBarShown, - content: { - SelectCurrencyView( - isBarShown: $isTargetBarShown, - onCurrencySelected: { observable.event.onTargetChange(target: $0)} - ).environmentObject(navigationStack) - } - ) - .onAppear { observable.startObserving() } - .onDisappear { observable.stopObserving() } - .onReceive(observable.effect) { onEffect(effect: $0) } - } - - private func onEffect(effect: NotificationsEffect) { - logger.i(message: {"NotificationsView onEffect \(effect.description)"}) - switch effect { - case is NotificationsEffect.Back: - navigationStack.pop() - case is NotificationsEffect.SelectBase: - isBaseBarShown.toggle() - case is NotificationsEffect.SelectTarget: - isTargetBarShown.toggle() - default: - logger.i(message: {"NotificationsView unknown effect"}) - } - } -} - -struct NotificationsView_Previews: PreviewProvider { - static var previews: some View { - NotificationsView() - } -} diff --git a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift index 001cc0c1a0..114474bb48 100644 --- a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift @@ -21,7 +21,7 @@ struct SelectCurrencyView: View { @StateObject var observable: SelectCurrencyObservable = koin.get() @Binding var isBarShown: Bool - var onCurrencySelected: (String) -> Void + var onSelectCurrency: (String) -> Void var body: some View { @@ -71,10 +71,10 @@ struct SelectCurrencyView: View { switch effect { // swiftlint:disable force_cast case is SelectCurrencyEffect.CurrencyChange: - onCurrencySelected((effect as! SelectCurrencyEffect.CurrencyChange).newBase) + onSelectCurrency((effect as! SelectCurrencyEffect.CurrencyChange).newBase) isBarShown = false case is SelectCurrencyEffect.OpenCurrencies: - navigationStack.push(CurrenciesView(onBaseChange: onCurrencySelected)) + navigationStack.push(CurrenciesView(onBaseChange: onSelectCurrency)) default: logger.i(message: {"BarView unknown effect"}) } diff --git a/ios/CCC/UI/Settings/SettingsView.swift b/ios/CCC/UI/Settings/SettingsView.swift index 3318870f59..cb28ec2512 100644 --- a/ios/CCC/UI/Settings/SettingsView.swift +++ b/ios/CCC/UI/Settings/SettingsView.swift @@ -50,14 +50,6 @@ struct SettingsView: View { onClick: observable.event.onCurrenciesClick ) - SettingsItemView( - imgName: "bell", - title: MR.strings().settings_item_notifications_title.get(), - subTitle: MR.strings().settings_item_notifications_sub_title.get(), - value: MR.strings().settings_item_notifications_value_disabled.get(), - onClick: observable.event.onNotificationsClicked - ) - // SettingsItemView( // imgName: "eye.slash.fill", // title: MR.strings().settings_item_remove_ads_title.get(), @@ -139,7 +131,6 @@ struct SettingsView: View { .onReceive(observable.effect) { onEffect(effect: $0) } } - // swiftlint:disable cyclomatic_complexity private func onEffect(effect: SettingsEffect) { logger.i(message: {"SettingsView onEffect \(effect.description)"}) switch effect { @@ -147,8 +138,6 @@ struct SettingsView: View { navigationStack.pop() case is SettingsEffect.OpenCurrencies: navigationStack.push(CurrenciesView(onBaseChange: onBaseChange)) - case is SettingsEffect.OpenNotifications: - navigationStack.push(NotificationsView()) case is SettingsEffect.FeedBack: emailViewVisibility.toggle() case is SettingsEffect.OnGitHub: diff --git a/resources/src/commonMain/resources/MR/base/strings.xml b/resources/src/commonMain/resources/MR/base/strings.xml index de8a0fd0c0..14aa40125c 100644 --- a/resources/src/commonMain/resources/MR/base/strings.xml +++ b/resources/src/commonMain/resources/MR/base/strings.xml @@ -90,11 +90,6 @@ Set your currencies %d active - Notifications - Set a rate watcher - Enabled - Disabled - Theme Change app theme Choose app theme @@ -103,6 +98,8 @@ Disable ads Expired\n Will expire\n%s + Active + Not active Ads are already disabled Synchronise @@ -126,14 +123,6 @@ Currencies - - Notifications - Rate - > - < - Notifications enabled - Notifications disabled - Remove Ads Would you like to watch a video to stop ads for 2 days ? From f8e7ff794d6331c3a9a59789d5a5d88be2473eae Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 8 May 2022 10:58:37 +0300 Subject: [PATCH 16/18] [#711] Library Updates (#714) --- buildSrc/src/main/kotlin/Dependencies.kt | 48 ++++++++---------------- buildSrc/src/main/kotlin/Versions.kt | 8 ++-- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 31d6e9e097..450bb6d43f 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -8,17 +8,13 @@ object Dependencies { const val TEST = "test" const val TEST_ANNOTATIONS = "test-annotations-common" const val KOIN_CORE = "io.insert-koin:koin-core:${Versions.KOIN}" - const val MULTIPLATFORM_SETTINGS = - "com.russhwolf:multiplatform-settings:${Versions.MULTIPLATFORM_SETTINGS}" - const val KOTLIN_X_DATE_TIME = - "org.jetbrains.kotlinx:kotlinx-datetime:${Versions.KOTLIN_X_DATE_TIME}" + const val MULTIPLATFORM_SETTINGS = "com.russhwolf:multiplatform-settings:${Versions.MULTIPLATFORM_SETTINGS}" + const val KOTLIN_X_DATE_TIME = "org.jetbrains.kotlinx:kotlinx-datetime:${Versions.KOTLIN_X_DATE_TIME}" const val KTOR_LOGGING = "io.ktor:ktor-client-logging:${Versions.KTOR}" const val KTOR_SETIALIZATION = "io.ktor:ktor-client-serialization:${Versions.KTOR}" - const val COROUTINES = - "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.COROUTINES}" + const val COROUTINES = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.COROUTINES}" const val SQL_DELIGHT_RUNTIME = "com.squareup.sqldelight:runtime:${Versions.SQL_DELIGHT}" - const val SQL_DELIGHT_COROUTINES_EXT = - "com.squareup.sqldelight:coroutines-extensions:${Versions.SQL_DELIGHT}" + const val SQL_DELIGHT_COROUTINES_EXT = "com.squareup.sqldelight:coroutines-extensions:${Versions.SQL_DELIGHT}" const val MOKO_RESOURCES = "dev.icerock.moko:resources:${Versions.MOKO_RESOURCES}" const val MOCKATIVE = "io.mockative:mockative:${Versions.MOCKATIVE}" const val SCOPE_MOB = "com.github.submob:scopemob:${Versions.SCOPE_MOB}" @@ -27,20 +23,14 @@ object Dependencies { } object Android { - const val ANDROID_MATERIAL = - "com.google.android.material:material:${Versions.ANDROID_MATERIAL}" - const val CONSTRAINT_LAYOUT = - "androidx.constraintlayout:constraintlayout:${Versions.CONSTRAINT_LAYOUT}" + const val ANDROID_MATERIAL = "com.google.android.material:material:${Versions.ANDROID_MATERIAL}" + const val CONSTRAINT_LAYOUT = "androidx.constraintlayout:constraintlayout:${Versions.CONSTRAINT_LAYOUT}" const val KOIN_ANDROID = "io.insert-koin:koin-android:${Versions.KOIN}" - const val FIREBASE_ANALYTICS = - "com.google.firebase:firebase-analytics-ktx:${Versions.FIREBASE_ANALYTICS}" - const val FIREBASE_REMOTE_CONFIG = - "com.google.firebase:firebase-config-ktx:${Versions.FIREBASE_REMOTE_CONFIG}" + const val FIREBASE_ANALYTICS = "com.google.firebase:firebase-analytics-ktx:${Versions.FIREBASE_ANALYTICS}" + const val FIREBASE_REMOTE_CONFIG = "com.google.firebase:firebase-config-ktx:${Versions.FIREBASE_REMOTE_CONFIG}" const val DESUGARING = "com.android.tools:desugar_jdk_libs:${Versions.DESUGARING}" - const val LIFECYCLE_VIEWMODEL = - "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.LIFECYCLE}" - const val LIFECYCLE_RUNTIME = - "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.LIFECYCLE}" + const val LIFECYCLE_VIEWMODEL = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.LIFECYCLE}" + const val LIFECYCLE_RUNTIME = "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.LIFECYCLE}" const val NAVIGATION = "androidx.navigation:navigation-fragment-ktx:${Versions.NAVIGATION}" const val KTOR = "io.ktor:ktor-client-android:${Versions.KTOR}" const val SQL_DELIGHT = "com.squareup.sqldelight:android-driver:${Versions.SQL_DELIGHT}" @@ -75,21 +65,15 @@ object Dependencies { } object ClassPaths { - const val ANDROID_GRADLE_PLUGIN = - "com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}" - const val KOTLIN_GRADLE_PLUGIN = - "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}" - const val KOTLIN_SERIALIZATION = - "org.jetbrains.kotlin:kotlin-serialization:${Versions.KOTLIN}" + const val ANDROID_GRADLE_PLUGIN = "com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}" + const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}" + const val KOTLIN_SERIALIZATION = "org.jetbrains.kotlin:kotlin-serialization:${Versions.KOTLIN}" const val SQL_DELIGHT = "com.squareup.sqldelight:gradle-plugin:${Versions.SQL_DELIGHT}" const val GSM = "com.google.gms:google-services:${Versions.GSM}" - const val CRASHLYTICS = - "com.google.firebase:firebase-crashlytics-gradle:${Versions.CRASHLYTICS}" - const val NAVIGATION = - "androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.NAVIGATION}" + const val CRASHLYTICS = "com.google.firebase:firebase-crashlytics-gradle:${Versions.CRASHLYTICS}" + const val NAVIGATION = "androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.NAVIGATION}" const val MOKO_RESOURCES = "dev.icerock.moko:resources-generator:${Versions.MOKO_RESOURCES}" - const val BUILD_KONFIG = - "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:${Versions.BUILD_KONFIG}" + const val BUILD_KONFIG = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:${Versions.BUILD_KONFIG}" const val KOVER = "org.jetbrains.kotlinx:kover:${Versions.KOVER}" } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 6e6979b846..f04915468e 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -7,14 +7,14 @@ object Versions { const val KOTLIN = "1.6.21" const val KSP = "$KOTLIN-1.0.5" const val ANDROID_GRADLE_PLUGIN = "7.1.3" - const val ANDROID_MATERIAL = "1.4.0" + const val ANDROID_MATERIAL = "1.6.0" const val CONSTRAINT_LAYOUT = "2.1.3" const val KTOR = "1.6.8" const val LOG_BACK = "1.2.11" const val KOIN = "3.1.6" - const val MULTIPLATFORM_SETTINGS = "0.8.1" - const val FIREBASE_ANALYTICS = "20.1.2" - const val FIREBASE_REMOTE_CONFIG = "21.0.2" + const val MULTIPLATFORM_SETTINGS = "0.9" + const val FIREBASE_ANALYTICS = "21.0.0" + const val FIREBASE_REMOTE_CONFIG = "21.1.0" const val DESUGARING = "1.1.5" const val GSM = "4.3.10" const val CRASHLYTICS = "2.8.1" From 6c0384495f5c916dc1d1a351b8630053b618226a Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 8 May 2022 20:56:16 +0300 Subject: [PATCH 17/18] [#676] add huawei link to Support Us logic (#693) --- .../com/oztechan/ccc/android/ui/main/MainActivity.kt | 3 ++- .../ccc/android/ui/settings/SettingsFragment.kt | 5 +++-- .../kotlin/com/oztechan/ccc/android/util/DeviceUtil.kt | 10 ++++++++++ resources/src/commonMain/resources/MR/base/strings.xml | 5 +++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt index d1a4e3ba5d..22db800b96 100755 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/main/MainActivity.kt @@ -16,6 +16,7 @@ import com.github.submob.basemob.activity.BaseActivity import com.oztechan.ccc.ad.AdManager import com.oztechan.ccc.analytics.AnalyticsManager import com.oztechan.ccc.analytics.model.UserProperty +import com.oztechan.ccc.android.util.getMarketLink import com.oztechan.ccc.android.util.requestAppReview import com.oztechan.ccc.android.util.showDialog import com.oztechan.ccc.android.util.updateAppTheme @@ -67,7 +68,7 @@ class MainActivity : BaseActivity() { positiveButton = R.string.update, cancelable = isCancelable ) { - startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_market_link)))) + startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getMarketLink()))) } private fun checkDestination() = with(getNavigationController()) { diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt index 7f5367ca91..4ebacd9b06 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/ui/settings/SettingsFragment.kt @@ -15,6 +15,7 @@ import com.github.submob.basemob.fragment.BaseVBFragment import com.oztechan.ccc.ad.AdManager import com.oztechan.ccc.analytics.AnalyticsManager import com.oztechan.ccc.analytics.model.FirebaseEvent +import com.oztechan.ccc.android.util.getMarketLink import com.oztechan.ccc.android.util.setBannerAd import com.oztechan.ccc.android.util.showDialog import com.oztechan.ccc.android.util.showSingleChoiceDialog @@ -151,7 +152,7 @@ class SettingsFragment : BaseVBFragment() { startIntent( Intent( Intent.ACTION_VIEW, - Uri.parse(getString(R.string.app_market_link)) + Uri.parse(requireContext().getMarketLink()) ) ) } @@ -228,7 +229,7 @@ class SettingsFragment : BaseVBFragment() { private fun share() = Intent(Intent.ACTION_SEND).apply { type = TEXT_TYPE - putExtra(Intent.EXTRA_TEXT, getString(R.string.app_market_link)) + putExtra(Intent.EXTRA_TEXT, requireContext().getMarketLink()) startActivity(Intent.createChooser(this, getString(R.string.settings_item_share_title))) } diff --git a/android/src/main/kotlin/com/oztechan/ccc/android/util/DeviceUtil.kt b/android/src/main/kotlin/com/oztechan/ccc/android/util/DeviceUtil.kt index cebcb08749..17850d0115 100644 --- a/android/src/main/kotlin/com/oztechan/ccc/android/util/DeviceUtil.kt +++ b/android/src/main/kotlin/com/oztechan/ccc/android/util/DeviceUtil.kt @@ -9,7 +9,10 @@ import android.content.res.Configuration import android.content.res.Resources import android.os.Build import androidx.appcompat.app.AppCompatDelegate +import com.oztechan.ccc.client.device import com.oztechan.ccc.client.model.AppTheme +import com.oztechan.ccc.client.model.Device +import mustafaozhan.github.com.mycurrencies.R import java.util.Locale fun updateBaseContextLocale(context: Context): Context? { @@ -45,3 +48,10 @@ private fun updateResourcesLocaleLegacy(context: Context, locale: Locale): Conte resources.updateConfiguration(configuration, resources.displayMetrics) return context } + +fun Context.getMarketLink() = getString( + when (device as Device.ANDROID) { + Device.ANDROID.GOOGLE -> R.string.app_market_link_google + Device.ANDROID.HUAWEI -> R.string.app_market_link_huawei + } +) diff --git a/resources/src/commonMain/resources/MR/base/strings.xml b/resources/src/commonMain/resources/MR/base/strings.xml index 14aa40125c..fc3eab78ff 100644 --- a/resources/src/commonMain/resources/MR/base/strings.xml +++ b/resources/src/commonMain/resources/MR/base/strings.xml @@ -52,7 +52,9 @@ Copied to clipboard! - Please rate us and review the app on Google Play Store :) + You can rate us and review our app in the market :) + https://play.google.com/store/apps/details?id=mustafaozhan.github.com.mycurrencies + https://appgallery.huawei.com/app/C104920917 RATE Update https://github.com/CurrencyConverterCalculator/CCC @@ -63,7 +65,6 @@ Feedback for CCC Dear Developer, Send Feedback: - https://play.google.com/store/apps/details?id=mustafaozhan.github.com.mycurrencies NEXT From 017e3bf5c46438fed735ffb50eb50460ae2f5456 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 9 May 2022 22:40:47 +0300 Subject: [PATCH 18/18] [#719] Library updates (#720) --- buildSrc/src/main/kotlin/Versions.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index f04915468e..9f87404771 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -36,8 +36,8 @@ object Versions { const val KOVER = "0.5.0" const val ROOT_BEER = "0.1.0" const val MOCKATIVE = "1.1.4" - const val SCOPE_MOB = "2.1.4" - const val PARSER_MOB = "1.1.5" - const val BASE_MOB = "2.1.3" - const val LOG_MOB = "2.2.0" + const val SCOPE_MOB = "2.1.5" + const val PARSER_MOB = "1.1.6" + const val BASE_MOB = "2.1.4" + const val LOG_MOB = "2.2.1" }