diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | 10 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_stack.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 |
3 files changed, 30 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 01da756da..804bfb3e6 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -5,6 +5,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; @@ -41,6 +42,8 @@ public class StackFragment extends Fragment { SwipeRefreshLayout swipeRefreshLayout; @BindView(R.id.recycler_view) RecyclerView recyclerView; + @BindView(R.id.no_cards) + LinearLayout noCards; /** * @param boardId of the current stack @@ -76,7 +79,7 @@ public class StackFragment extends Fragment { initRecyclerView(); if (getActivity() != null) { - if (syncManager == null){ + if (syncManager == null) { syncManager = new SyncManager(getActivity()); initRecyclerView(); } @@ -111,7 +114,10 @@ public class StackFragment extends Fragment { syncManager.getStack(account.getId(), stackId).observe(StackFragment.this, (FullStack stack) -> { if (stack != null) { syncManager.getFullCardsForStack(account.getId(), stack.getLocalId()).observe(StackFragment.this, (List<FullCard> cards) -> { - if (cards != null) { + if (cards == null || cards.size() == 0) { + this.noCards.setVisibility(View.VISIBLE); + } else { + this.noCards.setVisibility(View.GONE); adapter.setCardList(cards); } }); diff --git a/app/src/main/res/layout/fragment_stack.xml b/app/src/main/res/layout/fragment_stack.xml index a3da20dd9..f64dfccff 100644 --- a/app/src/main/res/layout/fragment_stack.xml +++ b/app/src/main/res/layout/fragment_stack.xml @@ -1,7 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:orientation="vertical"> + + <LinearLayout + android:id="@+id/no_cards" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone"> + + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:textSize="20sp" + android:text="@string/no_cards" + + android:textAlignment="center" /> + </LinearLayout> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:id="@+id/swipe_refresh_layout" @@ -12,10 +29,10 @@ android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:scrollbars="vertical" + android:clipToPadding="false" android:paddingTop="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding" - android:clipToPadding="false" - android:scrollbarStyle="outsideOverlay" /> + android:scrollbarStyle="outsideOverlay" + android:scrollbars="vertical" /> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 676fbefb9..904571bac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -119,4 +119,5 @@ <string name="about_server_app_version_text">Server app version:</string> <string name="no_files_attached_to_this_card">There are no files attached to this card.</string> <string name="attachments">Attachments</string> + <string name="no_cards">No cards yet</string> </resources> |