modify send bcc success call back
MODIFY
bither-android/src/net/bither/activity/hot/SplitBCCHDAccountMonitoredSendActivity.java
bither-android/src/net/bither/activity/hot/SplitBCCHDAccountMonitoredSendActivity.java
@@ -278,6 +278,8 @@ public class SplitBCCHDAccountMonitoredSendActivity extends SplitBCCSendActivity
btnSend.postDelayed(new Runnable() {
@Override
public void run() {
+ setResult(SplitBccSelectAddressActivity.
+ SPLIT_BCC_HDACCOUNT_REQUEST_CODE, null);
finish();
}
},1000);

MODIFY
bither-android/src/net/bither/activity/hot/SplitBCCHDAccountSendActivity.java
bither-android/src/net/bither/activity/hot/SplitBCCHDAccountSendActivity.java
@@ -207,6 +207,8 @@ public class SplitBCCHDAccountSendActivity extends SplitBCCSendActivity implemen
btnSend.postDelayed(new Runnable() {
@Override
public void run() {
+ setResult(SplitBccSelectAddressActivity.
+ SPLIT_BCC_HDACCOUNT_REQUEST_CODE, null);
finish();
}
},1000);

MODIFY
bither-android/src/net/bither/activity/hot/SplitBCCSendActivity.java
bither-android/src/net/bither/activity/hot/SplitBCCSendActivity.java
@@ -182,6 +182,8 @@ public class SplitBCCSendActivity extends SwipeRightActivity implements EntryKey
btnSend.postDelayed(new Runnable() {
@Override
public void run() {
+ setResult(SplitBccSelectAddressActivity.
+ SPLIT_BCC_HDACCOUNT_REQUEST_CODE, null);
finish();
}
},1000);

MODIFY
bither-android/src/net/bither/activity/hot/SplitBccColdWalletSendActivity.java
bither-android/src/net/bither/activity/hot/SplitBccColdWalletSendActivity.java
@@ -260,6 +260,8 @@ public class SplitBccColdWalletSendActivity extends SplitBCCSendActivity {
btnSend.postDelayed(new Runnable() {
@Override
public void run() {
+ setResult(SplitBccSelectAddressActivity.
+ SPLIT_BCC_HDACCOUNT_REQUEST_CODE, null);
finish();
}
},1000);

MODIFY
bither-android/src/net/bither/activity/hot/SplitBccSelectAddressActivity.java
bither-android/src/net/bither/activity/hot/SplitBccSelectAddressActivity.java
package net.bither.activity.hot;
+import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
@@ -13,7 +14,8 @@ import net.bither.ui.base.listener.IBackClickListener;
*/
public class SplitBccSelectAddressActivity extends SwipeRightFragmentActivity {
-
+ public static final int SPLIT_BCC_HDACCOUNT_REQUEST_CODE = 777;
+ HotAddressFragment hotAddressFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -26,7 +28,7 @@ public class SplitBccSelectAddressActivity extends SwipeRightFragmentActivity {
findViewById(R.id.ibtn_back).setOnClickListener(
new IBackClickListener(0, R.anim.slide_out_right));
FragmentManager manager = getSupportFragmentManager();
- HotAddressFragment hotAddressFragment = (HotAddressFragment) manager.findFragmentById(R.id.fragment_split_address);
+ hotAddressFragment = (HotAddressFragment) manager.findFragmentById(R.id.fragment_split_address);
}
@Override
@@ -34,4 +36,13 @@ public class SplitBccSelectAddressActivity extends SwipeRightFragmentActivity {
super.finish();
overridePendingTransition(0, R.anim.slide_out_right);
}
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ if (SplitBccSelectAddressActivity.
+ SPLIT_BCC_HDACCOUNT_REQUEST_CODE == requestCode) {
+ hotAddressFragment.doRefresh();
+ }
+ }
}

MODIFY
bither-android/src/net/bither/adapter/hot/HotAddressFragmentListAdapter.java
bither-android/src/net/bither/adapter/hot/HotAddressFragmentListAdapter.java
@@ -42,6 +42,7 @@ import net.bither.activity.hot.SplitBCCHDAccountMonitoredSendActivity;
import net.bither.activity.hot.SplitBCCHDAccountSendActivity;
import net.bither.activity.hot.SplitBCCSendActivity;
import net.bither.activity.hot.SplitBccColdWalletSendActivity;
+import net.bither.activity.hot.SplitBccSelectAddressActivity;
import net.bither.bitherj.core.Address;
import net.bither.bitherj.core.AddressManager;
import net.bither.bitherj.core.EnterpriseHDMAddress;
@@ -473,6 +474,7 @@ public class HotAddressFragmentListAdapter extends BaseExpandableListAdapter imp
}
if (AppSharedPreference.getInstance().isObtainBcc(getIsObtainKey)) {
view.setObtainAddress(a);
+ view.setClickable(false);
} else {
view.setAddress(a);
}
@@ -510,8 +512,11 @@ public class HotAddressFragmentListAdapter extends BaseExpandableListAdapter imp
public void onClick(View v) {
if (!clicked) {
clicked = true;
- if (isSyncComplete(a))
- activity.startActivity(new Intent(activity, SplitBCCHDAccountSendActivity.class));
+ if (isSyncComplete(a)) {
+ Intent intent = new Intent(activity, SplitBCCHDAccountSendActivity.class);
+ activity.startActivityForResult(intent,
+ SplitBccSelectAddressActivity.SPLIT_BCC_HDACCOUNT_REQUEST_CODE);
+ }
v.postDelayed(new Runnable() {
@Override
public void run() {
@@ -549,8 +554,11 @@ public class HotAddressFragmentListAdapter extends BaseExpandableListAdapter imp
public void onClick(View v) {
if (!clicked) {
clicked = true;
- if (isSyncComplete(a))
- activity.startActivity(new Intent(activity, SplitBCCHDAccountMonitoredSendActivity.class));
+ if (isSyncComplete(a)) {
+ Intent intent = new Intent(activity, SplitBCCHDAccountMonitoredSendActivity.class);
+ activity.startActivityForResult(intent,
+ SplitBccSelectAddressActivity.SPLIT_BCC_HDACCOUNT_REQUEST_CODE);
+ }
v.postDelayed(new Runnable() {
@Override
public void run() {
@@ -616,7 +624,8 @@ public class HotAddressFragmentListAdapter extends BaseExpandableListAdapter imp
intent.putExtra(BitherSetting.INTENT_REF.ADDRESS_HAS_PRIVATE_KEY_PASS_VALUE_TAG,
isPrivate);
intent.putExtra(BitherSetting.INTENT_REF.ADDRESS_IS_HDM_KEY_PASS_VALUE_TAG, isHDM);
- activity.startActivity(intent);
+ activity.startActivityForResult(intent,
+ SplitBccSelectAddressActivity.SPLIT_BCC_HDACCOUNT_REQUEST_CODE);
}
} else {
Intent intent = new Intent(activity, isEnterpriseHDM ?

modify send bcc success call back