Skip to content

Commit

Permalink
Merge pull request #338 from UseHover/release-fixes
Browse files Browse the repository at this point in the history
Release fixes
  • Loading branch information
alexosugo authored Oct 12, 2021
2 parents 6d61c44 + 1466c36 commit 7c87472
Show file tree
Hide file tree
Showing 29 changed files with 343 additions and 309 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

#Deploy to alpha track
- name: Deploy to internal test track
uses: r0adkll/upload-google-play@v1
uses: r0adkll/upload-google-play@v1.0.15
with:
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
packageName: com.hover.stax
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ android {
applicationId "com.hover.stax"
minSdkVersion 18
targetSdkVersion 30
versionCode 85
versionName "1.5.6.3"
versionCode 88
versionName "1.5.6.7"

vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
49 changes: 26 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.hover.stax">

<uses-permission android:name="android.permission.INTERNET" />
Expand Down Expand Up @@ -117,9 +116,10 @@
</intent-filter>
</activity>

<activity android:name=".languages.SelectLanguageActivity"
<activity
android:name=".languages.SelectLanguageActivity"
android:label="@string/language">
<intent-filter >
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -144,7 +144,7 @@
<activity
android:name=".transfers.TransferActivity"
android:theme="@style/StaxTheme"
android:windowSoftInputMode="stateVisible|adjustResize"/>
android:windowSoftInputMode="stateVisible|adjustResize" />

<activity
android:name=".requests.RequestActivity"
Expand Down Expand Up @@ -192,24 +192,25 @@
android:name=".onboarding.OnBoardingActivity"
android:theme="@style/StaxTheme" />

<activity android:name=".library.LibraryActivity"
android:theme="@style/StaxTheme">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="stax.me"
android:pathPattern="@string/deeplink_lib"
android:scheme="https" />
<data
android:host="stax.me"
android:pathPattern="@string/deeplink_lib"
android:scheme="http" />
</intent-filter>
</activity>
<activity
android:name=".library.LibraryActivity"
android:theme="@style/StaxTheme">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="stax.me"
android:pathPattern="@string/deeplink_lib"
android:scheme="https" />
<data
android:host="stax.me"
android:pathPattern="@string/deeplink_lib"
android:scheme="http" />
</intent-filter>
</activity>

<receiver
android:name=".hover.TransactionReceiver"
Expand All @@ -230,7 +231,9 @@
</intent-filter>
</receiver>

<receiver android:name="com.appsflyer.SingleInstallBroadcastReceiver" android:exported="true">
<receiver
android:name="com.appsflyer.SingleInstallBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/hover/stax/ApplicationInstance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ class ApplicationInstance : Application() {
}

companion object {
val transactionDetails_TryAgainCounter : MutableMap <String, Int> by Delegates.observable(HashMap(), { _, _, _->})
val txnDetailsRetryCounter : MutableMap <String, Int> by Delegates.observable(HashMap(), { _, _, _->})
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/hover/stax/SplashScreenActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class SplashScreenActivity : AppCompatActivity(), BiometricChecker.AuthListener,
startActivity(intent)
}

override fun onAuthError(error: String?) = UIHelper.flashMessage(this, getString(R.string.toast_error_auth))
override fun onAuthError(error: String) = runOnUiThread { UIHelper.flashMessage(this, getString(R.string.toast_error_auth)) }

override fun onAuthSuccess(action: HoverAction?) = chooseNavigation(intent)

Expand Down
24 changes: 11 additions & 13 deletions app/src/main/java/com/hover/stax/balances/BalanceAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ class BalanceAdapter(val channels: List<Channel>, val balanceListener: BalanceLi
holder.binding.balanceRefreshIcon.setColorFilter(secondary)
}

private fun setColorForEmptyAmount(show: Boolean, holder: BalancesViewHolder, secondary: Int) {
if (show) {
var drawable = ContextCompat.getDrawable(holder.itemView.context, R.drawable.ic_remove)

if (drawable != null) {
drawable = DrawableCompat.wrap(drawable)
DrawableCompat.setTint(drawable.mutate(), secondary)
holder.binding.balanceAmount.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
}
} else holder.binding.balanceAmount.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
private fun setColorForEmptyAmount(holder: BalancesViewHolder, secondary: Int) {
var drawable = ContextCompat.getDrawable(holder.itemView.context, R.drawable.ic_remove)

if (drawable != null) {
drawable = DrawableCompat.wrap(drawable)
DrawableCompat.setTint(drawable.mutate(), secondary)
holder.binding.balanceAmount.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
}
}

inner class BalancesViewHolder(val binding: BalanceItemBinding) : RecyclerView.ViewHolder(binding.root) {
Expand All @@ -75,13 +73,13 @@ class BalanceAdapter(val channels: List<Channel>, val balanceListener: BalanceLi
}
else -> {
binding.balanceAmount.text = ""
setColorForEmptyAmount(true, holder, UIHelper.getColor(channel.secondaryColorHex, false, binding.root.context))
setColorForEmptyAmount(holder, UIHelper.getColor(channel.secondaryColorHex, false, binding.root.context))
}
}

setColors(
holder, UIHelper.getColor(channel.primaryColorHex, true, holder.itemView.context),
UIHelper.getColor(channel.secondaryColorHex, false, holder.itemView.context)
holder, UIHelper.getColor(channel.primaryColorHex, true, holder.itemView.context),
UIHelper.getColor(channel.secondaryColorHex, false, holder.itemView.context)
)

if (channel.id == Channel.DUMMY) {
Expand Down
57 changes: 10 additions & 47 deletions app/src/main/java/com/hover/stax/balances/BalancesFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView
import com.hover.stax.R
import com.hover.stax.channels.Channel
Expand All @@ -19,11 +18,7 @@ import com.hover.stax.navigation.NavigationInterface
import com.hover.stax.utils.Constants
import com.hover.stax.utils.UIHelper
import com.hover.stax.utils.Utils
import com.hover.stax.utils.bubbleshowcase.BubbleShowCase
import com.hover.stax.views.staxcardstack.StaxCardStackView
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.koin.androidx.viewmodel.ext.android.sharedViewModel


Expand All @@ -34,14 +29,9 @@ class BalancesFragment : Fragment(), NavigationInterface {
private lateinit var balanceStack: StaxCardStackView
private lateinit var balancesRecyclerView: RecyclerView

private var firstAccBubble: BubbleShowCase? = null
private var secondAccBubble: BubbleShowCase? = null

private var balancesVisible = false
private var channelList: List<Channel>? = null

private var bubbleShowCaseJob: Job? = null

private var _binding: FragmentBalanceBinding? = null
private val binding get() = _binding!!

Expand All @@ -60,20 +50,19 @@ class BalancesFragment : Fragment(), NavigationInterface {
setUpLinkNewAccount()
}

override fun onPause() {
super.onPause()

bubbleShowCaseJob?.let { if (it.isActive) it.cancel() }

firstAccBubble?.dismiss()
secondAccBubble?.dismiss()
}

private fun setUpBalances() {
initBalanceCard()

val observer = Observer<List<Channel>> { t -> updateServices(ArrayList(t)) }
balancesViewModel.selectedChannels.observe(viewLifecycleOwner, observer)
with(balancesViewModel) {
selectedChannels.observe(viewLifecycleOwner, observer)
shouldShowBalances.observe(viewLifecycleOwner) {
if (it == true) {
showBalanceCards(true)
showBalances(false)
}
}
}
}

private fun setUpLinkNewAccount() {
Expand All @@ -88,7 +77,6 @@ class BalancesFragment : Fragment(), NavigationInterface {
)
it.setOnClickListener {
showBalanceCards(!balancesVisible)
showBubbleIfRequired()
}
}

Expand All @@ -98,7 +86,7 @@ class BalancesFragment : Fragment(), NavigationInterface {
}
}

fun showBalanceCards(status: Boolean) {
private fun showBalanceCards(status: Boolean) {
toggleLink(status)
balanceTitle.setCompoundDrawablesRelativeWithIntrinsicBounds(
if (status) R.drawable.ic_visibility_on else R.drawable.ic_visibility_off, 0, 0, 0
Expand Down Expand Up @@ -128,26 +116,6 @@ class BalancesFragment : Fragment(), NavigationInterface {
updateStackCard(channels)

channelList = channels
showBubbleIfRequired()
}

private fun showBubbleIfRequired() {
channelList?.let {
if (Channel.areAllDummies(it)) {
if (!SHOWN_BUBBLE_MAIN_ACCOUNT && balancesVisible) {
firstAccBubble = ShowcaseExecutor(requireActivity(), binding).showcaseAddFirstAccount()
SHOWN_BUBBLE_MAIN_ACCOUNT = true
}
} else if (Channel.hasDummy(channelList)) {
if (!SHOWN_BUBBLE_OTHER_ACCOUNT && balancesVisible) {
bubbleShowCaseJob = viewLifecycleOwner.lifecycleScope.launch {
delay(2000)
secondAccBubble = ShowcaseExecutor(requireActivity(), binding).showCaseAddSecondAccount()
SHOWN_BUBBLE_OTHER_ACCOUNT = true
}
}
}
}
}

private fun updateStackCard(channels: List<Channel>?) {
Expand Down Expand Up @@ -190,13 +158,8 @@ class BalancesFragment : Fragment(), NavigationInterface {
if (SHOW_ADD_ANOTHER_ACCOUNT) addChannelLink.visibility = if (show) View.VISIBLE else View.GONE
}

private fun cancelShowcase() {
bubbleShowCaseJob?.let { if (it.isActive) it.cancel() }
}

override fun onDestroyView() {
super.onDestroyView()
cancelShowcase()
_binding = null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BalancesViewModel(val application: Application, val repo: DatabaseRepo) :
var selectedChannels: LiveData<List<Channel>> = MutableLiveData()
var runFlag = MutableLiveData(NONE)
var toRun = MediatorLiveData<List<HoverAction>>()
var shouldShowBalances = MutableLiveData(false)
var actions: LiveData<List<HoverAction>> = MediatorLiveData()

private var runBalanceError = MutableLiveData<Boolean>()
Expand Down Expand Up @@ -142,7 +143,9 @@ class BalancesViewModel(val application: Application, val repo: DatabaseRepo) :
return list
}

fun hasChannels(): Boolean = !selectedChannels.value.isNullOrEmpty()
fun showBalances(show: Boolean) {
shouldShowBalances.value = show
}

interface RunBalanceListener {
fun startRun(a: HoverAction, index: Int)
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/hover/stax/bounties/BountyActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.google.firebase.ktx.Firebase
import com.hover.sdk.actions.HoverAction
import com.hover.sdk.api.HoverParameters
import com.hover.stax.R
import com.hover.stax.balances.BalancesFragment
import com.hover.stax.databinding.ActivityBountyBinding
import com.hover.stax.navigation.AbstractNavigationActivity
import com.hover.stax.pushNotification.PushNotificationTopicsInterface
Expand Down Expand Up @@ -106,7 +105,7 @@ class BountyActivity : AbstractNavigationActivity(), PushNotificationTopicsInter
fetchAccount(account.idToken!!)
} catch (e: ApiException) {
Timber.e(e, "Google sign in failed")
bountyViewModel.setLoginfailed(true)
bountyViewModel.setLoginFailed(true)
}
}
}
Expand All @@ -119,7 +118,7 @@ class BountyActivity : AbstractNavigationActivity(), PushNotificationTopicsInter
Timber.i("Sign in with credential: success")
auth.currentUser?.let { user -> bountyViewModel.setUser(user) }
} else {
bountyViewModel.setLoginfailed(true)
bountyViewModel.setLoginFailed(true)
Timber.e(it.exception, "Sign in with credential failed")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BountyEmailFragment : Fragment(), NavigationInterface, View.OnClickListene
viewModel.didLoginFail.observe(viewLifecycleOwner) {
if (it == true) {
updateProgress(100)
viewModel.setLoginfailed(false)
viewModel.setLoginFailed(false)
}
}
}
Expand Down
Loading

0 comments on commit 7c87472

Please sign in to comment.