From 0928a5bc8182b1f8def071265965a59cb8a7ac7a Mon Sep 17 00:00:00 2001 From: dtvv Date: Thu, 11 Oct 2018 18:01:50 -0500 Subject: [PATCH] Add the new buttons push animation to the buttons in the fragment_import_account_options.xml --- .../ImportAccountOptionsFragment.java | 34 +++++++++++++++++++ .../fragment_import_account_options.xml | 11 +++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java index 845cb9c..47fec08 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java @@ -6,6 +6,7 @@ import android.arch.lifecycle.ViewModelProviders; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.PorterDuff; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -17,6 +18,7 @@ import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.util.Log; import android.view.LayoutInflater; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; @@ -24,6 +26,7 @@ import android.widget.Button; import android.widget.EditText; import android.widget.Toast; +import com.thekhaeng.pushdownanim.PushDownAnim; import com.vincent.filepicker.ToastUtil; import java.net.URISyntaxException; @@ -31,6 +34,7 @@ import java.net.URISyntaxException; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; +import butterknife.OnTouch; import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.activities.BoardActivity; import cy.agorise.crystalwallet.activities.ImportSeedActivity; @@ -56,6 +60,8 @@ public class ImportAccountOptionsFragment extends DialogFragment { Button btnClose; @BindView(R.id.btnImportBackup) Button btnImportBackup; + @BindView(R.id.btnImportSeed) + Button btnImportSeed; private static final int PERMISSION_REQUEST_CODE = 1; @@ -98,6 +104,34 @@ public class ImportAccountOptionsFragment extends DialogFragment { View view = inflater.inflate(R.layout.fragment_import_account_options, null); ButterKnife.bind(this, view); + /* + * Integration of library with button efects + * */ + PushDownAnim.setPushDownAnimTo(btnClose) + .setOnClickListener( new View.OnClickListener(){ + @Override + public void onClick( View view ){ + cancel(); + } + + } ); + PushDownAnim.setPushDownAnimTo(btnImportBackup) + .setOnClickListener( new View.OnClickListener(){ + @Override + public void onClick( View view ){ + importBackup(); + } + + } ); + PushDownAnim.setPushDownAnimTo(btnImportSeed) + .setOnClickListener( new View.OnClickListener(){ + @Override + public void onClick( View view ){ + importSeed(); + } + + } ); + return builder.setView(view).create(); } diff --git a/app/src/main/res/layout/fragment_import_account_options.xml b/app/src/main/res/layout/fragment_import_account_options.xml index a6380bf..908f2a0 100644 --- a/app/src/main/res/layout/fragment_import_account_options.xml +++ b/app/src/main/res/layout/fragment_import_account_options.xml @@ -57,17 +57,16 @@