modify get split fork coins, cold wallet sign tx symbol and unit
MODIFY
bither-android/AndroidManifest.xml
bither-android/AndroidManifest.xml
android:name=".activity.hot.SplitBccColdWalletSendActivity"
android:screenOrientation="portrait"
android:theme="@style/BitherTransparentBgTheme" />
+ <activity
+ android:name=".activity.hot.SplitForkCoinsActivity"
+ android:screenOrientation="portrait"
+ android:theme="@style/BitherTransparentBgTheme" />
<activity
android:name="net.bither.activity.hot.SelectAddressToSendActivity"
android:configChanges="orientation|keyboard|keyboardHidden"

MODIFY
bither-android/res/layout/activity_hot_advance_options.xml
bither-android/res/layout/activity_hot_advance_options.xml
</LinearLayout>
<LinearLayout
- android:id="@+id/ll_split_bcc"
+ android:id="@+id/ll_fork_coins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
- android:id="@+id/tv_split_bcc"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/ll_split_btg"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_btg"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/ll_split_sbtc"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_sbtc"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/ll_split_btw"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_btw"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/ll_split_bcd"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_bcd"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/ll_split_btf"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_btf"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/ll_split_btp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_btp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/ui_touchable_bg"
- android:duplicateParentState="true"
- android:gravity="left"
- android:padding="10dp"
- android:textColor="@color/text_field_text_color"
- android:textSize="18sp" />
-
- <include layout="@layout/layout_vertical_seperator" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/ll_split_btn"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/tv_split_btn"
+ android:id="@+id/tv_fork_coins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ui_touchable_bg"
android:duplicateParentState="true"
+ android:text="@string/get_fork_coins_title"
android:gravity="left"
android:padding="10dp"
android:textColor="@color/text_field_text_color"

ADD
bither-android/res/layout/activity_split_fork_coins.xml
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <net.bither.ui.base.SwipeRightTouchView
+ android:id="@+id/swipe_right_touch_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/bg">
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="@dimen/title_bar_below_margin">
+
+ <net.bither.ui.base.OverScrollableScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/bg"
+ android:paddingLeft="@dimen/card_list_padding"
+ android:paddingRight="@dimen/card_list_padding">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/white"
+ android:orientation="vertical"
+ android:paddingBottom="6dp"
+ android:paddingTop="10dp">
+
+ <LinearLayout
+ android:id="@+id/ll_split_bcc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_bcc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/ll_split_btg"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_btg"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll_split_sbtc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_sbtc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/ll_split_btw"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_btw"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll_split_bcd"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_bcd"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll_split_btf"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_btf"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll_split_btp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_btp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll_split_btn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_split_btn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ui_touchable_bg"
+ android:duplicateParentState="true"
+ android:gravity="left"
+ android:padding="10dp"
+ android:textColor="@color/text_field_text_color"
+ android:textSize="18sp" />
+
+ <include layout="@layout/layout_vertical_seperator" />
+ </LinearLayout>
+ </LinearLayout>
+ <include layout="@layout/layout_card_foreground_single" />
+
+ </FrameLayout>
+ </LinearLayout>
+ </net.bither.ui.base.OverScrollableScrollView>
+
+ <include layout="@layout/layout_dropdown_message" />
+
+ </FrameLayout>
+
+ <FrameLayout
+ android:id="@+id/fl_title_bar"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/title_bar_height"
+ android:layout_alignParentTop="true"
+ android:background="@drawable/title_bar_bg"
+ android:paddingBottom="3dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/tab_button_background"
+ android:duplicateParentState="true"
+ android:orientation="horizontal">
+
+ <ImageButton
+ android:id="@+id/ibtn_back"
+ android:layout_width="@dimen/title_bar_height"
+ android:layout_height="match_parent"
+ android:background="@drawable/tab_button_background"
+ android:src="@drawable/title_bar_back" />
+
+ <ImageView
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@drawable/title_bar_seperator" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="5dp"
+ android:gravity="center"
+ android:shadowColor="@color/text_field_text_color"
+ android:shadowDx="1"
+ android:shadowDy="-1"
+ android:shadowRadius="0.5"
+ android:text="@string/get_fork_coins_title"
+ android:textColor="@color/white"
+ android:textSize="20sp"
+ android:textStyle="bold" />
+ </LinearLayout>
+ </FrameLayout>
+ </net.bither.ui.base.SwipeRightTouchView>
+</FrameLayout>
\ No newline at end of file

MODIFY
bither-android/res/values/strings.xml
bither-android/res/values/strings.xml
<string name="setting_privacy_policy">Privacy Policy</string>
<!--Split Coin-->
+ <string name="get_fork_coins_title">Get Fork Coins</string>
<string name="get_split_coin_setting_name">Get %s</string>
<string name="get_split_coin">Getable: </string>
<string name="not_bitpie_split_coin_address">Only sent to Bitpie %s address</string>

MODIFY
bither-android/src/net/bither/activity/cold/SignTxActivity.java
bither-android/src/net/bither/activity/cold/SignTxActivity.java
@@ -128,7 +128,13 @@ public class SignTxActivity extends SwipeRightActivity implements
}
private void showTransaction() {
- String symbol = AppSharedPreference.getInstance().getBitcoinUnit().name();
+ String symbol;
+ Coin coin = Utils.getCoinByAddressHeader(qrCodeTransport.getToAddress());
+ if(coin == Coin.BTC) {
+ symbol = AppSharedPreference.getInstance().getBitcoinUnit().name();
+ } else {
+ symbol = coin.getSplitCoin().getName();
+ }
tvSymbol.setText(symbol);
tvFeeSymbol.setText(symbol);
@@ -140,13 +146,13 @@ public class SignTxActivity extends SwipeRightActivity implements
qrCodeTransport.getMyAddress().length()));
}
tvTo.setText(WalletUtils.formatHash(qrCodeTransport.getToAddress(), 4, qrCodeTransport.getToAddress().length()));
- tvAmount.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getTo()));
- tvFee.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getFee()));
+ tvAmount.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getTo(), coin));
+ tvFee.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getFee(), coin));
llChange.setVisibility(View.GONE);
if(!Utils.isEmpty(qrCodeTransport.getChangeAddress())){
llChange.setVisibility(View.VISIBLE);
tvAddressChange.setText(WalletUtils.formatHash(qrCodeTransport.getChangeAddress(), 4, qrCodeTransport.getChangeAddress().length()));
- tvAmountChange.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getChangeAmt()));
+ tvAmountChange.setText(UnitUtilWrapper.formatValueWithBold(qrCodeTransport.getChangeAmt(),coin));
}
Address address = WalletUtils
.findPrivateKey(qrCodeTransport.getMyAddress());

MODIFY
bither-android/src/net/bither/activity/hot/HotAdvanceActivity.java
bither-android/src/net/bither/activity/hot/HotAdvanceActivity.java
@@ -122,27 +122,12 @@ public class HotAdvanceActivity extends SwipeRightFragmentActivity {
private Button btnTrashCan;
private LinearLayout btnHDMRecovery;
private LinearLayout btnHDMServerPasswordReset;
- private LinearLayout btnSplitBcc;
- private LinearLayout btnSplitBtg;
- private LinearLayout btnSplitSbtc;
- private LinearLayout btnSplitBtw;
- private LinearLayout btnSplitBcd;
- private LinearLayout btnSplitBtf;
- private LinearLayout btnSplitBtp;
- private LinearLayout btnSplitBtn;
+ private LinearLayout llForkCoins;
private DialogProgress dp;
private HDMKeychainRecoveryUtil hdmRecoveryUtil;
private HDMResetServerPasswordUtil hdmResetServerPasswordUtil;
private TextView tvVserion;
private AlertDialog.Builder selectedBuilder;
- private TextView tvSplitBcc;
- private TextView tvSplitBtg;
- private TextView tvSplitSbtc;
- private TextView tvSplitBtw;
- private TextView tvSplitBcd;
- private TextView tvSplitBtf;
- private TextView tvSplitBtp;
- private TextView tvSplitBtn;
public static final String SplitCoinKey = "SplitCoin";
@Override
@@ -161,14 +146,7 @@ public class HotAdvanceActivity extends SwipeRightFragmentActivity {
btnEditPassword = (Button) findViewById(R.id.btn_edit_password);
btnTrashCan = (Button) findViewById(R.id.btn_trash_can);
btnHDMRecovery = (LinearLayout) findViewById(R.id.ll_hdm_recover);
- btnSplitBcc = (LinearLayout) findViewById(R.id.ll_split_bcc);
- btnSplitBtg = (LinearLayout) findViewById(R.id.ll_split_btg);
- btnSplitSbtc = (LinearLayout) findViewById(R.id.ll_split_sbtc);
- btnSplitBtw = (LinearLayout) findViewById(R.id.ll_split_btw);
- btnSplitBcd = (LinearLayout) findViewById(R.id.ll_split_bcd);
- btnSplitBtf = (LinearLayout) findViewById(R.id.ll_split_btf);
- btnSplitBtp = (LinearLayout) findViewById(R.id.ll_split_btp);
- btnSplitBtn = (LinearLayout) findViewById(R.id.ll_split_btn);
+ llForkCoins = (LinearLayout) findViewById(R.id.ll_fork_coins);
btnHDMServerPasswordReset = (LinearLayout) findViewById(R.id.ll_hdm_server_auth_reset);
ssvImportPrivateKey = (SettingSelectorView) findViewById(R.id.ssv_import_private_key);
ssvImprotBip38Key = (SettingSelectorView) findViewById(R.id.ssv_import_bip38_key);
@@ -189,14 +167,7 @@ public class HotAdvanceActivity extends SwipeRightFragmentActivity {
ssvTotalBalanceHide.setSelector(totalBalanceHideSelector);
btnTrashCan.setOnClickListener(trashCanClick);
btnHDMRecovery.setOnClickListener(hdmRecoverClick);
- btnSplitBcc.setOnClickListener(splitClick);
- btnSplitBtg.setOnClickListener(splitClick);
- btnSplitSbtc.setOnClickListener(splitClick);
- btnSplitBtw.setOnClickListener(splitClick);
- btnSplitBcd.setOnClickListener(splitClick);
- btnSplitBtf.setOnClickListener(splitClick);
- btnSplitBtp.setOnClickListener(splitClick);
- btnSplitBtn.setOnClickListener(splitClick);
+ llForkCoins.setOnClickListener(splitClick);
btnHDMServerPasswordReset.setOnClickListener(hdmServerPasswordResetClick);
((SettingSelectorView) findViewById(R.id.ssv_message_signing)).setSelector
(messageSigningSelector);
@@ -215,22 +186,6 @@ public class HotAdvanceActivity extends SwipeRightFragmentActivity {
tvVserion.setText(Version.name + " " + Version.version);
hdmRecoveryUtil = new HDMKeychainRecoveryUtil(this, dp);
configureHDMServerPasswordReset();
- tvSplitBcc = (TextView) findViewById(R.id.tv_split_bcc);
- tvSplitBtg = (TextView) findViewById(R.id.tv_split_btg);
- tvSplitSbtc = (TextView) findViewById(R.id.tv_split_sbtc);
- tvSplitBtw = (TextView) findViewById(R.id.tv_split_btw);
- tvSplitBcd = (TextView) findViewById(R.id.tv_split_bcd);
- tvSplitBtf = (TextView) findViewById(R.id.tv_split_btf);
- tvSplitBtp = (TextView) findViewById(R.id.tv_split_btp);
- tvSplitBtn = (TextView) findViewById(R.id.tv_split_btn);
- tvSplitBcc.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BCC.getName()));
- tvSplitBtg.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTG.getName()));
- tvSplitSbtc.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.SBTC.getName()));
- tvSplitBtw.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTW.getName()));
- tvSplitBcd.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BCD.getName()));
- tvSplitBtf.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTF.getName()));
- tvSplitBtp.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTP.getName()));
- tvSplitBtn.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTN.getName()));
}
@Override
@@ -411,53 +366,10 @@ public class HotAdvanceActivity extends SwipeRightFragmentActivity {
private View.OnClickListener splitClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
- SplitCoin coin;
- switch (view.getId()) {
- case R.id.ll_split_btn:
- coin = SplitCoin.BTN;
- break;
- case R.id.ll_split_btf:
- coin = SplitCoin.BTF;
- break;
- case R.id.ll_split_btp:
- coin = SplitCoin.BTP;
- break;
- case R.id.ll_split_btg:
- coin = SplitCoin.BTG;
- break;
- case R.id.ll_split_sbtc:
- coin = SplitCoin.SBTC;
- break;
- case R.id.ll_split_btw:
- coin = SplitCoin.BTW;
- break;
- case R.id.ll_split_bcd:
- coin = SplitCoin.BCD;
- break;
- default:
- coin = SplitCoin.BCC;
- break;
-
- }
- long lastBlockHeight = PeerManager.instance().getLastBlockHeight();
- long forkBlockHeight = coin.getForkBlockHeight();
- if (lastBlockHeight < forkBlockHeight) {
- DropdownMessage.showDropdownMessage(HotAdvanceActivity.this, String.format(getString
- (R.string.please_firstly_sync_to_block_no), forkBlockHeight));
- } else {
- AddressManager addressManager = AddressManager.getInstance();
- if (!addressManager.hasHDAccountHot() && !addressManager.hasHDAccountMonitored() &&
- addressManager.getPrivKeyAddresses().size() == 0 && addressManager.getWatchOnlyAddresses().size()
- == 0) {
- DropdownMessage.showDropdownMessage(HotAdvanceActivity.this, getString(R.string.no_private_key));
- } else {
- Intent intent = new Intent(HotAdvanceActivity.this, SplitBccSelectAddressActivity.class);
- intent.putExtra(SplitCoinKey, coin);
+ Intent intent = new Intent(HotAdvanceActivity.this, SplitForkCoinsActivity.class);
startActivity(intent);
}
- }
- }
};

ADD
bither-android/src/net/bither/activity/hot/SplitForkCoinsActivity.java
+package net.bither.activity.hot;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import net.bither.R;
+import net.bither.bitherj.core.AddressManager;
+import net.bither.bitherj.core.PeerManager;
+import net.bither.bitherj.core.SplitCoin;
+import net.bither.bitherj.core.Version;
+import net.bither.bitherj.utils.Utils;
+import net.bither.ui.base.DropdownMessage;
+import net.bither.ui.base.SettingSelectorView;
+import net.bither.ui.base.SwipeRightFragmentActivity;
+import net.bither.ui.base.dialog.DialogProgress;
+import net.bither.ui.base.listener.IBackClickListener;
+import net.bither.util.HDMKeychainRecoveryUtil;
+
+/**
+ * Created by denmark on 2018/1/19.
+ */
+
+public class SplitForkCoinsActivity extends SwipeRightFragmentActivity {
+ private LinearLayout btnSplitBcc, btnSplitBtg, btnSplitSbtc, btnSplitBtw,
+ btnSplitBcd, btnSplitBtf, btnSplitBtp, btnSplitBtn;
+
+ private TextView tvSplitBcc,tvSplitBtg,tvSplitSbtc,tvSplitBtw,tvSplitBcd,
+ tvSplitBtf,tvSplitBtp,tvSplitBtn;
+
+ public static final String SplitCoinKey = "SplitCoin";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ overridePendingTransition(R.anim.slide_in_right, 0);
+ setContentView(R.layout.activity_split_fork_coins);
+ initView();
+ }
+
+ private void initView() {
+
+ findViewById(R.id.ibtn_back).setOnClickListener(new IBackClickListener());
+
+ btnSplitBcc = (LinearLayout) findViewById(R.id.ll_split_bcc);
+ btnSplitBtg = (LinearLayout) findViewById(R.id.ll_split_btg);
+ btnSplitSbtc = (LinearLayout) findViewById(R.id.ll_split_sbtc);
+ btnSplitBtw = (LinearLayout) findViewById(R.id.ll_split_btw);
+ btnSplitBcd = (LinearLayout) findViewById(R.id.ll_split_bcd);
+ btnSplitBtf = (LinearLayout) findViewById(R.id.ll_split_btf);
+ btnSplitBtp = (LinearLayout) findViewById(R.id.ll_split_btp);
+ btnSplitBtn = (LinearLayout) findViewById(R.id.ll_split_btn);
+ btnSplitBcc.setOnClickListener(splitClick);
+ btnSplitBtg.setOnClickListener(splitClick);
+ btnSplitSbtc.setOnClickListener(splitClick);
+ btnSplitBtw.setOnClickListener(splitClick);
+ btnSplitBcd.setOnClickListener(splitClick);
+ btnSplitBtf.setOnClickListener(splitClick);
+ btnSplitBtp.setOnClickListener(splitClick);
+ btnSplitBtn.setOnClickListener(splitClick);
+ tvSplitBcc = (TextView) findViewById(R.id.tv_split_bcc);
+ tvSplitBtg = (TextView) findViewById(R.id.tv_split_btg);
+ tvSplitSbtc = (TextView) findViewById(R.id.tv_split_sbtc);
+ tvSplitBtw = (TextView) findViewById(R.id.tv_split_btw);
+ tvSplitBcd = (TextView) findViewById(R.id.tv_split_bcd);
+ tvSplitBtf = (TextView) findViewById(R.id.tv_split_btf);
+ tvSplitBtp = (TextView) findViewById(R.id.tv_split_btp);
+ tvSplitBtn = (TextView) findViewById(R.id.tv_split_btn);
+ tvSplitBcc.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BCC.getName()));
+ tvSplitBtg.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTG.getName()));
+ tvSplitSbtc.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.SBTC.getName()));
+ tvSplitBtw.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTW.getName()));
+ tvSplitBcd.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BCD.getName()));
+ tvSplitBtf.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTF.getName()));
+ tvSplitBtp.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTP.getName()));
+ tvSplitBtn.setText(Utils.format(getString(R.string.get_split_coin_setting_name), SplitCoin.BTN.getName()));
+ }
+
+ private View.OnClickListener splitClick = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ SplitCoin coin;
+ switch (view.getId()) {
+ case R.id.ll_split_btn:
+ coin = SplitCoin.BTN;
+ break;
+ case R.id.ll_split_btf:
+ coin = SplitCoin.BTF;
+ break;
+ case R.id.ll_split_btp:
+ coin = SplitCoin.BTP;
+ break;
+ case R.id.ll_split_btg:
+ coin = SplitCoin.BTG;
+ break;
+ case R.id.ll_split_sbtc:
+ coin = SplitCoin.SBTC;
+ break;
+ case R.id.ll_split_btw:
+ coin = SplitCoin.BTW;
+ break;
+ case R.id.ll_split_bcd:
+ coin = SplitCoin.BCD;
+ break;
+ default:
+ coin = SplitCoin.BCC;
+ break;
+
+ }
+
+ long lastBlockHeight = PeerManager.instance().getLastBlockHeight();
+ long forkBlockHeight = coin.getForkBlockHeight();
+ if (lastBlockHeight < forkBlockHeight) {
+ DropdownMessage.showDropdownMessage(SplitForkCoinsActivity.this, String.format(getString
+ (R.string.please_firstly_sync_to_block_no), forkBlockHeight));
+ } else {
+ AddressManager addressManager = AddressManager.getInstance();
+ if (!addressManager.hasHDAccountHot() && !addressManager.hasHDAccountMonitored() &&
+ addressManager.getPrivKeyAddresses().size() == 0 && addressManager.getWatchOnlyAddresses().size()
+ == 0) {
+ DropdownMessage.showDropdownMessage(SplitForkCoinsActivity.this, getString(R.string.no_private_key));
+ } else {
+ Intent intent = new Intent(SplitForkCoinsActivity.this, SplitBccSelectAddressActivity.class);
+ intent.putExtra(SplitCoinKey, coin);
+ startActivity(intent);
+ }
+ }
+ }
+ };
+
+}

MODIFY
bither-android/src/net/bither/ui/base/dialog/DialogHdSendConfirm.java
bither-android/src/net/bither/ui/base/dialog/DialogHdSendConfirm.java
@@ -110,8 +110,8 @@ public class DialogHdSendConfirm extends CenterDialog implements DialogInterface
amount += tx.amountSentToAddress(toAddress);
fee += tx.getFee();
}
- tvBtc.setText(UnitUtilWrapper.formatValueWithBold(amount,splitCoin));
- tvFee.setText(UnitUtilWrapper.formatValueWithBold(fee,splitCoin));
+ tvBtc.setText(UnitUtilWrapper.formatValueWithBold(amount,splitCoin.getCoin()));
+ tvFee.setText(UnitUtilWrapper.formatValueWithBold(fee,splitCoin.getCoin()));
}
@Override

MODIFY
bither-android/src/net/bither/util/UnitUtilWrapper.java
bither-android/src/net/bither/util/UnitUtilWrapper.java
@@ -40,6 +40,7 @@ import android.widget.TextView;
import net.bither.BitherApplication;
import net.bither.R;
+import net.bither.bitherj.core.Coin;
import net.bither.bitherj.core.SplitCoin;
import net.bither.bitherj.utils.UnitUtil;
import net.bither.bitherj.utils.UnitUtil.BitcoinUnit;
@@ -123,8 +124,12 @@ public class UnitUtilWrapper {
return formatValueWithBold(value, unit().boldAfterDot);
}
- public static SpannableString formatValueWithBold(final long value, SplitCoin splitCoin) {
- return formatValueWithBold(value, 2,splitCoin);
+
+ public static SpannableString formatValueWithBold(final long value, Coin coin) {
+ if(coin != Coin.BTC) {
+ return formatValueWithBold(value, 2,coin.getSplitCoin());
+ }
+ return formatValueWithBold(value);
}
private static SpannableString formatValueWithBold(final long value, int boldLengthAfterDot,SplitCoin...coin) {

modify get split fork coins, cold wallet sign tx symbol and unit