From 25f44aca37a20f9229b19e7a89c2fe1f2644b9b7 Mon Sep 17 00:00:00 2001 From: ata2001 Date: Fri, 18 Sep 2015 19:16:32 +0200 Subject: [PATCH 1/5] Add hungarian translation --- app/src/main/res/values-hu/strings.xml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/src/main/res/values-hu/strings.xml diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml new file mode 100644 index 000000000..a74b6bd7f --- /dev/null +++ b/app/src/main/res/values-hu/strings.xml @@ -0,0 +1,37 @@ + + NewPipe + NewPipe + Nincs találat + megtekintés + Feltöltve: + Nem található lejátszó. Telepítsen egyet! + Telepítsen egyet + Mégse + https://f-droid.org/repository/browse/?fdfilter=vlc&fdid=org.videolan.vlc + Megnyitás böngészőben + Megosztás + Lejátszás + Letöltés + Keresés + Beállítások + Küldés ezzel: + Erre gondolt: + Keresési lap: + Megosztás ezzel: + Válasszon böngészőt: + forgatás + Beállítások + Külső lejátszó használata + Letöltések helye + Útvonal a letöltött videók tárolásához + Adja meg a letöltési útvonalat + Automatikus lejátszás Intent-en keresztül + Automatikusan elindítja a videót, ha az külső alkalmazásból volt hívva + Alapértelmezett felbontás + Lejátszás Kodi-val + A Kore alkalmazás nem található. A Kore szükséges a videók Kodi médiaközponttal való lejátszásához. + Kore telepítése + https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore + \"Lejátszás Kodi-val\" opció mutatása + Mutat egy opciót a videók Kodi médiaközponttal való lejátszására + From 7c7cb2c26c284401519d4d80e3c1025714912b7c Mon Sep 17 00:00:00 2001 From: Soofe Date: Fri, 18 Sep 2015 22:26:21 +0200 Subject: [PATCH 2/5] Add French translation --- app/src/main/res/values-fr/strings.xml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/src/main/res/values-fr/strings.xml diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml new file mode 100644 index 000000000..b31061b0e --- /dev/null +++ b/app/src/main/res/values-fr/strings.xml @@ -0,0 +1,38 @@ + + + NewPipe + Démarrer automatiquement la vidéo si elle a été appellée à partir d\'une autre application. + Annuler + Choisir un navigateur: + Résolution par défaut: + S\'agirait-il de: + Télécharger + Emplacement des téléchargements + Entrez l\'emplacement du téléchargement + Emplacement des vidéos téléchargées. + https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore + https://f-droid.org/repository/browse/?fdfilter=vlc&fdid=org.videolan.vlc + Installer + Installer Kore + L\'application Kore est introuvable. Kore est nécessaire afin de lire des vidéos dans Kodi media center. + Aucun lecteur de streaming détecté. Vous devriez en installer un. + Aucun résultat. + Ouvrir dans le navigateur + Lire + Lecture automatique via Intent. + Lire avec Kodi + rotation + Chercher + Chercher dans la page: + Envoyer avec + Paramètres + Partager + Partager avec: + Afficher une option pour lire la vidéo avec Kodi media center. + Afficher l\'option \"Lire avec Kodi\" + Paramètres + NewPipe + Envoyé le: + Utiliser un lecteur externe + vues + \ No newline at end of file From c59754499f0cc3cb5ec660c5d6004e3b762ed16e Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 20 Sep 2015 13:19:28 +0200 Subject: [PATCH 3/5] new app icon & made player fullscreen work better --- .idea/misc.xml | 2 +- .../org/schabi/newpipe/PlayVideoActivity.java | 124 ++++++++++-- .../newpipe/VideoItemDetailActivity.java | 6 +- .../newpipe/VideoItemDetailFragment.java | 1 + .../schabi/newpipe/VideoItemListActivity.java | 4 + .../schabi/newpipe/VideoItemListFragment.java | 1 + .../main/res/layout/activity_play_video.xml | 9 +- .../res/layout/activity_videoitem_list.xml | 4 +- app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 4720 -> 2406 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2570 -> 1432 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 6056 -> 3116 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 8979 -> 4728 bytes app/src/main/res/values-v21/styles.xml | 2 + app/src/main/res/values/styles.xml | 1 + assets/new_newpipe_icon.svg | 188 ++++++++++++++++++ 15 files changed, 320 insertions(+), 22 deletions(-) create mode 100644 assets/new_newpipe_icon.svg diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f..5d1998103 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java index db7d09691..4ec9afbd6 100644 --- a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java +++ b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java @@ -2,12 +2,16 @@ package org.schabi.newpipe; import android.content.Intent; import android.content.pm.ActivityInfo; +import android.content.res.Configuration; +import android.content.res.Resources; import android.media.MediaPlayer; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; +import android.util.DisplayMetrics; import android.util.Log; import android.view.Display; import android.view.Menu; @@ -17,8 +21,11 @@ import android.view.Surface; import android.view.View; import android.view.WindowManager; import android.widget.Button; +import android.widget.FrameLayout; +import android.widget.LinearLayout; import android.widget.MediaController; import android.widget.ProgressBar; +import android.widget.SeekBar; import android.widget.VideoView; /** @@ -50,6 +57,7 @@ public class PlayVideoActivity extends AppCompatActivity { private static final String POSITION = "position"; private static final long HIDING_DELAY = 3000; + private static final long TAB_HIDING_DELAY = 100; private String videoUrl = ""; @@ -61,6 +69,8 @@ public class PlayVideoActivity extends AppCompatActivity { private View decorView; private boolean uiIsHidden = false; private static long lastUiShowTime = 0; + private boolean isLandscape = true; + private boolean hasSoftKeys = false; @Override protected void onCreate(Bundle savedInstanceState) { @@ -68,6 +78,9 @@ public class PlayVideoActivity extends AppCompatActivity { setContentView(R.layout.activity_play_video); + isLandscape = checkIfLandscape(); + hasSoftKeys = checkIfhasSoftKeys(); + actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); Intent intent = getIntent(); @@ -91,6 +104,7 @@ public class PlayVideoActivity extends AppCompatActivity { videoView.seekTo(position); if (position == 0) { videoView.start(); + showUi(); } else { videoView.pause(); } @@ -113,16 +127,21 @@ public class PlayVideoActivity extends AppCompatActivity { decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { - if((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { - uiIsHidden = false; + if (visibility == View.VISIBLE && uiIsHidden) { showUi(); - } else { - uiIsHidden = true; - hideUi(); } } }); - showUi(); + + decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } + + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + } @Override @@ -166,8 +185,16 @@ public class PlayVideoActivity extends AppCompatActivity { } @Override - protected void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); + public void onConfigurationChanged(Configuration config) { + super.onConfigurationChanged(config); + + if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) { + isLandscape = true; + adjustMediaControllMetrics(); + } else if (config.orientation == Configuration.ORIENTATION_PORTRAIT){ + isLandscape = false; + adjustMediaControllMetrics(); + } } @Override @@ -187,15 +214,15 @@ public class PlayVideoActivity extends AppCompatActivity { private void showUi() { try { uiIsHidden = false; - mediaController.show(); + mediaController.show(100000); actionBar.show(); - //decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); - //| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + adjustMediaControllMetrics(); + getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { - if ((System.currentTimeMillis() - lastUiShowTime) > HIDING_DELAY) { + if ((System.currentTimeMillis() - lastUiShowTime) >= HIDING_DELAY) { hideUi(); } } @@ -210,8 +237,75 @@ public class PlayVideoActivity extends AppCompatActivity { uiIsHidden = true; actionBar.hide(); mediaController.hide(); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); - //decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); - //| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + + private void adjustMediaControllMetrics() { + MediaController.LayoutParams mediaControllerLayout + = new MediaController.LayoutParams(MediaController.LayoutParams.MATCH_PARENT, + MediaController.LayoutParams.WRAP_CONTENT); + + if(!hasSoftKeys) { + mediaControllerLayout.setMargins(20, 0, 20, 20); + } else { + int width = getNavigationBarWidth(); + int height = getNavigationBarHeight(); + mediaControllerLayout.setMargins(width + 20, 0, width + 20, height + 20); + } + mediaController.setLayoutParams(mediaControllerLayout); + } + + private boolean checkIfhasSoftKeys(){ + if(Build.VERSION.SDK_INT >= 17) { + return getNavigationBarHeight() != 0 || getNavigationBarWidth() != 0; + } else { + return true; + } + } + + private int getNavigationBarHeight() { + if(Build.VERSION.SDK_INT >= 17) { + Display d = getWindowManager().getDefaultDisplay(); + + DisplayMetrics realDisplayMetrics = new DisplayMetrics(); + d.getRealMetrics(realDisplayMetrics); + DisplayMetrics displayMetrics = new DisplayMetrics(); + d.getMetrics(displayMetrics); + + int realHeight = realDisplayMetrics.heightPixels; + int displayHeight = displayMetrics.heightPixels; + return (realHeight - displayHeight); + } else { + return 50; + } + } + + private int getNavigationBarWidth() { + if(Build.VERSION.SDK_INT >= 17) { + Display d = getWindowManager().getDefaultDisplay(); + + DisplayMetrics realDisplayMetrics = new DisplayMetrics(); + d.getRealMetrics(realDisplayMetrics); + DisplayMetrics displayMetrics = new DisplayMetrics(); + d.getMetrics(displayMetrics); + + int realWidth = realDisplayMetrics.widthPixels; + int displayWidth = displayMetrics.widthPixels; + return (realWidth - displayWidth); + } else { + return 50; + } + } + + public boolean checkIfLandscape() { + DisplayMetrics displayMetrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); + return displayMetrics.heightPixels < displayMetrics.widthPixels; } } diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java index cc9287796..cc0c95edf 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java @@ -1,16 +1,20 @@ package org.schabi.newpipe; import android.content.ContentProviderOperation; +import android.content.res.Configuration; +import android.os.Build; import android.preference.PreferenceManager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NavUtils; +import android.util.DisplayMetrics; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import android.view.WindowManager; import org.schabi.newpipe.youtube.YoutubeExtractor; @@ -39,12 +43,12 @@ public class VideoItemDetailActivity extends AppCompatActivity { private String videoUrl; private int currentStreamingService = -1; + private boolean isLandscape; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_videoitem_detail); - // Show the Up button in the action bar. getSupportActionBar().setDisplayHomeAsUpEnabled(true); ActionBarHandler.getHandler().setupNavMenu(this); diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index 23ca053f8..9b2afe39d 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -15,6 +15,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java index 827f5e8e1..0a46ac10e 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java @@ -2,15 +2,19 @@ package org.schabi.newpipe; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; +import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.preference.PreferenceManager; import android.support.v7.app.AppCompatActivity; +import android.util.DisplayMetrics; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.support.v7.widget.SearchView; import android.widget.ImageView; diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java index c3f7b46f6..c924aa227 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java @@ -13,6 +13,7 @@ import android.widget.ListView; import android.widget.Toast; import java.net.URL; +import java.util.List; import java.util.Vector; diff --git a/app/src/main/res/layout/activity_play_video.xml b/app/src/main/res/layout/activity_play_video.xml index b2721fd07..433930f71 100644 --- a/app/src/main/res/layout/activity_play_video.xml +++ b/app/src/main/res/layout/activity_play_video.xml @@ -9,17 +9,20 @@ + android:layout_gravity="center" + android:focusable="false"/>