bither cold wallet added display my addresses
MODIFY
bither-android/res/layout/activity_qr_code.xml
bither-android/res/layout/activity_qr_code.xml
android:textColor="@color/text_field_text_color"
android:textSize="18sp" />
+ <LinearLayout
+ android:id="@+id/ll_first_address"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:orientation="vertical" >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="10dp"
+ android:gravity="center_horizontal"
+ android:textColor="@color/text_field_text_color"
+ android:text="@string/hd_account_monitor_check_first_address"
+ android:textSize="15sp" />
+
+ <TextView
+ android:id="@+id/tv_first_address"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="6dp"
+ android:gravity="center_horizontal"
+ android:textColor="@color/password_strength_weak"
+ android:text="@string/hd_account_monitor_check_first_address"
+ android:textSize="16sp" />
+
+ </LinearLayout>
<net.bither.ui.base.OverScrollableViewPager
android:id="@+id/pager"

MODIFY
bither-android/src/net/bither/SignMessageAddressListActivity.java
bither-android/src/net/bither/SignMessageAddressListActivity.java
@@ -36,14 +36,17 @@ import java.util.List;
public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
public static final String SignMgsTypeSelect = "SignMgsTypeSelect";
+ public static final String PassWord = "PassWord";
public static final String IsHdAccountHot = "IsHdAccountHot";
public static final String IsDetectBcc = "IsDetectBcc";
public static final String IsSignHash = "IsSignHash";
+ public static final String IsShowAddress= "IsShowAddress";
private int page = 1;
private boolean hasMore = true;
private boolean isLoading = false;
+ private CharSequence password;
private SignMessageTypeSelect signMessageTypeSelect;
private AbstractHD.PathType pathType;
private boolean isHot;
@@ -56,6 +59,7 @@ public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
private HDAccount hdAccount;
private HDAccountCold hdAccountCold;
private BitpieHDAccountCold bitpieHDAccountCold;
+ private boolean isShowAddress;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -68,8 +72,13 @@ public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
bitpieHDAccountCold = AddressManager.getInstance().getBitpieHDAccountCold();
signMessageTypeSelect = (SignMessageTypeSelect) getIntent().getSerializableExtra(SignMgsTypeSelect);
isHot = (boolean) getIntent().getSerializableExtra(IsHdAccountHot);
- tvTitle.setText(R.string.sign_message_select_address);
+ isShowAddress = getIntent().getBooleanExtra(IsShowAddress, false);
+ tvTitle.setText(isShowAddress ? R.string.address_mine : R.string.sign_message_select_address);
isSignHash = getIntent().getBooleanExtra(IsSignHash, false);
+ if (signMessageTypeSelect != SignMessageTypeSelect.Hot) {
+ String tempString = getIntent().getStringExtra(PassWord);
+ password = tempString.subSequence(0, tempString.length());
+ }
initView();
}
@@ -136,12 +145,12 @@ public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
isLoading = true;
List<HDAccount.HDAccountAddress> address;
if (signMessageTypeSelect.isBitpieCold()) {
- address = bitpieHDAccountCold.getHdColdAddresses(page, pathType);
+ address = bitpieHDAccountCold.getHdColdAddresses(page, pathType, password);
} else {
if (isHot) {
address = hdAccount.getHdHotAddresses(page, pathType);
} else {
- address = hdAccountCold.getHdColdAddresses(page, pathType);
+ address = hdAccountCold.getHdColdAddresses(page, pathType, password);
}
}
@@ -183,7 +192,9 @@ public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
h.tvAddress.setText(WalletUtils.formatHash(a.getAddress(), 4, 20));
h.tvIndex.setText(String.valueOf(position));
h.tvBalance.setText(UnitUtilWrapper.formatValue(a.getBalance()));
+ if (!isShowAddress) {
convertView.setOnClickListener(new ListItemClick(a));
+ }
break;
case HdReceive:
case HdChange:
@@ -197,7 +208,9 @@ public class SignMessageAddressListActivity extends SwipeRightFragmentActivity {
} else {
h.llBalance.setVisibility(View.GONE);
}
+ if (!isShowAddress) {
convertView.setOnClickListener(new HdAddressListItemClick(hdar));
+ }
break;
}
return convertView;

MODIFY
bither-android/src/net/bither/fragment/cold/AddAddressBitpieColdHDAccountViewFragment.java
bither-android/src/net/bither/fragment/cold/AddAddressBitpieColdHDAccountViewFragment.java
@@ -27,6 +27,7 @@ import android.widget.TextView;
import net.bither.R;
import net.bither.bitherj.core.AddressManager;
+import net.bither.bitherj.core.BitpieHDAccountCold;
import net.bither.bitherj.core.HDAccountCold;
import net.bither.bitherj.crypto.SecureCharSequence;
import net.bither.ui.base.dialog.DialogHDMSeedWordList;
@@ -71,7 +72,7 @@ public class AddAddressBitpieColdHDAccountViewFragment extends Fragment implemen
}
private void showQr() {
- final HDAccountCold account = AddressManager.getInstance().getHDAccountCold();
+ final BitpieHDAccountCold account = AddressManager.getInstance().getBitpieHDAccountCold();
if (account == null) {
return;
}
@@ -87,7 +88,7 @@ public class AddAddressBitpieColdHDAccountViewFragment extends Fragment implemen
}
private void showPhrase() {
- final HDAccountCold account = AddressManager.getInstance().getHDAccountCold();
+ final BitpieHDAccountCold account = AddressManager.getInstance().getBitpieHDAccountCold();
if (account == null) {
return;
}

MODIFY
bither-android/src/net/bither/qrcode/BitherQRCodeActivity.java
bither-android/src/net/bither/qrcode/BitherQRCodeActivity.java
@@ -26,12 +26,15 @@ import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.TextView;
import net.bither.BitherSetting;
import net.bither.R;
import net.bither.activity.cold.BitpieColdSignChangeCoinActivity;
import net.bither.activity.cold.SignTxActivity;
+import net.bither.bitherj.core.AddressManager;
+import net.bither.bitherj.core.BitpieHDAccountCold;
import net.bither.bitherj.qrcode.QRCodeBitpieColdSignMessage;
import net.bither.bitherj.qrcode.QRCodeEnodeUtil;
import net.bither.bitherj.qrcode.QRCodeUtil;
@@ -52,6 +55,8 @@ public class BitherQRCodeActivity extends SwipeRightFragmentActivity implements
private boolean hasChangeAddress = false;
private ViewPager pager;
private TextView tvTitle;
+ private LinearLayout llFirstAddress;
+ private TextView tvFirstAddress;
private ImageView ivSeparator;
private ImageButton btnSwitch;
private boolean isNewVerion;
@@ -119,6 +124,8 @@ public class BitherQRCodeActivity extends SwipeRightFragmentActivity implements
btnSwitch.setOnClickListener(switchClickListener);
pager = (ViewPager) findViewById(R.id.pager);
tvTitle = (TextView) findViewById(R.id.tv_title);
+ tvFirstAddress = findViewById(R.id.tv_first_address);
+ llFirstAddress = findViewById(R.id.ll_first_address);
mTouchView.addIgnoreView(pager);
if (hasOldQRCode) {
ivSeparator.setVisibility(View.VISIBLE);
@@ -127,6 +134,12 @@ public class BitherQRCodeActivity extends SwipeRightFragmentActivity implements
ivSeparator.setVisibility(View.INVISIBLE);
btnSwitch.setVisibility(View.INVISIBLE);
}
+ if (signMessageType == QRCodeBitpieColdSignMessage.SignMessageType.LoginSign) {
+ if (AddressManager.getInstance().hasBitpieHDAccountCold()) {
+ tvFirstAddress.setText(AddressManager.getInstance().getBitpieHDAccountCold().getFirstAddressFromDb());
+ llFirstAddress.setVisibility(View.VISIBLE);
+ }
+ }
adapter = new QRFragmentPagerAdapter(getSupportFragmentManager());
pager.setAdapter(adapter);
pager.setOffscreenPageLimit(1);

MODIFY
bither-android/src/net/bither/ui/base/ColdAddressFragmentBitpieHDAccountColdListItemView.java
bither-android/src/net/bither/ui/base/ColdAddressFragmentBitpieHDAccountColdListItemView.java
package net.bither.ui.base;
import android.content.Context;
+import android.content.Intent;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -27,11 +28,13 @@ import android.widget.ImageButton;
import android.widget.TextView;
import net.bither.R;
+import net.bither.SignMessageAddressListActivity;
import net.bither.bitherj.core.AddressManager;
import net.bither.bitherj.core.BitpieHDAccountCold;
import net.bither.bitherj.crypto.SecureCharSequence;
import net.bither.bitherj.crypto.hd.DeterministicKey;
import net.bither.bitherj.qrcode.QRCodeUtil;
+import net.bither.enums.SignMessageTypeSelect;
import net.bither.ui.base.dialog.DialogHDMSeedWordList;
import net.bither.ui.base.dialog.DialogHDMonitorFirstAddressValidation;
import net.bither.ui.base.dialog.DialogPassword;
@@ -46,6 +49,11 @@ import net.bither.util.WalletUtils;
import java.util.ArrayList;
import java.util.List;
+import static net.bither.SignMessageAddressListActivity.IsHdAccountHot;
+import static net.bither.SignMessageAddressListActivity.IsShowAddress;
+import static net.bither.SignMessageAddressListActivity.IsSignHash;
+import static net.bither.SignMessageAddressListActivity.PassWord;
+import static net.bither.SignMessageAddressListActivity.SignMgsTypeSelect;
import static net.bither.bitherj.qrcode.QRCodeUtil.HD_MONITOR_QR_SPLIT;
/**
@@ -184,6 +192,25 @@ public class ColdAddressFragmentBitpieHDAccountColdListItemView extends FrameLay
}).show();
}
}));
+
+ actions.add(new DialogWithActions.Action(R.string.address_mine, new
+ Runnable() {
+ @Override
+ public void run() {
+ new DialogPassword(getContext(), new IDialogPasswordListener() {
+ @Override
+ public void onPasswordEntered(final SecureCharSequence password) {
+ Intent intent = new Intent(getContext(), SignMessageAddressListActivity.class);
+ intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.BitpieColdReceive);
+ intent.putExtra(IsHdAccountHot, false);
+ intent.putExtra(IsSignHash, false);
+ intent.putExtra(PassWord, password);
+ intent.putExtra(IsShowAddress, true);
+ getContext().startActivity(intent);
+ }
+ }).show();
+ }
+ }));
return actions;
}
};

MODIFY
bither-android/src/net/bither/ui/base/ColdAddressFragmentHDAccountColdListItemView.java
bither-android/src/net/bither/ui/base/ColdAddressFragmentHDAccountColdListItemView.java
package net.bither.ui.base;
import android.content.Context;
+import android.content.Intent;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -26,10 +27,12 @@ import android.widget.FrameLayout;
import android.widget.ImageButton;
import net.bither.R;
+import net.bither.SignMessageAddressListActivity;
import net.bither.bitherj.core.AddressManager;
import net.bither.bitherj.core.HDAccountCold;
import net.bither.bitherj.crypto.SecureCharSequence;
import net.bither.bitherj.qrcode.QRCodeUtil;
+import net.bither.enums.SignMessageTypeSelect;
import net.bither.ui.base.dialog.DialogHDMSeedWordList;
import net.bither.ui.base.dialog.DialogHDMonitorFirstAddressValidation;
import net.bither.ui.base.dialog.DialogPassword;
@@ -44,6 +47,11 @@ import net.bither.util.WalletUtils;
import java.util.ArrayList;
import java.util.List;
+import static net.bither.SignMessageAddressListActivity.IsHdAccountHot;
+import static net.bither.SignMessageAddressListActivity.IsShowAddress;
+import static net.bither.SignMessageAddressListActivity.IsSignHash;
+import static net.bither.SignMessageAddressListActivity.PassWord;
+import static net.bither.SignMessageAddressListActivity.SignMgsTypeSelect;
import static net.bither.bitherj.qrcode.QRCodeUtil.HD_MONITOR_QR_SPLIT;
/**
@@ -181,6 +189,24 @@ public class ColdAddressFragmentHDAccountColdListItemView extends FrameLayout {
}).show();
}
}));
+ actions.add(new DialogWithActions.Action(R.string.address_mine, new
+ Runnable() {
+ @Override
+ public void run() {
+ new DialogPassword(getContext(), new IDialogPasswordListener() {
+ @Override
+ public void onPasswordEntered(final SecureCharSequence password) {
+ Intent intent = new Intent(getContext(), SignMessageAddressListActivity.class);
+ intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.HdReceive);
+ intent.putExtra(IsHdAccountHot, false);
+ intent.putExtra(IsSignHash, false);
+ intent.putExtra(PassWord, password);
+ intent.putExtra(IsShowAddress, true);
+ getContext().startActivity(intent);
+ }
+ }).show();
+ }
+ }));
return actions;
}
};

MODIFY
bither-android/src/net/bither/ui/base/dialog/DialogSignHashSelectType.java
bither-android/src/net/bither/ui/base/dialog/DialogSignHashSelectType.java
@@ -17,6 +17,7 @@ import net.bither.ui.base.listener.IDialogPasswordListener;
import static net.bither.SignMessageAddressListActivity.IsHdAccountHot;
import static net.bither.SignMessageAddressListActivity.IsSignHash;
+import static net.bither.SignMessageAddressListActivity.PassWord;
import static net.bither.SignMessageAddressListActivity.SignMgsTypeSelect;
public class DialogSignHashSelectType extends CenterDialog {
@@ -78,6 +79,7 @@ public class DialogSignHashSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.HdReceive);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, true);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();
@@ -95,6 +97,7 @@ public class DialogSignHashSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.HdChange);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, true);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();

MODIFY
bither-android/src/net/bither/ui/base/dialog/DialogSignMessageSelectType.java
bither-android/src/net/bither/ui/base/dialog/DialogSignMessageSelectType.java
@@ -18,6 +18,7 @@ import net.bither.ui.base.listener.IDialogPasswordListener;
import static net.bither.SignMessageAddressListActivity.IsHdAccountHot;
import static net.bither.SignMessageAddressListActivity.IsSignHash;
+import static net.bither.SignMessageAddressListActivity.PassWord;
import static net.bither.SignMessageAddressListActivity.SignMgsTypeSelect;
/**
@@ -94,6 +95,7 @@ public class DialogSignMessageSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.HdReceive);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, isSignHash);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();
@@ -111,6 +113,7 @@ public class DialogSignMessageSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.HdChange);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, isSignHash);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();
@@ -128,6 +131,7 @@ public class DialogSignMessageSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.BitpieColdReceive);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, isSignHash);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();
@@ -145,6 +149,7 @@ public class DialogSignMessageSelectType extends CenterDialog {
intent.putExtra(SignMgsTypeSelect, SignMessageTypeSelect.BitpieColdChange);
intent.putExtra(IsHdAccountHot, isHot);
intent.putExtra(IsSignHash, isSignHash);
+ intent.putExtra(PassWord, password);
getContext().startActivity(intent);
}
}).show();

MODIFY
bitherj
bitherj
-Subproject commit 7ddabede6057b8fb12de3cde67de9c195a4d4069
+Subproject commit a80307d402a40730ff59f9914fe1fc8d8a1bd739

bither cold wallet added display my addresses