Kiwix-android: Undo in tab switcher not working

Created on 9 Mar 2020  路  5Comments  路  Source: kiwix/kiwix-android

Describe the bug
The UNDO option is not clickable when you are in tab switcher mode.

Expected behavior
The UNDO option should work as expected.

Steps to reproduce the behavior:

  1. Go to tab switcher mode.
  2. Close a tab.
  3. Try to undo by clicking the UNDO option in snackbar. It is not clickable.

Environment

  • Version of Kiwix Android : 3.2.1
  • Device : Redmi 4
  • OS version : Nougat

Most helpful comment

Yes @abdulwd
I found the solution
In CoreMainActivity.closeTab wrong View was passed to the Snackbar.make()
We need to pass tabSwitcherRoot instead of snackbarRoot.
Along with this from #1872

This can be solved by calling tabsAdapter.notifyDataSetChanged();
under the snackbar.setAction() for Undo after the tabsAdapter.notifyItemInserted(index);
in the CoreMainActivity.closeTab

All 5 comments

Hey! @sonusourav
You've correctly pointed out the issue.

~So this is a won't fix issue.~

Not a won't fix. This used to work we just need some workaround to get this working.

Yes @abdulwd
I found the solution
In CoreMainActivity.closeTab wrong View was passed to the Snackbar.make()
We need to pass tabSwitcherRoot instead of snackbarRoot.
Along with this from #1872

This can be solved by calling tabsAdapter.notifyDataSetChanged();
under the snackbar.setAction() for Undo after the tabsAdapter.notifyItemInserted(index);
in the CoreMainActivity.closeTab

@sonusourav has this been fixed?

Yeah by #1879

Was this page helpful?
0 / 5 - 0 ratings