mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Scroll to selected position on tab switcher display
This commit is contained in:
parent
86e62ea7ca
commit
574f68e81a
@ -455,6 +455,9 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
backToTopButton.hide();
|
||||
tabSwitcherRoot.setVisibility(View.VISIBLE);
|
||||
supportInvalidateOptionsMenu();
|
||||
if (tabsAdapter.getSelected() < webViewList.size()) {
|
||||
tabRecyclerView.getLayoutManager().scrollToPosition(tabsAdapter.getSelected());
|
||||
}
|
||||
}
|
||||
|
||||
private void hideTabSwitcher() {
|
||||
@ -1365,8 +1368,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
break;
|
||||
case REQUEST_PREFERENCES:
|
||||
if (resultCode == RESULT_RESTART) {
|
||||
finish();
|
||||
startActivity(new Intent(MainActivity.this, MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
if (resultCode == RESULT_HISTORY_CLEARED) {
|
||||
webViewList.clear();
|
||||
|
@ -128,6 +128,10 @@ public class TabsAdapter extends RecyclerView.Adapter<TabsAdapter.ViewHolder> {
|
||||
return webViews.size();
|
||||
}
|
||||
|
||||
int getSelected() {
|
||||
return selectedPosition;
|
||||
}
|
||||
|
||||
public void setSelected(int position) {
|
||||
this.selectedPosition = position;
|
||||
}
|
||||
|
@ -124,6 +124,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:background="?attr/drawerBackground"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/drawer_right" />
|
||||
</android.support.v4.widget.DrawerLayout>
|
@ -3,8 +3,6 @@
|
||||
android:id="@+id/right_drawer_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/drawerBackground"
|
||||
android:clickable="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical" />
|
||||
android:focusable="true" />
|
Loading…
x
Reference in New Issue
Block a user