Add scroll view to environment sensor fragment.

This commit is contained in:
Denis-Cosmin Nutiu 2020-11-28 23:03:53 +02:00
parent 18dd554dc4
commit 0a5a59fdb6

View file

@ -6,214 +6,220 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.sensors.SensorsFragment">
<androidx.cardview.widget.CardView
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent"
android:layout_height="match_parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
android:id="@+id/cardView" android:layout_margin="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" android:gravity="center">
<ImageView
android:layout_width="272dp"
android:layout_height="268dp" tools:src="@tools:sample/avatars"
android:id="@+id/sensorStatusImageView"
android:layout_marginEnd="70dp"
android:layout_marginStart="70dp"
android:contentDescription="@string/environment_status_description"
android:background="#00FFFFFF"
android:tooltipText="what is this amaaaizng"
android:layout_marginTop="90dp" app:srcCompat="@drawable/status_neutral"
tools:srcCompat="@drawable/status_neutral" android:adjustViewBounds="true"
android:scaleType="center"
/>
<com.google.android.material.chip.Chip
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sensorStatusChip"
android:layout_marginEnd="30dp" android:layout_marginStart="30dp" android:textAlignment="center"
tools:text="Sensor Status Explain" android:textStyle="bold" android:layout_marginTop="15dp"
android:layout_marginBottom="15dp" android:clickable="false"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:orientation="vertical"
android:layout_width="409dp"
android:layout_height="294dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/linearLayout"
app:layout_constraintTop_toBottomOf="@+id/cardView">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="195dp"
android:layout_height="wrap_content" android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cardView" android:layout_margin="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" android:gravity="center">
<ImageView
android:layout_width="272dp"
android:layout_height="268dp" tools:src="@tools:sample/avatars"
android:id="@+id/sensorStatusImageView"
android:layout_marginEnd="70dp"
android:layout_marginStart="70dp"
android:contentDescription="@string/environment_status_description"
android:background="#00FFFFFF"
android:tooltipText="what is this amaaaizng"
android:layout_marginTop="0dp" app:srcCompat="@drawable/status_neutral"
tools:srcCompat="@drawable/status_neutral" android:adjustViewBounds="true"
android:scaleType="center"
/>
<com.google.android.material.chip.Chip
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sensorStatusChip"
android:layout_marginEnd="30dp" android:layout_marginStart="30dp"
android:textAlignment="center"
tools:text="Sensor Status Explain" android:textStyle="bold" android:layout_marginTop="15dp"
android:layout_marginBottom="15dp" android:clickable="false"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:orientation="vertical"
android:layout_width="409dp"
android:layout_height="294dp"
android:id="@+id/linearLayout"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/thermometer"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorTempImg"
android:adjustViewBounds="false"
android:contentDescription="@string/temperature_icon_desc" android:cropToPadding="false"
android:scaleType="fitCenter"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="25dp"
>
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorTempText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="10000"
/>
<TextView
android:text="@string/temp_sensor_unit"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/envSensorTempUnitDesc"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:src="@drawable/humidity"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorHumidityImg"
android:adjustViewBounds="true"
android:contentDescription="@string/humidity_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="25dp"
<androidx.cardview.widget.CardView
android:layout_width="195dp"
android:layout_height="wrap_content" android:layout_margin="5dp"
>
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorHumidityText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="100.11"/>
<TextView
android:text="@string/humidity_sensor_unit"
android:layout_width="55dp"
android:layout_height="0dp" android:id="@+id/envSensorHumidityUnitDesc"
android:layout_weight="1" android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/thermometer"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorTempImg"
android:adjustViewBounds="false"
android:contentDescription="@string/temperature_icon_desc"
android:cropToPadding="false"
android:scaleType="fitCenter"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="25dp"
>
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorTempText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="10000"
/>
<TextView
android:text="@string/temp_sensor_unit"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/envSensorTempUnitDesc"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:src="@drawable/humidity"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorHumidityImg"
android:adjustViewBounds="true"
android:contentDescription="@string/humidity_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="25dp"
>
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorHumidityText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="100.11"/>
<TextView
android:text="@string/humidity_sensor_unit"
android:layout_width="55dp"
android:layout_height="0dp" android:id="@+id/envSensorHumidityUnitDesc"
android:layout_weight="1" android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.cardview.widget.CardView
android:layout_width="195dp"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/barometer"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorPresureImg"
android:contentDescription="@string/barometer_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginStart="29dp"
android:layout_marginTop="21dp" android:layout_marginBottom="25dp">
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorPressureText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="1000.5"
/>
<TextView
android:text="@string/pressure_unit_desc"
android:layout_height="wrap_content"
>
<androidx.cardview.widget.CardView
android:layout_width="195dp"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/envSensorPressureUnitDesc"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/poisoning"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorVocImg"
android:contentDescription="@string/voc_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginStart="29dp"
android:layout_marginTop="21dp" android:layout_marginBottom="25dp">
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorVocText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="100.11"
/>
<TextView
android:text="@string/gasvoc_sensor_unit_descriptio"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/barometer"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorPresureImg"
android:contentDescription="@string/barometer_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginStart="29dp"
android:layout_marginTop="21dp" android:layout_marginBottom="25dp">
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorPressureText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="1000.5"
/>
<TextView
android:text="@string/pressure_unit_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/envSensorPressureUnitDesc"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_margin="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/textView5"
android:gravity="center"/>
</LinearLayout>
android:layout_height="match_parent">
<ImageView
android:src="@drawable/poisoning"
android:layout_width="55dp"
android:layout_height="52dp" android:id="@+id/envSensorVocImg"
android:contentDescription="@string/voc_icon_desc"
android:layout_marginStart="29dp"
android:layout_marginTop="21dp"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginStart="29dp"
android:layout_marginTop="21dp" android:layout_marginBottom="25dp">
<TextView
android:layout_width="55dp"
android:layout_height="26dp" android:id="@+id/envSensorVocText"
android:gravity="center" android:foregroundGravity="center"
android:backgroundTint="#00FFFEFE"
android:clickable="false" android:drawableTint="#00FFFFFF"
android:textStyle="bold" android:textColor="#000000"
android:textSize="16sp"
tools:text="100.11"
/>
<TextView
android:text="@string/gasvoc_sensor_unit_descriptio"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/textView5"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>