Merge remote-tracking branch 'origin/dev' into dev
|
@ -15,9 +15,9 @@ Version 2, June 1991
|
|||
</p>
|
||||
|
||||
<pre>
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.<br/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA<br/>
|
||||
<br/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
</pre>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Mozilla Public License, version 2.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="mozilla-public-license-version-2.0">Mozilla Public License<br>Version 2.0</h1>
|
||||
<h2 id="definitions">1. Definitions</h2>
|
||||
|
|
|
@ -181,7 +181,6 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
|
|||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -51,6 +51,10 @@ public class License implements Parcelable {
|
|||
return abbreviation;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
|
|
|
@ -1,22 +1,13 @@
|
|||
package org.schabi.newpipe.about;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebView;
|
||||
import android.view.*;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -48,25 +39,7 @@ public class LicenseFragment extends Fragment {
|
|||
* @param license the license to show
|
||||
*/
|
||||
public static void showLicense(Context context, License license) {
|
||||
if(context == null) {
|
||||
throw new NullPointerException("context is null");
|
||||
}
|
||||
if(license == null) {
|
||||
throw new NullPointerException("license is null");
|
||||
}
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||
alert.setTitle(license.getName());
|
||||
|
||||
WebView wv = new WebView(context);
|
||||
wv.loadUrl(license.getContentUri().toString());
|
||||
alert.setView(wv);
|
||||
alert.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
alert.show();
|
||||
new LicenseFragmentHelper().execute(context, license);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -111,7 +84,6 @@ public class LicenseFragment extends Fragment {
|
|||
});
|
||||
softwareComponentsView.addView(componentView);
|
||||
registerForContextMenu(componentView);
|
||||
|
||||
}
|
||||
return rootView;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package org.schabi.newpipe.about;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.webkit.WebView;
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.util.ThemeHelper;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class LicenseFragmentHelper extends AsyncTask<Object, Void, Integer> {
|
||||
|
||||
private Context context;
|
||||
private License license;
|
||||
|
||||
@Override
|
||||
protected Integer doInBackground(Object... objects) {
|
||||
context = (Context) objects[0];
|
||||
license = (License) objects[1];
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Integer result){
|
||||
String webViewData = getFormattedLicense(context, license);
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||
alert.setTitle(license.getName());
|
||||
|
||||
WebView wv = new WebView(context);
|
||||
wv.loadData(webViewData, "text/html; charset=UTF-8", null);
|
||||
|
||||
alert.setView(wv);
|
||||
alert.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
alert.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context the context to use
|
||||
* @param license the license
|
||||
* @return String which contains a HTML formatted license page styled according to the context's theme
|
||||
*/
|
||||
public static String getFormattedLicense(Context context, License license) {
|
||||
if(context == null) {
|
||||
throw new NullPointerException("context is null");
|
||||
}
|
||||
if(license == null) {
|
||||
throw new NullPointerException("license is null");
|
||||
}
|
||||
|
||||
String licenseContent = "";
|
||||
String webViewData;
|
||||
try {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(context.getAssets().open(license.getFilename()), "UTF-8"));
|
||||
String str;
|
||||
while ((str = in.readLine()) != null) {
|
||||
licenseContent += str;
|
||||
}
|
||||
in.close();
|
||||
|
||||
// split the HTML file and insert the stylesheet into the HEAD of the file
|
||||
String[] insert = licenseContent.split("</head>");
|
||||
webViewData = insert[0] + "<style type=\"text/css\">"
|
||||
+ getLicenseStylesheet(context) + "</style></head>"
|
||||
+ insert[1];
|
||||
} catch (Exception e) {
|
||||
throw new NullPointerException("could not get license file:" + getLicenseStylesheet(context));
|
||||
}
|
||||
return webViewData;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param context
|
||||
* @return String which is a CSS stylesheet according to the context's theme
|
||||
*/
|
||||
public static String getLicenseStylesheet(Context context) {
|
||||
boolean isLightTheme = ThemeHelper.isLightThemeSelected(context);
|
||||
return "body{padding:12px 15px;margin:0;background:#"
|
||||
+ getHexRGBColor(context, isLightTheme
|
||||
? R.color.light_license_background_color
|
||||
: R.color.dark_license_background_color)
|
||||
+ ";color:#"
|
||||
+ getHexRGBColor(context, isLightTheme
|
||||
? R.color.light_license_text_color
|
||||
: R.color.dark_license_text_color) + ";}"
|
||||
+ "a[href]{color:#"
|
||||
+ getHexRGBColor(context, isLightTheme
|
||||
? R.color.light_youtube_primary_color
|
||||
: R.color.dark_youtube_primary_color) + ";}"
|
||||
+ "pre{white-space: pre-wrap;}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast R.color to a hexadecimal color value
|
||||
* @param context the context to use
|
||||
* @param color the color number from R.color
|
||||
* @return a six characters long String with hexadecimal RGB values
|
||||
*/
|
||||
public static String getHexRGBColor(Context context, int color) {
|
||||
return context.getResources().getString(color).substring(3);
|
||||
}
|
||||
|
||||
}
|
|
@ -2,6 +2,7 @@ package org.schabi.newpipe.fragments;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -13,6 +14,24 @@ public class BlankFragment extends BaseFragment {
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
||||
if(activity != null && activity.getSupportActionBar() != null) {
|
||||
activity.getSupportActionBar()
|
||||
.setTitle("NewPipe");
|
||||
}
|
||||
return inflater.inflate(R.layout.fragment_blank, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if(isVisibleToUser) {
|
||||
if(activity != null && activity.getSupportActionBar() != null) {
|
||||
activity.getSupportActionBar()
|
||||
.setTitle("NewPipe");
|
||||
}
|
||||
// leave this inline. Will make it harder for copy cats.
|
||||
// If you are a Copy cat FUCK YOU.
|
||||
// I WILL FIND YOU, AND I WILL ...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.schabi.newpipe.report.UserAction;
|
|||
import org.schabi.newpipe.util.Constants;
|
||||
import org.schabi.newpipe.util.KioskTranslator;
|
||||
import org.schabi.newpipe.util.NavigationHelper;
|
||||
import org.schabi.newpipe.util.ThemeHelper;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
|
@ -84,6 +85,28 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||
viewPager.setOffscreenPageLimit(adapter.getCount());
|
||||
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
if(ThemeHelper.isLightThemeSelected(getActivity())) {
|
||||
tabLayout.setBackgroundColor(getResources().getColor(R.color.light_youtube_primary_color));
|
||||
}
|
||||
|
||||
if(PreferenceManager.getDefaultSharedPreferences(getActivity())
|
||||
.getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key))
|
||||
.equals(getString(R.string.subscription_page_key))) {
|
||||
if(ThemeHelper.isLightThemeSelected(getActivity())) {
|
||||
tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_black_24dp);
|
||||
} else{
|
||||
tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_white_24dp);
|
||||
}
|
||||
} else {
|
||||
if(ThemeHelper.isLightThemeSelected(getActivity())) {
|
||||
tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_black_24dp);
|
||||
tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_black_24dp);
|
||||
} else {
|
||||
tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_white_24dp);
|
||||
tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_white_24dp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -108,7 +131,6 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||
|
||||
ActionBar supportActionBar = activity.getSupportActionBar();
|
||||
if (supportActionBar != null) {
|
||||
supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +193,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return getString(this.tabTitles[position]);
|
||||
//return getString(this.tabTitles[position]);
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.schabi.newpipe.R;
|
|||
import org.schabi.newpipe.database.subscription.SubscriptionEntity;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.UrlIdHandler;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfo;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
|
||||
|
@ -33,6 +34,7 @@ import org.schabi.newpipe.fragments.subscription.SubscriptionService;
|
|||
import org.schabi.newpipe.report.UserAction;
|
||||
import org.schabi.newpipe.util.AnimationUtils;
|
||||
import org.schabi.newpipe.util.ExtractorHelper;
|
||||
import org.schabi.newpipe.util.KioskTranslator;
|
||||
import org.schabi.newpipe.util.Localization;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -81,6 +83,20 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
|||
// LifeCycle
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if(activity != null
|
||||
&& useAsFrontPage
|
||||
&& isVisibleToUser) {
|
||||
try {
|
||||
activity.getSupportActionBar().setTitle(currentInfo.name);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
@ -125,7 +141,6 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
|||
ActionBar supportActionBar = activity.getSupportActionBar();
|
||||
if(useAsFrontPage) {
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
//supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
} else {
|
||||
inflater.inflate(R.menu.menu_channel, menu);
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ public class FeedFragment extends BaseListFragment<List<SubscriptionEntity>, Voi
|
|||
}
|
||||
|
||||
if(useAsFrontPage) {
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
supportActionBar.setDisplayShowTitleEnabled(true);
|
||||
//supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,9 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
|
|||
|
||||
public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
|
||||
|
||||
private String kioskId = "";
|
||||
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////
|
||||
// Views
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
@ -76,6 +79,7 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
|
|||
instance.setInitialData(serviceId,
|
||||
kioskTypeUrlIdHandler.getUrl(kioskId),
|
||||
kioskId);
|
||||
instance.kioskId = kioskId;
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -83,6 +87,18 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
|
|||
// LifeCycle
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if(useAsFrontPage && isVisibleToUser) {
|
||||
try {
|
||||
activity.getSupportActionBar().setTitle(KioskTranslator.getTranslatedKioskName(kioskId, getActivity()));
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_kiosk, container, false);
|
||||
|
@ -97,7 +113,6 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
|
|||
super.onCreateOptionsMenu(menu, inflater);
|
||||
ActionBar supportActionBar = activity.getSupportActionBar();
|
||||
if (supportActionBar != null && useAsFrontPage) {
|
||||
//supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.support.annotation.NonNull;
|
|||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -19,6 +20,7 @@ import org.schabi.newpipe.fragments.BaseStateFragment;
|
|||
import org.schabi.newpipe.info_list.InfoItemBuilder;
|
||||
import org.schabi.newpipe.info_list.InfoListAdapter;
|
||||
import org.schabi.newpipe.report.UserAction;
|
||||
import org.schabi.newpipe.util.KioskTranslator;
|
||||
import org.schabi.newpipe.util.NavigationHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -52,6 +54,17 @@ public class SubscriptionFragment extends BaseStateFragment<List<SubscriptionEnt
|
|||
// Fragment LifeCycle
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if(isVisibleToUser && activity != null) {
|
||||
activity.getSupportActionBar()
|
||||
.setTitle(R.string.tab_subscriptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
@ -64,6 +77,9 @@ public class SubscriptionFragment extends BaseStateFragment<List<SubscriptionEnt
|
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
||||
activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
|
||||
activity.setTitle(R.string.tab_subscriptions);
|
||||
if(useAsFrontPage) {
|
||||
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
}
|
||||
return inflater.inflate(R.layout.fragment_subscription, container, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
|
|||
public class PopupVideoPlayer extends Service {
|
||||
private static final String TAG = ".PopupVideoPlayer";
|
||||
private static final boolean DEBUG = BasePlayer.DEBUG;
|
||||
private static final int SHUTDOWN_FLING_VELOCITY = 10000;
|
||||
|
||||
private static final int NOTIFICATION_ID = 40028922;
|
||||
public static final String ACTION_CLOSE = "org.schabi.newpipe.player.PopupVideoPlayer.CLOSE";
|
||||
|
@ -303,7 +304,6 @@ public class PopupVideoPlayer extends Service {
|
|||
|
||||
public void onVideoClose() {
|
||||
if (DEBUG) Log.d(TAG, "onVideoClose() called");
|
||||
savePositionAndSize();
|
||||
stopSelf();
|
||||
}
|
||||
|
||||
|
@ -574,9 +574,7 @@ public class PopupVideoPlayer extends Service {
|
|||
private int initialPopupX, initialPopupY;
|
||||
private boolean isMoving;
|
||||
|
||||
private int onDownPopupWidth = 0;
|
||||
private boolean isResizing;
|
||||
private boolean isResizingRightSide;
|
||||
|
||||
@Override
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
|
@ -603,27 +601,20 @@ public class PopupVideoPlayer extends Service {
|
|||
initialPopupY = windowLayoutParams.y;
|
||||
popupWidth = windowLayoutParams.width;
|
||||
popupHeight = windowLayoutParams.height;
|
||||
onDownPopupWidth = windowLayoutParams.width;
|
||||
return false;
|
||||
return super.onDown(e);
|
||||
}
|
||||
|
||||
@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);
|
||||
updateScreenSize();
|
||||
checkPositionBounds();
|
||||
updatePopupSize((int) screenWidth, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
if (isResizing) return false;
|
||||
if (isResizing) return super.onScroll(e1, e2, distanceX, distanceY);
|
||||
|
||||
if (playerImpl.getCurrentState() != BasePlayer.STATE_BUFFERING
|
||||
&& (!isMoving || playerImpl.getControlsRoot().getAlpha() != 1f)) playerImpl.showControls(0);
|
||||
|
@ -659,19 +650,33 @@ public class PopupVideoPlayer extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||
if (Math.abs(velocityX) > SHUTDOWN_FLING_VELOCITY) {
|
||||
if (DEBUG) Log.d(TAG, "Popup close fling velocity= " + velocityX);
|
||||
onVideoClose();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
gestureDetector.onTouchEvent(event);
|
||||
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 (event.getPointerCount() == 2 && !isResizing) {
|
||||
if (DEBUG) Log.d(TAG, "onTouch() 2 finger pointer detected, enabling resizing.");
|
||||
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;
|
||||
}
|
||||
if (width <= maximumWidth && width >= minimumWidth) updatePopupSize(width, -1);
|
||||
return true;
|
||||
|
||||
if (event.getAction() == MotionEvent.ACTION_MOVE && !isMoving && isResizing) {
|
||||
if (DEBUG) Log.d(TAG, "onTouch() ACTION_MOVE > v = [" + v + "], e1.getRaw = [" + event.getRawX() + ", " + event.getRawY() + "]");
|
||||
return handleMultiDrag(event);
|
||||
}
|
||||
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
|
@ -692,6 +697,29 @@ public class PopupVideoPlayer extends Service {
|
|||
return true;
|
||||
}
|
||||
|
||||
private boolean handleMultiDrag(final MotionEvent event) {
|
||||
if (event.getPointerCount() != 2) return false;
|
||||
|
||||
final float firstPointerX = event.getX(0);
|
||||
final float secondPointerX = event.getX(1);
|
||||
|
||||
final float diff = Math.abs(firstPointerX - secondPointerX);
|
||||
if (firstPointerX > secondPointerX) {
|
||||
// second pointer is the anchor (the leftmost pointer)
|
||||
windowLayoutParams.x = (int) (event.getRawX() - diff);
|
||||
} else {
|
||||
// first pointer is the anchor
|
||||
windowLayoutParams.x = (int) event.getRawX();
|
||||
}
|
||||
|
||||
checkPositionBounds();
|
||||
updateScreenSize();
|
||||
|
||||
final int width = (int) Math.min(screenWidth, diff);
|
||||
updatePopupSize(width, -1);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
|||
getContext());
|
||||
|
||||
String summary =
|
||||
String.format(getString(R.string.service_kosk_string),
|
||||
String.format(getString(R.string.service_kiosk_string),
|
||||
serviceName,
|
||||
kioskName);
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
|||
getContext());
|
||||
|
||||
String summary =
|
||||
String.format(getString(R.string.service_kosk_string),
|
||||
String.format(getString(R.string.service_kiosk_string),
|
||||
service.getServiceInfo().name,
|
||||
kioskName);
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ public class SelectKioskFragment extends DialogFragment {
|
|||
|
||||
for(StreamingService service : NewPipe.getServices()) {
|
||||
for(String kioskId : service.getKioskList().getAvailableKiosks()) {
|
||||
String name = String.format(getString(R.string.service_kosk_string),
|
||||
String name = String.format(getString(R.string.service_kiosk_string),
|
||||
service.getServiceInfo().name,
|
||||
KioskTranslator.getTranslatedKioskName(kioskId, getContext()));
|
||||
kioskList.add(new Entry(
|
||||
|
|
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 290 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 334 B |
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 595 B |
After Width: | Height: | Size: 483 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 874 B |
After Width: | Height: | Size: 866 B |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
|
@ -16,4 +16,10 @@
|
|||
android:layout_marginTop="50dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -62,4 +62,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -34,4 +34,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -4,6 +4,7 @@
|
|||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/items_list"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -61,4 +62,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -10,13 +10,14 @@
|
|||
android:id="@+id/main_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@color/dark_youtube_primary_color"
|
||||
app:tabGravity="fill"/>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_above="@id/main_tab_layout"/>
|
||||
android:layout_below="@id/main_tab_layout"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -62,4 +62,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -81,4 +81,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -35,4 +35,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,9 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/video_item_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:focusableInTouchMode="true">
|
||||
|
@ -395,3 +399,11 @@
|
|||
</LinearLayout>
|
||||
</com.nirhart.parallaxscroll.views.ParallaxScrollView>
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"
|
||||
android:layout_alignParentTop="true"/>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -36,9 +36,4 @@
|
|||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:background="?attr/toolbar_shadow_drawable"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -273,5 +273,4 @@ pentru a deschide în mod pop-up</string>
|
|||
<string name="trending">Trenduri</string>
|
||||
<string name="top_50">Top 50</string>
|
||||
<string name="new_and_hot">Tendințe</string>
|
||||
<string name="service_kosk_string">%1$s/%2$s</string>
|
||||
</resources>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<color name="light_ripple_color">#48868686</color>
|
||||
<color name="light_contrast_background_color">#1fa6a6a6</color>
|
||||
<color name="light_shadow_start_color">#5a000000</color>
|
||||
<color name="light_license_background_color">#ffffff</color>
|
||||
<color name="light_license_text_color">#212121</color>
|
||||
|
||||
<!-- Dark Theme -->
|
||||
<color name="dark_background_color">#222222</color>
|
||||
|
@ -20,6 +22,8 @@
|
|||
<color name="dark_ripple_color">#48ffffff</color>
|
||||
<color name="dark_contrast_background_color">#1f717171</color>
|
||||
<color name="dark_shadow_start_color">#82000000</color>
|
||||
<color name="dark_license_background_color">#424242</color>
|
||||
<color name="dark_license_text_color">#ffffff</color>
|
||||
|
||||
<!-- Black Theme -->
|
||||
<color name="black_background_color">#000</color>
|
||||
|
@ -37,8 +41,8 @@
|
|||
|
||||
<color name="subscribe_background_color">#e53935</color>
|
||||
<color name="subscribe_text_color">#fff</color>
|
||||
<color name="subscribed_background_color">#d6d6d6</color>d
|
||||
<color name="subscribed_text_color">#717171</color>d
|
||||
<color name="subscribed_background_color">#d6d6d6</color>
|
||||
<color name="subscribed_text_color">#717171</color>
|
||||
|
||||
<!-- GigaGet theme -->
|
||||
<color name="bluegray">#607D8B</color>
|
||||
|
|
|
@ -290,5 +290,5 @@
|
|||
<string name="trending">Trending</string>
|
||||
<string name="top_50">Top 50</string>
|
||||
<string name="new_and_hot">New & hot</string>
|
||||
<string name="service_kosk_string">%1$s/%2$s</string>
|
||||
<string name="service_kiosk_string" translatable="false">%1$s/%2$s</string>
|
||||
</resources>
|
||||
|
|