Fix spinner dropdown arrow not displaying in attendance summary (#207)

This commit is contained in:
Mikołaj Pich 2019-01-07 00:56:32 +01:00 committed by Rafał Borcz
parent b9ac592ea9
commit ea6a928cb4
4 changed files with 48 additions and 26 deletions

View File

@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.View.GONE
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.ViewGroup
import android.widget.ArrayAdapter
@ -101,7 +102,7 @@ class AttendanceSummaryFragment : BaseSessionFragment(), AttendanceSummaryView,
}
override fun showSubjects(show: Boolean) {
attendanceSummarySubjects.visibility = if (show) VISIBLE else VISIBLE
attendanceSummarySubjectsContainer.visibility = if (show) VISIBLE else INVISIBLE
}
override fun hideRefresh() {

View File

@ -2,22 +2,40 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:context=".ui.modules.attendance.summary.AttendanceSummaryFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/attendanceSummarySubjectsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
android:elevation="5dp"
android:padding="5dp"
android:visibility="invisible"
tools:listitem="@layout/item_attendance_summary"
tools:targetApi="lollipop"
tools:visibility="visible">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/attendanceSummarySubjects"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:background="?android:attr/windowBackground"
android:elevation="5dp"
android:padding="15dp"
android:ellipsize="middle"
android:entries="@array/endpoints_keys"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingEnd="30dp"
android:paddingRight="30dp"
android:paddingBottom="10dp"
android:spinnerMode="dialog" />
</LinearLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/attendanceSummarySwipe"
@ -27,7 +45,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/attendanceSummaryRecycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
tools:listitem="@layout/item_attendance_summary" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@ -21,16 +22,16 @@
android:layout_marginEnd="40dp"
android:layout_marginRight="40dp"
android:layout_weight="1"
android:text="@string/app_name"
android:textSize="17sp" />
android:textSize="17sp"
tools:text="January" />
<TextView
android:id="@+id/attendanceSummaryPercentage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="75%" />
</LinearLayout>
<LinearLayout
@ -60,8 +61,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="50" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -91,8 +92,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="0" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -122,8 +123,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="25" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -153,8 +154,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="0" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -184,8 +185,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -215,8 +216,8 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="0" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -246,7 +247,7 @@
android:layout_marginEnd="25dp"
android:layout_marginRight="25dp"
android:gravity="end"
android:text="@string/app_name"
android:textSize="12sp" />
android:textSize="12sp"
tools:text="0" />
</LinearLayout>
</LinearLayout>

View File

@ -10,5 +10,6 @@
android:paddingRight="16dp"
android:textAlignment="textStart"
android:paddingBottom="12dp"
android:ellipsize="end"
android:text="@string/app_name"
android:textSize="16sp" />