checkpoint: dialog with transition and lottie

This commit is contained in:
Kevin Gorham 2019-02-01 22:35:45 -05:00 committed by Kevin Gorham
parent fd59c36f99
commit 2550d3a12e
10 changed files with 469 additions and 332 deletions

View File

@ -19,6 +19,9 @@ android {
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
dataBinding {
enabled true
}
buildTypes {
release {
minifyEnabled false
@ -72,6 +75,7 @@ dependencies {
// Other
implementation deps.speeddial
implementation "com.airbnb.android:lottie:2.7.0"
compile 'com.facebook.stetho:stetho:1.5.0'
testImplementation deps.junit

View File

@ -53,19 +53,13 @@ class HomeFragment : BaseFragment(), HomePresenter.HomeView {
savedInstanceState: Bundle?
): View? {
viewsInitialized = false
val enterTransitionSet = TransitionSet().apply {
addTransition(TransitionInflater.from(mainActivity).inflateTransition(android.R.transition.move))
duration = 400L
val enterTransitionSet = TransitionInflater.from(mainActivity).inflateTransition(R.transition.transition_zec_sent).apply {
duration = 350L
}
this.sharedElementEnterTransition = enterTransitionSet
this.sharedElementReturnTransition = enterTransitionSet
// sharedElementEnterTransition = ChangeBounds().apply {
// duration = 750
// }
// sharedElementReturnTransition= ChangeBounds().apply {
// duration = 750
// }
return inflater.inflate(R.layout.fragment_home, container, false)
}
@ -76,6 +70,7 @@ class HomeFragment : BaseFragment(), HomePresenter.HomeView {
mainActivity.setupNavigation()
mainActivity.supportActionBar?.setTitle(R.string.destination_title_home)
}
// background_active_transaction.isActivated = true
headerFullViews = arrayOf(text_balance_usd, text_balance_includes_info, text_balance_zec, image_zec_symbol_balance_shadow, image_zec_symbol_balance)
headerEmptyViews = arrayOf(text_balance_zec_info, text_balance_zec_empty, image_zec_symbol_balance_shadow_empty, image_zec_symbol_balance_empty)
@ -85,10 +80,11 @@ class HomeFragment : BaseFragment(), HomePresenter.HomeView {
group_empty_view_items.visibility = View.GONE
group_full_view_items.visibility = View.GONE
// image_logo.setOnClickListener {
image_logo.setOnClickListener {
// forceRedraw()
// toggleViews(false)
// }
background_active_transaction.isActivated = !background_active_transaction.isActivated
}
}
override fun onResume() {

View File

@ -9,11 +9,10 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.text.toSpannable
import androidx.databinding.DataBindingUtil
import androidx.navigation.fragment.FragmentNavigatorExtras
import androidx.transition.TransitionInflater
import androidx.transition.TransitionSet
import cash.z.android.wallet.R
import cash.z.android.wallet.extention.Toaster
import cash.z.android.wallet.databinding.FragmentSendBinding
import cash.z.android.wallet.extention.afterTextChanged
import cash.z.android.wallet.extention.toAppColor
import cash.z.android.wallet.extention.tryIgnore
@ -21,7 +20,6 @@ import cash.z.android.wallet.ui.activity.MainActivity
import cash.z.android.wallet.ui.presenter.SendPresenter
import dagger.Module
import dagger.android.ContributesAndroidInjector
import kotlinx.android.synthetic.main.fragment_send.*
import kotlinx.coroutines.launch
import java.text.DecimalFormat
@ -33,18 +31,22 @@ import java.text.DecimalFormat
class SendFragment : BaseFragment(), SendPresenter.SendView {
lateinit var sendPresenter: SendPresenter
lateinit var binding: FragmentSendBinding
private val zecFormatter = DecimalFormat("#.######")
private val usdFormatter = DecimalFormat("###,###,###.##")
private val zecSelected get() = group_zec_selected.visibility == View.VISIBLE
private val zecSelected get() = binding.groupZecSelected.visibility == View.VISIBLE
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_send, container, false)
return DataBindingUtil.inflate<FragmentSendBinding>(
inflater, R.layout.fragment_send, container, false
).let {
binding = it
it.root
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -55,18 +57,19 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
mainActivity.supportActionBar?.setTitle(R.string.destination_title_send)
}
initPresenter()
initDialog()
}
// temporary function until presenter is setup
private fun initPresenter() {
image_swap_currency.setOnClickListener {
binding.imageSwapCurrency.setOnClickListener {
onToggleCurrency()
}
text_value_header.afterTextChanged {
binding.textValueHeader.afterTextChanged {
tryIgnore {
val value = text_value_header.text.toString().toDouble()
text_value_subheader.text = if (zecSelected) {
val value = binding.textValueHeader.text.toString().toDouble()
binding.textValueSubheader.text = if (zecSelected) {
usdFormatter.format(value * MainActivity.USD_PER_ZEC)
} else {
zecFormatter.format(value / MainActivity.USD_PER_ZEC)
@ -74,16 +77,23 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
}
}
text_area_memo.afterTextChanged {
text_memo_char_count.text = "${text_area_memo.text.length} / ${resources.getInteger(R.integer.max_memo_length)}"
binding.textAreaMemo.afterTextChanged {
binding.textMemoCharCount.text = "${binding.textAreaMemo.text.length} / ${resources.getInteger(R.integer.max_memo_length)}"
}
button_send_zec.setOnClickListener {
// onSendZec()
onSendSuccess()
binding.buttonSendZec.setOnClickListener {
showSendDialog()
}
// onBalanceUpdated(12.82129334)
}
private fun initDialog() {
binding.dialogSendBackground.setOnClickListener {
hideSendDialog()
}
binding.dialogSendContents.setOnClickListener {
sendPresenter.onDialogConfirm()
}
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
@ -104,20 +114,10 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
sendPresenter.stop()
}
override fun onSendSuccess() {
setSendEnabled(true)
val enterTransitionSet = TransitionSet()
enterTransitionSet.addTransition(TransitionInflater.from(mainActivity).inflateTransition(android.R.transition.explode))
enterTransitionSet.duration = 1000L
enterTransitionSet.startDelay = 10L
this.sharedElementEnterTransition = enterTransitionSet
this.sharedElementReturnTransition = enterTransition
// mainActivity.navController.navigateUp()
override fun submit(){
val extras = FragmentNavigatorExtras(
transition_active_transaction_bg to getString(R.string.transition_active_transaction))
binding.dialogSendContents to getString(R.string.transition_active_transaction)
)
mainActivity.navController.navigate(R.id.nav_home_fragment,
null,
@ -125,21 +125,16 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
extras)
}
override fun onSendFailure() {
setSendEnabled(true)
Toaster.short("Sending FAILED!")
}
fun onToggleCurrency() {
val headerValue = text_value_header.text
text_value_header.setText(text_value_subheader.text)
text_value_subheader.text = headerValue
val headerValue = binding.textValueHeader.text
binding.textValueHeader.setText(binding.textValueSubheader.text)
binding.textValueSubheader.text = headerValue
if (zecSelected) {
group_zec_selected.visibility = View.GONE
group_usd_selected.visibility = View.VISIBLE
binding.groupZecSelected.visibility = View.GONE
binding.groupUsdSelected.visibility = View.VISIBLE
} else {
group_zec_selected.visibility = View.VISIBLE
group_usd_selected.visibility = View.GONE
binding.groupZecSelected.visibility = View.VISIBLE
binding.groupUsdSelected.visibility = View.GONE
}
}
@ -151,7 +146,7 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
val availableTextSpan = "${availableZecFormatter.format(zecBalance)} ZEC Available".toSpannable()
availableTextSpan.setSpan(ForegroundColorSpan(R.color.colorPrimary.toAppColor()), availableTextSpan.length - "Available".length, availableTextSpan.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
availableTextSpan.setSpan(StyleSpan(Typeface.BOLD), 0, 6, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
text_zec_value_available.text = availableTextSpan
binding.textZecValueAvailable.text = availableTextSpan
}
private fun onSendZec() {
@ -167,14 +162,29 @@ class SendFragment : BaseFragment(), SendPresenter.SendView {
sendPresenter.sendToAddress(amount, address)
}
fun setSendEnabled(isEnabled: Boolean) {
button_send_zec.isEnabled = isEnabled
//
// Internal View Logic
//
private fun showSendDialog() {
setSendEnabled(false) // partially because we need to lower the button elevation
binding.groupDialogSend.visibility = View.VISIBLE
}
private fun hideSendDialog() {
setSendEnabled(true)
binding.groupDialogSend.visibility = View.GONE
}
private fun setSendEnabled(isEnabled: Boolean) {
binding.buttonSendZec.isEnabled = isEnabled
if (isEnabled) {
button_send_zec.text = "send zec"
progress_send.visibility = View.GONE
binding.buttonSendZec.text = "send zec"
binding.progressSend.visibility = View.GONE
} else {
button_send_zec.text = "sending..."
progress_send.visibility = View.VISIBLE
binding.buttonSendZec.text = "sending..."
binding.progressSend.visibility = View.VISIBLE
}
}
}

View File

@ -16,9 +16,8 @@ class SendPresenter(
) : Presenter {
interface SendView : PresenterView {
fun onSendSuccess()
fun onSendFailure()
fun updateBalance(old: Long, new: Long)
fun submit()
}
private var balanceJob: Job? = null
@ -56,20 +55,24 @@ class SendPresenter(
synchronizer.downloader.connection.submitTransaction(transactionRaw)
Log.e("@TWIG", "successfully submitted")
Toaster.short("Successfully sent $value ZEC")
view.onSendSuccess()
// view.onSendSuccess() -- use CompleteableDeferred here, instead
} catch (t: Throwable) {
Log.e("@TWIG", "submit failed due to $t")
try{synchronizer.repository.deleteTransactionById(transactionId)}catch(t:Throwable){}
view.onSendFailure()
// view.onSendFailure() -- use CompleteableDeferred here, instead
}
} else {
Log.e("@TWIG", "calling send did not seem to result in a transaction being created")
try{synchronizer.repository.deleteTransactionById(transactionId)}catch(t:Throwable){}
view.onSendFailure()
// view.onSendFailure() -- use CompleteableDeferred here, instead
}
}
}
fun onDialogConfirm() {
view.submit()
}
private suspend fun findTransaction(txId: Long): Transaction? {
return if (txId < 0) null else synchronizer.repository.findTransactionById(txId)
}

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true">
<set android:ordering="together">
<objectAnimator
android:propertyName="backgroundColor"
android:valueFrom="@color/zcashGray_light"
android:valueTo="@color/zcashBlue"
android:duration="@android:integer/config_shortAnimTime"
android:valueType="colorType" />
<objectAnimator
android:propertyName="translationZ"
android:valueTo="8dp"
android:startOffset="300"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
</item>
<item>
<set android:ordering="together">
<objectAnimator
android:propertyName="backgroundColor"
android:valueFrom="@color/zcashBlue"
android:valueTo="@color/zcashGray_light"
android:duration="@android:integer/config_shortAnimTime"
android:valueType="colorType" />
<objectAnimator
android:propertyName="translationZ"
android:valueTo="0dp"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
</item>
</selector>

View File

@ -1,290 +1,330 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_send_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".ui.fragment.SendFragment">
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
<ScrollView
android:id="@+id/layout_send_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fragment_send_background">
android:fillViewport="true"
tools:context=".ui.fragment.SendFragment">
<!-- -->
<!-- Guidelines -->
<!-- -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_content_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.1" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_content_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.9" />
<Space
android:id="@+id/guideline_spacer"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/guideline_content_end" />
<include
layout="@layout/include_app_bar"
tools:ignore="MissingConstraints" />
<View
android:id="@+id/background_header"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/zcashWhite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar"
app:layout_constraintVertical_chainStyle="spread" />
android:layout_height="match_parent"
android:background="@color/fragment_send_background">
<TextView
android:id="@+id/text_zec_value_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="12.82129334 ZEC Available"
app:layout_constraintBottom_toBottomOf="@id/background_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/background_header" />
<!-- -->
<!-- Guidelines -->
<!-- -->
<View
android:id="@+id/transition_active_transaction_bg"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:background="@drawable/background_rounded_corners"
android:transitionName="@string/transition_active_transaction"
app:layout_constraintBottom_toTopOf="@id/input_zcash_address"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHeight_default="percent"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/background_header"
app:layout_constraintVertical_chainStyle="spread_inside" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_content_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.1" />
<TextView
android:id="@+id/text_amount_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:text="@string/send_label_amount"
android:textColor="@color/text_dark"
app:layout_constraintStart_toStartOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_content_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.9" />
<!-- Currency swap symbol -->
<ImageView
android:id="@+id/image_swap_currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="28dp"
android:backgroundTint="@color/zcashPrimaryMedium"
android:foregroundTint="@color/colorAccent"
android:tint="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/transition_active_transaction_bg"
app:layout_constraintEnd_toEndOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg"
app:srcCompat="@drawable/ic_import_export_black" />
<Space
android:id="@+id/guideline_spacer"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/guideline_content_end" />
<EditText
android:id="@+id/text_value_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:inputType="numberDecimal"
android:minWidth="12dp"
android:text="0"
android:textColor="@color/text_dark"
android:textSize="@dimen/text_size_h3"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/transition_active_transaction_bg"
app:layout_constraintEnd_toEndOf="@id/transition_active_transaction_bg"
app:layout_constraintStart_toStartOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg" />
<include
layout="@layout/include_app_bar"
tools:ignore="MissingConstraints" />
<TextView
android:id="@+id/text_value_subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/text_dark"
app:layout_constraintEnd_toEndOf="@id/text_value_header"
app:layout_constraintStart_toStartOf="@id/text_value_header"
app:layout_constraintTop_toBottomOf="@id/text_value_header" />
<View
android:id="@+id/background_header"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/zcashWhite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar"
app:layout_constraintVertical_chainStyle="spread" />
<!-- Zec symbol : header -->
<ImageView
android:id="@+id/image_zec_symbol_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:tint="@color/text_dark"
app:layout_constraintEnd_toStartOf="@id/text_value_header"
app:layout_constraintTop_toTopOf="@id/text_value_header"
app:srcCompat="@drawable/ic_zec_symbol" />
<TextView
android:id="@+id/text_zec_value_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/background_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/background_header"
tools:text="12.82129334 ZEC Available" />
<!-- Zec symbol : subheader -->
<ImageView
android:id="@+id/image_zec_symbol_subheader"
android:layout_width="8dp"
android:layout_height="0dp"
android:layout_marginTop="4dp"
android:tint="@color/text_dark"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintEnd_toStartOf="@id/text_value_subheader"
app:layout_constraintTop_toTopOf="@id/text_value_subheader"
app:srcCompat="@drawable/ic_zec_symbol" />
<View
android:id="@+id/transition_active_transaction_bg"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:background="@drawable/background_rounded_corners"
app:layout_constraintBottom_toTopOf="@id/input_zcash_address"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHeight_default="percent"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/background_header"
app:layout_constraintVertical_chainStyle="spread_inside" />
<TextView
android:id="@+id/text_dollar_symbol_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="$"
android:textColor="@color/text_dark"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/image_zec_symbol_header"
app:layout_constraintTop_toTopOf="@id/image_zec_symbol_header" />
<TextView
android:id="@+id/text_amount_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:text="@string/send_label_amount"
android:textColor="@color/text_dark"
app:layout_constraintStart_toStartOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg" />
<TextView
android:id="@+id/text_dollar_symbol_subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginRight="2dp"
android:text="$"
android:textColor="@color/text_dark"
android:textSize="8dp"
app:layout_constraintEnd_toStartOf="@id/image_zec_symbol_subheader"
app:layout_constraintTop_toTopOf="@id/image_zec_symbol_subheader" />
<!-- Currency swap symbol -->
<ImageView
android:id="@+id/image_swap_currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="28dp"
android:backgroundTint="@color/zcashPrimaryMedium"
android:foregroundTint="@color/colorAccent"
android:tint="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/transition_active_transaction_bg"
app:layout_constraintEnd_toEndOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg"
app:srcCompat="@drawable/ic_import_export_black" />
<EditText
android:id="@+id/input_zcash_address"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/send_hint_input_zcash_address"
app:layout_constraintBottom_toTopOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/transition_active_transaction_bg" />
<EditText
android:id="@+id/text_value_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:inputType="numberDecimal"
android:minWidth="12dp"
android:text="0"
android:textColor="@color/text_dark"
android:textSize="@dimen/text_size_h3"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/transition_active_transaction_bg"
app:layout_constraintEnd_toEndOf="@id/transition_active_transaction_bg"
app:layout_constraintStart_toStartOf="@id/transition_active_transaction_bg"
app:layout_constraintTop_toTopOf="@id/transition_active_transaction_bg" />
<!-- Scan QR code -->
<ImageView
android:id="@+id/image_scan_qr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:tint="@color/zcashBlack_87"
app:layout_constraintBottom_toBottomOf="@id/input_zcash_address"
app:layout_constraintEnd_toEndOf="@id/input_zcash_address"
app:layout_constraintTop_toTopOf="@id/input_zcash_address"
app:srcCompat="@drawable/ic_qrcode_24dp" />
<TextView
android:id="@+id/text_value_subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/text_dark"
app:layout_constraintEnd_toEndOf="@id/text_value_header"
app:layout_constraintStart_toStartOf="@id/text_value_header"
app:layout_constraintTop_toBottomOf="@id/text_value_header" />
<TextView
android:id="@+id/text_to_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_label_to"
app:layout_constraintBottom_toTopOf="@id/input_zcash_address"
app:layout_constraintStart_toStartOf="@id/input_zcash_address" />
<!-- Zec symbol : header -->
<ImageView
android:id="@+id/image_zec_symbol_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:tint="@color/text_dark"
app:layout_constraintEnd_toStartOf="@id/text_value_header"
app:layout_constraintTop_toTopOf="@id/text_value_header"
app:srcCompat="@drawable/ic_zec_symbol" />
<EditText
android:id="@+id/text_area_memo"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/background_rounded_corners"
android:backgroundTint="@color/zcashWhite_87"
android:gravity="top|left"
android:inputType="textMultiLine"
android:maxLength="@integer/max_memo_length"
android:padding="16dp"
app:layout_constraintBottom_toTopOf="@id/button_send_zec"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHeight_default="percent"
app:layout_constraintHeight_percent="0.25"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/input_zcash_address" />
<!-- Zec symbol : subheader -->
<ImageView
android:id="@+id/image_zec_symbol_subheader"
android:layout_width="8dp"
android:layout_height="0dp"
android:layout_marginTop="4dp"
android:tint="@color/text_dark"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintEnd_toStartOf="@id/text_value_subheader"
app:layout_constraintTop_toTopOf="@id/text_value_subheader"
app:srcCompat="@drawable/ic_zec_symbol" />
<Button
android:id="@+id/button_send_zec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_submit_button_text"
app:layout_constraintBottom_toTopOf="@id/guideline_spacer"
app:layout_constraintEnd_toEndOf="@id/text_area_memo"
app:layout_constraintTop_toBottomOf="@id/text_area_memo" />
<TextView
android:id="@+id/text_dollar_symbol_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="$"
android:textColor="@color/text_dark"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/image_zec_symbol_header"
app:layout_constraintTop_toTopOf="@id/image_zec_symbol_header" />
<ProgressBar
android:id="@+id/progress_send"
android:indeterminate="true"
android:theme="@style/Zcash.Progressbar.Indeterminate"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="8dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="@+id/button_send_zec"
app:layout_constraintBottom_toBottomOf="@+id/button_send_zec"
app:layout_constraintEnd_toStartOf="@+id/button_send_zec"/>
<TextView
android:id="@+id/text_dollar_symbol_subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginRight="2dp"
android:text="$"
android:textColor="@color/text_dark"
android:textSize="8dp"
app:layout_constraintEnd_toStartOf="@id/image_zec_symbol_subheader"
app:layout_constraintTop_toTopOf="@id/image_zec_symbol_subheader" />
<View
android:id="@+id/divider_memo"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginBottom="40dp"
android:background="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.7" />
<EditText
android:id="@+id/input_zcash_address"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/send_hint_input_zcash_address"
app:layout_constraintBottom_toTopOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/transition_active_transaction_bg" />
<TextView
android:id="@+id/text_memo_char_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 / 512"
android:textColor="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="@id/divider_memo"
app:layout_constraintTop_toBottomOf="@id/divider_memo" />
<!-- Scan QR code -->
<ImageView
android:id="@+id/image_scan_qr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:tint="@color/zcashBlack_87"
app:layout_constraintBottom_toBottomOf="@id/input_zcash_address"
app:layout_constraintEnd_toEndOf="@id/input_zcash_address"
app:layout_constraintTop_toTopOf="@id/input_zcash_address"
app:srcCompat="@drawable/ic_qrcode_24dp" />
<TextView
android:id="@+id/text_to_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_label_to"
app:layout_constraintBottom_toTopOf="@id/input_zcash_address"
app:layout_constraintStart_toStartOf="@id/input_zcash_address" />
<EditText
android:id="@+id/text_area_memo"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/background_rounded_corners"
android:backgroundTint="@color/zcashWhite_87"
android:gravity="top|left"
android:inputType="textMultiLine"
android:maxLength="@integer/max_memo_length"
android:padding="16dp"
app:layout_constraintBottom_toTopOf="@id/button_send_zec"
app:layout_constraintEnd_toEndOf="@id/guideline_content_end"
app:layout_constraintHeight_default="percent"
app:layout_constraintHeight_percent="0.25"
app:layout_constraintStart_toStartOf="@id/guideline_content_start"
app:layout_constraintTop_toBottomOf="@id/input_zcash_address" />
<Button
android:id="@+id/button_send_zec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_submit_button_text"
app:layout_constraintBottom_toTopOf="@id/guideline_spacer"
app:layout_constraintEnd_toEndOf="@id/text_area_memo"
app:layout_constraintTop_toBottomOf="@id/text_area_memo" />
<ProgressBar
android:id="@+id/progress_send"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:indeterminate="true"
android:padding="8dp"
android:theme="@style/Zcash.Progressbar.Indeterminate"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/button_send_zec"
app:layout_constraintEnd_toStartOf="@+id/button_send_zec"
app:layout_constraintTop_toTopOf="@+id/button_send_zec" />
<View
android:id="@+id/divider_memo"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginBottom="40dp"
android:background="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.7" />
<TextView
android:id="@+id/text_memo_char_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 / 512"
android:textColor="@color/zcashGray_light"
app:layout_constraintBottom_toBottomOf="@id/text_area_memo"
app:layout_constraintEnd_toEndOf="@id/divider_memo"
app:layout_constraintTop_toBottomOf="@id/divider_memo" />
<!-- -->
<!-- Dialog -->
<!-- -->
<View
android:id="@+id/dialog_send_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/zcashBlack_54"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/dialog_send_contents"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/background_rounded_corners"
android:transitionName="@string/transition_active_transaction"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_default="percent"
app:layout_constraintHeight_percent="0.25"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="@dimen/ratio_golden_small"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.80">
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- -->
<!-- Groups -->
<!-- -->
<androidx.constraintlayout.widget.Group
android:id="@+id/group_zec_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="image_zec_symbol_header,text_dollar_symbol_subheader" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_usd_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="image_zec_symbol_subheader,text_dollar_symbol_header" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_dialog_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="dialog_send_contents, dialog_send_background" />
<!-- -->
<!-- Groups -->
<!-- -->
<androidx.constraintlayout.widget.Group
android:id="@+id/group_zec_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="image_zec_symbol_header,text_dollar_symbol_subheader" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_usd_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="image_zec_symbol_subheader,text_dollar_symbol_header" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>

View File

@ -17,13 +17,29 @@
android:paddingEnd="16dp">
<View
android:id="@+id/transition_active_transaction_bg"
android:id="@+id/background_active_transaction"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/background_rounded_corners"
android:transitionName="@string/transition_active_transaction"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
android:stateListAnimator="@animator/selector_active_raise"
android:clickable="true"
android:focusableInTouchMode="true"
/>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="36dp"
android:layout_height="0dp"
android:layout_marginLeft="16dp"
app:lottie_autoPlay="true"
app:lottie_loop="false"
app:lottie_rawRes="@raw/lottie_active_transaction_fail"
app:layout_constraintTop_toTopOf="@id/background_active_transaction"
app:layout_constraintBottom_toBottomOf="@id/background_active_transaction"
app:layout_constraintStart_toStartOf="@id/background_active_transaction"/>
<!-- Label: Past Activity -->
<TextView
@ -37,7 +53,7 @@
android:textStyle="bold"
android:paddingBottom="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/transition_active_transaction_bg" />
app:layout_constraintTop_toBottomOf="@id/background_active_transaction" />
<!-- Transactions -->
<androidx.recyclerview.widget.RecyclerView

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<transitionSet
xmlns:android="http://schemas.android.com/apk/res/android"
android:transitionOrdering="together">
<changeBounds/>
<changeTransform/>
<changeClipBounds/>
<changeImageTransform/>
<!--<changeBounds android:interpolator="@android:interpolator/fast_out_slow_in">-->
<!--<targets>-->
<!--<target android:targetName="@string/transition_active_transaction" />-->
<!--</targets>-->
<!--</changeBounds>-->
</transitionSet>

View File

@ -21,4 +21,8 @@
<dimen name="text_size_button">14sp</dimen>
<dimen name="text_size_caption">12sp</dimen>
<dimen name="text_size_overline">10sp</dimen>
<!-- Ratios -->
<item name="ratio_golden_small" format="float" type="dimen">0.381966</item>
<item name="ratio_golden_large" format="float" type="dimen">0.618034</item>
</resources>