Skip to content

Commit 7646c68

Browse files
authored
Merge pull request #7989 from litetex/refactor-playback-parameter-dialog
Rewrote ``PlaybackParameterDialog``
2 parents b59a601 + a311519 commit 7646c68

6 files changed

Lines changed: 702 additions & 715 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import android.content.Context
2525
import android.content.Intent
2626
import android.content.SharedPreferences
2727
import android.graphics.Typeface
28-
import android.graphics.drawable.Drawable
2928
import android.graphics.drawable.LayerDrawable
3029
import android.os.Bundle
3130
import android.os.Parcelable
@@ -37,7 +36,6 @@ import android.view.MenuItem
3736
import android.view.View
3837
import android.view.ViewGroup
3938
import android.widget.Button
40-
import androidx.annotation.AttrRes
4139
import androidx.annotation.Nullable
4240
import androidx.appcompat.app.AlertDialog
4341
import androidx.appcompat.content.res.AppCompatResources
@@ -80,6 +78,7 @@ import org.schabi.newpipe.util.DeviceUtils
8078
import org.schabi.newpipe.util.Localization
8179
import org.schabi.newpipe.util.NavigationHelper
8280
import org.schabi.newpipe.util.ThemeHelper.getGridSpanCountStreams
81+
import org.schabi.newpipe.util.ThemeHelper.resolveDrawable
8382
import org.schabi.newpipe.util.ThemeHelper.shouldUseGridLayout
8483
import java.time.OffsetDateTime
8584
import java.util.function.Consumer
@@ -579,19 +578,6 @@ class FeedFragment : BaseStateFragment<FeedState>() {
579578
lastNewItemsCount = highlightCount
580579
}
581580

582-
private fun resolveDrawable(context: Context, @AttrRes attrResId: Int): Drawable? {
583-
return androidx.core.content.ContextCompat.getDrawable(
584-
context,
585-
android.util.TypedValue().apply {
586-
context.theme.resolveAttribute(
587-
attrResId,
588-
this,
589-
true
590-
)
591-
}.resourceId
592-
)
593-
}
594-
595581
private fun showNewItemsLoaded() {
596582
tryGetNewItemsLoadedButton()?.clearAnimation()
597583
tryGetNewItemsLoadedButton()

0 commit comments

Comments
 (0)