Improved ReceiveTransactionFragment in and out animations

This commit is contained in:
Severiano Jaramillo 2017-12-23 19:52:37 -06:00
parent b57666dff5
commit eaaf6303b1
3 changed files with 22 additions and 3 deletions

View file

@ -7,8 +7,10 @@ import android.arch.lifecycle.Observer;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.DialogFragment; import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Editable; import android.text.Editable;
@ -78,6 +80,8 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
private Invoice invoice; private Invoice invoice;
private ArrayList<LineItem> invoiceItems; private ArrayList<LineItem> invoiceItems;
private FloatingActionButton fabReceive;
public static ReceiveTransactionFragment newInstance(long cryptoNetAccountId) { public static ReceiveTransactionFragment newInstance(long cryptoNetAccountId) {
ReceiveTransactionFragment f = new ReceiveTransactionFragment(); ReceiveTransactionFragment f = new ReceiveTransactionFragment();
@ -100,6 +104,8 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
fabReceive = getActivity().findViewById(R.id.fabReceive);
fabReceive.hide();
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.ReceiveTransactionTheme); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.ReceiveTransactionTheme);
//builder.setTitle("Receive Assets"); //builder.setTitle("Receive Assets");
@ -169,6 +175,18 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
return dialog; return dialog;
} }
@Override
public void onDestroy() {
super.onDestroy();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
fabReceive.show();
}
}, 400);
}
@OnTextChanged(value = R.id.etAmount, @OnTextChanged(value = R.id.etAmount,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED) callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterAmountChanged(Editable editable) { void afterAmountChanged(Editable editable) {

View file

@ -152,8 +152,8 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
} }
@Override @Override
public void onDetach() { public void onDestroy() {
super.onDetach(); super.onDestroy();
Handler handler = new Handler(); Handler handler = new Handler();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set <set
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/overshoot_interpolator" > android:interpolator="@android:anim/overshoot_interpolator"
android:startOffset="400">
<translate <translate
android:fromXDelta="-150%" android:fromXDelta="-150%"
android:toXDelta="0%" android:toXDelta="0%"