From 53b9ffcbc8f42caa459028069ab019cabe909ebf Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 15 Dec 2015 14:25:04 +0100 Subject: [PATCH 1/3] Translated using Weblate (Russian) Currently translated at 100.0% (47 of 47 strings) --- app/src/main/res/values-ru/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 0a18ca09a..798c4f09b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -43,4 +43,13 @@ Похожие видео Показывать следующее и предложенные видео Предпочитаемый язык контента +ВИДЕО И АУДИО + ИНФОРМАЦИЯ + ПРОЧЕЕ + + Миниатюра видео-превью + Миниатюра видео-превью + Миниатюра аватара пользователся + Дислайки + Лайки From 63b16d925d55a99e680b92c6742464cbb62f344c Mon Sep 17 00:00:00 2001 From: M2ck Date: Tue, 15 Dec 2015 11:36:18 +0100 Subject: [PATCH 2/3] Translated using Weblate (French) Currently translated at 100.0% (47 of 47 strings) --- app/src/main/res/values-fr/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a7b786565..7da59e8d1 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -47,4 +47,5 @@ Je n\'aime pas J\'aime Langue du contenu + Avatar de l\'utilisateur From f9ad0f12d005ade0b82bcc436ee81c964897fb57 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 15 Dec 2015 22:53:29 +0100 Subject: [PATCH 3/3] Fixed serveral things: * ugly workaround for the details_view_layout problem on older devices * removed "display button on the left side" option since it's not nececeay anymore. --- .../newpipe/VideoItemDetailFragment.java | 47 ++-- .../layout-v18/fragment_videoitem_detail.xml | 219 ++++++++++++++++++ .../res/layout/fragment_videoitem_detail.xml | 34 +-- app/src/main/res/layout/video_item.xml | 8 +- app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fa/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-ko/strings.xml | 1 - app/src/main/res/values-nl/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sr/strings.xml | 1 - app/src/main/res/values/colors.xml | 1 - app/src/main/res/values/settings_keys.xml | 1 - app/src/main/res/values/strings.xml | 1 - app/src/main/res/xml/settings_screen.xml | 5 - 20 files changed, 260 insertions(+), 68 deletions(-) create mode 100644 app/src/main/res/layout-v18/fragment_videoitem_detail.xml diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index a7c80bea6..4290e5c9c 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -8,6 +8,7 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Point; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; @@ -379,20 +380,6 @@ public class VideoItemDetailFragment extends Fragment { e.printStackTrace(); } - if (PreferenceManager.getDefaultSharedPreferences(getActivity()) - .getBoolean(getString(R.string.leftHandLayout), false) && checkIfLandscape()) { - RelativeLayout.LayoutParams oldLayout = - (RelativeLayout.LayoutParams) playVideoButton.getLayoutParams(); - RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( - RelativeLayout.LayoutParams.WRAP_CONTENT, - RelativeLayout.LayoutParams.WRAP_CONTENT); - layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); - layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); - layoutParams.setMargins(oldLayout.leftMargin, oldLayout.topMargin, - oldLayout.rightMargin, oldLayout.bottomMargin); - playVideoButton.setLayoutParams(layoutParams); - } - playVideoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -422,22 +409,26 @@ public class VideoItemDetailFragment extends Fragment { } }); - ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView); - thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { - // This is used to synchronize the thumbnailWindowButton and the playVideoButton - // inside the ScrollView with the actual size of the thumbnail. - @Override - public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { - RelativeLayout.LayoutParams newWindowLayoutParams = - (RelativeLayout.LayoutParams) thumbnailWindowLayout.getLayoutParams(); - newWindowLayoutParams.height = bottom - top; - thumbnailWindowLayout.setLayoutParams(newWindowLayoutParams); + // todo: Fix this workaround (probably with a better design), so that older android + // versions don't have problems rendering the thumbnail right. + if(Build.VERSION.SDK_INT >= 18) { + ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView); + thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { + // This is used to synchronize the thumbnailWindowButton and the playVideoButton + // inside the ScrollView with the actual size of the thumbnail. + @Override + public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { + RelativeLayout.LayoutParams newWindowLayoutParams = + (RelativeLayout.LayoutParams) thumbnailWindowLayout.getLayoutParams(); + newWindowLayoutParams.height = bottom - top; + thumbnailWindowLayout.setLayoutParams(newWindowLayoutParams); - //noinspection SuspiciousNameCombination - initialThumbnailPos.set(top, left); + //noinspection SuspiciousNameCombination + initialThumbnailPos.set(top, left); - } - }); + } + }); + } } } diff --git a/app/src/main/res/layout-v18/fragment_videoitem_detail.xml b/app/src/main/res/layout-v18/fragment_videoitem_detail.xml new file mode 100644 index 000000000..91cfea986 --- /dev/null +++ b/app/src/main/res/layout-v18/fragment_videoitem_detail.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + +