import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.InputType;
+import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
// .setAction("Action", null).show();
}
+ public int dp2px(float dp) {
+ return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics()));
+ }
public void addTransactionAccountFromMenu(MenuItem item) {
final AutoCompleteTextView acc = new AutoCompleteTextView(this);
acc.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT, 9f));
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 );
- amt.setMinWidth(64);
+ amt.setMinWidth(dp2px(40));
amt.setTextAlignment(EditText.TEXT_ALIGNMENT_VIEW_END);
final TableRow row = new TableRow(this);
android:width="0dp"
android:hint="@string/new_transaction_amount_hint"
android:inputType="numberDecimal|numberSigned"
- android:minWidth="24pt"
+ android:minWidth="40dp"
android:nextFocusDown="@id/new_transaction_acc_2"
android:nextFocusForward="@id/new_transaction_acc_2"
android:textAlignment="viewEnd" />
android:width="0dp"
android:hint="@string/new_transaction_amount_hint"
android:inputType="numberDecimal|numberSigned"
- android:minWidth="24pt"
+ android:minWidth="40dp"
android:textAlignment="viewEnd" />
</TableRow>