Add the new buttons push animation to the buttons in the fragment_import_account_options.xml

This commit is contained in:
dtvv 2018-10-11 18:01:50 -05:00
parent bd6a27f15b
commit 0928a5bc81
2 changed files with 39 additions and 6 deletions

View file

@ -6,6 +6,7 @@ import android.arch.lifecycle.ViewModelProviders;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.PorterDuff;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -17,6 +18,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
@ -24,6 +26,7 @@ import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import com.thekhaeng.pushdownanim.PushDownAnim;
import com.vincent.filepicker.ToastUtil; import com.vincent.filepicker.ToastUtil;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@ -31,6 +34,7 @@ import java.net.URISyntaxException;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import butterknife.OnTouch;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.activities.BoardActivity; import cy.agorise.crystalwallet.activities.BoardActivity;
import cy.agorise.crystalwallet.activities.ImportSeedActivity; import cy.agorise.crystalwallet.activities.ImportSeedActivity;
@ -56,6 +60,8 @@ public class ImportAccountOptionsFragment extends DialogFragment {
Button btnClose; Button btnClose;
@BindView(R.id.btnImportBackup) @BindView(R.id.btnImportBackup)
Button btnImportBackup; Button btnImportBackup;
@BindView(R.id.btnImportSeed)
Button btnImportSeed;
private static final int PERMISSION_REQUEST_CODE = 1; 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); View view = inflater.inflate(R.layout.fragment_import_account_options, null);
ButterKnife.bind(this, view); 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(); return builder.setView(view).create();
} }

View file

@ -57,17 +57,16 @@
<Button <Button
android:id="@+id/btnCancel" android:id="@+id/btnCancel"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="59dp"
android:layout_marginTop="32dp" android:layout_marginTop="22dp"
android:background="@color/redColor"
android:text="@string/dialog_cancel"
android:theme="@style/RedButton" android:theme="@style/RedButton"
android:text="@string/dialog_cancel"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/btnImportSeed" app:layout_constraintEnd_toEndOf="@id/btnImportSeed"
app:layout_constraintStart_toStartOf="@id/btnImportSeed" app:layout_constraintStart_toStartOf="@id/btnImportSeed"
app:layout_constraintEnd_toEndOf="@id/btnImportSeed"/> app:layout_constraintTop_toBottomOf="@id/btnImportSeed" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>