raychenon/gray-sky-weather

View on GitHub
app/src/main/res/layout/forecast_weather_fragment.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <data>
        <import type="android.view.View"/>
        <import type="io.betterapps.graysky.data.coroutines.Status"/>
        <variable
            name="obsWeather"
            type="io.betterapps.graysky.data.binding.ObservableWeather" />
    </data>
<androidx.constraintlayout.widget.ConstraintLayout
    android:id="@+id/weather_forecast_constraintlayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/forecast_weather_location_textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/padding"
        android:text="City"
        android:textSize="22sp"
        android:textStyle="bold"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/forecast_weather_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        app:layout_constraintTop_toBottomOf="@id/forecast_weather_location_textview"
        app:layout_constraintLeft_toLeftOf="parent" />

    <TextView
        android:id="@+id/forecast_weather_error_textview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/errorBackground"
        android:textColor="@color/white"
        android:textSize="18sp"
        android:visibility="@{obsWeather.errorMsg == null ? View.GONE : View.VISIBLE}"
        android:text="@{obsWeather.errorMsg}"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

    <ProgressBar
        android:id="@+id/forecast_weather_progressbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="@{obsWeather.progressStatus}"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>