mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-11-16 23:04:56 +00:00
add tab description and download dialog bag button
This commit is contained in:
parent
28accff9ba
commit
003170e6d8
@ -359,6 +359,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
|
|||||||
toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp);
|
toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp);
|
||||||
toolbar.inflateMenu(R.menu.dialog_url);
|
toolbar.inflateMenu(R.menu.dialog_url);
|
||||||
toolbar.setNavigationOnClickListener(v -> getDialog().dismiss());
|
toolbar.setNavigationOnClickListener(v -> getDialog().dismiss());
|
||||||
|
toolbar.setNavigationContentDescription(R.string.cancel);
|
||||||
|
|
||||||
okButton = toolbar.findViewById(R.id.okay);
|
okButton = toolbar.findViewById(R.id.okay);
|
||||||
okButton.setEnabled(false);// disable until the download service connection is done
|
okButton.setEnabled(false);// disable until the download service connection is done
|
||||||
|
@ -159,6 +159,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||||||
|
|
||||||
viewPager.setOffscreenPageLimit(pagerAdapter.getCount());
|
viewPager.setOffscreenPageLimit(pagerAdapter.getCount());
|
||||||
updateTabsIcon();
|
updateTabsIcon();
|
||||||
|
updateTabsContentDescription();
|
||||||
updateCurrentTitle();
|
updateCurrentTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,6 +172,17 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateTabsContentDescription() {
|
||||||
|
for (int i = 0; i < tabsList.size(); i++) {
|
||||||
|
final TabLayout.Tab tabToSet = tabLayout.getTabAt(i);
|
||||||
|
if (tabToSet != null) {
|
||||||
|
final Tab t = tabsList.get(i);
|
||||||
|
tabToSet.setIcon(t.getTabIconRes(activity));
|
||||||
|
tabToSet.setContentDescription(t.getTabName(activity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateCurrentTitle() {
|
private void updateCurrentTitle() {
|
||||||
setTitle(tabsList.get(viewPager.getCurrentItem()).getTabName(requireContext()));
|
setTitle(tabsList.get(viewPager.getCurrentItem()).getTabName(requireContext()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user