Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f9d6103 authored by Amit Kumar's avatar Amit Kumar
Browse files

Constrain space for city name in weather widget

parent a73ed891
Loading
Loading
Loading
Loading
Loading
+88 −88
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:clipChildren="true"
@@ -16,20 +16,20 @@
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="8dp"
            android:layout_toStartOf="@+id/weather_setting_imageview"
            android:padding="8dp"
            android:text="@string/weather"
            android:textAllCaps="true"
            android:textColor="#88FFFFFF"
            android:textSize="16sp"/>
        <ImageView
            android:id="@+id/weather_setting_imageview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:padding="8dp"
            android:contentDescription="@string/weather_setting"
            android:padding="8dp"
            android:src="@drawable/ic_settings_white_24dp"
            android:id="@+id/weather_setting_imageview"
        />
    </RelativeLayout>
    <FrameLayout
@@ -42,14 +42,24 @@
            android:layout_height="120dp"
            android:layout_gravity="center"
            android:gravity="center"
            android:textSize="16sp"
            android:text="@string/weather_tap_to_setup"
            android:textColor="@color/transparent_white"/>
        <RelativeLayout
            android:textColor="@color/transparent_white"
            android:textSize="16sp"
            android:visibility="gone"/>
        <LinearLayout
            android:id="@+id/weather_panel"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">
            android:orientation="vertical"
            android:visibility="visible">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="16dp">

                <ImageView
                    android:id="@+id/weather_image"
@@ -57,66 +67,62 @@
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                android:layout_marginBottom="8dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="16dp"
                    android:layout_centerVertical="true"
                    android:contentDescription="@string/weather_condition_image"
                    android:src="@drawable/weather_color_32"/>
            <GridLayout
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="32dp"
                android:layout_marginTop="16dp"
                android:layout_toEndOf="@id/weather_image"
                android:columnCount="2"
                android:rowCount="3">
                    android:layout_centerVertical="true"
                    android:layout_marginEnd="8dp"
                    android:layout_marginStart="16dp"
                    android:layout_toEndOf="@+id/weather_image"
                    android:layout_toStartOf="@+id/weather_temperature_linearlayout"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/weather_city"
                    android:layout_column="0"
                    android:layout_columnSpan="1"
                    android:layout_columnWeight="3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                    android:layout_row="0"
                    android:layout_rowSpan="1"
                        android:layout_marginEnd="8dp"
                        android:ellipsize="end"
                        android:fontFamily="sans-serif-medium"
                        android:maxLines="2"
                        android:textColor="@color/white"
                    android:textSize="18sp"/>
                        android:textSize="18sp"
                        tools:text="Chhatarpur, New Delhi, India"/>

                    <TextView
                        android:id="@+id/weather_condition"
                    android:layout_column="0"
                    android:layout_columnSpan="1"
                    android:layout_columnWeight="3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                    android:layout_row="1"
                    android:layout_rowSpan="1"
                        android:textColor="@color/transparent_white"
                    android:textSize="16sp"/>
                        android:textSize="16sp"
                        tools:text="Fair"/>

                    <TextView
                        android:id="@+id/weather_chance_rain"
                    android:layout_column="0"
                    android:layout_columnSpan="1"
                    android:layout_columnWeight="3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                    android:layout_row="2"
                    android:layout_rowSpan="1"
                        android:textColor="@color/transparent_white"
                    android:textSize="14sp"/>

                        android:textSize="14sp"
                        tools:text="40%, 11kpH SW"/>
                </LinearLayout>
                <LinearLayout
                    android:id="@+id/weather_temperature_linearlayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_centerVertical="true"
                    android:orientation="vertical">
                    <TextView
                        android:id="@+id/weather_current_temperature"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                    android:layout_column="1"
                    android:layout_columnSpan="1"
                    android:layout_columnWeight="1"
                        android:layout_gravity="end"
                    android:layout_row="0"
                    android:layout_rowSpan="2"
                        android:fontFamily="sans-serif-light"
                        android:gravity="end"
                        android:text="@string/dummy_weather_temp"
@@ -127,27 +133,21 @@
                        android:id="@+id/weather_low_high"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                    android:layout_column="1"
                    android:layout_columnSpan="1"
                    android:layout_columnWeight="1"
                    android:layout_row="2"
                    android:layout_rowSpan="1"
                        android:gravity="end"
                        android:text="@string/dummy_weather_temp_min_max"
                        android:textColor="@color/white"/>
            </GridLayout>
                </LinearLayout>
            </RelativeLayout>

            <HorizontalScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/weather_image"
                android:layout_centerHorizontal="true"
                android:fadingEdgeLength="12dp"
                android:requiresFadingEdge="horizontal"
                android:layout_marginBottom="8dp"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:fadingEdgeLength="12dp"
                android:requiresFadingEdge="horizontal"
                android:scrollbars="none">

                <LinearLayout
@@ -158,6 +158,6 @@
                    android:orientation="horizontal"/>
            </HorizontalScrollView>

        </RelativeLayout>
        </LinearLayout>
    </FrameLayout>
</LinearLayout>
 No newline at end of file