From d754f67c7722a686100c119c9bbb302f4216c02a Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Thu, 28 Mar 2019 22:06:11 +0100 Subject: [PATCH] remove unnecessary format and add landscape layout for detail activity --- .../MainNativeActivity.java | 8 ++--- .../main/res/layout-land/activity_detail.xml | 32 +++++++++++++++++++ app/src/main/res/layout/activity_detail.xml | 27 ++++++++++++---- 3 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 app/src/main/res/layout-land/activity_detail.xml diff --git a/app/src/main/java/de/weseng/wifiweatherstation/MainNativeActivity.java b/app/src/main/java/de/weseng/wifiweatherstation/MainNativeActivity.java index ec11d8f..8ff4106 100644 --- a/app/src/main/java/de/weseng/wifiweatherstation/MainNativeActivity.java +++ b/app/src/main/java/de/weseng/wifiweatherstation/MainNativeActivity.java @@ -767,24 +767,24 @@ public class MainNativeActivity extends AppCompatActivity { TextView tv = findViewById(v); if (weatherId != null && weatherId.startsWith("5")){ // 5xx rain if (!gust.equals("")) - tv.setText(Html.fromHtml(String.format(getString(R.string.weather_outdoor_rain_and_gust), + tv.setText(Html.fromHtml(getString(R.string.weather_outdoor_rain_and_gust, name, dt, description, clouds, temp, tempMin, tempMax, apparent, humidity, pressure, speed, deg, gust, sunrise, sunset), Html.FROM_HTML_MODE_COMPACT)); else - tv.setText(Html.fromHtml(String.format(getString(R.string.weather_outdoor_rain), + tv.setText(Html.fromHtml(getString(R.string.weather_outdoor_rain, name, dt, description, clouds, temp, tempMin, tempMax, apparent, humidity, pressure, speed, deg, sunrise, sunset), Html.FROM_HTML_MODE_COMPACT)); } else if (!gust.equals("")) - tv.setText(Html.fromHtml(String.format(getString(R.string.weather_outdoor_gust), + tv.setText(Html.fromHtml(getString(R.string.weather_outdoor_gust, name, dt, description, clouds, temp, tempMin, tempMax, apparent, humidity, pressure, speed, deg, gust, sunrise, sunset), Html.FROM_HTML_MODE_COMPACT)); - else tv.setText(Html.fromHtml(String.format(getString(R.string.weather_outdoor), + else tv.setText(Html.fromHtml(getString(R.string.weather_outdoor, name, dt, description, clouds, temp, tempMin, tempMax, apparent, humidity, pressure, speed, deg, diff --git a/app/src/main/res/layout-land/activity_detail.xml b/app/src/main/res/layout-land/activity_detail.xml new file mode 100644 index 0000000..f9219c3 --- /dev/null +++ b/app/src/main/res/layout-land/activity_detail.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_detail.xml b/app/src/main/res/layout/activity_detail.xml index 25b2c83..d7e6dad 100644 --- a/app/src/main/res/layout/activity_detail.xml +++ b/app/src/main/res/layout/activity_detail.xml @@ -5,13 +5,28 @@ android:layout_height="match_parent" tools:context=".DetailActivity"> - + android:orientation="vertical" + tools:layout_editor_absoluteX="8dp" + tools:layout_editor_absoluteY="58dp"> + + + + + + \ No newline at end of file