From: Damyan Ivanov Date: Sun, 9 Dec 2018 11:57:45 +0000 (+0000) Subject: improved layout on multi-line account names X-Git-Tag: v0.3~278 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7ec1c4772ff88e23ed826cc19c5a9a32e35ddf7e;p=mobile-ledger.git improved layout on multi-line account names --- diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index d2b3b476..5ab1af08 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -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); diff --git a/app/src/main/res/layout/content_new_transaction.xml b/app/src/main/res/layout/content_new_transaction.xml index 32756060..429d1b08 100644 --- a/app/src/main/res/layout/content_new_transaction.xml +++ b/app/src/main/res/layout/content_new_transaction.xml @@ -65,17 +65,19 @@ 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" />