import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.util.TypedValue;
+import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
TableLayout t = new TableLayout(this);
TableRow r = new TableRow(this);
r.setLayoutParams(new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+ r.setGravity(Gravity.CENTER_VERTICAL);
r.setPadding(getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin), dp2px(4), getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin), dp2px(4));
if (even)
r.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg, getTheme()));
TextView amt_tv = new TextView(this, null, R.style.account_summary_amounts);
amt_tv.setLayoutParams(new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1f));
amt_tv.setTextAlignment(EditText.TEXT_ALIGNMENT_VIEW_END);
+ amt_tv.setGravity(Gravity.CENTER);
amt_tv.setMinWidth(dp2px(40f));
StringBuilder amt_text = new StringBuilder();
try (Cursor cAmounts = db.rawQuery("SELECT currency, value FROM account_values WHERE account = ?", new String[]{acc_name})) {
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/table_row_even_bg"
+ android:gravity="center"
android:paddingStart="@dimen/activity_horizontal_margin"
android:paddingEnd="@dimen/activity_horizontal_margin">
<TextView
android:id="@+id/textView2"
style="@style/account_summary_amounts"
- android:text="123.45" />
+ android:text="123,45\n678,90" />
</TableRow>
</TableLayout>