Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teams: smoother surveys search (fixes #5373) #5434

Merged
merged 4 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2358
versionName "0.23.58"
versionCode 2359
versionName "0.23.59"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.text.Editable
import android.text.TextWatcher
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.EditText
import android.widget.RadioButton
import android.widget.RadioGroup
Expand Down Expand Up @@ -84,6 +85,10 @@ class SurveyFragment : BaseRecyclerFragment<RealmStepExam?>(), SurveyAdoptListen

private fun initializeViews(view: View) {
spn = view.findViewById(R.id.spn_sort)
val adapter = ArrayAdapter.createFromResource(
requireContext(), R.array.sort_by_date, R.layout.spinner_text)
adapter.setDropDownViewResource(R.layout.spinner_text)
spn.adapter = adapter
etSearch = requireView().findViewById(R.id.et_search)
addNewSurvey = view.findViewById(R.id.fab_add_new_survey)
rbTeamSurvey = view.findViewById(R.id.rbTeamSurvey)
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/res/layout/fragment_survey.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/secondary_bg">
android:background="@color/secondary_bg"
android:weightSum="1">

<org.ole.planet.myplanet.utilities.CustomSpinner
android:id="@+id/spn_sort"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:entries="@array/sort_by_date"
android:padding="@dimen/padding_normal"
android:popupBackground="@color/secondary_bg"
android:backgroundTint="@color/daynight_textColor"
android:theme="@style/SpinnerItemStyle" />
android:theme="@style/SpinnerItemStyle"
android:spinnerMode="dialog"
android:layout_weight="0.6"/>
<include
layout="@layout/layout_search"
android:layout_width="0dp"
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/spinner_text.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="17sp"
android:maxLines="2"
android:ellipsize="none"
android:breakStrategy="simple"
android:textColor= "@color/daynight_textColor"/>
Loading