lots of GUI tweaks

This commit is contained in:
m2049r 2017-08-29 21:35:23 +02:00
parent 39d9c4d0c3
commit e39cd1c988
11 changed files with 103 additions and 149 deletions

View File

@ -65,6 +65,7 @@ public class GenerateReviewFragment extends Fragment {
boolean testnet = WalletManager.getInstance().isTestNet(); boolean testnet = WalletManager.getInstance().isTestNet();
tvWalletMnemonic.setTextIsSelectable(testnet); tvWalletMnemonic.setTextIsSelectable(testnet);
tvWalletSpendKey.setTextIsSelectable(testnet);
bAccept.setOnClickListener(new View.OnClickListener() { bAccept.setOnClickListener(new View.OnClickListener() {
@Override @Override

View File

@ -50,7 +50,7 @@ public class TxFragment extends Fragment {
static public final String ARG_INFO = "info"; 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() { public TxFragment() {
super(); super();
@ -146,10 +146,10 @@ public class TxFragment extends Fragment {
sb.append(getString(R.string.tx_timestamp)).append(": "); sb.append(getString(R.string.tx_timestamp)).append(": ");
sb.append(TS_FORMATTER.format(new Date(info.timestamp * 1000))).append("\n"); sb.append(TS_FORMATTER.format(new Date(info.timestamp * 1000))).append("\n");
sb.append(getString(R.string.tx_blockheight)).append(": "); sb.append(getString(R.string.tx_blockheight)).append(": ");
if (info.isPending) { if (info.isFailed) {
sb.append(getString(R.string.tx_pending)).append("\n");
} else if (info.isFailed) {
sb.append(getString(R.string.tx_failed)).append("\n"); sb.append(getString(R.string.tx_failed)).append("\n");
} else if (info.isPending) {
sb.append(getString(R.string.tx_pending)).append("\n");
} else { } else {
sb.append(info.blockheight).append("\n"); sb.append(info.blockheight).append("\n");
} }
@ -196,10 +196,10 @@ public class TxFragment extends Fragment {
tvTxId.setText(info.hash); tvTxId.setText(info.hash);
tvTxKey.setText(info.txKey.isEmpty() ? "-" : info.txKey); tvTxKey.setText(info.txKey.isEmpty() ? "-" : info.txKey);
tvTxPaymentId.setText(info.paymentId); tvTxPaymentId.setText(info.paymentId);
if (info.isPending) { if (info.isFailed) {
tvTxBlockheight.setText(getString(R.string.tx_pending));
} else if (info.isFailed) {
tvTxBlockheight.setText(getString(R.string.tx_failed)); tvTxBlockheight.setText(getString(R.string.tx_failed));
} else if (info.isPending) {
tvTxBlockheight.setText(getString(R.string.tx_pending));
} else { } else {
tvTxBlockheight.setText("" + info.blockheight); tvTxBlockheight.setText("" + info.blockheight);
} }

View File

@ -332,6 +332,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
final WalletFragment walletFragment = (WalletFragment) final WalletFragment walletFragment = (WalletFragment)
getFragmentManager().findFragmentById(R.id.fragment_container); getFragmentManager().findFragmentById(R.id.fragment_container);
if (wallet.isSynchronized()) { if (wallet.isSynchronized()) {
Log.d(TAG, "onRefreshed() synced");
releaseWakeLock(); // the idea is to stay awake until synced releaseWakeLock(); // the idea is to stay awake until synced
if (!synced) { if (!synced) {
onProgress(null); onProgress(null);

View File

@ -40,8 +40,7 @@ import java.util.TimeZone;
public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfoAdapter.ViewHolder> { public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfoAdapter.ViewHolder> {
private static final String TAG = "TransactionInfoAdapter"; private static final String TAG = "TransactionInfoAdapter";
private final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd"); private final SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private final SimpleDateFormat TIME_FORMATTER = new SimpleDateFormat("HH:mm:ss");
static final int TX_RED = Color.rgb(255, 79, 65); static final int TX_RED = Color.rgb(255, 79, 65);
static final int TX_GREEN = Color.rgb(54, 176, 91); static final int TX_GREEN = Color.rgb(54, 176, 91);
@ -60,8 +59,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
this.listener = listener; this.listener = listener;
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
TimeZone tz = cal.getTimeZone(); //get the local time zone. TimeZone tz = cal.getTimeZone(); //get the local time zone.
DATE_FORMATTER.setTimeZone(tz); DATETIME_FORMATTER.setTimeZone(tz);
TIME_FORMATTER.setTimeZone(tz);
} }
@Override @Override
@ -113,8 +111,8 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
final TextView tvAmount; final TextView tvAmount;
final TextView tvAmountPoint; final TextView tvAmountPoint;
final TextView tvAmountDecimal; final TextView tvAmountDecimal;
final TextView tvDate; final TextView tvPaymentId;
final TextView tvTime; final TextView tvDateTime;
TransactionInfo infoItem; TransactionInfo infoItem;
ViewHolder(View itemView) { 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 // 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.tvAmountPoint = (TextView) itemView.findViewById(R.id.tx_amount_point);
this.tvAmountDecimal = (TextView) itemView.findViewById(R.id.tx_amount_decimal); this.tvAmountDecimal = (TextView) itemView.findViewById(R.id.tx_amount_decimal);
this.tvDate = (TextView) itemView.findViewById(R.id.tx_date); this.tvPaymentId = (TextView) itemView.findViewById(R.id.tx_paymentid);
this.tvTime = (TextView) itemView.findViewById(R.id.tx_time); this.tvDateTime = (TextView) itemView.findViewById(R.id.tx_datetime);
} }
private String getDate(long time) { private String getDateTime(long time) {
return DATE_FORMATTER.format(new Date(time * 1000)); return DATETIME_FORMATTER.format(new Date(time * 1000));
}
private String getTime(long time) {
return TIME_FORMATTER.format(new Date(time * 1000));
} }
private void setTxColour(int clr) { private void setTxColour(int clr) {
@ -146,6 +140,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
String displayAmount = Wallet.getDisplayAmount(infoItem.amount); String displayAmount = Wallet.getDisplayAmount(infoItem.amount);
// TODO fix this with i8n code but cryptonote::print_money always uses '.' for decimal point // TODO fix this with i8n code but cryptonote::print_money always uses '.' for decimal point
String amountParts[] = displayAmount.split("\\."); String amountParts[] = displayAmount.split("\\.");
amountParts[1] = amountParts[1].substring(0,5);
this.tvAmount.setText(amountParts[0]); this.tvAmount.setText(amountParts[0]);
this.tvAmountDecimal.setText(amountParts[1]); this.tvAmountDecimal.setText(amountParts[1]);
@ -163,8 +158,8 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
} else { } else {
setTxColour(TX_RED); setTxColour(TX_RED);
} }
this.tvDate.setText(getDate(infoItem.timestamp)); this.tvPaymentId.setText(infoItem.paymentId.equals("0000000000000000")?"":infoItem.paymentId);
this.tvTime.setText(getTime(infoItem.timestamp)); this.tvDateTime.setText(getDateTime(infoItem.timestamp));
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
} }

View File

@ -157,43 +157,4 @@
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:text="@string/generate_button_accept" android:text="@string/generate_button_accept"
android:visibility="gone" /> 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> </LinearLayout>

View File

@ -30,7 +30,7 @@
android:gravity="center" android:gravity="center"
android:hint="@string/prompt_daemon" android:hint="@string/prompt_daemon"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="text" android:inputType="textWebEmailAddress|textNoSuggestions"
android:maxLines="1" android:maxLines="1"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="15sp" android:textSize="15sp"

View File

@ -233,6 +233,14 @@
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:text="@string/send_send_hint" /> 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>
</LinearLayout> </LinearLayout>

View File

@ -1,95 +1,79 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/card" android:id="@+id/card"
android:layout_width="match_parent" android:layout_width="match_parent"
app:cardBackgroundColor="@color/main_background"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="1dp"> android:layout_margin="1sp"
app:cardBackgroundColor="@color/main_background">
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:layout_editor_absoluteY="0dp" android:layout_marginBottom="8sp"
tools:layout_editor_absoluteX="0dp"> android:layout_marginTop="8sp"
tools:layout_editor_absoluteX="0sp"
tools:layout_editor_absoluteY="0sp">
<TextView <TextView
android:id="@+id/tx_amount" android:id="@+id/tx_amount"
android:gravity="end" android:layout_width="60sp"
android:layout_width="70sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="99999999" android:gravity="end"
android:textColor="@android:color/holo_red_light"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" android:text="9999999"
android:layout_marginLeft="8dp" android:textColor="@android:color/holo_red_light"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"/> app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tx_amount_point" android:id="@+id/tx_amount_point"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="."
android:textColor="@android:color/holo_red_light"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" 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_constraintLeft_toRightOf="@+id/tx_amount"
android:layout_marginLeft="0dp" app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"/>
<TextView <TextView
android:id="@+id/tx_amount_decimal" android:id="@+id/tx_amount_decimal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="999999999999" android:textSize="14sp"
android:text="99999"
android:textColor="@android:color/holo_red_light" android:textColor="@android:color/holo_red_light"
android:textSize="14sp" app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/tx_amount_point" app:layout_constraintLeft_toRightOf="@+id/tx_amount_point"
android:layout_marginLeft="0dp" app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"/>
<TextView <TextView
android:id="@+id/tx_date" android:id="@+id/tx_paymentid"
android:textColor="@android:color/black" 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_datetime"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="14sp"
android:text="2017-05-22" android:text="2017-05-22 21:32"
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_time"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:layout_width="wrap_content" app:layout_constraintBaseline_toBaselineOf="@+id/tx_amount"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="21:32:11"
app:layout_constraintRight_toLeftOf="parent" app:layout_constraintRight_toLeftOf="parent"
android:layout_marginRight="8dp" app:layout_constraintTop_toTopOf="parent" />
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>

View File

@ -18,7 +18,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Loading..." android:text="Loading..."
android:textSize="16sp" android:textSize="12sp"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -95,6 +95,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="4sp" android:layout_marginEnd="4sp"
android:textColor="@color/tx_pending"
android:text="+" android:text="+"
android:textSize="16sp" /> android:textSize="16sp" />
@ -103,6 +104,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="00000000.000000000000" android:text="00000000.000000000000"
android:textColor="@color/tx_pending"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <TextView
@ -110,6 +112,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="4sp" android:layout_marginStart="4sp"
android:text="@string/label_unconfirmed_alance" android:text="@string/label_unconfirmed_alance"
android:textColor="@color/tx_pending"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>

View File

@ -9,7 +9,8 @@
<color name="tx_green">#36b05b</color> <color name="tx_green">#36b05b</color>
<color name="tx_red">#ff4f41</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="moneroOrange">#fa6600</color>
<color name="white">#ffffff</color> <color name="white">#ffffff</color>

View File

@ -64,7 +64,7 @@
<string name="generate_password_hint">Wallet Password</string> <string name="generate_password_hint">Wallet Password</string>
<string name="generate_buttonGenerate">Make me a wallet already!</string> <string name="generate_buttonGenerate">Make me a wallet already!</string>
<string name="generate_seed">Mnemonic Seed</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_backup">Backup</string>
<string name="generate_button_export">Export Keys</string> <string name="generate_button_export">Export Keys</string>