Browse Source

introduce schimmer effect for loading screen for activities and view bindings

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 năm trước cách đây
mục cha
commit
168c0d5483

+ 63 - 102
src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java

@@ -24,15 +24,10 @@
 
 package com.owncloud.android.ui.activity;
 
-import android.graphics.PorterDuff;
 import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ProgressBar;
-import android.widget.TextView;
 
 import com.google.android.material.snackbar.Snackbar;
 import com.nextcloud.client.account.User;
@@ -41,6 +36,7 @@ import com.nextcloud.client.jobs.NotificationWork;
 import com.nextcloud.client.network.ClientFactory;
 import com.nextcloud.java.util.Optional;
 import com.owncloud.android.R;
+import com.owncloud.android.databinding.NotificationsLayoutBinding;
 import com.owncloud.android.datamodel.ArbitraryDataProvider;
 import com.owncloud.android.lib.common.OwnCloudClient;
 import com.owncloud.android.lib.common.operations.RemoteOperation;
@@ -61,12 +57,6 @@ import javax.inject.Inject;
 
 import androidx.annotation.VisibleForTesting;
 import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
-import butterknife.BindString;
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.Unbinder;
 
 /**
  * Activity displaying all server side stored notification items.
@@ -75,33 +65,7 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
 
     private static final String TAG = NotificationsActivity.class.getSimpleName();
 
-    @BindView(R.id.empty_list_view)
-    public LinearLayout emptyContentContainer;
-
-    public SwipeRefreshLayout swipeListRefreshLayout;
-
-    public SwipeRefreshLayout swipeEmptyListRefreshLayout;
-
-    @BindView(R.id.empty_list_view_text)
-    public TextView emptyContentMessage;
-
-    @BindView(R.id.empty_list_view_headline)
-    public TextView emptyContentHeadline;
-
-    @BindView(R.id.empty_list_icon)
-    public ImageView emptyContentIcon;
-
-    @BindView(android.R.id.list)
-    public RecyclerView recyclerView;
-
-    @BindString(R.string.notifications_no_results_headline)
-    public String noResultsHeadline;
-
-    @BindString(R.string.notifications_no_results_message)
-    public String noResultsMessage;
-
-    private Unbinder unbinder;
-
+    private NotificationsLayoutBinding binding;
     private NotificationListAdapter adapter;
     private Snackbar snackbar;
     private OwnCloudClient client;
@@ -114,8 +78,8 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
         Log_OC.v(TAG, "onCreate() start");
         super.onCreate(savedInstanceState);
 
-        setContentView(R.layout.notifications_layout);
-        unbinder = ButterKnife.bind(this);
+        binding = NotificationsLayoutBinding.inflate(getLayoutInflater());
+        setContentView(binding.getRoot());
 
         optionalUser = getUser();
 
@@ -137,26 +101,27 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
 
         updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_item_notifications));
 
-        swipeEmptyListRefreshLayout = findViewById(R.id.swipe_containing_empty);
-        swipeListRefreshLayout = findViewById(R.id.swipe_containing_list);
-        ThemeUtils.colorSwipeRefreshLayout(this, swipeListRefreshLayout);
-        ThemeUtils.colorSwipeRefreshLayout(this, swipeEmptyListRefreshLayout);
+        ThemeUtils.colorSwipeRefreshLayout(this, binding.swipeContainingList);
+        ThemeUtils.colorSwipeRefreshLayout(this, binding.swipeContainingEmpty);
 
         // setup drawer
         setupDrawer(R.id.nav_notifications);
 
         if (!optionalUser.isPresent()) {
             // show error
-            runOnUiThread(() -> setEmptyContent(noResultsHeadline, getString(R.string.account_not_found)));
+            runOnUiThread(() -> setEmptyContent(
+                getString(R.string.notifications_no_results_headline),
+                getString(R.string.account_not_found))
+                         );
             return;
         }
 
-        swipeListRefreshLayout.setOnRefreshListener(() -> {
+        binding.swipeContainingList.setOnRefreshListener(() -> {
             setLoadingMessage();
             fetchAndSetData();
         });
 
-        swipeEmptyListRefreshLayout.setOnRefreshListener(() -> {
+        binding.swipeContainingEmpty.setOnRefreshListener(() -> {
             setLoadingMessage();
             fetchAndSetData();
         });
@@ -174,8 +139,9 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
             String pushUrl = getResources().getString(R.string.push_server_url);
 
             if (pushUrl.isEmpty()) {
-                snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_not_implemented,
-                        Snackbar.LENGTH_INDEFINITE);
+                snackbar = Snackbar.make(binding.emptyList.emptyListView,
+                                         R.string.push_notifications_not_implemented,
+                                         Snackbar.LENGTH_INDEFINITE);
             } else {
                 final ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
                 final String accountName = optionalUser.isPresent() ? optionalUser.get().getAccountName() : "";
@@ -183,14 +149,16 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
                                                                      UserAccountManager.ACCOUNT_USES_STANDARD_PASSWORD);
 
                 if (usesOldLogin) {
-                    snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_old_login,
-                            Snackbar.LENGTH_INDEFINITE);
+                    snackbar = Snackbar.make(binding.emptyList.emptyListView,
+                                             R.string.push_notifications_old_login,
+                                             Snackbar.LENGTH_INDEFINITE);
                 } else {
                     String pushValue = arbitraryDataProvider.getValue(accountName, PushUtils.KEY_PUSH);
 
                     if (pushValue == null || pushValue.isEmpty()) {
-                        snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_temp_error,
-                                Snackbar.LENGTH_INDEFINITE);
+                        snackbar = Snackbar.make(binding.emptyList.emptyListView,
+                                                 R.string.push_notifications_temp_error,
+                                                 Snackbar.LENGTH_INDEFINITE);
                     }
                 }
             }
@@ -217,21 +185,16 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
         setupPushWarning();
     }
 
-    public void onDestroy() {
-        super.onDestroy();
-        unbinder.unbind();
-    }
-
     /**
      * sets up the UI elements and loads all notification items.
      */
     private void setupContent() {
-        emptyContentIcon.setImageResource(R.drawable.ic_notification);
+        binding.emptyList.emptyListIcon.setImageResource(R.drawable.ic_notification);
         setLoadingMessage();
 
         LinearLayoutManager layoutManager = new LinearLayoutManager(this);
 
-        recyclerView.setLayoutManager(layoutManager);
+        binding.list.setLayoutManager(layoutManager);
 
         fetchAndSetData();
     }
@@ -239,14 +202,18 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
     @VisibleForTesting
     public void populateList(List<Notification> notifications) {
         adapter.setNotificationItems(notifications);
+        binding.loadingContent.setVisibility(View.GONE);
 
         if (notifications.size() > 0) {
-            swipeEmptyListRefreshLayout.setVisibility(View.GONE);
-            swipeListRefreshLayout.setVisibility(View.VISIBLE);
+            binding.swipeContainingEmpty.setVisibility(View.GONE);
+            binding.swipeContainingList.setVisibility(View.VISIBLE);
         } else {
-            setEmptyContent(noResultsHeadline, noResultsMessage);
-            swipeListRefreshLayout.setVisibility(View.GONE);
-            swipeEmptyListRefreshLayout.setVisibility(View.VISIBLE);
+            setEmptyContent(
+                getString(R.string.notifications_no_results_headline),
+                getString(R.string.notifications_no_results_message)
+                           );
+            binding.swipeContainingList.setVisibility(View.GONE);
+            binding.swipeContainingEmpty.setVisibility(View.VISIBLE);
         }
     }
 
@@ -263,7 +230,7 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
 
             if (adapter == null) {
                 adapter = new NotificationListAdapter(client, this);
-                recyclerView.setAdapter(adapter);
+                binding.list.setAdapter(adapter);
             }
 
             RemoteOperation getRemoteNotificationOperation = new GetNotificationsRemoteOperation();
@@ -276,7 +243,7 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
             } else {
                 Log_OC.d(TAG, result.getLogMessage());
                 // show error
-                runOnUiThread(() -> setEmptyContent(noResultsHeadline, result.getLogMessage()));
+                runOnUiThread(() -> setEmptyContent(getString(R.string.notifications_no_results_headline), result.getLogMessage()));
             }
 
             hideRefreshLayoutLoader();
@@ -287,8 +254,8 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
 
     private void hideRefreshLayoutLoader() {
         runOnUiThread(() -> {
-            swipeListRefreshLayout.setRefreshing(false);
-            swipeEmptyListRefreshLayout.setRefreshing(false);
+            binding.swipeContainingList.setRefreshing(false);
+            binding.swipeContainingEmpty.setRefreshing(false);
         });
     }
 
@@ -302,48 +269,40 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
     public boolean onOptionsItemSelected(MenuItem item) {
         boolean retval = true;
 
-        switch (item.getItemId()) {
-            case android.R.id.home:
-                if (isDrawerOpen()) {
-                    closeDrawer();
-                } else {
-                    openDrawer();
-                }
-                break;
-
-            case R.id.action_empty_notifications:
-                new DeleteAllNotificationsTask(client, this).execute();
-                break;
-
-            default:
-                retval = super.onOptionsItemSelected(item);
-                break;
+        int itemId = item.getItemId();
+        if (itemId == android.R.id.home) {
+            if (isDrawerOpen()) {
+                closeDrawer();
+            } else {
+                openDrawer();
+            }
+        } else if (itemId == R.id.action_empty_notifications) {
+            new DeleteAllNotificationsTask(client, this).execute();
+        } else {
+            retval = super.onOptionsItemSelected(item);
         }
 
         return retval;
     }
 
     private void setLoadingMessage() {
-        emptyContentHeadline.setText(R.string.notifications_loading_activity);
-        emptyContentMessage.setText("");
-        emptyContentIcon.setVisibility(View.GONE);
+        binding.swipeContainingEmpty.setVisibility(View.GONE);
     }
 
     @VisibleForTesting
     public void setEmptyContent(String headline, String message) {
-        if (emptyContentContainer != null && emptyContentMessage != null) {
-            emptyContentHeadline.setText(headline);
-            emptyContentMessage.setText(message);
-            emptyContentMessage.setVisibility(View.VISIBLE);
-            emptyContentIcon.setImageResource(R.drawable.ic_notification);
-            emptyContentIcon.setVisibility(View.VISIBLE);
-        }
+        binding.emptyList.emptyListViewHeadline.setText(headline);
+        binding.emptyList.emptyListViewText.setText(message);
+        binding.emptyList.emptyListIcon.setImageResource(R.drawable.ic_notification);
+
+        binding.loadingContent.setVisibility(View.GONE);
+        binding.emptyList.emptyListViewText.setVisibility(View.VISIBLE);
+        binding.emptyList.emptyListIcon.setVisibility(View.VISIBLE);
     }
 
     @Override
     protected void onResume() {
         super.onResume();
-
         setDrawerMenuItemChecked(R.id.nav_notifications);
     }
 
@@ -360,9 +319,10 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
         adapter.removeNotification(holder);
 
         if (adapter.getItemCount() == 0) {
-            setEmptyContent(noResultsHeadline, noResultsMessage);
-            swipeListRefreshLayout.setVisibility(View.GONE);
-            swipeEmptyListRefreshLayout.setVisibility(View.VISIBLE);
+            setEmptyContent(getString(R.string.notifications_no_results_headline), getString(R.string.notifications_no_results_message));
+            binding.swipeContainingList.setVisibility(View.GONE);
+            binding.loadingContent.setVisibility(View.GONE);
+            binding.swipeContainingEmpty.setVisibility(View.VISIBLE);
         }
     }
 
@@ -370,9 +330,10 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
     public void onRemovedAllNotifications(boolean isSuccess) {
         if (isSuccess) {
             adapter.removeAllNotifications();
-            setEmptyContent(noResultsHeadline, noResultsMessage);
-            swipeListRefreshLayout.setVisibility(View.GONE);
-            swipeEmptyListRefreshLayout.setVisibility(View.VISIBLE);
+            setEmptyContent(getString(R.string.notifications_no_results_headline), getString(R.string.notifications_no_results_message));
+            binding.loadingContent.setVisibility(View.GONE);
+            binding.swipeContainingList.setVisibility(View.GONE);
+            binding.swipeContainingEmpty.setVisibility(View.VISIBLE);
         } else {
             DisplayUtils.showSnackMessage(this, getString(R.string.clear_notifications_failed));
         }

+ 66 - 0
src/main/res/layout/activity_list_item_schimmer.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  Nextcloud Android client application
+
+  Copyright (C) 2020 Andy Scherzinger
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:padding="@dimen/standard_padding">
+
+    <com.elyeproj.loaderviewlibrary.LoaderImageView
+        android:id="@+id/activity_icon"
+        android:layout_width="@dimen/activity_icon_width"
+        android:layout_height="@dimen/activity_icon_height"
+        android:layout_alignParentTop="true"
+        android:contentDescription="@null"
+        app:corners="100" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_toEndOf="@id/activity_icon"
+        android:orientation="vertical"
+        android:paddingTop="2dp"
+        android:paddingStart="@dimen/activity_icon_layout_right_end_margin"
+        android:paddingEnd="@dimen/zero">
+
+        <com.elyeproj.loaderviewlibrary.LoaderTextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:textStyle="bold" />
+
+        <com.elyeproj.loaderviewlibrary.LoaderTextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp" />
+
+        <com.elyeproj.loaderviewlibrary.LoaderTextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp" />
+
+        <com.elyeproj.loaderviewlibrary.LoaderTextView
+            android:layout_width="120dp"
+            android:layout_height="wrap_content"
+            android:layout_gravity="end"
+            android:layout_marginTop="12dp" />
+
+    </LinearLayout>
+
+</RelativeLayout>

+ 5 - 176
src/main/res/layout/activity_list_layout.xml

@@ -73,183 +73,12 @@
                     android:layout_height="wrap_content"
                     android:layout_marginStart="@dimen/standard_list_item_size"
                     android:layout_marginTop="10dp"
-                    android:layout_marginBottom="40dp"/>
+                    android:layout_marginBottom="40dp" />
 
-                <RelativeLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:paddingRight="@dimen/standard_padding"
-                    android:paddingBottom="@dimen/standard_padding"
-                    android:paddingLeft="@dimen/standard_padding">
-
-                    <com.elyeproj.loaderviewlibrary.LoaderImageView
-                        android:id="@+id/activity_icon1"
-                        app:corners="100"
-                        android:layout_width="@dimen/activity_icon_width"
-                        android:layout_height="@dimen/activity_icon_height"
-                        android:layout_alignParentTop="true"
-                        android:layout_marginTop="@dimen/standard_margin"
-                        android:padding="2dp"
-                        android:contentDescription="@null" />
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:layout_toEndOf="@id/activity_icon1">
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:ellipsize="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"
-                            android:paddingTop="@dimen/standard_padding" />
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="120dp"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:layout_gravity="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                    </LinearLayout>
-
-                </RelativeLayout>
-
-                <RelativeLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:paddingRight="@dimen/standard_padding"
-                    android:paddingBottom="@dimen/standard_padding"
-                    android:paddingLeft="@dimen/standard_padding">
-
-                    <com.elyeproj.loaderviewlibrary.LoaderImageView
-                        android:id="@+id/activity_icon2"
-                        app:corners="100"
-                        android:layout_width="@dimen/activity_icon_width"
-                        android:layout_height="@dimen/activity_icon_height"
-                        android:layout_alignParentTop="true"
-                        android:layout_marginTop="@dimen/standard_margin"
-                        android:padding="2dp"
-                        android:contentDescription="@null" />
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:layout_toEndOf="@id/activity_icon2">
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:ellipsize="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"
-                            android:paddingTop="@dimen/standard_padding" />
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="120dp"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:layout_gravity="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                    </LinearLayout>
-
-                </RelativeLayout>
-
-                <RelativeLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:paddingRight="@dimen/standard_padding"
-                    android:paddingBottom="@dimen/standard_padding"
-                    android:paddingLeft="@dimen/standard_padding">
-
-                    <com.elyeproj.loaderviewlibrary.LoaderImageView
-                        android:id="@+id/activity_icon3"
-                        app:corners="100"
-                        android:layout_width="@dimen/activity_icon_width"
-                        android:layout_height="@dimen/activity_icon_height"
-                        android:layout_alignParentTop="true"
-                        android:layout_marginTop="@dimen/standard_margin"
-                        android:padding="2dp"
-                        android:contentDescription="@null" />
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:layout_toEndOf="@id/activity_icon3">
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:id="@+id/activity_subject"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:ellipsize="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"
-                            android:paddingTop="@dimen/standard_padding"
-                            android:textAppearance="?android:attr/textAppearanceListItem" />
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                        <com.elyeproj.loaderviewlibrary.LoaderTextView
-                            android:layout_width="120dp"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="4dp"
-                            android:layout_gravity="end"
-                            android:paddingEnd="@dimen/zero"
-                            android:paddingStart="@dimen/activity_icon_layout_right_end_margin"/>
-
-                    </LinearLayout>
-
-                </RelativeLayout>
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
 
             </LinearLayout>
         </FrameLayout>

+ 16 - 1
src/main/res/layout/notifications_layout.xml

@@ -39,6 +39,19 @@
             android:layout_below="@id/appbar"
             app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
+            <LinearLayout
+                android:id="@+id/loading_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
+                <include layout="@layout/activity_list_item_schimmer" />
+
+            </LinearLayout>
+
             <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
                 android:id="@+id/swipe_containing_list"
                 android:layout_width="match_parent"
@@ -69,7 +82,9 @@
                 android:footerDividersEnabled="false"
                 android:visibility="visible">
 
-                <include layout="@layout/empty_list"/>
+                <include
+                    android:id="@+id/empty_list"
+                    layout="@layout/empty_list"/>
             </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
 
         </FrameLayout>