From e1d2c576a9989b84518b60cf358aed90ac3ee8d4 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 22 Sep 2019 11:01:35 +0200 Subject: [PATCH 1/4] remove shasum for new android studio --- gradle/wrapper/gradle-wrapper.properties | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5084c008b..e2a99f5b5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,6 @@ -#Fri Mar 30 10:42:05 CEST 2018 +#Sun Sep 22 10:40:45 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists 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 From 28accff9ba1c61b2240ddb406cc819894e2883bf Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 22 Sep 2019 11:59:50 +0200 Subject: [PATCH 2/4] add content description for toggle service button --- .../java/org/schabi/newpipe/MainActivity.java | 16 ++++++++++++++-- app/src/main/res/layout-v21/drawer_header.xml | 1 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index a9f2e9622..b9b2e158a 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -73,6 +73,7 @@ public class MainActivity extends AppCompatActivity { private DrawerLayout drawer = null; private NavigationView drawerItems = null; private TextView headerServiceView = null; + private Button toggleServiceButton = null; private boolean servicesShown = false; private ImageView serviceArrow; @@ -266,8 +267,8 @@ public class MainActivity extends AppCompatActivity { serviceArrow = hView.findViewById(R.id.drawer_arrow); headerServiceView = hView.findViewById(R.id.drawer_header_service_view); - Button action = hView.findViewById(R.id.drawer_header_action_button); - action.setOnClickListener(view -> { + toggleServiceButton = hView.findViewById(R.id.drawer_header_action_button); + toggleServiceButton.setOnClickListener(view -> { toggleServices(); }); } @@ -279,6 +280,7 @@ public class MainActivity extends AppCompatActivity { drawerItems.getMenu().removeGroup(R.id.menu_tabs_group); drawerItems.getMenu().removeGroup(R.id.menu_options_about_group); + if(servicesShown) { showServices(); } else { @@ -364,6 +366,8 @@ public class MainActivity extends AppCompatActivity { String selectedServiceName = NewPipe.getService( ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName(); headerServiceView.setText(selectedServiceName); + toggleServiceButton.setContentDescription( + getString(R.string.drawer_header_description) + selectedServiceName); } catch (Exception 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) { try { if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]"); diff --git a/app/src/main/res/layout-v21/drawer_header.xml b/app/src/main/res/layout-v21/drawer_header.xml index 4474ee4ed..22e81883d 100644 --- a/app/src/main/res/layout-v21/drawer_header.xml +++ b/app/src/main/res/layout-v21/drawer_header.xml @@ -9,6 +9,7 @@ android:id="@+id/drawer_header_action_button" android:layout_width="match_parent" android:layout_height="match_parent" + android:contentDescription="@string/drawer_header_description" android:background="?android:attr/selectableItemBackground" /> K M B + Toggle service, currently selected: No subscribers From 003170e6d8648f930721f4b8cde54ea72f08fc17 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 22 Sep 2019 13:26:53 +0200 Subject: [PATCH 3/4] add tab description and download dialog bag button --- .../org/schabi/newpipe/download/DownloadDialog.java | 1 + .../org/schabi/newpipe/fragments/MainFragment.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java index f77daa092..9f9dce259 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -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.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); + toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false);// disable until the download service connection is done diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 5c5fd8635..7aeafb4a2 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -159,6 +159,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte viewPager.setOffscreenPageLimit(pagerAdapter.getCount()); updateTabsIcon(); + updateTabsContentDescription(); 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() { setTitle(tabsList.get(viewPager.getCurrentItem()).getTabName(requireContext())); } From 7e65648412cfbdff27743aa7db490364754ccb4f Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 22 Sep 2019 13:34:44 +0200 Subject: [PATCH 4/4] change video preview text --- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 7cbfdca92..71fc9f00d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -32,7 +32,7 @@ Video & Audio Bevorzugte Sprache des Inhalts Video-Vorschaubild - Video-Vorschaubild + Video abspielen, dauer Nutzerbild Gefällt nicht Gefällt diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 62b673edd..aa0bbc299 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -228,7 +228,7 @@ Details: Video preview thumbnail - Video preview thumbnail + Play video, duration: Uploader\'s avatar thumbnail Likes Dislikes