lots of GUI tweaks
This commit is contained in:
parent
39d9c4d0c3
commit
e39cd1c988
|
@ -65,6 +65,7 @@ public class GenerateReviewFragment extends Fragment {
|
|||
|
||||
boolean testnet = WalletManager.getInstance().isTestNet();
|
||||
tvWalletMnemonic.setTextIsSelectable(testnet);
|
||||
tvWalletSpendKey.setTextIsSelectable(testnet);
|
||||
|
||||
bAccept.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TxFragment extends Fragment {
|
|||
|
||||
static public final String ARG_INFO = "info";
|
||||
|
||||
private final SimpleDateFormat TS_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private final SimpleDateFormat TS_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
|
||||
|
||||
public TxFragment() {
|
||||
super();
|
||||
|
@ -146,10 +146,10 @@ public class TxFragment extends Fragment {
|
|||
sb.append(getString(R.string.tx_timestamp)).append(": ");
|
||||
sb.append(TS_FORMATTER.format(new Date(info.timestamp * 1000))).append("\n");
|
||||
sb.append(getString(R.string.tx_blockheight)).append(": ");
|
||||
if (info.isPending) {
|
||||
sb.append(getString(R.string.tx_pending)).append("\n");
|
||||
} else if (info.isFailed) {
|
||||
if (info.isFailed) {
|
||||
sb.append(getString(R.string.tx_failed)).append("\n");
|
||||
} else if (info.isPending) {
|
||||
sb.append(getString(R.string.tx_pending)).append("\n");
|
||||
} else {
|
||||
sb.append(info.blockheight).append("\n");
|
||||
}
|
||||
|
@ -196,10 +196,10 @@ public class TxFragment extends Fragment {
|
|||
tvTxId.setText(info.hash);
|
||||
tvTxKey.setText(info.txKey.isEmpty() ? "-" : info.txKey);
|
||||
tvTxPaymentId.setText(info.paymentId);
|
||||
if (info.isPending) {
|
||||
tvTxBlockheight.setText(getString(R.string.tx_pending));
|
||||
} else if (info.isFailed) {
|
||||
if (info.isFailed) {
|
||||
tvTxBlockheight.setText(getString(R.string.tx_failed));
|
||||
} else if (info.isPending) {
|
||||
tvTxBlockheight.setText(getString(R.string.tx_pending));
|
||||
} else {
|
||||
tvTxBlockheight.setText("" + info.blockheight);
|
||||
}
|
||||
|
|
|
@ -332,6 +332,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
if (wallet.isSynchronized()) {
|
||||
Log.d(TAG, "onRefreshed() synced");
|
||||
releaseWakeLock(); // the idea is to stay awake until synced
|
||||
if (!synced) {
|
||||
onProgress(null);
|
||||
|
|
|
@ -40,8 +40,7 @@ import java.util.TimeZone;
|
|||
public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfoAdapter.ViewHolder> {
|
||||
private static final String TAG = "TransactionInfoAdapter";
|
||||
|
||||
private final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
|
||||
private final SimpleDateFormat TIME_FORMATTER = new SimpleDateFormat("HH:mm:ss");
|
||||
private final SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
static final int TX_RED = Color.rgb(255, 79, 65);
|
||||
static final int TX_GREEN = Color.rgb(54, 176, 91);
|
||||
|
@ -60,8 +59,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
this.listener = listener;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
TimeZone tz = cal.getTimeZone(); //get the local time zone.
|
||||
DATE_FORMATTER.setTimeZone(tz);
|
||||
TIME_FORMATTER.setTimeZone(tz);
|
||||
DATETIME_FORMATTER.setTimeZone(tz);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,9 +91,9 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
public int compare(TransactionInfo o1, TransactionInfo o2) {
|
||||
long b1 = o1.timestamp;
|
||||
long b2 = o2.timestamp;
|
||||
if (b1>b2) {
|
||||
if (b1 > b2) {
|
||||
return -1;
|
||||
} else if (b1<b2) {
|
||||
} else if (b1 < b2) {
|
||||
return 1;
|
||||
} else {
|
||||
return o1.hash.compareTo(o2.hash);
|
||||
|
@ -113,8 +111,8 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
final TextView tvAmount;
|
||||
final TextView tvAmountPoint;
|
||||
final TextView tvAmountDecimal;
|
||||
final TextView tvDate;
|
||||
final TextView tvTime;
|
||||
final TextView tvPaymentId;
|
||||
final TextView tvDateTime;
|
||||
TransactionInfo infoItem;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
|
@ -123,16 +121,12 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
// I know this is stupid but can't be bothered to align decimals otherwise
|
||||
this.tvAmountPoint = (TextView) itemView.findViewById(R.id.tx_amount_point);
|
||||
this.tvAmountDecimal = (TextView) itemView.findViewById(R.id.tx_amount_decimal);
|
||||
this.tvDate = (TextView) itemView.findViewById(R.id.tx_date);
|
||||
this.tvTime = (TextView) itemView.findViewById(R.id.tx_time);
|
||||
this.tvPaymentId = (TextView) itemView.findViewById(R.id.tx_paymentid);
|
||||
this.tvDateTime = (TextView) itemView.findViewById(R.id.tx_datetime);
|
||||
}
|
||||
|
||||
private String getDate(long time) {
|
||||
return DATE_FORMATTER.format(new Date(time * 1000));
|
||||
}
|
||||
|
||||
private String getTime(long time) {
|
||||
return TIME_FORMATTER.format(new Date(time * 1000));
|
||||
private String getDateTime(long time) {
|
||||
return DATETIME_FORMATTER.format(new Date(time * 1000));
|
||||
}
|
||||
|
||||
private void setTxColour(int clr) {
|
||||
|
@ -146,6 +140,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
String displayAmount = Wallet.getDisplayAmount(infoItem.amount);
|
||||
// TODO fix this with i8n code but cryptonote::print_money always uses '.' for decimal point
|
||||
String amountParts[] = displayAmount.split("\\.");
|
||||
amountParts[1] = amountParts[1].substring(0,5);
|
||||
|
||||
this.tvAmount.setText(amountParts[0]);
|
||||
this.tvAmountDecimal.setText(amountParts[1]);
|
||||
|
@ -163,8 +158,8 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||
} else {
|
||||
setTxColour(TX_RED);
|
||||
}
|
||||
this.tvDate.setText(getDate(infoItem.timestamp));
|
||||
this.tvTime.setText(getTime(infoItem.timestamp));
|
||||
this.tvPaymentId.setText(infoItem.paymentId.equals("0000000000000000")?"":infoItem.paymentId);
|
||||
this.tvDateTime.setText(getDateTime(infoItem.timestamp));
|
||||
|
||||
itemView.setOnClickListener(this);
|
||||
}
|
||||
|
|
|
@ -157,43 +157,4 @@
|
|||
android:background="@color/colorPrimary"
|
||||
android:text="@string/generate_button_accept"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llFunctions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dip"
|
||||
android:background="@color/colorPrimary" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bBackup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:text="@string/generate_button_backup" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bExport"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:text="@string/generate_button_export" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bDelete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@color/colorAccent"
|
||||
android:text="@string/generate_button_delete" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:gravity="center"
|
||||
android:hint="@string/prompt_daemon"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:inputType="textWebEmailAddress|textNoSuggestions"
|
||||
android:maxLines="1"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="15sp"
|
||||
|
|
|
@ -233,6 +233,14 @@
|
|||
android:background="@color/colorPrimary"
|
||||
android:text="@string/send_send_hint" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/colorPrimary"
|
||||
android:text="@string/send_send_hint" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,96 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/card"
|
||||
android:layout_width="match_parent"
|
||||
app:cardBackgroundColor="@color/main_background"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="1dp">
|
||||
android:layout_margin="1sp"
|
||||
app:cardBackgroundColor="@color/main_background">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8sp"
|
||||
android:layout_marginTop="8sp"
|
||||
tools:layout_editor_absoluteX="0sp"
|
||||
tools:layout_editor_absoluteY="0sp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_amount"
|
||||
android:layout_width="60sp"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout_editor_absoluteY="0dp"
|
||||
tools:layout_editor_absoluteX="0dp">
|
||||
android:gravity="end"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:text="9999999"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_amount"
|
||||
android:gravity="end"
|
||||
android:layout_width="70sp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="99999999"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tx_amount_point"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:text="."
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tx_amount"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_amount_point"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="."
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tx_amount"
|
||||
android:layout_marginLeft="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tx_amount_decimal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="99999"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tx_amount_point"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_amount_decimal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="999999999999"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tx_amount_point"
|
||||
android:layout_marginLeft="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tx_paymentid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="8sp"
|
||||
android:textSize="13sp"
|
||||
android:text="0123456789abcdef"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tx_datetime"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_date"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="2017-05-22"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tx_time"
|
||||
android:layout_marginRight="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tx_datetime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="2017-05-22 21:32"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_time"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="21:32:11"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Loading..."
|
||||
android:textSize="16sp"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -95,6 +95,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4sp"
|
||||
android:textColor="@color/tx_pending"
|
||||
android:text="+"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
@ -103,6 +104,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="00000000.000000000000"
|
||||
android:textColor="@color/tx_pending"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -110,6 +112,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4sp"
|
||||
android:text="@string/label_unconfirmed_alance"
|
||||
android:textColor="@color/tx_pending"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
|
||||
<color name="tx_green">#36b05b</color>
|
||||
<color name="tx_red">#ff4f41</color>
|
||||
<color name="tx_pending">#FF4081</color>
|
||||
<color name="tx_pending">#4835b0</color>
|
||||
<color name="tx_failed">#d000ff</color>
|
||||
|
||||
<color name="moneroOrange">#fa6600</color>
|
||||
<color name="white">#ffffff</color>
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<string name="generate_password_hint">Wallet Password</string>
|
||||
<string name="generate_buttonGenerate">Make me a wallet already!</string>
|
||||
<string name="generate_seed">Mnemonic Seed</string>
|
||||
<string name="generate_button_accept">I have noted the above\nNow, I want to loose all my money!</string>
|
||||
<string name="generate_button_accept">I have noted the above</string>
|
||||
|
||||
<string name="generate_button_backup">Backup</string>
|
||||
<string name="generate_button_export">Export Keys</string>
|
||||
|
|
Loading…
Reference in New Issue