File tree 1 file changed +7
-0
lines changed
app/src/main/java/fr/free/nrw/commons/nearby
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 6
6
import android .support .v4 .app .Fragment ;
7
7
import android .support .v4 .app .FragmentManager ;
8
8
import android .support .v7 .app .AlertDialog ;
9
+ import android .support .v7 .widget .LinearLayoutManager ;
9
10
import android .support .v7 .widget .PopupMenu ;
11
+ import android .support .v7 .widget .RecyclerView ;
10
12
import android .view .LayoutInflater ;
11
13
import android .view .MenuItem ;
12
14
import android .view .View ;
@@ -112,6 +114,11 @@ protected void hookListeners(View view) {
112
114
closeLayout (buttonLayout );
113
115
} else {
114
116
openLayout (buttonLayout );
117
+ RecyclerView recyclerView = (RecyclerView ) view .getParent ();
118
+ int lastPosition = recyclerView .getAdapter ().getItemCount () - 1 ;
119
+ if (recyclerView .getChildLayoutPosition (view ) == lastPosition ) {
120
+ ((LinearLayoutManager ) recyclerView .getLayoutManager ()).scrollToPositionWithOffset (lastPosition , buttonLayout .getHeight ());
121
+ }
115
122
}
116
123
117
124
};
You can’t perform that action at this time.
0 commit comments