Skip to content

Commit

Permalink
Merge branch 'dev' into Use_BitmapCompat_createScaledBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Aug 4, 2022
2 parents 867d641 + 8a774dc commit 39a39c0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 29 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ext {
androidxWorkVersion = '2.7.1'

icepickVersion = '3.2.0'
exoPlayerVersion = '2.18.0'
exoPlayerVersion = '2.18.1'
googleAutoServiceVersion = '1.0.1'
groupieVersion = '2.10.1'
markwonVersion = '4.6.2'
Expand Down Expand Up @@ -197,12 +197,12 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"

/** AndroidX **/
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.fragment:fragment-ktx:1.3.6'
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation "androidx.lifecycle:lifecycle-livedata-ktx:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${androidxLifecycleVersion}"
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
Expand All @@ -218,7 +218,7 @@ dependencies {
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation "androidx.work:work-runtime-ktx:${androidxWorkVersion}"
implementation "androidx.work:work-rxjava3:${androidxWorkVersion}"
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.1'

/** Third-party libraries **/
// Instance state boilerplate elimination
Expand Down
17 changes: 3 additions & 14 deletions app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.DeobfuscateException
import org.schabi.newpipe.ktx.isNetworkRelated
import org.schabi.newpipe.util.ServiceHelper
import java.io.PrintWriter
import java.io.StringWriter

@Parcelize
class ErrorInfo(
Expand Down Expand Up @@ -80,19 +78,10 @@ class ErrorInfo(
companion object {
const val SERVICE_NONE = "none"

private fun getStackTrace(throwable: Throwable): String {
StringWriter().use { stringWriter ->
PrintWriter(stringWriter, true).use { printWriter ->
throwable.printStackTrace(printWriter)
return stringWriter.buffer.toString()
}
}
}

fun throwableToStringList(throwable: Throwable) = arrayOf(getStackTrace(throwable))
fun throwableToStringList(throwable: Throwable) = arrayOf(throwable.stackTraceToString())

fun throwableListToStringList(throwable: List<Throwable>) =
Array(throwable.size) { i -> getStackTrace(throwable[i]) }
fun throwableListToStringList(throwableList: List<Throwable>) =
throwableList.map { it.stackTraceToString() }.toTypedArray()

private fun getInfoServiceName(info: Info?) =
if (info == null) SERVICE_NONE else ServiceHelper.getNameOfServiceById(info.serviceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ private void addMetadataItem(final LayoutInflater inflater,

private void addTagsMetadataItem(final LayoutInflater inflater, final LinearLayout layout) {
if (streamInfo.getTags() != null && !streamInfo.getTags().isEmpty()) {
final ItemMetadataTagsBinding itemBinding =
ItemMetadataTagsBinding.inflate(inflater, layout, false);
final var itemBinding = ItemMetadataTagsBinding.inflate(inflater, layout, false);

streamInfo.getTags().stream().sorted().forEach(tag -> {
streamInfo.getTags().stream().sorted(String.CASE_INSENSITIVE_ORDER).forEach(tag -> {
final Chip chip = (Chip) inflater.inflate(R.layout.chip,
itemBinding.metadataTagsChips, false);
chip.setText(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,11 @@ private void addVideoPlayerView() {
// Prevent from re-adding a view multiple times
new Handler(Looper.getMainLooper()).post(() ->
player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
if (binding != null) {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
}
}));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Based on ExoPlayer's DefaultHttpDataSource, version 2.18.0.
* Based on ExoPlayer's DefaultHttpDataSource, version 2.18.1.
*
* Original source code copyright (C) 2016 The Android Open Source Project, licensed under the
* Apache License, Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.widget.FrameLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;

import com.google.android.material.bottomsheet.BottomSheetBehavior;
Expand All @@ -18,7 +19,8 @@

public class CustomBottomSheetBehavior extends BottomSheetBehavior<FrameLayout> {

public CustomBottomSheetBehavior(final Context context, final AttributeSet attrs) {
public CustomBottomSheetBehavior(@NonNull final Context context,
@Nullable final AttributeSet attrs) {
super(context, attrs);
}

Expand All @@ -32,7 +34,7 @@ public CustomBottomSheetBehavior(final Context context, final AttributeSet attrs
@Override
public boolean onInterceptTouchEvent(@NonNull final CoordinatorLayout parent,
@NonNull final FrameLayout child,
final MotionEvent event) {
@NonNull final MotionEvent event) {
// Drop following when action ends
if (event.getAction() == MotionEvent.ACTION_CANCEL
|| event.getAction() == MotionEvent.ACTION_UP) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.SeekBar;
Expand Down Expand Up @@ -149,7 +148,7 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) {
assureCorrectAppLanguage(getContext());
Icepick.restoreInstanceState(this, savedInstanceState);

binding = DialogPlaybackParameterBinding.inflate(LayoutInflater.from(getContext()));
binding = DialogPlaybackParameterBinding.inflate(getLayoutInflater());
initUI();

final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity())
Expand Down

0 comments on commit 39a39c0

Please sign in to comment.