Fixes from henrry code
This commit is contained in:
parent
9a1dc0548d
commit
10cc88c8d3
6 changed files with 108 additions and 102 deletions
|
@ -26,6 +26,7 @@ import butterknife.OnTextChanged;
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
||||||
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
|
import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
import cy.agorise.crystalwallet.models.GeneralSetting;
|
import cy.agorise.crystalwallet.models.GeneralSetting;
|
||||||
import cy.agorise.crystalwallet.util.PasswordManager;
|
import cy.agorise.crystalwallet.util.PasswordManager;
|
||||||
import cy.agorise.crystalwallet.viewmodels.GeneralSettingListViewModel;
|
import cy.agorise.crystalwallet.viewmodels.GeneralSettingListViewModel;
|
||||||
|
@ -43,7 +44,7 @@ public class PatternRequestActivity extends AppCompatActivity {
|
||||||
/*
|
/*
|
||||||
* External listener for success or fail
|
* External listener for success or fail
|
||||||
* */
|
* */
|
||||||
//private static OnResponse onResponse;
|
private static OnResponse onResponse;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contains the bad tries
|
* Contains the bad tries
|
||||||
|
@ -143,9 +144,9 @@ public class PatternRequestActivity extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static void setOnResponse(OnResponse onResponse) {
|
public static void setOnResponse(OnResponse onResponse) {
|
||||||
PatternRequestActivity.onResponse = onResponse;
|
PatternRequestActivity.onResponse = onResponse;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
private void incorrect(){
|
private void incorrect(){
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import cy.agorise.crystalwallet.dialogs.material.DialogMaterial;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.NegativeResponse;
|
import cy.agorise.crystalwallet.dialogs.material.NegativeResponse;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.PositiveResponse;
|
import cy.agorise.crystalwallet.dialogs.material.PositiveResponse;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.QuestionDialog;
|
import cy.agorise.crystalwallet.dialogs.material.QuestionDialog;
|
||||||
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
import cy.agorise.crystalwallet.models.AccountSeed;
|
import cy.agorise.crystalwallet.models.AccountSeed;
|
||||||
import cy.agorise.crystalwallet.models.GeneralSetting;
|
import cy.agorise.crystalwallet.models.GeneralSetting;
|
||||||
import cy.agorise.crystalwallet.util.PasswordManager;
|
import cy.agorise.crystalwallet.util.PasswordManager;
|
||||||
|
@ -59,7 +59,7 @@ public class PinRequestActivity extends AppCompatActivity {
|
||||||
/*
|
/*
|
||||||
* External listener for success or fail
|
* External listener for success or fail
|
||||||
* */
|
* */
|
||||||
//private static OnResponse onResponse;
|
private static OnResponse onResponse;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,16 +113,16 @@ public class PinRequestActivity extends AppCompatActivity {
|
||||||
if (CrystalSecurityMonitor.getInstance(null).is2ndFactorSet()) {
|
if (CrystalSecurityMonitor.getInstance(null).is2ndFactorSet()) {
|
||||||
CrystalSecurityMonitor.getInstance(null).call2ndFactor(this);
|
CrystalSecurityMonitor.getInstance(null).call2ndFactor(this);
|
||||||
|
|
||||||
/*if(onResponse != null){
|
if(onResponse != null){
|
||||||
onResponse.onSuccess();
|
onResponse.onSuccess();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.finish();
|
this.finish();
|
||||||
|
|
||||||
/*if(onResponse != null){
|
if(onResponse != null){
|
||||||
onResponse.onFailed();
|
onResponse.onFailed();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -221,9 +221,9 @@ public class PinRequestActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*public static void setOnResponse(OnResponse onResponse) {
|
public static void setOnResponse(OnResponse onResponse) {
|
||||||
PinRequestActivity.onResponse = onResponse;
|
PinRequestActivity.onResponse = onResponse;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
@OnTextChanged(value = R.id.etPassword,
|
@OnTextChanged(value = R.id.etPassword,
|
||||||
|
@ -241,5 +241,3 @@ public class PinRequestActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import cy.agorise.crystalwallet.activities.PatternRequestActivity;
|
||||||
import cy.agorise.crystalwallet.activities.PinRequestActivity;
|
import cy.agorise.crystalwallet.activities.PinRequestActivity;
|
||||||
import cy.agorise.crystalwallet.activities.PocketRequestActivity;
|
import cy.agorise.crystalwallet.activities.PocketRequestActivity;
|
||||||
import cy.agorise.crystalwallet.fragments.PatternSecurityFragment;
|
import cy.agorise.crystalwallet.fragments.PatternSecurityFragment;
|
||||||
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
import cy.agorise.crystalwallet.models.GeneralSetting;
|
import cy.agorise.crystalwallet.models.GeneralSetting;
|
||||||
import cy.agorise.crystalwallet.notifiers.CrystalWalletNotifier;
|
import cy.agorise.crystalwallet.notifiers.CrystalWalletNotifier;
|
||||||
import cy.agorise.crystalwallet.viewmodels.GeneralSettingListViewModel;
|
import cy.agorise.crystalwallet.viewmodels.GeneralSettingListViewModel;
|
||||||
|
@ -131,7 +131,7 @@ public class CrystalSecurityMonitor implements Application.ActivityLifecycleCall
|
||||||
public void onActivityStarted(Activity activity) {
|
public void onActivityStarted(Activity activity) {
|
||||||
if (numStarted == 0) {
|
if (numStarted == 0) {
|
||||||
if (!actualSecurity().equals("")){
|
if (!actualSecurity().equals("")){
|
||||||
callPasswordRequest(activity);
|
callPasswordRequest(activity,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
numStarted++;
|
numStarted++;
|
||||||
|
@ -142,39 +142,39 @@ public class CrystalSecurityMonitor implements Application.ActivityLifecycleCall
|
||||||
numStarted--;
|
numStarted--;
|
||||||
if (numStarted == 0) {
|
if (numStarted == 0) {
|
||||||
if (!actualSecurity().equals("")){
|
if (!actualSecurity().equals("")){
|
||||||
callPasswordRequest(activity);
|
callPasswordRequest(activity,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void callPasswordRequest(Activity activity){
|
public void callPasswordRequest(Activity activity, final OnResponse onResponsePattern){
|
||||||
if ((!activity.getIntent().hasExtra("ACTIVITY_TYPE")) || (!activity.getIntent().getStringExtra("ACTIVITY_TYPE").equals("PASSWORD_REQUEST"))) {
|
if ((!activity.getIntent().hasExtra("ACTIVITY_TYPE")) || (!activity.getIntent().getStringExtra("ACTIVITY_TYPE").equals("PASSWORD_REQUEST"))) {
|
||||||
Intent intent = null;
|
Intent intent = null;
|
||||||
if ((this.passwordEncrypted != null) && (!this.passwordEncrypted.equals(""))) {
|
if ((this.passwordEncrypted != null) && (!this.passwordEncrypted.equals(""))) {
|
||||||
|
|
||||||
intent = new Intent(activity, PinRequestActivity.class);
|
intent = new Intent(activity, PinRequestActivity.class);
|
||||||
|
|
||||||
//PinRequestActivity.setOnResponse(null);
|
PinRequestActivity.setOnResponse(null);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Connect error and success listeners
|
* Connect error and success listeners
|
||||||
* */
|
* */
|
||||||
/*if(onResponsePattern != null){
|
if(onResponsePattern != null){
|
||||||
PinRequestActivity.setOnResponse(onResponsePattern);
|
PinRequestActivity.setOnResponse(onResponsePattern);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
} else if ((this.patternEncrypted != null) && (!this.patternEncrypted.equals(""))) {
|
} else if ((this.patternEncrypted != null) && (!this.patternEncrypted.equals(""))) {
|
||||||
|
|
||||||
intent = new Intent(activity, PatternRequestActivity.class);
|
intent = new Intent(activity, PatternRequestActivity.class);
|
||||||
|
|
||||||
//PatternRequestActivity.setOnResponse(null);
|
PatternRequestActivity.setOnResponse(null);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Connect error and success listeners
|
* Connect error and success listeners
|
||||||
* */
|
* */
|
||||||
/*if(onResponsePattern != null){
|
if(onResponsePattern != null){
|
||||||
PatternRequestActivity.setOnResponse(onResponsePattern);
|
PatternRequestActivity.setOnResponse(onResponsePattern);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
intent.putExtra("ACTIVITY_TYPE", "PASSWORD_REQUEST");
|
intent.putExtra("ACTIVITY_TYPE", "PASSWORD_REQUEST");
|
||||||
|
@ -220,7 +220,4 @@ public class CrystalSecurityMonitor implements Application.ActivityLifecycleCall
|
||||||
public void onActivityDestroyed(Activity activity) {
|
public void onActivityDestroyed(Activity activity) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,7 +30,7 @@ import butterknife.OnTextChanged;
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
||||||
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
import cy.agorise.crystalwallet.models.GeneralSetting;
|
import cy.agorise.crystalwallet.models.GeneralSetting;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests;
|
||||||
import cy.agorise.crystalwallet.util.ChildViewPager;
|
import cy.agorise.crystalwallet.util.ChildViewPager;
|
||||||
|
|
|
@ -152,6 +152,16 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
|
||||||
}
|
}
|
||||||
List<CryptoCurrency> cryptoCurrencyList = db.cryptoCurrencyDao().getByIds(assetIds);
|
List<CryptoCurrency> cryptoCurrencyList = db.cryptoCurrencyDao().getByIds(assetIds);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test
|
||||||
|
* */
|
||||||
|
CryptoCurrency crypto1 = new CryptoCurrency();
|
||||||
|
crypto1.setId(1);
|
||||||
|
crypto1.setName("BITCOIN");
|
||||||
|
crypto1.setPrecision(1);
|
||||||
|
cryptoCurrencyList.add(crypto1);
|
||||||
|
|
||||||
|
|
||||||
CryptoCurrencyAdapter assetAdapter = new CryptoCurrencyAdapter(getContext(), android.R.layout.simple_spinner_item, cryptoCurrencyList);
|
CryptoCurrencyAdapter assetAdapter = new CryptoCurrencyAdapter(getContext(), android.R.layout.simple_spinner_item, cryptoCurrencyList);
|
||||||
spAsset.setAdapter(assetAdapter);
|
spAsset.setAdapter(assetAdapter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ import cy.agorise.crystalwallet.R;
|
||||||
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
import cy.agorise.crystalwallet.application.CrystalSecurityMonitor;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.ToastIt;
|
import cy.agorise.crystalwallet.dialogs.material.ToastIt;
|
||||||
//import cy.agorise.crystalwallet.interfaces.OnResponse;
|
import cy.agorise.crystalwallet.interfaces.OnResponse;
|
||||||
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.ValidateBitsharesSendRequest;
|
import cy.agorise.crystalwallet.requestmanagers.ValidateBitsharesSendRequest;
|
||||||
|
@ -623,14 +623,14 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
/*
|
/*
|
||||||
* If exists mode scurity show it and valide events in case of success or fail
|
* If exists mode scurity show it and valide events in case of success or fail
|
||||||
* */
|
* */
|
||||||
/*CrystalSecurityMonitor.getInstance(null).callPasswordRequest(this.getActivity(), new OnResponse() {
|
CrystalSecurityMonitor.getInstance(null).callPasswordRequest(this.getActivity(), new OnResponse() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show loading dialog
|
* Show loading dialog
|
||||||
* */
|
* */
|
||||||
/* crystalDialog = new CrystalDialog((Activity) getContext());
|
crystalDialog = new CrystalDialog((Activity) getContext());
|
||||||
crystalDialog.setText("Sending");
|
crystalDialog.setText("Sending");
|
||||||
crystalDialog.progress();
|
crystalDialog.progress();
|
||||||
crystalDialog.show();
|
crystalDialog.show();
|
||||||
|
@ -642,7 +642,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
|
||||||
public void onFailed() {
|
public void onFailed() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue