-Change the buttons style to the buttons to material one in the import_seed.xml and java source

-Add the new buttons push animation to the buttons in the import_seed.xml and java source
-Include layout in the buttons to fix orientación and correct size with the new properties
This commit is contained in:
dtvv 2018-10-12 03:41:36 -05:00
parent 012aea807e
commit b4cc708970
3 changed files with 43 additions and 15 deletions

View file

@ -7,10 +7,13 @@ import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.View;
import android.widget.Button; 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 butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
@ -58,6 +61,9 @@ public class ImportSeedActivity extends AppCompatActivity implements UIValidator
final Activity activity = this; final Activity activity = this;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -65,6 +71,24 @@ public class ImportSeedActivity extends AppCompatActivity implements UIValidator
ButterKnife.bind(this); ButterKnife.bind(this);
/*
* Integration of library with button efects
* */
PushDownAnim.setPushDownAnimTo(btnCancel)
.setOnClickListener( new View.OnClickListener(){
@Override
public void onClick( View view ){
cancel();
}
} );
PushDownAnim.setPushDownAnimTo(btnImport)
.setOnClickListener( new View.OnClickListener(){
@Override
public void onClick( View view ){
importSeed();
}
} );
/* /*
* Initially the button CREATE WALLET should be disabled * Initially the button CREATE WALLET should be disabled
* */ * */
@ -354,7 +378,7 @@ public class ImportSeedActivity extends AppCompatActivity implements UIValidator
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
btnImport.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); //btnImport.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
btnImport.setEnabled(true); btnImport.setEnabled(true);
} }
}); });
@ -368,7 +392,7 @@ public class ImportSeedActivity extends AppCompatActivity implements UIValidator
@Override @Override
public void run() { public void run() {
btnImport.setEnabled(false); btnImport.setEnabled(false);
btnImport.setBackground(getDrawable(R.drawable.disable_style)); //btnImport.setBackground(getDrawable(R.drawable.disable_style));
} }
}); });
} }

View file

@ -33,6 +33,7 @@
android:id="@+id/btnDisAgree" android:id="@+id/btnDisAgree"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.50" android:layout_weight="0.50"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:theme="@style/RedButton" android:theme="@style/RedButton"

View file

@ -90,33 +90,36 @@
<LinearLayout <LinearLayout
android:id="@+id/linearlayoutButtons" android:id="@+id/linearlayoutButtons"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_below="@+id/tilAccountName" android:layout_below="@+id/tilAccountName"
android:orientation="horizontal"
android:layout_marginTop="40dp"> android:layout_marginTop="40dp">
<Button <Button
android:id="@+id/btnCancel" android:id="@+id/btnCancel"
android:layout_width="140dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginRight="5dp" android:layout_weight="0.50"
android:background="@color/redColor" android:layout_marginEnd="8dp"
android:text="@string/cancel" android:layout_marginStart="8dp"
android:theme="@style/RedButton"
android:textColor="@color/white" android:textColor="@color/white"
android:textStyle="bold" /> android:textSize="14sp"
android:text="@string/cancel" />
<Button <Button
android:id="@+id/btnImport" android:id="@+id/btnImport"
android:layout_width="140dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_weight="0.50"
android:layout_marginLeft="5dp" android:layout_marginEnd="8dp"
android:background="@color/colorPrimary" android:layout_marginStart="8dp"
android:theme="@style/BlueButton"
android:text="@string/create_wallet" android:text="@string/create_wallet"
android:textColor="@color/white" android:textSize="14sp"
android:textStyle="bold" /> android:textColor="@color/white" />
</LinearLayout> </LinearLayout>