Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit ce2a67d

Browse files
authored
Merge pull request #101 from XDagger/develop
Add remark to transactions
2 parents c4bbeb5 + 5c67292 commit ce2a67d

File tree

8 files changed

+91
-105
lines changed

8 files changed

+91
-105
lines changed

app/src/main/java/io/xdag/xdagwallet/adapter/TransactionAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public TransactionAdapter(@Nullable
3030
protected void convert(BaseViewHolder helper, final BlockDetailModel.BlockAsAddress item) {
3131
helper.setText(R.id.item_transaction_tv_address, item.address);
3232
helper.setText(R.id.item_transaction_tv_amount, item.getAmount());
33+
helper.setText(R.id.item_transaction_tv_remark, item.remark);
3334
helper.setTextColor(R.id.item_transaction_tv_amount, item.getAmountColor());
3435
helper.setImageResource(R.id.item_transaction_img_type, item.getTypeImage());
3536

app/src/main/java/io/xdag/xdagwallet/model/BlockDetailModel.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import android.text.TextUtils;
44
import android.view.View;
5+
6+
import java.util.List;
7+
58
import io.xdag.common.Common;
69
import io.xdag.xdagwallet.R;
710
import io.xdag.xdagwallet.net.error.ErrorResponse;
8-
import java.util.List;
911

1012
/**
1113
* created by lxm on 2018/7/24.
@@ -23,21 +25,10 @@ public class BlockDetailModel extends ErrorResponse {
2325
public String difficulty;
2426
public String balance_address;
2527
public String balance;
28+
public String remark;
2629
public List<BlockAsAddress> block_as_transaction;
2730
public List<BlockAsAddress> block_as_address;
2831

29-
// public static class BlockAsTransaction {
30-
// /**
31-
// * direction : fee
32-
// * address : 6LN4oKM6n3oEn/rvKSqLLcZnqiNpa4aa
33-
// * amount : 0.000000000
34-
// */
35-
//
36-
// public String direction;
37-
// public String address;
38-
// public String amount;
39-
// }
40-
4132

4233
public static class BlockAsAddress {
4334
/**
@@ -53,10 +44,6 @@ public static class BlockAsAddress {
5344
public String time;
5445
public String remark;
5546

56-
public String getRemark(){
57-
return remark;
58-
}
59-
6047
public int getTypeImage() {
6148
if (isInput()) {
6249
return R.drawable.ic_input;

app/src/main/java/io/xdag/xdagwallet/model/PoolListModel.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
public class PoolListModel implements Serializable {
1515

16-
private static final String CACHE_KEY = "io,xdag.android-wallet.pool.list";
16+
private static final String CACHE_KEY = "io.xdag.android-wallet.pool.list";
1717

1818
private static final PoolListModel sInstance = new PoolListModel();
1919

@@ -40,30 +40,8 @@ private PoolListModel() {
4040

4141
public void init() {
4242
poolList.clear();
43+
// xdagmine.com:13654
4344
poolList.add(new PoolModel("xdagmine.com:13654"));
44-
poolList.add(new PoolModel("feipool.xyz:13654"));
45-
poolList.add(new PoolModel("xdagscan.com:13654"));
46-
poolList.add(new PoolModel("cn.xdag.vspool.com:13654"));
47-
poolList.add(new PoolModel("142.44.143.234:777"));
48-
poolList.add(new PoolModel("pool.xdagcn.com:13654"));
49-
poolList.add(new PoolModel("pool.xdagpool.com:13654"));
50-
poolList.add(new PoolModel("xdag.coolmine.top:13654"));
51-
poolList.add(new PoolModel("109.196.45.218:443"));
52-
poolList.add(new PoolModel("139.99.124.23:13654"));
53-
poolList.add(new PoolModel("xdag.jeepool.com:13654"));
54-
poolList.add(new PoolModel("95.216.36.234:13654"));
55-
poolList.add(new PoolModel("pool.xdagcn.com:13654"));
56-
poolList.add(new PoolModel("xdag.yourspool.com:443"));
57-
poolList.add(new PoolModel("xdag.uupool.cn:13654"));
58-
poolList.add(new PoolModel("139.99.124.135:13654"));
59-
poolList.add(new PoolModel("136.243.55.153:13654"));
60-
poolList.add(new PoolModel("pool1.xdag.signal2noi.se:443"));
61-
poolList.add(new PoolModel("78.46.82.220:13654"));
62-
poolList.add(new PoolModel("172.105.216.53:3355"));
63-
poolList.add(new PoolModel("142.44.143.234:777"));
64-
poolList.add(new PoolModel("xdag.coolmine.top:13654"));
65-
poolList.add(new PoolModel("xdag.poolaroid.cash:443"));
66-
poolList.add(new PoolModel("pool.xdag.us:13654"));
6745
}
6846

6947

app/src/main/java/io/xdag/xdagwallet/net/HttpRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package io.xdag.xdagwallet.net;
22

33
import android.app.Activity;
4+
5+
import java.util.List;
6+
47
import io.reactivex.android.schedulers.AndroidSchedulers;
58
import io.reactivex.disposables.Disposable;
69
import io.reactivex.functions.Consumer;
7-
import io.xdag.xdagwallet.config.Config;
810
import io.xdag.xdagwallet.model.BlockDetailModel;
911
import io.xdag.xdagwallet.model.ConfigModel;
1012
import io.xdag.xdagwallet.model.VersionModel;
1113
import io.xdag.xdagwallet.net.error.ErrorConsumer;
1214
import io.xdag.xdagwallet.net.rx.Detail2AddressListFunction;
1315
import io.xdag.xdagwallet.net.rx.Detail2TranListFunction;
14-
import java.util.List;
1516

1617
/**
1718
* created by lxm on 2018/8/31.

app/src/main/java/io/xdag/xdagwallet/net/error/ErrorConsumer.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
import android.app.Activity;
44
import android.text.TextUtils;
5+
56
import com.google.gson.Gson;
7+
8+
import java.io.IOException;
9+
610
import io.reactivex.functions.Consumer;
711
import io.xdag.common.tool.MLog;
812
import io.xdag.xdagwallet.util.AlertUtil;
9-
import java.io.IOException;
1013
import okhttp3.ResponseBody;
1114
import retrofit2.HttpException;
1215

1316
/**
1417
* created by lxm on 2018/7/19.
15-
*
18+
* <p>
1619
* handle exception
1720
*/
1821
public class ErrorConsumer implements Consumer<Throwable> {
@@ -30,26 +33,31 @@ public ErrorConsumer(Activity activity) {
3033
}
3134

3235

33-
@Override public void accept(Throwable throwable) {
36+
@Override
37+
public void accept(Throwable throwable) {
3438
MLog.i(throwable.getMessage());
35-
String errorMessage = throwable.getMessage();
39+
String message = throwable.getMessage();
40+
// ignore the time out of https://raw.githubusercontent.com/
41+
if (message.contains("githubusercontent")) {
42+
return;
43+
}
3644
if (throwable instanceof HttpException) {
3745
// parse error message
3846
HttpException httpException = (HttpException) throwable;
3947
try {
4048
ResponseBody errorBody = httpException.response().errorBody();
4149
if (errorBody != null) {
4250
ErrorResponse errorResponse = gson.fromJson(errorBody.string(),
43-
ErrorResponse.class);
51+
ErrorResponse.class);
4452
if (errorResponse != null && !TextUtils.isEmpty(errorResponse.message)) {
45-
errorMessage = errorResponse.message;
53+
message = errorResponse.message;
4654
}
4755

4856
}
4957
} catch (IOException ignored) {
5058
}
5159

5260
}
53-
AlertUtil.show(activity, errorMessage);
61+
AlertUtil.show(activity, message);
5462
}
5563
}
Lines changed: 63 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,74 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:app="http://schemas.android.com/apk/res-auto"
5-
xmlns:tools="http://schemas.android.com/tools"
6-
android:layout_width="match_parent"
7-
android:layout_height="wrap_content"
8-
android:background="?android:attr/selectableItemBackground"
9-
android:clickable="true"
10-
android:elevation="@dimen/elevation"
11-
android:focusable="true"
12-
android:padding="@dimen/space_16">
2+
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="wrap_content"
7+
android:background="?android:attr/selectableItemBackground"
8+
android:clickable="true"
9+
android:elevation="@dimen/elevation"
10+
android:focusable="true"
11+
android:padding="@dimen/space_16">
1312

1413
<ImageView
15-
android:id="@+id/item_transaction_img_type"
16-
android:layout_width="wrap_content"
17-
android:layout_height="wrap_content"
18-
android:src="@drawable/ic_input"
19-
android:textSize="@dimen/size_text"
20-
app:layout_constraintBottom_toBottomOf="@id/item_transaction_tv_time"
21-
app:layout_constraintLeft_toLeftOf="parent"
22-
app:layout_constraintTop_toTopOf="@id/item_transaction_tv_address"/>
14+
android:id="@+id/item_transaction_img_type"
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:src="@drawable/ic_input"
18+
android:textSize="@dimen/size_text"
19+
app:layout_constraintBottom_toBottomOf="@id/item_transaction_tv_time"
20+
app:layout_constraintLeft_toLeftOf="parent"
21+
app:layout_constraintTop_toTopOf="@id/item_transaction_tv_address" />
22+
23+
<TextView
24+
android:id="@+id/item_transaction_tv_address"
25+
android:layout_width="0dp"
26+
android:layout_height="wrap_content"
27+
android:layout_marginLeft="@dimen/space_8"
28+
android:layout_marginTop="@dimen/space_8"
29+
android:layout_marginRight="@dimen/space_8"
30+
android:ellipsize="middle"
31+
android:singleLine="true"
32+
android:textColor="@color/LIGHT_BLACK"
33+
app:layout_constraintLeft_toRightOf="@id/item_transaction_img_type"
34+
app:layout_constraintRight_toLeftOf="@id/item_transaction_tv_amount"
35+
app:layout_constraintTop_toTopOf="parent"
36+
tools:text="ewrXrSDbCmqH/fkLuQkEMiwed3709C2k" />
2337

2438
<TextView
25-
android:id="@+id/item_transaction_tv_address"
26-
android:layout_width="0dp"
27-
android:layout_height="wrap_content"
28-
android:layout_marginTop="@dimen/space_8"
29-
android:layout_marginLeft="@dimen/space_8"
30-
android:layout_marginRight="@dimen/space_8"
31-
android:ellipsize="middle"
32-
android:singleLine="true"
33-
android:textColor="@color/LIGHT_BLACK"
34-
app:layout_constraintLeft_toRightOf="@id/item_transaction_img_type"
35-
app:layout_constraintRight_toLeftOf="@id/item_transaction_tv_amount"
36-
app:layout_constraintTop_toTopOf="parent"
37-
tools:text="ewrXrSDbCmqH/fkLuQkEMiwed3709C2k"/>
39+
android:id="@+id/item_transaction_tv_amount"
40+
android:layout_width="wrap_content"
41+
android:layout_height="wrap_content"
42+
android:textColor="@color/colorPrimary"
43+
android:textSize="@dimen/size_title"
44+
app:layout_constraintBottom_toBottomOf="@id/item_transaction_img_type"
45+
app:layout_constraintRight_toRightOf="parent"
46+
app:layout_constraintTop_toTopOf="@id/item_transaction_img_type"
47+
tools:text="+100" />
3848

3949
<TextView
40-
android:id="@+id/item_transaction_tv_amount"
41-
android:layout_width="wrap_content"
42-
android:layout_height="wrap_content"
43-
android:textColor="@color/colorPrimary"
44-
android:textSize="@dimen/size_title"
45-
app:layout_constraintBottom_toBottomOf="@id/item_transaction_img_type"
46-
app:layout_constraintRight_toRightOf="parent"
47-
app:layout_constraintTop_toTopOf="@id/item_transaction_img_type"
48-
tools:text="+100"/>
50+
android:id="@+id/item_transaction_tv_time"
51+
android:layout_width="wrap_content"
52+
android:layout_height="wrap_content"
53+
android:layout_marginTop="@dimen/space_4"
54+
android:textColor="@color/GERY"
55+
android:textSize="@dimen/size_tip"
56+
android:visibility="visible"
57+
app:layout_constraintLeft_toLeftOf="@id/item_transaction_tv_address"
58+
app:layout_constraintTop_toBottomOf="@id/item_transaction_tv_address"
59+
tools:text="2018/2/23 23:33" />
4960

5061
<TextView
51-
android:id="@+id/item_transaction_tv_time"
52-
android:layout_width="wrap_content"
53-
android:layout_height="wrap_content"
54-
android:visibility="visible"
55-
android:layout_marginTop="@dimen/space_4"
56-
android:textColor="@color/GERY"
57-
android:textSize="@dimen/size_tip"
58-
app:layout_constraintLeft_toLeftOf="@id/item_transaction_tv_address"
59-
app:layout_constraintTop_toBottomOf="@id/item_transaction_tv_address"
60-
tools:text="2018/2/23 23:33"/>
62+
android:id="@+id/item_transaction_tv_remark"
63+
android:layout_width="wrap_content"
64+
android:layout_height="wrap_content"
65+
android:textColor="@color/GERY"
66+
android:textSize="@dimen/size_tip"
67+
android:visibility="visible"
68+
android:layout_marginStart="@dimen/space_32"
69+
app:layout_constraintBottom_toBottomOf="@id/item_transaction_tv_time"
70+
app:layout_constraintLeft_toRightOf="@id/item_transaction_tv_time"
71+
app:layout_constraintTop_toTopOf="@id/item_transaction_tv_time"
72+
tools:text="remark" />
6173

6274
</android.support.constraint.ConstraintLayout>

app/src/main/res/layout/layout_dialog_input.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
1212
android:digits="@string/password_format"
13-
android:maxLength="18"
1413
android:layout_marginLeft="@dimen/space_24"
1514
android:layout_marginRight="@dimen/space_24"
1615
android:inputType="textPassword">

update.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"versionCode": 24,
3-
"versionName": "0.2.4",
4-
"url": "https://github.com/XDagger/android-wallet/releases/download/release_0.2.4/android_wallet_release_v0.2.4.apk"
2+
"versionCode": 25,
3+
"versionName": "0.2.5(Fix bug)",
4+
"url": "https://github.com/XDagger/android-wallet/releases/download/release_0.2.5/android_wallet_release_v0.2.5.apk"
55
}

0 commit comments

Comments
 (0)