Merge "Talkback properly says top of the hour times - DO NOT MERGE" into ub-deskclock-fantasy
diff --git a/src/com/android/deskclock/AlarmClockFragment.java b/src/com/android/deskclock/AlarmClockFragment.java
index 63ef052..c3999db 100644
--- a/src/com/android/deskclock/AlarmClockFragment.java
+++ b/src/com/android/deskclock/AlarmClockFragment.java
@@ -96,7 +96,9 @@
     private AlarmTimeClickHandler mAlarmTimeClickHandler;
     private LinearLayoutManager mLayoutManager;
 
-    /** The public no-arg constructor required by all fragments. */
+    /**
+     * The public no-arg constructor required by all fragments.
+     */
     public AlarmClockFragment() {
         super(ALARMS);
     }
@@ -151,6 +153,11 @@
                         }
                         // Record the freshly expanded alarm.
                         mExpandedAlarmId = holder.itemId;
+                        final RecyclerView.ViewHolder viewHolder =
+                                mRecyclerView.findViewHolderForItemId(mExpandedAlarmId);
+                        if (viewHolder != null) {
+                            smoothScrollTo(viewHolder.getAdapterPosition());
+                        }
                     }
                 } else if (mExpandedAlarmId == holder.itemId) {
                     // The expanded alarm is now collapsed so update the tracking id.
@@ -217,7 +224,7 @@
 
     @Override
     public void smoothScrollTo(int position) {
-        mLayoutManager.scrollToPositionWithOffset(position, 20);
+        mLayoutManager.scrollToPositionWithOffset(position, 0);
     }
 
     @Override
@@ -276,7 +283,7 @@
      * Updates the adapters items, deferring the update until the current animation is finished or
      * if no animation is running then the listener will be automatically be invoked immediately.
      *
-     * @param items the new list of {@link AlarmItemHolder} to use
+     * @param items       the new list of {@link AlarmItemHolder} to use
      * @param updateToken a monotonically increasing value used to preserve ordering of deferred
      *                    updates
      */
diff --git a/src/com/android/deskclock/alarms/ScrollHandler.java b/src/com/android/deskclock/alarms/ScrollHandler.java
index 9ac00a5..168bed9 100644
--- a/src/com/android/deskclock/alarms/ScrollHandler.java
+++ b/src/com/android/deskclock/alarms/ScrollHandler.java
@@ -30,4 +30,4 @@
      * Perform smooth scroll to position.
      */
     void smoothScrollTo(int position);
-}
+}
\ No newline at end of file