Skip to content
Open
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
7 changes: 7 additions & 0 deletions changelog/unreleased/4836
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Pull to refresh members and links

A pull to refresh has been added to the space members and links lists
in order to refresh the data and permissions with a simple gesture.

https://github.com/owncloud/android/issues/4773
https://github.com/owncloud/android/pull/4836
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ class SpaceMembersFragment : Fragment(), SpaceMembersAdapter.SpaceMembersAdapter

subscribeToViewModels()

binding.swipeRefreshMembers.setOnRefreshListener {
spaceMembersViewModel.getSpacePermissions()
spaceMembersViewModel.getSpaceMembers()
}

binding.addMemberButton.setOnClickListener {
spaceMembersViewModel.resetViewModel()
listener?.addMember(
Expand Down Expand Up @@ -263,11 +268,11 @@ class SpaceMembersFragment : Fragment(), SpaceMembersAdapter.SpaceMembersAdapter
showSpaceLinks()
}
}
binding.indeterminateProgressBar.isVisible = false
binding.swipeRefreshMembers.isRefreshing = false
}
}
}
is UIResult.Loading -> { binding.indeterminateProgressBar.isVisible = true }
is UIResult.Loading -> { binding.swipeRefreshMembers.isRefreshing = true }
is UIResult.Error -> {
requireActivity().finish()
Timber.e(uiResult.error, "Failed to retrieve space members for space: ${currentSpace.id} (${currentSpace.id})")
Expand Down
240 changes: 119 additions & 121 deletions owncloudApp/src/main/res/layout/members_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,155 +16,153 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout 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"
android:id="@+id/shareScroll"
android:id="@+id/swipe_refresh_members"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.spaces.members.SpaceMembersActivity">

<LinearLayout
android:id="@+id/members_section"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="match_parent">
Comment thread
jesmrec marked this conversation as resolved.

<LinearLayout
android:id="@+id/members_list_section"
android:id="@+id/members_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/members_list_section"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar_start_color">

<TextView
android:id="@+id/members_title"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:gravity="center"
android:text="@string/members_title"
android:layout_marginStart="@dimen/standard_half_margin"
android:textAllCaps="true"
android:textColor="@color/white"
android:textStyle="bold"
android:accessibilityHeading="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<ImageButton
android:id="@+id/add_member_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="@dimen/standard_padding"
android:background="@color/transparent"
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_member"
android:visibility="gone"
android:focusable="true"
android:clickable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"/>

</androidx.constraintlayout.widget.ConstraintLayout>

<ProgressBar
android:id="@+id/indeterminate_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone"/>
android:orientation="vertical">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar_start_color">

<TextView
android:id="@+id/members_title"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:gravity="center"
android:text="@string/members_title"
android:layout_marginStart="@dimen/standard_half_margin"
android:textAllCaps="true"
android:textColor="@color/white"
android:textStyle="bold"
android:accessibilityHeading="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<ImageButton
android:id="@+id/add_member_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="@dimen/standard_padding"
android:background="@color/transparent"
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_member"
android:visibility="gone"
android:focusable="true"
android:clickable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"/>

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/members_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"/>

</LinearLayout>

<LinearLayout
android:id="@+id/public_links_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar_start_color">
</LinearLayout>

<TextView
android:id="@+id/public_links_title"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:gravity="center"
android:text="@string/share_via_link_section_title"
android:layout_marginStart="@dimen/standard_half_margin"
android:textAllCaps="true"
android:textColor="@color/white"
android:textStyle="bold"
android:accessibilityHeading="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<ImageButton
android:id="@+id/add_public_link_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="@dimen/standard_padding"
android:background="@color/transparent"
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_public_link"
android:visibility="gone"
android:focusable="true"
android:clickable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"/>

</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/public_links_warning"
<LinearLayout
android:id="@+id/public_links_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/warning_background_color"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:paddingStart="@dimen/standard_half_padding"
android:paddingEnd="@dimen/standard_half_padding"
android:text="@string/share_warning_about_forwarding_space_public_links"
android:textColor="@color/warning_grey_text"
android:textSize="15sp" />
android:orientation="vertical">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar_start_color">

<TextView
android:id="@+id/public_links_title"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:gravity="center"
android:text="@string/share_via_link_section_title"
android:layout_marginStart="@dimen/standard_half_margin"
android:textAllCaps="true"
android:textColor="@color/white"
android:textStyle="bold"
android:accessibilityHeading="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<ImageButton
android:id="@+id/add_public_link_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="@dimen/standard_padding"
android:background="@color/transparent"
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_public_link"
android:visibility="gone"
android:focusable="true"
android:clickable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"/>

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/public_links_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" />
<TextView
android:id="@+id/public_links_warning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/warning_background_color"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:paddingStart="@dimen/standard_half_padding"
android:paddingEnd="@dimen/standard_half_padding"
android:text="@string/share_warning_about_forwarding_space_public_links"
android:textColor="@color/warning_grey_text"
android:textSize="15sp" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/public_links_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" />

<TextView
android:id="@+id/no_public_links_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:paddingStart="@dimen/standard_half_padding"
android:paddingEnd="@dimen/standard_half_padding"
android:text="@string/share_no_public_links"
android:textSize="15sp"
android:visibility="gone"/>
<TextView
android:id="@+id/no_public_links_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:paddingStart="@dimen/standard_half_padding"
android:paddingEnd="@dimen/standard_half_padding"
android:text="@string/share_no_public_links"
android:textSize="15sp"
android:visibility="gone"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>
</androidx.core.widget.NestedScrollView>

</androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
Loading