]> git.ktnx.net Git - mobile-ledger.git/commitdiff
improved layout on multi-line account names
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 11:57:45 +0000 (11:57 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 11:57:45 +0000 (11:57 +0000)
app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java
app/src/main/res/layout/content_new_transaction.xml

index d2b3b476b7a39e230f92ec89027eeada1bef0d64..5ab1af08b2b5a913eaec9db095add5f84e550570 100644 (file)
@@ -18,6 +18,7 @@ import android.text.InputType;
 import android.text.TextWatcher;
 import android.util.Log;
 import android.util.TypedValue;
+import android.view.Gravity;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.MotionEvent;
@@ -252,7 +253,8 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
         acc.setWidth(0);
 
         final EditText amt = new EditText(this);
-        amt.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1f));
+        amt.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,
+                TableRow.LayoutParams.MATCH_PARENT, 1f));
         amt.setHint(R.string.new_transaction_amount_hint);
         amt.setWidth(0);
         amt.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL );
@@ -261,6 +263,7 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
 
         final TableRow row = new TableRow(this);
         row.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
+        row.setGravity(Gravity.BOTTOM);
         row.addView(acc);
         row.addView(amt);
         table.addView(row);
index 32756060f9209a6b7725b8879078c76f807abb46..429d1b081fd9d71c7793be20b050696a0fc99f16 100644 (file)
                         android:id="@+id/new_transaction_acc_1"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
+                        android:layout_gravity="bottom"
                         android:layout_weight="9"
                         android:width="0dp"
                         android:hint="@string/new_transaction_account_hint"
                         android:nextFocusDown="@id/new_transaction_amt_1"
                         android:nextFocusForward="@id/new_transaction_amt_1"
-                        android:textColorLink="@android:color/background_light" />
+                        android:text="This is a sample account name, deliberately long" />
 
                     <EditText
                         android:id="@+id/new_transaction_amt_1"
                         android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
+                        android:layout_height="match_parent"
+                        android:layout_gravity="bottom"
                         android:layout_weight="1"
                         android:width="0dp"
                         android:hint="@string/new_transaction_amount_hint"
@@ -94,6 +96,7 @@
                         android:id="@+id/new_transaction_acc_2"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
+                        android:layout_gravity="bottom"
                         android:layout_weight="9"
                         android:width="0dp"
                         android:hint="@string/new_transaction_account_hint"
                         android:id="@+id/new_transaction_amt_2"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_gravity="bottom"
                         android:layout_weight="1"
                         android:width="0dp"
                         android:hint="@string/new_transaction_amount_hint"