1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-26 01:50:32 +00:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-05-09 14:11:45 +02:00
commit 47646e1c62
24 changed files with 690 additions and 366 deletions

View File

@ -24,6 +24,11 @@ Project status:
[<img src="screenshots/screenshot_3.png" width=160>](screenshots/screenshot_3.png) [<img src="screenshots/screenshot_3.png" width=160>](screenshots/screenshot_3.png)
[<img src="screenshots/screenshot_4.png" width=160>](screenshots/screenshot_4.png) [<img src="screenshots/screenshot_4.png" width=160>](screenshots/screenshot_4.png)
[<img src="screenshots/screenshot_5.png" width=160>](screenshots/screenshot_5.png) [<img src="screenshots/screenshot_5.png" width=160>](screenshots/screenshot_5.png)
[<img src="screenshots/screenshot_6.png" width=160>](screenshots/screenshot_6.png)
[<img src="screenshots/screenshot_7.png" width=160>](screenshots/screenshot_7.png)
[<img src="screenshots/screenshot_8.png" width=160>](screenshots/screenshot_8.png)
[<img src="screenshots/screenshot_9.png" width=160>](screenshots/screenshot_9.png)
## Description ## Description

View File

@ -8,8 +8,8 @@ android {
applicationId "org.schabi.newpipe" applicationId "org.schabi.newpipe"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 25 targetSdkVersion 25
versionCode 31 versionCode 32
versionName "0.9.4" versionName "0.9.5"
} }
buildTypes { buildTypes {
release { release {

View File

@ -1,28 +0,0 @@
package org.schabi.newpipe;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
public class ThemableActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (PreferenceManager.getDefaultSharedPreferences(this)
.getString("theme", getResources().getString(R.string.light_theme_title)).
equals(getResources().getString(R.string.dark_theme_title))) {
setTheme(R.style.DarkTheme);
}
}
@Override
protected void onResume() {
super.onResume();
if (PreferenceManager.getDefaultSharedPreferences(this)
.getString("theme", getResources().getString(R.string.light_theme_title)).
equals(getResources().getString(R.string.dark_theme_title))) {
setTheme(R.style.DarkTheme);
}
}
}

View File

@ -1,7 +1,5 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Rect; import android.graphics.Rect;
@ -28,6 +26,8 @@ import org.schabi.newpipe.R;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public abstract class BaseFragment extends Fragment { public abstract class BaseFragment extends Fragment {
protected final String TAG = "BaseFragment@" + Integer.toHexString(hashCode()); protected final String TAG = "BaseFragment@" + Integer.toHexString(hashCode());
protected static final boolean DEBUG = MainActivity.DEBUG; protected static final boolean DEBUG = MainActivity.DEBUG;
@ -130,70 +130,6 @@ public abstract class BaseFragment extends Fragment {
// Utils // Utils
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
public void animateView(final View view, final boolean enterOrExit, long duration) {
animateView(view, enterOrExit, duration, 0, null);
}
public void animateView(final View view, final boolean enterOrExit, long duration, final Runnable execOnEnd) {
animateView(view, enterOrExit, duration, 0, execOnEnd);
}
public void animateView(final View view, final boolean enterOrExit, long duration, long delay) {
animateView(view, enterOrExit, duration, delay, null);
}
/**
* Animate the view
*
* @param view view that will be animated
* @param enterOrExit true to enter, false to exit
* @param duration how long the animation will take, in milliseconds
* @param delay how long the animation will take to start, in milliseconds
* @param execOnEnd runnable that will be executed when the animation ends
*/
public void animateView(final View view, final boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
if (DEBUG) Log.d(TAG, "animateView() called with: view = [" + view + "], enterOrExit = [" + enterOrExit + "], duration = [" + duration + "], execOnEnd = [" + execOnEnd + "]");
if (view == null) return;
if (view.getVisibility() == View.VISIBLE && enterOrExit) {
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
view.setAlpha(1f);
if (execOnEnd != null) execOnEnd.run();
return;
} else if ((view.getVisibility() == View.GONE || view.getVisibility() == View.INVISIBLE) && !enterOrExit) {
view.animate().setListener(null).cancel();
view.setVisibility(View.GONE);
view.setAlpha(0f);
if (execOnEnd != null) execOnEnd.run();
return;
}
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
if (enterOrExit) {
view.animate().alpha(1f).setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null) execOnEnd.run();
}
}).start();
} else {
view.animate().alpha(0f)
.setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null) execOnEnd.run();
}
})
.start();
}
}
protected void setErrorMessage(String message, boolean showRetryButton) { protected void setErrorMessage(String message, boolean showRetryButton) {
if (errorTextView == null || activity == null) return; if (errorTextView == null || activity == null) return;

View File

@ -36,6 +36,8 @@ import java.io.Serializable;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.ArrayList; import java.util.ArrayList;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class ChannelFragment extends BaseFragment implements ChannelExtractorWorker.OnChannelInfoReceive { public class ChannelFragment extends BaseFragment implements ChannelExtractorWorker.OnChannelInfoReceive {
private final String TAG = "ChannelFragment@" + Integer.toHexString(hashCode()); private final String TAG = "ChannelFragment@" + Integer.toHexString(hashCode());

View File

@ -19,6 +19,7 @@ import android.text.TextUtils;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.util.Log; import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -39,7 +40,6 @@ import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import org.schabi.newpipe.ImageErrorLoadingListener; import org.schabi.newpipe.ImageErrorLoadingListener;
import org.schabi.newpipe.Localization;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity; import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.download.DownloadDialog; import org.schabi.newpipe.download.DownloadDialog;
@ -55,6 +55,8 @@ import org.schabi.newpipe.player.MainVideoPlayer;
import org.schabi.newpipe.player.PlayVideoActivity; import org.schabi.newpipe.player.PlayVideoActivity;
import org.schabi.newpipe.player.PopupVideoPlayer; import org.schabi.newpipe.player.PopupVideoPlayer;
import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper; import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.Utils; import org.schabi.newpipe.util.Utils;
@ -64,6 +66,8 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Stack; import java.util.Stack;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class VideoDetailFragment extends BaseFragment implements StreamExtractorWorker.OnStreamInfoReceivedListener, SharedPreferences.OnSharedPreferenceChangeListener, View.OnClickListener { public class VideoDetailFragment extends BaseFragment implements StreamExtractorWorker.OnStreamInfoReceivedListener, SharedPreferences.OnSharedPreferenceChangeListener, View.OnClickListener {
private final String TAG = "VideoDetailFragment@" + Integer.toHexString(hashCode()); private final String TAG = "VideoDetailFragment@" + Integer.toHexString(hashCode());
@ -71,9 +75,6 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
private static final int INITIAL_RELATED_VIDEOS = 8; private static final int INITIAL_RELATED_VIDEOS = 8;
private static final String KORE_PACKET = "org.xbmc.kore"; private static final String KORE_PACKET = "org.xbmc.kore";
private static final String SERVICE_ID_KEY = "service_id_key";
private static final String VIDEO_URL_KEY = "video_url_key";
private static final String VIDEO_TITLE_KEY = "video_title_key";
private static final String STACK_KEY = "stack_key"; private static final String STACK_KEY = "stack_key";
private static final String INFO_KEY = "info_key"; private static final String INFO_KEY = "info_key";
private static final String WAS_RELATED_EXPANDED_KEY = "was_related_expanded_key"; private static final String WAS_RELATED_EXPANDED_KEY = "was_related_expanded_key";
@ -170,9 +171,9 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]"); if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
if (savedInstanceState != null) { if (savedInstanceState != null) {
videoTitle = savedInstanceState.getString(VIDEO_TITLE_KEY); videoTitle = savedInstanceState.getString(Constants.KEY_TITLE);
videoUrl = savedInstanceState.getString(VIDEO_URL_KEY); videoUrl = savedInstanceState.getString(Constants.KEY_URL);
serviceId = savedInstanceState.getInt(SERVICE_ID_KEY, 0); serviceId = savedInstanceState.getInt(Constants.KEY_SERVICE_ID, 0);
wasRelatedStreamsExpanded = savedInstanceState.getBoolean(WAS_RELATED_EXPANDED_KEY, false); wasRelatedStreamsExpanded = savedInstanceState.getBoolean(WAS_RELATED_EXPANDED_KEY, false);
Serializable serializable = savedInstanceState.getSerializable(STACK_KEY); Serializable serializable = savedInstanceState.getSerializable(STACK_KEY);
if (serializable instanceof Stack) { if (serializable instanceof Stack) {
@ -289,9 +290,9 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
if (DEBUG) Log.d(TAG, "onSaveInstanceState() called with: outState = [" + outState + "]"); if (DEBUG) Log.d(TAG, "onSaveInstanceState() called with: outState = [" + outState + "]");
outState.putString(VIDEO_URL_KEY, videoUrl); outState.putString(Constants.KEY_URL, videoUrl);
outState.putString(VIDEO_TITLE_KEY, videoTitle); outState.putString(Constants.KEY_TITLE, videoTitle);
outState.putInt(SERVICE_ID_KEY, serviceId); outState.putInt(Constants.KEY_SERVICE_ID, serviceId);
outState.putSerializable(STACK_KEY, stack); outState.putSerializable(STACK_KEY, stack);
int nextCount = currentStreamInfo != null && currentStreamInfo.next_video != null ? 2 : 0; int nextCount = currentStreamInfo != null && currentStreamInfo.next_video != null ? 2 : 0;
@ -420,7 +421,10 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
if (isLoading.get()) return; if (isLoading.get()) return;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !PermissionHelper.checkSystemAlertWindowPermission(activity)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !PermissionHelper.checkSystemAlertWindowPermission(activity)) {
Toast.makeText(activity, R.string.msg_popup_permission, Toast.LENGTH_LONG).show(); Toast toast = Toast.makeText(activity, R.string.msg_popup_permission, Toast.LENGTH_LONG);
TextView messageView = (TextView) toast.getView().findViewById(android.R.id.message);
if (messageView != null) messageView.setGravity(Gravity.CENTER);
toast.show();
return; return;
} }
@ -844,7 +848,7 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
else parallaxScrollRootView.scrollTo(0, 0); else parallaxScrollRootView.scrollTo(0, 0);
} }
animateView(contentRootLayoutHiding, false, greaterThanThreshold ? 250 : 0, new Runnable() { animateView(contentRootLayoutHiding, false, greaterThanThreshold ? 250 : 0, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
handleStreamInfo(infoFinal, false); handleStreamInfo(infoFinal, false);
@ -1052,7 +1056,7 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
private void setErrorImage(final int imageResource) { private void setErrorImage(final int imageResource) {
if (thumbnailImageView == null || activity == null) return; if (thumbnailImageView == null || activity == null) return;
thumbnailImageView.setImageDrawable(ContextCompat.getDrawable(activity, imageResource)); thumbnailImageView.setImageDrawable(ContextCompat.getDrawable(activity, imageResource));
animateView(thumbnailImageView, false, 0, new Runnable() { animateView(thumbnailImageView, false, 0, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
animateView(thumbnailImageView, true, 500); animateView(thumbnailImageView, true, 500);

View File

@ -37,6 +37,7 @@ import org.schabi.newpipe.extractor.search.SearchResult;
import org.schabi.newpipe.fragments.BaseFragment; import org.schabi.newpipe.fragments.BaseFragment;
import org.schabi.newpipe.info_list.InfoItemBuilder; import org.schabi.newpipe.info_list.InfoItemBuilder;
import org.schabi.newpipe.info_list.InfoListAdapter; import org.schabi.newpipe.info_list.InfoListAdapter;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.workers.SearchWorker; import org.schabi.newpipe.workers.SearchWorker;
import org.schabi.newpipe.workers.SuggestionWorker; import org.schabi.newpipe.workers.SuggestionWorker;
@ -45,12 +46,13 @@ import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class SearchFragment extends BaseFragment implements SuggestionWorker.OnSuggestionResult, SearchWorker.OnSearchResult { public class SearchFragment extends BaseFragment implements SuggestionWorker.OnSuggestionResult, SearchWorker.OnSearchResult {
private final String TAG = "SearchFragment@" + Integer.toHexString(hashCode()); private final String TAG = "SearchFragment@" + Integer.toHexString(hashCode());
// savedInstanceBundle arguments // savedInstanceBundle arguments
private static final String QUERY_KEY = "query_key"; private static final String QUERY_KEY = "query_key";
private static final String PAGE_NUMBER_KEY = "page_number_key"; private static final String PAGE_NUMBER_KEY = "page_number_key";
private static final String SERVICE_KEY = "service_key";
private static final String INFO_LIST_KEY = "info_list_key"; private static final String INFO_LIST_KEY = "info_list_key";
private static final String WAS_LOADING_KEY = "was_loading_key"; private static final String WAS_LOADING_KEY = "was_loading_key";
private static final String ERROR_KEY = "error_key"; private static final String ERROR_KEY = "error_key";
@ -101,7 +103,7 @@ public class SearchFragment extends BaseFragment implements SuggestionWorker.OnS
setHasOptionsMenu(true); setHasOptionsMenu(true);
if (savedInstanceState != null) { if (savedInstanceState != null) {
searchQuery = savedInstanceState.getString(QUERY_KEY); searchQuery = savedInstanceState.getString(QUERY_KEY);
serviceId = savedInstanceState.getInt(SERVICE_KEY, 0); serviceId = savedInstanceState.getInt(Constants.KEY_SERVICE_ID, 0);
pageNumber = savedInstanceState.getInt(PAGE_NUMBER_KEY, 0); pageNumber = savedInstanceState.getInt(PAGE_NUMBER_KEY, 0);
wasLoading.set(savedInstanceState.getBoolean(WAS_LOADING_KEY, false)); wasLoading.set(savedInstanceState.getBoolean(WAS_LOADING_KEY, false));
filterItemCheckedId = savedInstanceState.getInt(FILTER_CHECKED_ID_KEY, 0); filterItemCheckedId = savedInstanceState.getInt(FILTER_CHECKED_ID_KEY, 0);
@ -171,7 +173,7 @@ public class SearchFragment extends BaseFragment implements SuggestionWorker.OnS
String query = searchEditText != null && !TextUtils.isEmpty(searchEditText.getText().toString()) String query = searchEditText != null && !TextUtils.isEmpty(searchEditText.getText().toString())
? searchEditText.getText().toString() : searchQuery; ? searchEditText.getText().toString() : searchQuery;
outState.putString(QUERY_KEY, query); outState.putString(QUERY_KEY, query);
outState.putInt(SERVICE_KEY, serviceId); outState.putInt(Constants.KEY_SERVICE_ID, serviceId);
outState.putInt(PAGE_NUMBER_KEY, pageNumber); outState.putInt(PAGE_NUMBER_KEY, pageNumber);
outState.putSerializable(INFO_LIST_KEY, ((ArrayList<InfoItem>) infoListAdapter.getItemsList())); outState.putSerializable(INFO_LIST_KEY, ((ArrayList<InfoItem>) infoListAdapter.getItemsList()));
outState.putBoolean(WAS_LOADING_KEY, curSearchWorker != null && curSearchWorker.isRunning()); outState.putBoolean(WAS_LOADING_KEY, curSearchWorker != null && curSearchWorker.isRunning());

View File

@ -1,49 +0,0 @@
package org.schabi.newpipe.fragments.search;
import android.support.v7.widget.SearchView;
/**
* Created by Christian Schabesberger on 02.08.16.
*
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
* SearchSuggestionListener.java is part of NewPipe.
*
* NewPipe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewPipe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
public class SearchSuggestionListener implements SearchView.OnSuggestionListener{
private final SearchView searchView;
private final SuggestionListAdapter adapter;
public SearchSuggestionListener(SearchView searchView, SuggestionListAdapter adapter) {
this.searchView = searchView;
this.adapter = adapter;
}
@Override
public boolean onSuggestionSelect(int position) {
String suggestion = adapter.getSuggestion(position);
searchView.setQuery(suggestion,true);
return false;
}
@Override
public boolean onSuggestionClick(int position) {
String suggestion = adapter.getSuggestion(position);
searchView.setQuery(suggestion,true);
return false;
}
}

View File

@ -21,10 +21,13 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper; import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.ThemeHelper;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
/** /**
* Activity Player implementing VideoPlayer * Activity Player implementing VideoPlayer
* *
@ -37,14 +40,7 @@ public class MainVideoPlayer extends Activity {
private AudioManager audioManager; private AudioManager audioManager;
private GestureDetector gestureDetector; private GestureDetector gestureDetector;
private final Runnable hideUiRunnable = new Runnable() {
@Override
public void run() {
hideSystemUi();
}
};
private boolean activityPaused; private boolean activityPaused;
private VideoPlayerImpl playerImpl; private VideoPlayerImpl playerImpl;
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
@ -265,14 +261,15 @@ public class MainVideoPlayer extends Activity {
else if (v.getId() == screenRotationButton.getId()) onScreenRotationClicked(); else if (v.getId() == screenRotationButton.getId()) onScreenRotationClicked();
if (getCurrentState() != STATE_COMPLETED) { if (getCurrentState() != STATE_COMPLETED) {
getControlsVisibilityHandler().removeCallbacksAndMessages(null);
animateView(playerImpl.getControlsRoot(), true, 300, 0, new Runnable() { animateView(playerImpl.getControlsRoot(), true, 300, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
if (getCurrentState() == STATE_PLAYING && !playerImpl.isQualityMenuVisible()) { if (getCurrentState() == STATE_PLAYING && !playerImpl.isQualityMenuVisible()) {
animateView(playerImpl.getControlsRoot(), false, 300, DEFAULT_CONTROLS_HIDE_TIME, true); hideControls(300, DEFAULT_CONTROLS_HIDE_TIME);
} }
} }
}, false); });
} }
} }
@ -285,14 +282,14 @@ public class MainVideoPlayer extends Activity {
public void onStopTrackingTouch(SeekBar seekBar) { public void onStopTrackingTouch(SeekBar seekBar) {
super.onStopTrackingTouch(seekBar); super.onStopTrackingTouch(seekBar);
if (playerImpl.wasPlaying()) { if (playerImpl.wasPlaying()) {
animateView(playerImpl.getControlsRoot(), false, 100, 0); hideControls(100, 0);
} }
} }
@Override @Override
public void onDismiss(PopupMenu menu) { public void onDismiss(PopupMenu menu) {
super.onDismiss(menu); super.onDismiss(menu);
if (isPlaying()) animateView(getControlsRoot(), false, 500, 0); if (isPlaying()) hideControls(300, 0);
} }
@Override @Override
@ -310,26 +307,23 @@ public class MainVideoPlayer extends Activity {
public void onLoading() { public void onLoading() {
super.onLoading(); super.onLoading();
playPauseButton.setImageResource(R.drawable.ic_pause_white); playPauseButton.setImageResource(R.drawable.ic_pause_white);
animateView(playPauseButton, false, 100, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 100);
} }
@Override @Override
public void onBuffering() { public void onBuffering() {
super.onBuffering(); super.onBuffering();
animateView(playPauseButton, false, 100, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 100);
} }
@Override @Override
public void onPlaying() { public void onPlaying() {
super.onPlaying(); super.onPlaying();
//playPauseButton.setImageResource(R.drawable.ic_pause_white); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, new Runnable() {
//animateView(playPauseButton, true, 500, 0);
animateView(playPauseButton, false, 80, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
playPauseButton.setImageResource(R.drawable.ic_pause_white); playPauseButton.setImageResource(R.drawable.ic_pause_white);
animateView(playPauseButton, true, 200, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, true, 200);
} }
}); });
@ -339,14 +333,11 @@ public class MainVideoPlayer extends Activity {
@Override @Override
public void onPaused() { public void onPaused() {
super.onPaused(); super.onPaused();
//playPauseButton.setImageResource(R.drawable.ic_play_arrow_white); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, new Runnable() {
//animateView(playPauseButton, true, 100, 0);
animateView(playPauseButton, false, 80, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white); playPauseButton.setImageResource(R.drawable.ic_play_arrow_white);
animateView(playPauseButton, true, 200, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, true, 200);
} }
}); });
@ -356,7 +347,7 @@ public class MainVideoPlayer extends Activity {
@Override @Override
public void onPausedSeek() { public void onPausedSeek() {
super.onPausedSeek(); super.onPausedSeek();
animateView(playPauseButton, false, 100, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 100);
} }
@ -366,11 +357,11 @@ public class MainVideoPlayer extends Activity {
playPauseButton.setImageResource(R.drawable.ic_pause_white); playPauseButton.setImageResource(R.drawable.ic_pause_white);
} else { } else {
showSystemUi(); showSystemUi();
animateView(playPauseButton, false, 0, 0, new Runnable() { animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 0, 0, new Runnable() {
@Override @Override
public void run() { public void run() {
playPauseButton.setImageResource(R.drawable.ic_replay_white); playPauseButton.setImageResource(R.drawable.ic_replay_white);
animateView(playPauseButton, true, 300, 0); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, true, 300);
} }
}); });
} }
@ -382,19 +373,20 @@ public class MainVideoPlayer extends Activity {
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@Override @Override
public void animateView(View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd, boolean hideUi) { public void hideControls(final long duration, long delay) {
//if (execOnEnd == null) playerImpl.setDefaultAnimationEnd(hideUiRunnable); if (DEBUG) Log.d(TAG, "hideControls() called with: delay = [" + delay + "]");
getControlsVisibilityHandler().removeCallbacksAndMessages(null);
if (hideUi && execOnEnd != null) { getControlsVisibilityHandler().postDelayed(new Runnable() {
Runnable combinedRunnable = new Runnable() {
@Override @Override
public void run() { public void run() {
execOnEnd.run(); animateView(getControlsRoot(), false, duration, 0, new Runnable() {
hideUiRunnable.run(); @Override
public void run() {
hideSystemUi();
} }
}; });
super.animateView(view, enterOrExit, duration, delay, combinedRunnable, true); }
} else super.animateView(view, enterOrExit, duration, delay, hideUi ? hideUiRunnable : execOnEnd, hideUi); }, delay);
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -443,14 +435,9 @@ public class MainVideoPlayer extends Activity {
if (DEBUG) Log.d(TAG, "onSingleTapConfirmed() called with: e = [" + e + "]"); if (DEBUG) Log.d(TAG, "onSingleTapConfirmed() called with: e = [" + e + "]");
if (playerImpl.getCurrentState() != BasePlayer.STATE_PLAYING) return true; if (playerImpl.getCurrentState() != BasePlayer.STATE_PLAYING) return true;
if (playerImpl.isControlsVisible()) playerImpl.animateView(playerImpl.getControlsRoot(), false, 150, 0, true); if (playerImpl.isControlsVisible()) playerImpl.hideControls(150, 0);
else { else {
playerImpl.animateView(playerImpl.getControlsRoot(), true, 500, 0, new Runnable() { playerImpl.showControlsThenHide();
@Override
public void run() {
playerImpl.animateView(playerImpl.getControlsRoot(), false, 300, VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME, true);
}
});
showSystemUi(); showSystemUi();
} }
return true; return true;
@ -500,7 +487,7 @@ public class MainVideoPlayer extends Activity {
if (DEBUG) Log.d(TAG, "onScroll().volumeControl, currentVolume = " + currentVolume); if (DEBUG) Log.d(TAG, "onScroll().volumeControl, currentVolume = " + currentVolume);
playerImpl.getVolumeTextView().setText(volumeUnicode + " " + Math.round((((float) currentVolume) / maxVolume) * 100) + "%"); playerImpl.getVolumeTextView().setText(volumeUnicode + " " + Math.round((((float) currentVolume) / maxVolume) * 100) + "%");
if (playerImpl.getVolumeTextView().getVisibility() != View.VISIBLE) playerImpl.animateView(playerImpl.getVolumeTextView(), true, 200, 0); if (playerImpl.getVolumeTextView().getVisibility() != View.VISIBLE) animateView(playerImpl.getVolumeTextView(), true, 200);
if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) playerImpl.getBrightnessTextView().setVisibility(View.GONE); if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) playerImpl.getBrightnessTextView().setVisibility(View.GONE);
} else { } else {
WindowManager.LayoutParams lp = getWindow().getAttributes(); WindowManager.LayoutParams lp = getWindow().getAttributes();
@ -515,7 +502,7 @@ public class MainVideoPlayer extends Activity {
playerImpl.getBrightnessTextView().setText(brightnessUnicode + " " + (brightnessNormalized == 1 ? 0 : brightnessNormalized) + "%"); playerImpl.getBrightnessTextView().setText(brightnessUnicode + " " + (brightnessNormalized == 1 ? 0 : brightnessNormalized) + "%");
if (playerImpl.getBrightnessTextView().getVisibility() != View.VISIBLE) playerImpl.animateView(playerImpl.getBrightnessTextView(), true, 200, 0); if (playerImpl.getBrightnessTextView().getVisibility() != View.VISIBLE) animateView(playerImpl.getBrightnessTextView(), true, 200);
if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) playerImpl.getVolumeTextView().setVisibility(View.GONE); if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) playerImpl.getVolumeTextView().setVisibility(View.GONE);
} }
return true; return true;
@ -527,11 +514,11 @@ public class MainVideoPlayer extends Activity {
eventsNum = 0; eventsNum = 0;
/* if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) playerImpl.getVolumeTextView().setVisibility(View.GONE); /* if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) playerImpl.getVolumeTextView().setVisibility(View.GONE);
if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) playerImpl.getBrightnessTextView().setVisibility(View.GONE);*/ if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) playerImpl.getBrightnessTextView().setVisibility(View.GONE);*/
if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) playerImpl.animateView(playerImpl.getVolumeTextView(), false, 200, 200); if (playerImpl.getVolumeTextView().getVisibility() == View.VISIBLE) animateView(playerImpl.getVolumeTextView(), false, 200, 200);
if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) playerImpl.animateView(playerImpl.getBrightnessTextView(), false, 200, 200); if (playerImpl.getBrightnessTextView().getVisibility() == View.VISIBLE) animateView(playerImpl.getBrightnessTextView(), false, 200, 200);
if (playerImpl.isControlsVisible() && playerImpl.getCurrentState() == BasePlayer.STATE_PLAYING) { if (playerImpl.isControlsVisible() && playerImpl.getCurrentState() == BasePlayer.STATE_PLAYING) {
playerImpl.animateView(playerImpl.getControlsRoot(), false, 300, VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME, true); playerImpl.hideControls(300, VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME);
} }
} }

View File

@ -7,13 +7,14 @@ import android.app.Service;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
@ -24,6 +25,8 @@ import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.PopupMenu; import android.widget.PopupMenu;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.DisplayImageOptions;
@ -43,6 +46,8 @@ import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.util.Utils; import org.schabi.newpipe.util.Utils;
import org.schabi.newpipe.workers.StreamExtractorWorker; import org.schabi.newpipe.workers.StreamExtractorWorker;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
/** /**
* Service Popup Player implementing VideoPlayer * Service Popup Player implementing VideoPlayer
* *
@ -58,14 +63,19 @@ public class PopupVideoPlayer extends Service {
public static final String ACTION_OPEN_DETAIL = "org.schabi.newpipe.player.PopupVideoPlayer.OPEN_DETAIL"; public static final String ACTION_OPEN_DETAIL = "org.schabi.newpipe.player.PopupVideoPlayer.OPEN_DETAIL";
public static final String ACTION_REPEAT = "org.schabi.newpipe.player.PopupVideoPlayer.REPEAT"; public static final String ACTION_REPEAT = "org.schabi.newpipe.player.PopupVideoPlayer.REPEAT";
private static final String POPUP_SAVED_WIDTH = "popup_saved_width";
private static final String POPUP_SAVED_X = "popup_saved_x";
private static final String POPUP_SAVED_Y = "popup_saved_y";
private WindowManager windowManager; private WindowManager windowManager;
private WindowManager.LayoutParams windowLayoutParams; private WindowManager.LayoutParams windowLayoutParams;
private GestureDetector gestureDetector; private GestureDetector gestureDetector;
private float screenWidth, screenHeight; private float screenWidth, screenHeight;
private float popupWidth, popupHeight; private float popupWidth, popupHeight;
private float currentPopupHeight = 110.0f * Resources.getSystem().getDisplayMetrics().density;
//private float minimumHeight = 100; // TODO: Use it when implementing the resize of the popup private float minimumWidth, minimumHeight;
private float maximumWidth, maximumHeight;
private final String setAlphaMethodName = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) ? "setImageAlpha" : "setAlpha"; private final String setAlphaMethodName = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) ? "setImageAlpha" : "setAlpha";
private NotificationManager notificationManager; private NotificationManager notificationManager;
@ -114,6 +124,8 @@ public class PopupVideoPlayer extends Service {
@Override @Override
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {
updateScreenSize(); updateScreenSize();
updatePopupSize(windowLayoutParams.width, -1);
checkPositionBounds();
} }
@Override @Override
@ -129,6 +141,8 @@ public class PopupVideoPlayer extends Service {
currentExtractorWorker.cancel(); currentExtractorWorker.cancel();
currentExtractorWorker = null; currentExtractorWorker = null;
} }
savePositionAndSize();
} }
@Override @Override
@ -144,21 +158,33 @@ public class PopupVideoPlayer extends Service {
private void initPopup() { private void initPopup() {
if (DEBUG) Log.d(TAG, "initPopup() called"); if (DEBUG) Log.d(TAG, "initPopup() called");
View rootView = View.inflate(this, R.layout.player_popup, null); View rootView = View.inflate(this, R.layout.player_popup, null);
playerImpl.setup(rootView); playerImpl.setup(rootView);
updateScreenSize(); updateScreenSize();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean popupRememberSizeAndPos = sharedPreferences.getBoolean(getString(R.string.popup_remember_size_pos_key), true);
float defaultSize = getResources().getDimension(R.dimen.popup_default_width);
popupWidth = popupRememberSizeAndPos ? sharedPreferences.getFloat(POPUP_SAVED_WIDTH, defaultSize) : defaultSize;
windowLayoutParams = new WindowManager.LayoutParams( windowLayoutParams = new WindowManager.LayoutParams(
(int) getMinimumVideoWidth(currentPopupHeight), (int) currentPopupHeight, (int) popupWidth, (int) getMinimumVideoHeight(popupWidth),
WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT); PixelFormat.TRANSLUCENT);
windowLayoutParams.gravity = Gravity.LEFT | Gravity.TOP; windowLayoutParams.gravity = Gravity.LEFT | Gravity.TOP;
int centerX = (int) (screenWidth / 2f - popupWidth / 2f);
int centerY = (int) (screenHeight / 2f - popupHeight / 2f);
windowLayoutParams.x = popupRememberSizeAndPos ? sharedPreferences.getInt(POPUP_SAVED_X, centerX) : centerX;
windowLayoutParams.y = popupRememberSizeAndPos ? sharedPreferences.getInt(POPUP_SAVED_Y, centerY) : centerY;
checkPositionBounds();
MySimpleOnGestureListener listener = new MySimpleOnGestureListener(); MySimpleOnGestureListener listener = new MySimpleOnGestureListener();
gestureDetector = new GestureDetector(this, listener); gestureDetector = new GestureDetector(this, listener);
gestureDetector.setIsLongpressEnabled(false); //gestureDetector.setIsLongpressEnabled(false);
rootView.setOnTouchListener(listener); rootView.setOnTouchListener(listener);
playerImpl.getLoadingPanel().setMinimumWidth(windowLayoutParams.width); playerImpl.getLoadingPanel().setMinimumWidth(windowLayoutParams.width);
playerImpl.getLoadingPanel().setMinimumHeight(windowLayoutParams.height); playerImpl.getLoadingPanel().setMinimumHeight(windowLayoutParams.height);
@ -219,13 +245,13 @@ public class PopupVideoPlayer extends Service {
notificationManager.notify(NOTIFICATION_ID, notBuilder.build()); notificationManager.notify(NOTIFICATION_ID, notBuilder.build());
} }
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Misc // Misc
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
public void onVideoClose() { public void onVideoClose() {
if (DEBUG) Log.d(TAG, "onVideoClose() called"); if (DEBUG) Log.d(TAG, "onVideoClose() called");
savePositionAndSize();
stopSelf(); stopSelf();
} }
@ -245,10 +271,23 @@ public class PopupVideoPlayer extends Service {
// Utils // Utils
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
private float getMinimumVideoWidth(float height) { private void checkPositionBounds() {
float width = height * (16.0f / 9.0f); // Respect the 16:9 ratio that most videos have if (windowLayoutParams.x > screenWidth - windowLayoutParams.width) windowLayoutParams.x = (int) (screenWidth - windowLayoutParams.width);
if (DEBUG) Log.d(TAG, "getMinimumVideoWidth() called with: height = [" + height + "], returned: " + width); if (windowLayoutParams.x < 0) windowLayoutParams.x = 0;
return width; if (windowLayoutParams.y > screenHeight - windowLayoutParams.height) windowLayoutParams.y = (int) (screenHeight - windowLayoutParams.height);
if (windowLayoutParams.y < 0) windowLayoutParams.y = 0;
}
private void savePositionAndSize() {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(PopupVideoPlayer.this);
sharedPreferences.edit().putInt(POPUP_SAVED_X, windowLayoutParams.x).apply();
sharedPreferences.edit().putInt(POPUP_SAVED_Y, windowLayoutParams.y).apply();
sharedPreferences.edit().putFloat(POPUP_SAVED_WIDTH, windowLayoutParams.width).apply();
}
private float getMinimumVideoHeight(float width) {
//if (DEBUG) Log.d(TAG, "getMinimumVideoHeight() called with: width = [" + width + "], returned: " + height);
return width / (16.0f / 9.0f); // Respect the 16:9 ratio that most videos have
} }
private void updateScreenSize() { private void updateScreenSize() {
@ -258,11 +297,39 @@ public class PopupVideoPlayer extends Service {
screenWidth = metrics.widthPixels; screenWidth = metrics.widthPixels;
screenHeight = metrics.heightPixels; screenHeight = metrics.heightPixels;
if (DEBUG) Log.d(TAG, "updateScreenSize() called > screenWidth = " + screenWidth + ", screenHeight = " + screenHeight); if (DEBUG) Log.d(TAG, "updateScreenSize() called > screenWidth = " + screenWidth + ", screenHeight = " + screenHeight);
popupWidth = getResources().getDimension(R.dimen.popup_default_width);
popupHeight = getMinimumVideoHeight(popupWidth);
minimumWidth = getResources().getDimension(R.dimen.popup_minimum_width);
minimumHeight = getMinimumVideoHeight(minimumWidth);
maximumWidth = screenWidth;
maximumHeight = screenHeight;
}
private void updatePopupSize(int width, int height) {
//if (DEBUG) Log.d(TAG, "updatePopupSize() called with: width = [" + width + "], height = [" + height + "]");
width = (int) (width > maximumWidth ? maximumWidth : width < minimumWidth ? minimumWidth : width);
if (height == -1) height = (int) getMinimumVideoHeight(width);
else height = (int) (height > maximumHeight ? maximumHeight : height < minimumHeight ? minimumHeight : height);
windowLayoutParams.width = width;
windowLayoutParams.height = height;
popupWidth = width;
popupHeight = height;
if (DEBUG) Log.d(TAG, "updatePopupSize() updated values: width = [" + width + "], height = [" + height + "]");
windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams);
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
private class VideoPlayerImpl extends VideoPlayer { private class VideoPlayerImpl extends VideoPlayer {
private TextView resizingIndicator;
VideoPlayerImpl() { VideoPlayerImpl() {
super("VideoPlayerImpl" + PopupVideoPlayer.TAG, PopupVideoPlayer.this); super("VideoPlayerImpl" + PopupVideoPlayer.TAG, PopupVideoPlayer.this);
} }
@ -271,13 +338,20 @@ public class PopupVideoPlayer extends Service {
public void playUrl(String url, String format, boolean autoPlay) { public void playUrl(String url, String format, boolean autoPlay) {
super.playUrl(url, format, autoPlay); super.playUrl(url, format, autoPlay);
windowLayoutParams.width = (int) getMinimumVideoWidth(currentPopupHeight); windowLayoutParams.width = (int) popupWidth;
windowLayoutParams.height = (int) getMinimumVideoHeight(popupWidth);
windowManager.updateViewLayout(getRootView(), windowLayoutParams); windowManager.updateViewLayout(getRootView(), windowLayoutParams);
notBuilder = createNotification(); notBuilder = createNotification();
startForeground(NOTIFICATION_ID, notBuilder.build()); startForeground(NOTIFICATION_ID, notBuilder.build());
} }
@Override
public void initViews(View rootView) {
super.initViews(rootView);
resizingIndicator = (TextView) rootView.findViewById(R.id.resizing_indicator);
}
@Override @Override
public void destroy() { public void destroy() {
super.destroy(); super.destroy();
@ -337,7 +411,7 @@ public class PopupVideoPlayer extends Service {
@Override @Override
public void onDismiss(PopupMenu menu) { public void onDismiss(PopupMenu menu) {
super.onDismiss(menu); super.onDismiss(menu);
if (isPlaying()) animateView(getControlsRoot(), false, 500, 0); if (isPlaying()) hideControls(500, 0);
} }
@Override @Override
@ -347,7 +421,14 @@ public class PopupVideoPlayer extends Service {
stopSelf(); stopSelf();
} }
/*////////////////////////////////////////////////////////////////////////// @Override
public void onStopTrackingTouch(SeekBar seekBar) {
super.onStopTrackingTouch(seekBar);
if (playerImpl.wasPlaying()) {
hideControls(100, 0);
}
}
/*//////////////////////////////////////////////////////////////////////////
// Broadcast Receiver // Broadcast Receiver
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@ -422,12 +503,21 @@ public class PopupVideoPlayer extends Service {
showAndAnimateControl(R.drawable.ic_replay_white, false); showAndAnimateControl(R.drawable.ic_replay_white, false);
} }
@SuppressWarnings("WeakerAccess")
public TextView getResizingIndicator() {
return resizingIndicator;
}
} }
private class MySimpleOnGestureListener extends GestureDetector.SimpleOnGestureListener implements View.OnTouchListener { private class MySimpleOnGestureListener extends GestureDetector.SimpleOnGestureListener implements View.OnTouchListener {
private int initialPopupX, initialPopupY; private int initialPopupX, initialPopupY;
private boolean isMoving; private boolean isMoving;
private int onDownPopupWidth = 0;
private boolean isResizing;
private boolean isResizingRightSide;
@Override @Override
public boolean onDoubleTap(MotionEvent e) { public boolean onDoubleTap(MotionEvent e) {
if (DEBUG) Log.d(TAG, "onDoubleTap() called with: e = [" + e + "]" + "rawXy = " + e.getRawX() + ", " + e.getRawY() + ", xy = " + e.getX() + ", " + e.getY()); if (DEBUG) Log.d(TAG, "onDoubleTap() called with: e = [" + e + "]" + "rawXy = " + e.getRawX() + ", " + e.getRawY() + ", xy = " + e.getX() + ", " + e.getY());
@ -450,15 +540,34 @@ public class PopupVideoPlayer extends Service {
if (DEBUG) Log.d(TAG, "onDown() called with: e = [" + e + "]"); if (DEBUG) Log.d(TAG, "onDown() called with: e = [" + e + "]");
initialPopupX = windowLayoutParams.x; initialPopupX = windowLayoutParams.x;
initialPopupY = windowLayoutParams.y; initialPopupY = windowLayoutParams.y;
popupWidth = playerImpl.getRootView().getWidth(); popupWidth = windowLayoutParams.width;
popupHeight = playerImpl.getRootView().getHeight(); popupHeight = windowLayoutParams.height;
onDownPopupWidth = windowLayoutParams.width;
return false; return false;
} }
@Override
public void onLongPress(MotionEvent e) {
if (DEBUG) Log.d(TAG, "onLongPress() called with: e = [" + e + "]");
playerImpl.showAndAnimateControl(-1, true);
playerImpl.getLoadingPanel().setVisibility(View.GONE);
playerImpl.hideControls(0, 0);
animateView(playerImpl.getCurrentDisplaySeek(), false, 0, 0);
animateView(playerImpl.getResizingIndicator(), true, 200, 0);
isResizing = true;
isResizingRightSide = e.getRawX() > windowLayoutParams.x + (windowLayoutParams.width / 2f);
}
@Override @Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (!isMoving || playerImpl.getControlsRoot().getAlpha() != 1f) playerImpl.animateView(playerImpl.getControlsRoot(), true, 30, 0); if (isResizing) return false;
if (playerImpl.getCurrentState() != BasePlayer.STATE_BUFFERING
&& (!isMoving || playerImpl.getControlsRoot().getAlpha() != 1f)) playerImpl.showControls(0);
isMoving = true; isMoving = true;
float diffX = (int) (e2.getRawX() - e1.getRawX()), posX = (int) (initialPopupX + diffX); float diffX = (int) (e2.getRawX() - e1.getRawX()), posX = (int) (initialPopupX + diffX);
float diffY = (int) (e2.getRawY() - e1.getRawY()), posY = (int) (initialPopupY + diffY); float diffY = (int) (e2.getRawY() - e1.getRawY()), posY = (int) (initialPopupY + diffY);
@ -477,7 +586,7 @@ public class PopupVideoPlayer extends Service {
", e2.getRaw = [" + e2.getRawX() + ", " + e2.getRawY() + "]" + ", e2.getRaw = [" + e2.getRawX() + ", " + e2.getRawY() + "]" +
", distanceXy = [" + distanceX + ", " + distanceY + "]" + ", distanceXy = [" + distanceX + ", " + distanceY + "]" +
", posXy = [" + posX + ", " + posY + "]" + ", posXy = [" + posX + ", " + posY + "]" +
", popupWh rootView.get wh = [" + popupWidth + " x " + popupHeight + "]"); ", popupWh = [" + popupWidth + " x " + popupHeight + "]");
windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams);
return true; return true;
} }
@ -485,17 +594,39 @@ public class PopupVideoPlayer extends Service {
private void onScrollEnd() { private void onScrollEnd() {
if (DEBUG) Log.d(TAG, "onScrollEnd() called"); if (DEBUG) Log.d(TAG, "onScrollEnd() called");
if (playerImpl.isControlsVisible() && playerImpl.getCurrentState() == BasePlayer.STATE_PLAYING) { if (playerImpl.isControlsVisible() && playerImpl.getCurrentState() == BasePlayer.STATE_PLAYING) {
playerImpl.animateView(playerImpl.getControlsRoot(), false, 300, VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME); playerImpl.hideControls(300, VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME);
} }
} }
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
gestureDetector.onTouchEvent(event); gestureDetector.onTouchEvent(event);
if (event.getAction() == MotionEvent.ACTION_UP && isMoving) { if (event.getAction() == MotionEvent.ACTION_MOVE && isResizing && !isMoving) {
//if (DEBUG) Log.d(TAG, "onTouch() ACTION_MOVE > v = [" + v + "], e1.getRaw = [" + event.getRawX() + ", " + event.getRawY() + "]");
int width;
if (isResizingRightSide) width = (int) event.getRawX() - windowLayoutParams.x;
else {
width = (int) (windowLayoutParams.width + (windowLayoutParams.x - event.getRawX()));
if (width > minimumWidth) windowLayoutParams.x = initialPopupX - (width - onDownPopupWidth);
}
if (width <= maximumWidth && width >= minimumWidth) updatePopupSize(width, -1);
return true;
}
if (event.getAction() == MotionEvent.ACTION_UP) {
if (DEBUG) Log.d(TAG, "onTouch() ACTION_UP > v = [" + v + "], e1.getRaw = [" + event.getRawX() + ", " + event.getRawY() + "]");
if (isMoving) {
isMoving = false; isMoving = false;
onScrollEnd(); onScrollEnd();
} }
if (isResizing) {
isResizing = false;
animateView(playerImpl.getResizingIndicator(), false, 100, 0);
playerImpl.changeState(playerImpl.getCurrentState());
}
savePositionAndSize();
}
return true; return true;
} }

View File

@ -12,6 +12,7 @@ import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Handler;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
@ -36,12 +37,15 @@ import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.stream_info.AudioStream; import org.schabi.newpipe.extractor.stream_info.AudioStream;
import org.schabi.newpipe.extractor.stream_info.VideoStream; import org.schabi.newpipe.extractor.stream_info.VideoStream;
import org.schabi.newpipe.util.AnimationUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
/** /**
* Base for <b>video</b> players * Base for <b>video</b> players
* *
@ -101,6 +105,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
private ImageButton fullScreenButton; private ImageButton fullScreenButton;
private ValueAnimator controlViewAnimator; private ValueAnimator controlViewAnimator;
private Handler controlsVisibilityHandler = new Handler();
private boolean isQualityPopupMenuVisible = false; private boolean isQualityPopupMenuVisible = false;
private boolean qualityChanged = false; private boolean qualityChanged = false;
@ -235,6 +240,9 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
if (!isProgressLoopRunning.get()) startProgressLoop(); if (!isProgressLoopRunning.get()) startProgressLoop();
controlsVisibilityHandler.removeCallbacksAndMessages(null);
animateView(controlsRoot, false, 300);
showAndAnimateControl(-1, true); showAndAnimateControl(-1, true);
playbackSeekBar.setEnabled(true); playbackSeekBar.setEnabled(true);
playbackSeekBar.setProgress(0); playbackSeekBar.setProgress(0);
@ -242,10 +250,10 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
// Bug on lower api, disabling and enabling the seekBar resets the thumb color -.-, so sets the color again // Bug on lower api, disabling and enabling the seekBar resets the thumb color -.-, so sets the color again
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) playbackSeekBar.getThumb().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) playbackSeekBar.getThumb().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);
animateView(endScreen, false, 0, 0); animateView(endScreen, false, 0);
loadingPanel.setBackgroundColor(Color.BLACK); loadingPanel.setBackgroundColor(Color.BLACK);
animateView(loadingPanel, true, 0, 0); animateView(loadingPanel, true, 0);
animateView(surfaceForeground, true, 100, 0); animateView(surfaceForeground, true, 100);
} }
@Override @Override
@ -254,26 +262,21 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
if (!isProgressLoopRunning.get()) startProgressLoop(); if (!isProgressLoopRunning.get()) startProgressLoop();
showAndAnimateControl(-1, true); showAndAnimateControl(-1, true);
loadingPanel.setVisibility(View.GONE); loadingPanel.setVisibility(View.GONE);
animateView(controlsRoot, true, 500, 0, new Runnable() { showControlsThenHide();
@Override animateView(currentDisplaySeek, AnimationUtils.Type.SCALE_AND_ALPHA, false, 200);
public void run() {
animateView(controlsRoot, false, 500, DEFAULT_CONTROLS_HIDE_TIME, true);
}
});
animateView(currentDisplaySeek, false, 200, 0);
} }
@Override @Override
public void onBuffering() { public void onBuffering() {
if (DEBUG) Log.d(TAG, "onBuffering() called"); if (DEBUG) Log.d(TAG, "onBuffering() called");
loadingPanel.setBackgroundColor(Color.TRANSPARENT); loadingPanel.setBackgroundColor(Color.TRANSPARENT);
animateView(loadingPanel, true, 500, 0); animateView(loadingPanel, true, 500);
} }
@Override @Override
public void onPaused() { public void onPaused() {
if (DEBUG) Log.d(TAG, "onPaused() called"); if (DEBUG) Log.d(TAG, "onPaused() called");
animateView(controlsRoot, true, 500, 100); showControls(400);
loadingPanel.setVisibility(View.GONE); loadingPanel.setVisibility(View.GONE);
} }
@ -289,9 +292,9 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
if (isProgressLoopRunning.get()) stopProgressLoop(); if (isProgressLoopRunning.get()) stopProgressLoop();
animateView(controlsRoot, true, 500, 0); showControls(500);
animateView(endScreen, true, 800, 0); animateView(endScreen, true, 800);
animateView(currentDisplaySeek, false, 200, 0); animateView(currentDisplaySeek, AnimationUtils.Type.SCALE_AND_ALPHA, false, 200);
loadingPanel.setVisibility(View.GONE); loadingPanel.setVisibility(View.GONE);
playbackSeekBar.setMax((int) simpleExoPlayer.getDuration()); playbackSeekBar.setMax((int) simpleExoPlayer.getDuration());
@ -302,7 +305,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
// Bug on lower api, disabling and enabling the seekBar resets the thumb color -.-, so sets the color again // Bug on lower api, disabling and enabling the seekBar resets the thumb color -.-, so sets the color again
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) playbackSeekBar.getThumb().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) playbackSeekBar.getThumb().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);
animateView(surfaceForeground, true, 100, 0); animateView(surfaceForeground, true, 100);
if (currentRepeatMode == RepeatMode.REPEAT_ONE) { if (currentRepeatMode == RepeatMode.REPEAT_ONE) {
changeState(STATE_LOADING); changeState(STATE_LOADING);
@ -324,7 +327,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
@Override @Override
public void onRenderedFirstFrame() { public void onRenderedFirstFrame() {
animateView(surfaceForeground, false, 100, 0); animateView(surfaceForeground, false, 100);
} }
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
@ -443,7 +446,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called"); if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called");
qualityPopupMenu.show(); qualityPopupMenu.show();
isQualityPopupMenuVisible = true; isQualityPopupMenuVisible = true;
animateView(getControlsRoot(), true, 300, 0); showControls(300);
VideoStream videoStream = getSelectedVideoStream(); VideoStream videoStream = getSelectedVideoStream();
qualityTextView.setText(MediaFormat.getNameById(videoStream.format) + " " + videoStream.resolution); qualityTextView.setText(MediaFormat.getNameById(videoStream.format) + " " + videoStream.resolution);
@ -469,8 +472,8 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
wasPlaying = isPlaying(); wasPlaying = isPlaying();
if (isPlaying()) simpleExoPlayer.setPlayWhenReady(false); if (isPlaying()) simpleExoPlayer.setPlayWhenReady(false);
animateView(controlsRoot, true, 0, 0); showControls(0);
animateView(currentDisplaySeek, true, 300, 0); animateView(currentDisplaySeek, AnimationUtils.Type.SCALE_AND_ALPHA, true, 300);
} }
@Override @Override
@ -481,7 +484,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
if (wasPlaying || simpleExoPlayer.getDuration() == seekBar.getProgress()) simpleExoPlayer.setPlayWhenReady(true); if (wasPlaying || simpleExoPlayer.getDuration() == seekBar.getProgress()) simpleExoPlayer.setPlayWhenReady(true);
playbackCurrentTime.setText(getTimeString(seekBar.getProgress())); playbackCurrentTime.setText(getTimeString(seekBar.getProgress()));
animateView(currentDisplaySeek, false, 200, 0); animateView(currentDisplaySeek, AnimationUtils.Type.SCALE_AND_ALPHA, false, 200);
if (getCurrentState() == STATE_PAUSED_SEEK) changeState(STATE_BUFFERING); if (getCurrentState() == STATE_PAUSED_SEEK) changeState(STATE_BUFFERING);
if (!isProgressLoopRunning.get()) startProgressLoop(); if (!isProgressLoopRunning.get()) startProgressLoop();
@ -550,107 +553,37 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
controlViewAnimator.start(); controlViewAnimator.start();
} }
public void animateView(View view, boolean enterOrExit, long duration, long delay) {
animateView(view, enterOrExit, duration, delay, null, false);
}
public void animateView(View view, boolean enterOrExit, long duration, long delay, boolean hideUi) {
animateView(view, enterOrExit, duration, delay, null, hideUi);
}
public void animateView(final View view, final boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
animateView(view, enterOrExit, duration, delay, execOnEnd, false);
}
/**
* Animate the view
*
* @param view view that will be animated
* @param enterOrExit true to enter, false to exit
* @param duration how long the animation will take, in milliseconds
* @param delay how long the animation will wait to start, in milliseconds
* @param execOnEnd runnable that will be executed when the animation ends
* @param hideUi need to hide ui when animation ends,
* just a helper for classes extending this
*/
public void animateView(final View view, final boolean enterOrExit, long duration, long delay, final Runnable execOnEnd, boolean hideUi) {
if (DEBUG) {
Log.d(TAG, "animateView() called with: view = [" + view + "], enterOrExit = [" + enterOrExit + "], duration = [" + duration + "], delay = [" + delay + "], execOnEnd = [" + execOnEnd + "]");
}
if (view.getVisibility() == View.VISIBLE && enterOrExit) {
if (DEBUG) Log.d(TAG, "animateView() view was already visible > view = [" + view + "]");
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
view.setAlpha(1f);
if (execOnEnd != null) execOnEnd.run();
return;
} else if ((view.getVisibility() == View.GONE || view.getVisibility() == View.INVISIBLE) && !enterOrExit) {
if (DEBUG) Log.d(TAG, "animateView() view was already gone > view = [" + view + "]");
view.animate().setListener(null).cancel();
view.setVisibility(View.GONE);
view.setAlpha(0f);
if (execOnEnd != null) execOnEnd.run();
return;
}
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
if (view == controlsRoot) {
if (enterOrExit) {
view.animate().alpha(1f).setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null) execOnEnd.run();
}
}).start();
} else {
view.animate().alpha(0f)
.setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null) execOnEnd.run();
}
})
.start();
}
return;
}
if (enterOrExit) {
view.setAlpha(0f);
view.setScaleX(.8f);
view.setScaleY(.8f);
view.animate().alpha(1f).scaleX(1f).scaleY(1f).setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null) execOnEnd.run();
}
}).start();
} else {
view.setAlpha(1f);
view.setScaleX(1f);
view.setScaleY(1f);
view.animate().alpha(0f).scaleX(.8f).scaleY(.8f).setDuration(duration).setStartDelay(delay)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null) execOnEnd.run();
}
})
.start();
}
}
public boolean isQualityMenuVisible() { public boolean isQualityMenuVisible() {
return isQualityPopupMenuVisible; return isQualityPopupMenuVisible;
} }
public void showControlsThenHide() {
if (DEBUG) Log.d(TAG, "showControlsThenHide() called");
animateView(controlsRoot, true, 300, 0, new Runnable() {
@Override
public void run() {
hideControls(300, DEFAULT_CONTROLS_HIDE_TIME);
}
});
}
public void showControls(long duration) {
if (DEBUG) Log.d(TAG, "showControls() called");
controlsVisibilityHandler.removeCallbacksAndMessages(null);
animateView(controlsRoot, true, duration);
}
public void hideControls(final long duration, long delay) {
if (DEBUG) Log.d(TAG, "hideControls() called with: delay = [" + delay + "]");
controlsVisibilityHandler.removeCallbacksAndMessages(null);
controlsVisibilityHandler.postDelayed(new Runnable() {
@Override
public void run() {
animateView(controlsRoot, false, duration);
}
}, delay);
}
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Getters and Setters // Getters and Setters
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@ -711,6 +644,10 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.
this.startedFromNewPipe = startedFromNewPipe; this.startedFromNewPipe = startedFromNewPipe;
} }
public Handler getControlsVisibilityHandler() {
return controlsVisibilityHandler;
}
public View getRootView() { public View getRootView() {
return rootView; return rootView;
} }

View File

@ -0,0 +1,126 @@
package org.schabi.newpipe.util;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.util.Log;
import android.view.View;
import org.schabi.newpipe.player.BasePlayer;
public class AnimationUtils {
private static final String TAG = "AnimationUtils";
private static final boolean DEBUG = BasePlayer.DEBUG;
public enum Type {
ALPHA, SCALE_AND_ALPHA
}
public static void animateView(View view, boolean enterOrExit, long duration) {
animateView(view, Type.ALPHA, enterOrExit, duration, 0, null);
}
public static void animateView(View view, boolean enterOrExit, long duration, long delay) {
animateView(view, Type.ALPHA, enterOrExit, duration, delay, null);
}
public static void animateView(View view, boolean enterOrExit, long duration, long delay, Runnable execOnEnd) {
animateView(view, Type.ALPHA, enterOrExit, duration, delay, execOnEnd);
}
public static void animateView(View view, Type animationType, boolean enterOrExit, long duration) {
animateView(view, animationType, enterOrExit, duration, 0, null);
}
public static void animateView(View view, Type animationType, boolean enterOrExit, long duration, long delay) {
animateView(view, animationType, enterOrExit, duration, delay, null);
}
/**
* Animate the view
*
* @param view view that will be animated
* @param animationType {@link Type} of the animation
* @param enterOrExit true to enter, false to exit
* @param duration how long the animation will take, in milliseconds
* @param delay how long the animation will wait to start, in milliseconds
* @param execOnEnd runnable that will be executed when the animation ends
*/
public static void animateView(final View view, Type animationType, boolean enterOrExit, long duration, long delay, Runnable execOnEnd) {
if (DEBUG) {
Log.d(TAG, "animateView() called with: view = [" + view + "], animationType = [" + animationType + "], enterOrExit = [" + enterOrExit + "], duration = [" + duration + "], delay = [" + delay + "], execOnEnd = [" + execOnEnd + "]");
}
if (view.getVisibility() == View.VISIBLE && enterOrExit) {
if (DEBUG) Log.d(TAG, "animateView() view was already visible > view = [" + view + "]");
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
view.setAlpha(1f);
if (execOnEnd != null) execOnEnd.run();
return;
} else if ((view.getVisibility() == View.GONE || view.getVisibility() == View.INVISIBLE) && !enterOrExit) {
if (DEBUG) Log.d(TAG, "animateView() view was already gone > view = [" + view + "]");
view.animate().setListener(null).cancel();
view.setVisibility(View.GONE);
view.setAlpha(0f);
if (execOnEnd != null) execOnEnd.run();
return;
}
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
switch (animationType) {
case ALPHA:
animateAlpha(view, enterOrExit, duration, delay, execOnEnd);
break;
case SCALE_AND_ALPHA:
animateScaleAndAlpha(view, enterOrExit, duration, delay, execOnEnd);
break;
}
}
private static void animateScaleAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
if (enterOrExit) {
view.setAlpha(0f);
view.setScaleX(.8f);
view.setScaleY(.8f);
view.animate().alpha(1f).scaleX(1f).scaleY(1f).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null) execOnEnd.run();
}
}).start();
} else {
view.setAlpha(1f);
view.setScaleX(1f);
view.setScaleY(1f);
view.animate().alpha(0f).scaleX(.8f).scaleY(.8f).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null) execOnEnd.run();
}
}).start();
}
}
private static void animateAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
if (enterOrExit) {
view.animate().alpha(1f).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null) execOnEnd.run();
}
}).start();
} else {
view.animate().alpha(0f).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null) execOnEnd.run();
}
}).start();
}
}
}

View File

@ -1,10 +1,12 @@
package org.schabi.newpipe; package org.schabi.newpipe.util;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import org.schabi.newpipe.R;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;

View File

@ -5,7 +5,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black" android:background="@android:color/black"
android:gravity="center"> android:gravity="center"
tools:layout_width="@dimen/popup_default_width"
tools:layout_height="101.25dp">
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout <com.google.android.exoplayer2.ui.AspectRatioFrameLayout
@ -189,4 +191,21 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:indeterminate="true"/> android:indeterminate="true"/>
</RelativeLayout> </RelativeLayout>
<TextView
android:id="@+id/resizing_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|top"
android:background="#6e000000"
android:gravity="center"
android:padding="5dp"
android:text="@string/popup_resizing_indicator_title"
android:textColor="@android:color/white"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible"/>
</FrameLayout> </FrameLayout>

View File

@ -0,0 +1,227 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- <string name="app_name" translatable="false">NewPipe</string> -->
<string name="main_bg_subtitle">শুরু করতে অনুসন্ধান এ আলতো চাপ</string>
<string name="background_player_name">NewPipe ব্যাকগ্রাউন্ড প্লেয়ার</string>
<!-- <string name="title_videoitem_detail" translatable="false">NewPipe</string> -->
<string name="view_count_text">%1$s বার দেখা হয়েছে</string>
<string name="upload_date_text">প্রকাশকাল %1$s</string>
<string name="no_player_found">কোন স্ট্রিম প্লেয়ার পাওয়া যায়নি। তুমি কি VLC ইনস্টল করতে চাও?</string>
<string name="install">ইনস্টল</string>
<string name="cancel">বাদ দাও</string>
<!-- <string name="fdroid_vlc_url" translatable="false">https://f-droid.org/repository/browse/?fdfilter=vlc&amp;fdid=org.videolan.vlc</string> -->
<string name="open_in_browser">ব্রাউজারে খোলো</string>
<string name="open_in_popup_mode">পপআপ মোডে খোলো</string>
<string name="share">শেয়ার</string>
<string name="loading">লোড হচ্ছে</string>
<string name="download">ডাউনলোড</string>
<string name="search">খোঁজ</string>
<string name="settings">সেটিং</string>
<string name="did_you_mean">তুমি কি বলতে চাচ্ছ %1$s ?</string>
<string name="search_page">"পেজ খোঁজ : "</string>
<string name="share_dialog_title">শেয়ার কর</string>
<string name="choose_browser">ব্রাউজার পছন্দ কর</string>
<string name="screen_rotation">রোটেশন</string>
<string name="settings_activity_title">সেটিং</string>
<string name="use_external_video_player_title">বাহ্যিক ভিডিও প্লেয়ার ব্যবহার করো</string>
<string name="use_external_audio_player_title">বাহ্যিক অডিও প্লেয়ার ব্যবহার করো</string>
<string name="popup_mode_share_menu_title">NewPipe পপআপ মোড</string>
<string name="controls_background_title">ব্যাকগ্রাউন্ড</string>
<string name="controls_popup_title">পপআপ</string>
<string name="download_path_title">Video download path</string>
<string name="download_path_summary">ডাউনলোড করা ভিডিও সঞ্চয় পাথ করার পাথ</string>
<string name="download_path_dialog_title">ভিডিওগুলির জন্য ডাউনলোডের পাথ প্রবেশ করাও</string>
<string name="download_path_audio_title">অডিও ডাউনলোড পাথ</string>
<string name="download_path_audio_summary">ডাউনলোড করা অডিও সঞ্চয় পাথ করার পাথ</string>
<string name="download_path_audio_dialog_title">অডিও ফাইলগুলির জন্য ডাউনলোডের পাথ প্রবেশ করাও</string>
<string name="autoplay_by_calling_app_title"> স্বয়ংক্রিয়ভাবে প্লে করুন যখন অন্য অ্যাপ্লিকেশন থেকে চালু করা হয়</string>
<string name="autoplay_by_calling_app_summary">স্বয়ংক্রিয়ভাবে একটি ভিডিও প্লে করো যখন NewPipe অন্য অ্যাপ্লিকেশন থেকে চালু করা হয়।</string>
<string name="default_resolution_title">ডিফল্ট রেজল্যুশন</string>
<string name="default_popup_resolution_title">ডিফল্ট পপআপ রেজল্যুশন</string>
<string name="show_higher_resolutions_title">উচ্চ রেজুলেশন দেখাও</string>
<string name="show_higher_resolutions_summary">শুধুমাত্র কিছু ডিভাইস 2k / 4k ভিডিও চালানোয় সমর্থন</string>
<string name="play_with_kodi_title">Kodi এর মাধ্যমে চালাও</string>
<string name="kore_not_found">Kore অ্যাপ্লিকেশন খুঁজে পাওয়া যায়নি। Kore ইনস্টল করবে?</string>
<!-- <string name="fdroid_kore_url" translatable="false">https://f-droid.org/repository/browse/?fdfilter=Kore&amp;fdid=org.xbmc.kore</string> -->
<string name="show_play_with_kodi_title">দেখাও \"Kodi এর মাধ্যমে চালাও \" বিকল্প</string>
<string name="show_play_with_kodi_summary">Kodi মিডিয়া সেন্টারে এর মাধ্যমে একটি ভিডিও প্লে করার জন্য একটি বিকল্প প্রদর্শন কর</string>
<string name="play_audio">অডিও</string>
<string name="default_audio_format_title">ডিফল্ট অডিও ফরম্যাট</string>
<string name="preferred_video_format_title">পছন্দের ভিডিও ফরম্যাট</string>
<string name="webm_description">WebM — বিনামূল্য/স্বাধীন ফরম্যাট</string>
<string name="m4a_description">m4a — ভালো মানের</string>
<string name="theme_title">থিম</string>
<string name="light_theme_title">উজ্জ্বল</string>
<string name="dark_theme_title">অন্ধকার</string>
<string name="black_theme_title">কালো</string>
<string name="popup_remember_size_pos_title">পপআপ আকার এবং অবস্থান মনে রাখো</string>
<string name="popup_remember_size_pos_summary">শেষ আকার এবং পপআপ সেট অবস্থান মনে রাখো</string>
<string name="download_dialog_title">ডাউনলোড</string>
<string-array name="download_options">
<item>ভিডিও</item>
<item>অডিও</item>
</string-array>
<string-array name="download_options_no_audio">
<item>ভিডিও</item>
</string-array>
<string-array name="download_options_no_video">
<item>অডিও</item>
</string-array>
<!-- <string-array name="theme_description_list">
<item>@string/light_theme_title</item>
<item>@string/dark_theme_title</item>
<item>@string/black_theme_title</item>
</string-array> -->
<string name="next_video_title">পরবর্তী ভিডিওগুলি</string>
<string name="show_next_and_similar_title">পরবর্তী এবং অনুরূপ ভিডিওগুলি দেখাও</string>
<string name="url_not_supported_toast">URL সমর্থিত নয়</string>
<string name="similar_videos_btn_text">অনুরূপ ভিডিওগুলি</string>
<string name="search_language_title">Preferred content language</string>
<string name="settings_category_video_audio_title">ভিডিও এবং অডিও</string>
<string name="settings_category_popup_title">পপআপ</string>
<string name="settings_category_appearance_title">এপিয়ারেন্স</string>
<string name="settings_category_other_title">অন্যান্য</string>
<!-- <string name="background_player_time_text" translatable="false">%1$s - NewPipe</string> -->
<string name="background_player_playing_toast">ব্যাকগ্রাউন্ডে বাজাও</string>
<string name="popup_playing_toast">পপআপ মোডে চালাও</string>
<!-- <string name="c3s_url" translatable="false">https://www.c3s.cc/</string> -->
<string name="play_btn_text">চালাও</string>
<string name="content">কনটেন্ট</string>
<string name="show_age_restricted_content_title">বয়স সীমাবদ্ধ কনটেন্ট দেখাও</string>
<string name="video_is_age_restricted">ভিডিওটিকে বয়স সীমিত করা হয়েছে। প্রথমে সেটিংসে বয়স সীমাবদ্ধ ভিডিওগুলি সক্ষম করুন।</string>
<string name="duration_live">লাইভ</string>
<string name="downloads">ডাউনলোড</string>
<string name="downloads_title">ডাউনলোড</string>
<string name="settings_title">সেটিং</string>
<string name="error_report_title">ত্রুটির তথ্য প্রতিবেদন</string>
<string name="all">সবগুলি</string>
<string name="channel">চ্যানেল</string>
<string name="yes">হ্যা</string>
<string name="later">পরবর্তী সময়ে</string>
<string name="disabled">নিস্ক্রীয়</string>
<string name="filter">Filter</string>
<string name="refresh">রিফ্রেশ</string>
<string name="clear">পরিষ্কার</string>
<string name="popup_resizing_indicator_title">আকার পরিবর্তন</string>
<!-- error strings -->
<string name="general_error">ত্রুটি</string>
<string name="network_error">নেটওয়ার্ক ত্রুটি</string>
<string name="could_not_load_thumbnails">সব থাম্বনেইল লোড করা যায়নি</string>
<string name="youtube_signature_decryption_error">ভিডিও URL স্বাক্ষর ডিক্রিপ্ট করা যায়নি।</string>
<string name="parsing_error">ওয়েবসাইট বিশ্লেষন করা যায়নি।</string>
<string name="light_parsing_error">ওয়েবসাইট সম্পুর্নভাবে বিশ্লেষন করা যায়নি।</string>
<string name="content_not_available">কনটেন্ট উপলব্ধ নয়</string>
<string name="blocked_by_gema">GEMA কর্তৃক ব্লক করা হয়েছে</string>
<string name="could_not_setup_download_menu">ডাউনলোড মেনু সেটআপ করা যায়নি</string>
<string name="live_streams_not_supported">এটি একটি লাইভ স্ট্রিম। যা এখনও সমর্থিত নয়।</string>
<string name="could_not_get_stream">কোনও স্ট্রিম পাওয়া যায়নি।</string>
<string name="could_not_load_image">চিত্র লোড করা যায়নি</string>
<string name="app_ui_crash">অ্যাপ / UI ক্র্যাশ করেছে</string>
<!-- error activity -->
<string name="sorry_string">দুঃখিত এটা ঘটা উচিত ছিল না</string>
<!-- <string name="guru_meditation" translatable="false">Guru Meditation.</string> -->
<string name="error_report_button_text">মেলের মাধ্যমে ত্রুটি প্রতিবেদন করুন</string>
<string name="error_snackbar_message">দুঃখিত কিছু ত্রুটি ঘটেছে</string>
<string name="error_snackbar_action">প্রতিবেদন</string>
<string name="what_device_headline">তথ্য:</string>
<string name="what_happened_headline">কি হয়েছিল:</string>
<!-- <string name="info_labels">What:\\nRequest:\\nContent Lang:\\nService:\\nGMT Time:\\nPackage:\\nVersion:\\nOS version:\\nGlob. IP range:</string> -->
<string name="info_searched_lbl">অনুসন্ধান:</string>
<string name="info_requested_stream_lbl">অনুরোধ করা স্ট্রিম:</string>
<string name="your_comment">তোমার মন্তব্য (ইংরেজিতে):</string>
<string name="error_details_headline">বর্ণনা:</string>
<!-- Content descriptions (for better accessibility) -->
<string name="list_thumbnail_view_description">ভিডিও প্রাকদর্শন থাম্বনেইল</string>
<string name="detail_thumbnail_view_description">ভিডিও প্রাকদর্শন থাম্বনেইল</string>
<string name="detail_uploader_thumbnail_view_description">আপলোডারের ইউজারপিক থাম্বনেইল</string>
<string name="detail_likes_img_view_description">পছন্দ</string>
<string name="detail_dislikes_img_view_description">অপছন্দ</string>
<string name="use_tor_title">টর ব্যবহার করো</string>
<string name="use_tor_summary">(পরীক্ষামূলক) গোপনীয়তা বর্ধিত করতে টর এর মাধ্যমে ডাউনলোড ট্রাফিক জোরপুর্বক পাঠাও (ভিডিওগুলি স্ট্রিমিং সমর্থিত নয়)</string>
<string name="report_error">একটি ত্রুটি রিপোর্ট করো</string>
<string name="user_report">ব্যবহারকারীর প্রতিবেদন</string>
<string name="err_dir_create">\'%1$s\' ডাউনলোড ডিরেক্টরি তৈরি করতে পারছে না</string>
<string name="info_dir_created">\'%1$s\' ডাউনলোড ডিরেক্টরি তৈরি করা হয়েছে</string>
<string name="enable_background_audio">ব্যাকগ্রাউন্ড এ চালাও</string>
<string name="video">ভিডিও</string>
<string name="audio">অডিও</string>
<string name="text">টেক্সট</string>
<string name="logging">লগিং</string>
<string name="logging_normal">সাধারণ</string>
<string name="logging_verbose">বাগাড়ম্বরপূর্ণ</string>
<string name="retry">পুনরায় চেষ্টা করো</string>
<string name="off">[বন্ধ]</string>
<string name="error_drm_not_supported">সুরক্ষিত কনটেন্ট 18 বছরের নিচে API মাত্রাগুলি সমর্থিত নয়</string>
<string name="error_drm_unsupported_scheme">এই ডিভাইসটি প্রয়োজনীয় DRM স্কিমের সমর্থন করে না</string>
<string name="error_drm_unknown">একটি অজানা DRM ত্রূটি ঘটেছে</string>
<string name="error_no_decoder">এই ডিভাইসটি <xliff:g id="mime_type">%1$s</xliff:g> এর জন্য একটি ডিকোডার প্রদান করে না</string>
<string name="error_no_secure_decoder">এই ডিভাইসটি <xliff:g id="mime_type">%1$s</xliff:g> এর জন্য একটি নিরাপদ ডিকোডার প্রদান করে না</string>
<string name="error_querying_decoders">ডিভাইস ডিকোডার জিজ্ঞাসা করতে অক্ষমs</string>
<string name="error_instantiating_decoder">ডিকোডার চালু করতে অক্ষম <xliff:g id="decoder_name">%1$s</xliff:g></string>
<string name="storage_permission_denied">স্টোরেজ অ্যাক্সেস করার অনুমতি অস্বীকার করা হয়েছে</string>
<string name="use_old_player_title">পুরানো প্লেয়ার ব্যবহার করো</string>
<string name="use_old_player_summary">মিডিয়াফ্রেমওয়ার্ক প্লেয়ারের পুরানো বিল্ড।</string>
<string name="videos">ভিডিওগুলি</string>
<string name="subscriber">গ্রাহক</string>
<string name="subscriber_plural">গ্রাহকরা</string>
<string name="subscribe">সাবস্ক্রাইব</string>
<string name="views">প্রদর্শন</string>
<string name="short_thousand">K</string>
<string name="short_million">M</string>
<string name="short_billion">B</string>
<!-- Missions -->
<string name="start">শুরু</string>
<string name="pause">বিরতি</string>
<string name="view">প্রদর্শন</string>
<string name="delete">ডিলেট</string>
<string name="checksum">চেকসাম</string>
<!-- Fragment -->
<string name="add">নতুন মিশন</string>
<string name="finish">ঠিক আছে</string>
<string name="switch_mode">তালিকা এবং গ্রিডের মধ্যে পরিবর্তন করো</string>
<!-- Msg -->
<string name="msg_url">ডাউনলোড URL</string>
<string name="msg_name">ফাইলের নাম</string>
<string name="msg_threads">থ্রেড</string>
<string name="msg_fetch_filename">ফাইলের নাম আনো</string>
<string name="msg_error">ভুল বার্তা</string>
<string name="msg_server_unsupported">সার্ভার অসমর্থিত</string>
<string name="msg_exists">ফাইল ইতিমধ্যে বিদ্যমান</string>
<string name="msg_url_malform">বিকৃত URL অথবা ইন্টারনেট নেই</string>
<string name="msg_running">NewPipe ডাউনলোড হচ্ছে</string>
<string name="msg_running_detail">বিস্তারিত জানার জন্য আলতো চাপ</string>
<string name="msg_wait">অনুগ্রহপূর্বক অপেক্ষা করো…</string>
<string name="msg_copied">ক্লিপবোর্ডে অনুলিপি করা হয়েছে</string>
<string name="no_available_dir">অনুগ্রহ করে একটি ডাউনলোড ডিরেক্টরি নির্বাচন করো</string>
<string name="msg_popup_permission">এই অনুমতিটি পপআপ মোডে খুলতে প্রয়োজন</string>
<!-- Checksum types -->
<!-- <string name="md5" translatable="false">MD5</string> -->
<!-- <string name="sha1" translatable="false">SHA1</string> -->
<string name="title_activity_channel">চ্যানেলের ক্রিয়াকলাপ</string>
<string name="action_settings">সেটিং</string>
<string name="reCaptchaActivity">reCAPTCHA</string>
<string name="reCaptcha_title">reCAPTCHA চ্যালেঞ্জ</string>
<string name="recaptcha_request_toast">reCAPTCHA চ্যালেঞ্জ অনুরোধ করা হয়েছে</string>
<!-- End of GigaGet's Strings -->
</resources>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="popup_default_width">230dp</dimen>
<dimen name="popup_minimum_width">140dp</dimen>
<!-- Video Item Detail View Dimensions--> <!-- Video Item Detail View Dimensions-->
<!-- Text Size --> <!-- Text Size -->
<dimen name="channel_item_detail_title_text_size">18sp</dimen> <dimen name="channel_item_detail_title_text_size">18sp</dimen>

View File

@ -17,7 +17,8 @@
<dimen name="video_item_search_duration_horizontal_padding">5sp</dimen> <dimen name="video_item_search_duration_horizontal_padding">5sp</dimen>
<dimen name="video_item_search_duration_margin">2sp</dimen> <dimen name="video_item_search_duration_margin">2sp</dimen>
<!-- Miscellaneous --> <!-- Miscellaneous -->
<dimen name="popup_default_width">180dp</dimen>
<dimen name="popup_minimum_width">120dp</dimen>
<!-- Video Item Detail View Dimensions--> <!-- Video Item Detail View Dimensions-->
<!-- Text Size --> <!-- Text Size -->
<dimen name="video_item_detail_title_text_size">16sp</dimen> <dimen name="video_item_detail_title_text_size">16sp</dimen>

View File

@ -2,6 +2,7 @@
<resources translatable="false"> <resources translatable="false">
<!-- Categories --> <!-- Categories -->
<string name="settings_category_video_audio" translatable="false">settings_category_video_audio</string> <string name="settings_category_video_audio" translatable="false">settings_category_video_audio</string>
<string name="settings_category_popup" translatable="false">settings_category_popup</string>
<string name="settings_category_appearance" translatable="false">settings_category_appearance</string> <string name="settings_category_appearance" translatable="false">settings_category_appearance</string>
<string name="settings_content_options" translatable="false">settings_content_options</string> <string name="settings_content_options" translatable="false">settings_content_options</string>
<string name="settings_category_other" translatable="false">settings_category_other</string> <string name="settings_category_other" translatable="false">settings_category_other</string>
@ -27,6 +28,8 @@
<item>144p</item> <item>144p</item>
</string-array> </string-array>
<string name="popup_remember_size_pos_key" translatable="false">popup_remember_size_pos_key</string>
<string name="default_popup_resolution_key" translatable="false">default_popup_resolution_key</string> <string name="default_popup_resolution_key" translatable="false">default_popup_resolution_key</string>
<string name="default_popup_resolution_value" translatable="false">480p</string> <string name="default_popup_resolution_value" translatable="false">480p</string>

View File

@ -59,6 +59,8 @@
<string name="light_theme_title">Light</string> <string name="light_theme_title">Light</string>
<string name="dark_theme_title">Dark</string> <string name="dark_theme_title">Dark</string>
<string name="black_theme_title">Black</string> <string name="black_theme_title">Black</string>
<string name="popup_remember_size_pos_title">Remember popup size and position</string>
<string name="popup_remember_size_pos_summary">Remember the last size and position set to the popup</string>
<string name="download_dialog_title">Download</string> <string name="download_dialog_title">Download</string>
<string-array name="download_options"> <string-array name="download_options">
@ -86,6 +88,7 @@
<string name="similar_videos_btn_text">Similar videos</string> <string name="similar_videos_btn_text">Similar videos</string>
<string name="search_language_title">Preferred content language</string> <string name="search_language_title">Preferred content language</string>
<string name="settings_category_video_audio_title">Video &amp; Audio</string> <string name="settings_category_video_audio_title">Video &amp; Audio</string>
<string name="settings_category_popup_title">Popup</string>
<string name="settings_category_appearance_title">Appearance</string> <string name="settings_category_appearance_title">Appearance</string>
<string name="settings_category_other_title">Other</string> <string name="settings_category_other_title">Other</string>
<string name="background_player_time_text" translatable="false">%1$s - NewPipe</string> <string name="background_player_time_text" translatable="false">%1$s - NewPipe</string>
@ -109,6 +112,7 @@
<string name="filter">Filter</string> <string name="filter">Filter</string>
<string name="refresh">Refresh</string> <string name="refresh">Refresh</string>
<string name="clear">Clear</string> <string name="clear">Clear</string>
<string name="popup_resizing_indicator_title">Resizing</string>
<!-- error strings --> <!-- error strings -->
<string name="general_error">Error</string> <string name="general_error">Error</string>

View File

@ -27,14 +27,6 @@
android:summary="%s" android:summary="%s"
android:defaultValue="@string/default_resolution_value"/> android:defaultValue="@string/default_resolution_value"/>
<ListPreference
android:key="@string/default_popup_resolution_key"
android:title="@string/default_popup_resolution_title"
android:entries="@array/resolution_list"
android:entryValues="@array/resolution_list"
android:summary="%s"
android:defaultValue="@string/default_popup_resolution_value"/>
<CheckBoxPreference <CheckBoxPreference
android:key="@string/show_higher_resolutions_key" android:key="@string/show_higher_resolutions_key"
android:title="@string/show_higher_resolutions_title" android:title="@string/show_higher_resolutions_title"
@ -64,6 +56,28 @@
android:summary="@string/use_old_player_summary" android:summary="@string/use_old_player_summary"
android:defaultValue="false"/> android:defaultValue="false"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:key="@string/settings_category_popup"
android:title="@string/settings_category_popup_title"
android:textAllCaps="true">
<ListPreference
android:key="@string/default_popup_resolution_key"
android:title="@string/default_popup_resolution_title"
android:entries="@array/resolution_list"
android:entryValues="@array/resolution_list"
android:summary="%s"
android:defaultValue="@string/default_popup_resolution_value"/>
<CheckBoxPreference
android:key="@string/popup_remember_size_pos_key"
android:title="@string/popup_remember_size_pos_title"
android:summary="@string/popup_remember_size_pos_summary"
android:defaultValue="true"/>
</PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:key="@string/settings_category_appearance" android:key="@string/settings_category_appearance"
android:title="@string/settings_category_appearance_title" android:title="@string/settings_category_appearance_title"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB