mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-25 01:20:34 +00:00
Merge pull request #2655 from TeamNewPipe/accessebility
Improve Accessebility for blind people
This commit is contained in:
commit
b4b24a4f70
@ -73,6 +73,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private DrawerLayout drawer = null;
|
private DrawerLayout drawer = null;
|
||||||
private NavigationView drawerItems = null;
|
private NavigationView drawerItems = null;
|
||||||
private TextView headerServiceView = null;
|
private TextView headerServiceView = null;
|
||||||
|
private Button toggleServiceButton = null;
|
||||||
|
|
||||||
private boolean servicesShown = false;
|
private boolean servicesShown = false;
|
||||||
private ImageView serviceArrow;
|
private ImageView serviceArrow;
|
||||||
@ -266,8 +267,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
serviceArrow = hView.findViewById(R.id.drawer_arrow);
|
serviceArrow = hView.findViewById(R.id.drawer_arrow);
|
||||||
headerServiceView = hView.findViewById(R.id.drawer_header_service_view);
|
headerServiceView = hView.findViewById(R.id.drawer_header_service_view);
|
||||||
Button action = hView.findViewById(R.id.drawer_header_action_button);
|
toggleServiceButton = hView.findViewById(R.id.drawer_header_action_button);
|
||||||
action.setOnClickListener(view -> {
|
toggleServiceButton.setOnClickListener(view -> {
|
||||||
toggleServices();
|
toggleServices();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -279,6 +280,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
drawerItems.getMenu().removeGroup(R.id.menu_tabs_group);
|
drawerItems.getMenu().removeGroup(R.id.menu_tabs_group);
|
||||||
drawerItems.getMenu().removeGroup(R.id.menu_options_about_group);
|
drawerItems.getMenu().removeGroup(R.id.menu_options_about_group);
|
||||||
|
|
||||||
|
|
||||||
if(servicesShown) {
|
if(servicesShown) {
|
||||||
showServices();
|
showServices();
|
||||||
} else {
|
} else {
|
||||||
@ -364,6 +366,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
String selectedServiceName = NewPipe.getService(
|
String selectedServiceName = NewPipe.getService(
|
||||||
ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName();
|
ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName();
|
||||||
headerServiceView.setText(selectedServiceName);
|
headerServiceView.setText(selectedServiceName);
|
||||||
|
toggleServiceButton.setContentDescription(
|
||||||
|
getString(R.string.drawer_header_description) + selectedServiceName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ErrorActivity.reportUiError(this, e);
|
ErrorActivity.reportUiError(this, e);
|
||||||
}
|
}
|
||||||
@ -557,6 +561,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateDrawerHeaderString(String content) {
|
||||||
|
NavigationView navigationView = findViewById(R.id.navigation);
|
||||||
|
View hView = navigationView.getHeaderView(0);
|
||||||
|
Button action = hView.findViewById(R.id.drawer_header_action_button);
|
||||||
|
|
||||||
|
action.setContentDescription(content);
|
||||||
|
}
|
||||||
|
|
||||||
private void handleIntent(Intent intent) {
|
private void handleIntent(Intent intent) {
|
||||||
try {
|
try {
|
||||||
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");
|
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");
|
||||||
|
@ -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()));
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
android:id="@+id/drawer_header_action_button"
|
android:id="@+id/drawer_header_action_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@string/drawer_header_description"
|
||||||
android:background="?android:attr/selectableItemBackground" />
|
android:background="?android:attr/selectableItemBackground" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<string name="settings_category_video_audio_title">Video & Audio</string>
|
<string name="settings_category_video_audio_title">Video & Audio</string>
|
||||||
<string name="content_language_title">Bevorzugte Sprache des Inhalts</string>
|
<string name="content_language_title">Bevorzugte Sprache des Inhalts</string>
|
||||||
<string name="list_thumbnail_view_description">Video-Vorschaubild</string>
|
<string name="list_thumbnail_view_description">Video-Vorschaubild</string>
|
||||||
<string name="detail_thumbnail_view_description">Video-Vorschaubild</string>
|
<string name="detail_thumbnail_view_description">Video abspielen, dauer</string>
|
||||||
<string name="detail_uploader_thumbnail_view_description">Nutzerbild</string>
|
<string name="detail_uploader_thumbnail_view_description">Nutzerbild</string>
|
||||||
<string name="detail_dislikes_img_view_description">Gefällt nicht</string>
|
<string name="detail_dislikes_img_view_description">Gefällt nicht</string>
|
||||||
<string name="detail_likes_img_view_description">Gefällt</string>
|
<string name="detail_likes_img_view_description">Gefällt</string>
|
||||||
|
@ -228,7 +228,7 @@
|
|||||||
<string name="error_details_headline">Details:</string>
|
<string name="error_details_headline">Details:</string>
|
||||||
<!-- Content descriptions (for better accessibility) -->
|
<!-- Content descriptions (for better accessibility) -->
|
||||||
<string name="list_thumbnail_view_description">Video preview thumbnail</string>
|
<string name="list_thumbnail_view_description">Video preview thumbnail</string>
|
||||||
<string name="detail_thumbnail_view_description">Video preview thumbnail</string>
|
<string name="detail_thumbnail_view_description">Play video, duration:</string>
|
||||||
<string name="detail_uploader_thumbnail_view_description">Uploader\'s avatar thumbnail</string>
|
<string name="detail_uploader_thumbnail_view_description">Uploader\'s avatar thumbnail</string>
|
||||||
<string name="detail_likes_img_view_description">Likes</string>
|
<string name="detail_likes_img_view_description">Likes</string>
|
||||||
<string name="detail_dislikes_img_view_description">Dislikes</string>
|
<string name="detail_dislikes_img_view_description">Dislikes</string>
|
||||||
@ -250,6 +250,7 @@
|
|||||||
<string name="short_thousand">K</string>
|
<string name="short_thousand">K</string>
|
||||||
<string name="short_million">M</string>
|
<string name="short_million">M</string>
|
||||||
<string name="short_billion">B</string>
|
<string name="short_billion">B</string>
|
||||||
|
<string name="drawer_header_description">Toggle service, currently selected:</string>
|
||||||
<!--Zero don't get selected (in some languages) as it is not a "special case" for android-->
|
<!--Zero don't get selected (in some languages) as it is not a "special case" for android-->
|
||||||
<string name="no_subscribers">No subscribers</string>
|
<string name="no_subscribers">No subscribers</string>
|
||||||
<plurals name="subscribers">
|
<plurals name="subscribers">
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,8 +1,6 @@
|
|||||||
#Fri Mar 30 10:42:05 CEST 2018
|
#Sun Sep 22 10:40:45 CEST 2019
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||||
distributionSha256Sum=9af7345c199f1731c187c96d3fe3d31f5405192a42046bafa71d846c3d9adacb
|
|
||||||
#distributionSha256Sum must be updated along with the version of gradle in distributionUrl
|
|
||||||
|
Loading…
Reference in New Issue
Block a user