Review fixes
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 17 Dec 2020 17:05:28 +0000 (18:05 +0100)
committerPiotr Czaja <p.czaja@samsung.com>
Tue, 14 Sep 2021 11:01:34 +0000 (13:01 +0200)
Fitness/Controls/BindableRecyclerView.cs

index 9962afc..108ac71 100644 (file)
@@ -23,13 +23,13 @@ namespace Fitness.Controls
         /// SelectedItem property
         /// </summary>
         public static readonly BindableProperty SelectedItemProperty =
-            BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(BindableRecyclerView), null, propertyChanged: OnSelectedItemChanged);
+            BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(BindableRecyclerView), null, propertyChanged: OnSelectionChanged);
 
         /// <summary>
         /// SelectionMode property
         /// </summary>
         public static readonly BindableProperty SelectionModeProperty =
-            BindableProperty.Create(nameof(SelectionMode), typeof(RecyclerViewSelectionMode), typeof(BindableRecyclerView), RecyclerViewSelectionMode.None, propertyChanged: OnSelectionModeChanged);
+            BindableProperty.Create(nameof(SelectionMode), typeof(RecyclerViewSelectionMode), typeof(BindableRecyclerView), RecyclerViewSelectionMode.None, propertyChanged: OnSelectionChanged);
 
         private TapGestureDetector detector;
 
@@ -106,18 +106,9 @@ namespace Fitness.Controls
             }
         }
 
-        public static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue)
+        public static void OnSelectionChanged(BindableObject bindable, object oldValue, object newValue)
         {
-            var recycler = bindable as BindableRecyclerView;
-            if (recycler != null)
-            {
-                recycler.EvaluateSelection();
-            }
-        }
-
-        public static void OnSelectionModeChanged(BindableObject bindable, object oldValue, object newValue)
-        {
-            if (bindable is BindableRecyclerView recycler && newValue is RecyclerViewSelectionMode mode)
+            if (bindable is BindableRecyclerView recycler)
             {
                 recycler.EvaluateSelection();
             }