remove unnecessary format and add landscape layout for detail activity
This commit is contained in:
@@ -767,24 +767,24 @@ public class MainNativeActivity extends AppCompatActivity {
|
|||||||
TextView tv = findViewById(v);
|
TextView tv = findViewById(v);
|
||||||
if (weatherId != null && weatherId.startsWith("5")){ // 5xx rain
|
if (weatherId != null && weatherId.startsWith("5")){ // 5xx rain
|
||||||
if (!gust.equals(""))
|
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,
|
name, dt, description, clouds,
|
||||||
temp, tempMin, tempMax, apparent,
|
temp, tempMin, tempMax, apparent,
|
||||||
humidity, pressure, speed, deg, gust,
|
humidity, pressure, speed, deg, gust,
|
||||||
sunrise, sunset), Html.FROM_HTML_MODE_COMPACT));
|
sunrise, sunset), Html.FROM_HTML_MODE_COMPACT));
|
||||||
else
|
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,
|
name, dt, description, clouds,
|
||||||
temp, tempMin, tempMax, apparent,
|
temp, tempMin, tempMax, apparent,
|
||||||
humidity, pressure, speed, deg,
|
humidity, pressure, speed, deg,
|
||||||
sunrise, sunset), Html.FROM_HTML_MODE_COMPACT));
|
sunrise, sunset), Html.FROM_HTML_MODE_COMPACT));
|
||||||
} else if (!gust.equals(""))
|
} 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,
|
name, dt, description, clouds,
|
||||||
temp, tempMin, tempMax, apparent,
|
temp, tempMin, tempMax, apparent,
|
||||||
humidity, pressure, speed, deg, gust,
|
humidity, pressure, speed, deg, gust,
|
||||||
sunrise, sunset), Html.FROM_HTML_MODE_COMPACT));
|
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,
|
name, dt, description, clouds,
|
||||||
temp, tempMin, tempMax, apparent,
|
temp, tempMin, tempMax, apparent,
|
||||||
humidity, pressure, speed, deg,
|
humidity, pressure, speed, deg,
|
||||||
|
|||||||
32
app/src/main/res/layout-land/activity_detail.xml
Normal file
32
app/src/main/res/layout-land/activity_detail.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".DetailActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:layout_editor_absoluteX="8dp"
|
||||||
|
tools:layout_editor_absoluteY="58dp">
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
|
android:id="@+id/chart1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="@dimen/widget_horizontal_margin"
|
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||||
|
android:layout_marginEnd="@dimen/widget_horizontal_margin"
|
||||||
|
android:layout_marginBottom="@dimen/activity_vertical_margin" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
@@ -5,13 +5,28 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".DetailActivity">
|
tools:context=".DetailActivity">
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
<LinearLayout
|
||||||
android:id="@+id/chart1"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/widget_horizontal_margin"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
tools:layout_editor_absoluteX="8dp"
|
||||||
android:layout_marginEnd="@dimen/widget_horizontal_margin"
|
tools:layout_editor_absoluteY="58dp">
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin" />
|
|
||||||
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
|
android:id="@+id/chart1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="@dimen/widget_horizontal_margin"
|
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||||
|
android:layout_marginEnd="@dimen/widget_horizontal_margin"
|
||||||
|
android:layout_marginBottom="@dimen/activity_vertical_margin" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user