-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:
dtvv 2018-08-17 12:08:49 -05:00
parent 119300d545
commit d2d17bb6b4
9 changed files with 50 additions and 17 deletions

View file

@ -52,6 +52,7 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.jaredrummler:material-spinner:1.2.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
//testCompile 'com.android.support.test:runner:1.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' //DTVV Thrusday 31 July 2018

View file

@ -120,6 +120,7 @@ public class BoardActivity extends CustomActivity {
public void run() {
LinearLayout tabLayout = (LinearLayout)((ViewGroup) tabLayoutFinal.getChildAt(0)).getChildAt(tab.getPosition());
tabLayout.setBackgroundColor(Color.TRANSPARENT);
TextView tabTextView = (TextView) tabLayout.getChildAt(1);
//tabTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP ,50);
Spannable WordtoSpan = new SpannableString(tabTextView.getText());

View file

@ -32,6 +32,7 @@ import android.widget.Spinner;
import android.widget.TextView;
import com.google.zxing.Result;
import com.jaredrummler.materialspinner.MaterialSpinner;
import java.io.File;
import java.math.RoundingMode;
@ -73,7 +74,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
SendTransactionValidator sendTransactionValidator;
@BindView(R.id.spFrom)
Spinner spFrom;
MaterialSpinner spFrom;
@BindView(R.id.tvFromError)
TextView tvFromError;
@BindView(R.id.etTo)
@ -176,8 +177,27 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
CryptoNetAccountListViewModel cryptoNetAccountListViewModel = ViewModelProviders.of(this).get(CryptoNetAccountListViewModel.class);
List<CryptoNetAccount> cryptoNetAccounts = cryptoNetAccountListViewModel.getCryptoNetAccountList();
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());
}
@ -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) {
this.sendTransactionValidator.validate();
}
}*/
@OnTextChanged(value = R.id.etTo,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
@ -311,7 +331,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
@OnClick(R.id.btnSend)
public void sendTransaction(){
if (this.sendTransactionValidator.isValid()) {
CryptoNetAccount fromAccountSelected = (CryptoNetAccount) spFrom.getSelectedItem();
CryptoNetAccount fromAccountSelected = (CryptoNetAccount) spFrom.getItems().get(spFrom.getSelectedIndex());
/*

View file

@ -4,6 +4,8 @@ import android.content.Context;
import android.widget.EditText;
import android.widget.Spinner;
import com.jaredrummler.materialspinner.MaterialSpinner;
import cy.agorise.crystalwallet.models.CryptoNetAccount;
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AmountValidationField;
import cy.agorise.crystalwallet.viewmodels.validators.validationfields.AssetValidationField;
@ -20,7 +22,7 @@ public class SendTransactionValidator extends UIValidator {
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);
this.account = account;
this.addField(new FromValidationField(fromEdit));

View file

@ -2,7 +2,10 @@ package cy.agorise.crystalwallet.viewmodels.validators.validationfields;
import android.widget.Spinner;
import com.jaredrummler.materialspinner.MaterialSpinner;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.models.CryptoNetAccount;
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
@ -14,9 +17,9 @@ import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountReq
public class FromValidationField extends ValidationField {
//private EditText fromField;
private Spinner fromField;
private MaterialSpinner fromField;
public FromValidationField(Spinner fromField){
public FromValidationField(MaterialSpinner fromField){
super(fromField);
this.fromField = fromField;
}
@ -24,8 +27,9 @@ public class FromValidationField extends ValidationField {
public void validate(){
final String newValue;
if (fromField.getSelectedItem() != null) {
newValue = fromField.getSelectedItem().toString();
if (fromField.getSelectedIndex() != -1) {
final CryptoNetAccount cryptoNetAccount = (CryptoNetAccount) fromField.getItems().get(fromField.getSelectedIndex());
newValue = cryptoNetAccount.getName();
} else {
newValue = "";
}

View file

@ -3,7 +3,10 @@ package cy.agorise.crystalwallet.viewmodels.validators.validationfields;
import android.widget.EditText;
import android.widget.Spinner;
import com.jaredrummler.materialspinner.MaterialSpinner;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.models.CryptoNetAccount;
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener;
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountRequest;
@ -14,10 +17,10 @@ import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountReq
public class ToValidationField extends ValidationField {
private Spinner fromField;
private MaterialSpinner fromField;
private EditText toField;
public ToValidationField(Spinner fromField, EditText toField){
public ToValidationField(MaterialSpinner fromField, EditText toField){
super(toField);
this.fromField = fromField;
this.toField = toField;
@ -25,8 +28,9 @@ public class ToValidationField extends ValidationField {
public void validate(){
final String fromNewValue;
if (fromField.getSelectedItem() != null) {
fromNewValue = fromField.getSelectedItem().toString();
if (fromField.getSelectedIndex() != -1) {
final CryptoNetAccount cryptoNetAccount = (CryptoNetAccount) fromField.getItems().get(fromField.getSelectedIndex());
fromNewValue = cryptoNetAccount.getName();
} else {
fromNewValue = "";
}

View file

@ -99,6 +99,7 @@
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_gravity="bottom"
android:background="@color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabSelectedTextColor="@color/white"

View file

@ -8,7 +8,7 @@
android:id="@+id/tabLayout"
android:layout_gravity="start"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="45dp"
android:background="#d9d9d9"
android:animateLayoutChanges="true" />

View file

@ -44,7 +44,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
<com.jaredrummler.materialspinner.MaterialSpinner
android:id="@+id/spFrom"
android:layout_width="0dp"
android:layout_height="wrap_content"