-In the Send Assets window fix the “account name to” to get better visual effects
-Integrate nice material spinner into crystal proyect -Change in class SendTransactionValidator for material spinner -Change in clas SendTransactionFragment for material spinner -At end this nice spinner did not work well and i removed it -Integrate this new nice material spinner into crystal proyect -Modified classes: SendTransactionFragment SendTransactionValidator ToValidationField FromValidationField -Create the first bubble inicial design background for the BroadActivity window -Remove the transparent squares in the BroadActivity -In the window of BroadActivity that the Tab tittles increase size when they are selected (tonigth) -Integrate bubble background gif to android (tonigth)
This commit is contained in:
parent
119300d545
commit
d2d17bb6b4
9 changed files with 50 additions and 17 deletions
|
@ -52,6 +52,7 @@ dependencies {
|
||||||
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
|
implementation 'com.jaredrummler:material-spinner:1.2.5'
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||||
//testCompile 'com.android.support.test:runner:1.0.1'
|
//testCompile 'com.android.support.test:runner:1.0.1'
|
||||||
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' //DTVV Thrusday 31 July 2018
|
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' //DTVV Thrusday 31 July 2018
|
||||||
|
|
|
@ -120,6 +120,7 @@ public class BoardActivity extends CustomActivity {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
LinearLayout tabLayout = (LinearLayout)((ViewGroup) tabLayoutFinal.getChildAt(0)).getChildAt(tab.getPosition());
|
LinearLayout tabLayout = (LinearLayout)((ViewGroup) tabLayoutFinal.getChildAt(0)).getChildAt(tab.getPosition());
|
||||||
|
tabLayout.setBackgroundColor(Color.TRANSPARENT);
|
||||||
TextView tabTextView = (TextView) tabLayout.getChildAt(1);
|
TextView tabTextView = (TextView) tabLayout.getChildAt(1);
|
||||||
//tabTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP ,50);
|
//tabTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP ,50);
|
||||||
Spannable WordtoSpan = new SpannableString(tabTextView.getText());
|
Spannable WordtoSpan = new SpannableString(tabTextView.getText());
|
||||||
|
|
|
@ -32,6 +32,7 @@ import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.zxing.Result;
|
import com.google.zxing.Result;
|
||||||
|
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
@ -73,7 +74,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
SendTransactionValidator sendTransactionValidator;
|
SendTransactionValidator sendTransactionValidator;
|
||||||
|
|
||||||
@BindView(R.id.spFrom)
|
@BindView(R.id.spFrom)
|
||||||
Spinner spFrom;
|
MaterialSpinner spFrom;
|
||||||
@BindView(R.id.tvFromError)
|
@BindView(R.id.tvFromError)
|
||||||
TextView tvFromError;
|
TextView tvFromError;
|
||||||
@BindView(R.id.etTo)
|
@BindView(R.id.etTo)
|
||||||
|
@ -176,8 +177,27 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
CryptoNetAccountListViewModel cryptoNetAccountListViewModel = ViewModelProviders.of(this).get(CryptoNetAccountListViewModel.class);
|
CryptoNetAccountListViewModel cryptoNetAccountListViewModel = ViewModelProviders.of(this).get(CryptoNetAccountListViewModel.class);
|
||||||
List<CryptoNetAccount> cryptoNetAccounts = cryptoNetAccountListViewModel.getCryptoNetAccountList();
|
List<CryptoNetAccount> cryptoNetAccounts = cryptoNetAccountListViewModel.getCryptoNetAccountList();
|
||||||
CryptoNetAccountAdapter fromSpinnerAdapter = new CryptoNetAccountAdapter(this.getContext(), android.R.layout.simple_spinner_item, cryptoNetAccounts);
|
CryptoNetAccountAdapter fromSpinnerAdapter = new CryptoNetAccountAdapter(this.getContext(), android.R.layout.simple_spinner_item, cryptoNetAccounts);
|
||||||
spFrom.setAdapter(fromSpinnerAdapter);
|
|
||||||
spFrom.setSelection(0);
|
//spFrom.setAdapter(fromSpinnerAdapter);
|
||||||
|
//spFrom.setSelection(0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Custom material spinner implementation
|
||||||
|
* */
|
||||||
|
spFrom.setItems(cryptoNetAccounts);
|
||||||
|
spFrom.setSelectedIndex(0);
|
||||||
|
spFrom.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<CryptoNetAccount>() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(MaterialSpinner view, int position, long id, CryptoNetAccount item) {
|
||||||
|
sendTransactionValidator.validate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
spFrom.setOnNothingSelectedListener(new MaterialSpinner.OnNothingSelectedListener() {
|
||||||
|
|
||||||
|
@Override public void onNothingSelected(MaterialSpinner spinner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// etFrom.setText(this.grapheneAccount.getName());
|
// etFrom.setText(this.grapheneAccount.getName());
|
||||||
}
|
}
|
||||||
|
@ -230,10 +250,10 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnItemSelected(R.id.spFrom)
|
/*@OnItemSelected(R.id.spFrom)
|
||||||
public void afterFromSelected(Spinner spinner, int position) {
|
public void afterFromSelected(Spinner spinner, int position) {
|
||||||
this.sendTransactionValidator.validate();
|
this.sendTransactionValidator.validate();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@OnTextChanged(value = R.id.etTo,
|
@OnTextChanged(value = R.id.etTo,
|
||||||
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
|
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
|
||||||
|
@ -311,7 +331,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
@OnClick(R.id.btnSend)
|
@OnClick(R.id.btnSend)
|
||||||
public void sendTransaction(){
|
public void sendTransaction(){
|
||||||
if (this.sendTransactionValidator.isValid()) {
|
if (this.sendTransactionValidator.isValid()) {
|
||||||
CryptoNetAccount fromAccountSelected = (CryptoNetAccount) spFrom.getSelectedItem();
|
CryptoNetAccount fromAccountSelected = (CryptoNetAccount) spFrom.getItems().get(spFrom.getSelectedIndex());
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -4,6 +4,8 @@ import android.content.Context;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
|
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||||
|
|
||||||
import cy.agorise.crystalwallet.models.CryptoNetAccount;
|
import cy.agorise.crystalwallet.models.CryptoNetAccount;
|
||||||
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AmountValidationField;
|
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AmountValidationField;
|
||||||
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AssetValidationField;
|
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AssetValidationField;
|
||||||
|
@ -20,7 +22,7 @@ public class SendTransactionValidator extends UIValidator {
|
||||||
private CryptoNetAccount account;
|
private CryptoNetAccount account;
|
||||||
|
|
||||||
|
|
||||||
public SendTransactionValidator(Context context, CryptoNetAccount account, Spinner fromEdit, EditText toEdit, Spinner assetSpinner, EditText amountEdit, EditText memoEdit){
|
public SendTransactionValidator(Context context, CryptoNetAccount account, MaterialSpinner fromEdit, EditText toEdit, Spinner assetSpinner, EditText amountEdit, EditText memoEdit){
|
||||||
super(context);
|
super(context);
|
||||||
this.account = account;
|
this.account = account;
|
||||||
this.addField(new FromValidationField(fromEdit));
|
this.addField(new FromValidationField(fromEdit));
|
||||||
|
|
|
@ -2,7 +2,10 @@ package cy.agorise.crystalwallet.viewmodels.validators.validationfields;
|
||||||
|
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
|
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||||
|
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
|
import cy.agorise.crystalwallet.models.CryptoNetAccount;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
|
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
|
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
|
||||||
|
@ -14,9 +17,9 @@ import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountReq
|
||||||
public class FromValidationField extends ValidationField {
|
public class FromValidationField extends ValidationField {
|
||||||
|
|
||||||
//private EditText fromField;
|
//private EditText fromField;
|
||||||
private Spinner fromField;
|
private MaterialSpinner fromField;
|
||||||
|
|
||||||
public FromValidationField(Spinner fromField){
|
public FromValidationField(MaterialSpinner fromField){
|
||||||
super(fromField);
|
super(fromField);
|
||||||
this.fromField = fromField;
|
this.fromField = fromField;
|
||||||
}
|
}
|
||||||
|
@ -24,8 +27,9 @@ public class FromValidationField extends ValidationField {
|
||||||
public void validate(){
|
public void validate(){
|
||||||
final String newValue;
|
final String newValue;
|
||||||
|
|
||||||
if (fromField.getSelectedItem() != null) {
|
if (fromField.getSelectedIndex() != -1) {
|
||||||
newValue = fromField.getSelectedItem().toString();
|
final CryptoNetAccount cryptoNetAccount = (CryptoNetAccount) fromField.getItems().get(fromField.getSelectedIndex());
|
||||||
|
newValue = cryptoNetAccount.getName();
|
||||||
} else {
|
} else {
|
||||||
newValue = "";
|
newValue = "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,10 @@ package cy.agorise.crystalwallet.viewmodels.validators.validationfields;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
|
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||||
|
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
|
import cy.agorise.crystalwallet.models.CryptoNetAccount;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
|
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
|
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
|
||||||
|
@ -14,10 +17,10 @@ import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountReq
|
||||||
|
|
||||||
public class ToValidationField extends ValidationField {
|
public class ToValidationField extends ValidationField {
|
||||||
|
|
||||||
private Spinner fromField;
|
private MaterialSpinner fromField;
|
||||||
private EditText toField;
|
private EditText toField;
|
||||||
|
|
||||||
public ToValidationField(Spinner fromField, EditText toField){
|
public ToValidationField(MaterialSpinner fromField, EditText toField){
|
||||||
super(toField);
|
super(toField);
|
||||||
this.fromField = fromField;
|
this.fromField = fromField;
|
||||||
this.toField = toField;
|
this.toField = toField;
|
||||||
|
@ -25,8 +28,9 @@ public class ToValidationField extends ValidationField {
|
||||||
|
|
||||||
public void validate(){
|
public void validate(){
|
||||||
final String fromNewValue;
|
final String fromNewValue;
|
||||||
if (fromField.getSelectedItem() != null) {
|
if (fromField.getSelectedIndex() != -1) {
|
||||||
fromNewValue = fromField.getSelectedItem().toString();
|
final CryptoNetAccount cryptoNetAccount = (CryptoNetAccount) fromField.getItems().get(fromField.getSelectedIndex());
|
||||||
|
fromNewValue = cryptoNetAccount.getName();
|
||||||
} else {
|
} else {
|
||||||
fromNewValue = "";
|
fromNewValue = "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,7 @@
|
||||||
<android.support.design.widget.TabLayout
|
<android.support.design.widget.TabLayout
|
||||||
android:id="@+id/tabLayout"
|
android:id="@+id/tabLayout"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:background="@color/transparent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:tabSelectedTextColor="@color/white"
|
app:tabSelectedTextColor="@color/white"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
android:id="@+id/tabLayout"
|
android:id="@+id/tabLayout"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="45dp"
|
||||||
android:background="#d9d9d9"
|
android:background="#d9d9d9"
|
||||||
android:animateLayoutChanges="true" />
|
android:animateLayoutChanges="true" />
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Spinner
|
<com.jaredrummler.materialspinner.MaterialSpinner
|
||||||
android:id="@+id/spFrom"
|
android:id="@+id/spFrom"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
Loading…
Reference in a new issue