mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-04-29 22:24:27 +02:00
feat(YouTube - Swipe controls): Swipe controls UI improvements (#4422)
This commit is contained in:
parent
2b34096af6
commit
198e4d2a23
@ -5,8 +5,6 @@ dependencies {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 33 // TODO: Update Swipe controls code to allow updating this to the latest sdk.
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
}
|
||||
|
@ -306,21 +306,21 @@ public class Settings extends BaseSettings {
|
||||
|
||||
// Swipe controls
|
||||
public static final BooleanSetting SWIPE_CHANGE_VIDEO = new BooleanSetting("revanced_swipe_change_video", FALSE, true);
|
||||
public static final BooleanSetting SWIPE_BRIGHTNESS = new BooleanSetting("revanced_swipe_brightness", FALSE);
|
||||
public static final BooleanSetting SWIPE_VOLUME = new BooleanSetting("revanced_swipe_volume", FALSE);
|
||||
public static final BooleanSetting SWIPE_BRIGHTNESS = new BooleanSetting("revanced_swipe_brightness", FALSE, true);
|
||||
public static final BooleanSetting SWIPE_VOLUME = new BooleanSetting("revanced_swipe_volume", FALSE, true);
|
||||
public static final BooleanSetting SWIPE_PRESS_TO_ENGAGE = new BooleanSetting("revanced_swipe_press_to_engage", FALSE, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final BooleanSetting SWIPE_HAPTIC_FEEDBACK = new BooleanSetting("revanced_swipe_haptic_feedback", TRUE, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final IntegerSetting SWIPE_MAGNITUDE_THRESHOLD = new IntegerSetting("revanced_swipe_threshold", 30, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final IntegerSetting SWIPE_OVERLAY_OPACITY = new IntegerSetting("revanced_swipe_overlay_background_opacity", 50, true,
|
||||
public static final BooleanSetting SWIPE_SHOW_CIRCULAR_OVERLAY = new BooleanSetting("revanced_swipe_show_circular_overlay", FALSE, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final BooleanSetting SWIPE_OVERLAY_MINIMAL_STYLE = new BooleanSetting("revanced_swipe_overlay_minimal_style", FALSE, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final IntegerSetting SWIPE_OVERLAY_OPACITY = new IntegerSetting("revanced_swipe_overlay_background_opacity", 60, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
private static final IntegerSetting DEPRECATED_SWIPE_OVERLAY_BACKGROUND_ALPHA = new IntegerSetting("revanced_swipe_overlay_background_alpha", 127);
|
||||
|
||||
// Debugging
|
||||
public static final IntegerSetting SWIPE_OVERLAY_TEXT_SIZE = new IntegerSetting("revanced_swipe_text_overlay_size", 22, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final LongSetting SWIPE_OVERLAY_TIMEOUT = new LongSetting("revanced_swipe_overlay_timeout", 500L, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final BooleanSetting SWIPE_SAVE_AND_RESTORE_BRIGHTNESS = new BooleanSetting("revanced_swipe_save_and_restore_brightness", TRUE, true, parent(SWIPE_BRIGHTNESS));
|
||||
|
@ -20,19 +20,17 @@ class SwipeControlsConfigurationProvider(
|
||||
* should swipe controls be enabled? (global setting)
|
||||
*/
|
||||
val enableSwipeControls: Boolean
|
||||
get() = isFullscreenVideo && (enableVolumeControls || enableBrightnessControl)
|
||||
get() = (enableVolumeControls || enableBrightnessControl) && isFullscreenVideo
|
||||
|
||||
/**
|
||||
* should swipe controls for volume be enabled?
|
||||
*/
|
||||
val enableVolumeControls: Boolean
|
||||
get() = Settings.SWIPE_VOLUME.get()
|
||||
val enableVolumeControls = Settings.SWIPE_VOLUME.get()
|
||||
|
||||
/**
|
||||
* should swipe controls for volume be enabled?
|
||||
*/
|
||||
val enableBrightnessControl: Boolean
|
||||
get() = Settings.SWIPE_BRIGHTNESS.get()
|
||||
val enableBrightnessControl = Settings.SWIPE_BRIGHTNESS.get()
|
||||
|
||||
/**
|
||||
* is the video player currently in fullscreen mode?
|
||||
@ -46,7 +44,7 @@ class SwipeControlsConfigurationProvider(
|
||||
* should volume key controls be overwritten? (global setting)
|
||||
*/
|
||||
val overwriteVolumeKeyControls: Boolean
|
||||
get() = isFullscreenVideo && enableVolumeControls
|
||||
get() = enableVolumeControls && isFullscreenVideo
|
||||
//endregion
|
||||
|
||||
//region gesture adjustments
|
||||
@ -65,7 +63,6 @@ class SwipeControlsConfigurationProvider(
|
||||
//endregion
|
||||
|
||||
//region overlay adjustments
|
||||
|
||||
/**
|
||||
* should the overlay enable haptic feedback?
|
||||
*/
|
||||
@ -79,15 +76,10 @@ class SwipeControlsConfigurationProvider(
|
||||
get() = Settings.SWIPE_OVERLAY_TIMEOUT.get()
|
||||
|
||||
/**
|
||||
* text size for the overlay, in sp
|
||||
* Gets the opacity value (0-100%) is converted to an alpha value (0-255) for transparency.
|
||||
* If the opacity value is out of range, it resets to the default and displays a warning message.
|
||||
*/
|
||||
val overlayTextSize: Int
|
||||
get() = Settings.SWIPE_OVERLAY_TEXT_SIZE.get()
|
||||
|
||||
/**
|
||||
* get the background color for text on the overlay, as a color int
|
||||
*/
|
||||
val overlayTextBackgroundColor: Int
|
||||
val overlayBackgroundOpacity: Int
|
||||
get() {
|
||||
var opacity = Settings.SWIPE_OVERLAY_OPACITY.get()
|
||||
|
||||
@ -102,11 +94,34 @@ class SwipeControlsConfigurationProvider(
|
||||
}
|
||||
|
||||
/**
|
||||
* get the foreground color for text on the overlay, as a color int
|
||||
* The color of the progress overlay.
|
||||
*/
|
||||
val overlayForegroundColor: Int
|
||||
val overlayProgressColor: Int
|
||||
get() = 0xBFFFFFFF.toInt()
|
||||
|
||||
/**
|
||||
* The color used for the background of the progress overlay fill.
|
||||
*/
|
||||
val overlayFillBackgroundPaint: Int
|
||||
get() = 0x80D3D3D3.toInt()
|
||||
|
||||
/**
|
||||
* The color used for the text and icons in the overlay.
|
||||
*/
|
||||
val overlayTextColor: Int
|
||||
get() = Color.WHITE
|
||||
|
||||
/**
|
||||
* A flag that determines if the overlay should only show the icon.
|
||||
*/
|
||||
val overlayShowOverlayMinimalStyle: Boolean
|
||||
get() = Settings.SWIPE_OVERLAY_MINIMAL_STYLE.get()
|
||||
|
||||
/**
|
||||
* A flag that determines if the progress bar should be circular.
|
||||
*/
|
||||
val isCircularProgressBar: Boolean
|
||||
get() = Settings.SWIPE_SHOW_CIRCULAR_OVERLAY.get()
|
||||
//endregion
|
||||
|
||||
//region behaviour
|
||||
|
@ -82,11 +82,15 @@ abstract class BaseGestureController(
|
||||
}
|
||||
|
||||
override fun onScroll(
|
||||
from: MotionEvent,
|
||||
from: MotionEvent?,
|
||||
to: MotionEvent,
|
||||
distanceX: Float,
|
||||
distanceY: Float,
|
||||
): Boolean {
|
||||
if (from == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
// submit to swipe detector
|
||||
submitForSwipe(from, to, distanceX, distanceY)
|
||||
|
||||
|
@ -1,138 +1,145 @@
|
||||
package app.revanced.extension.youtube.swipecontrols.views
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.RectF
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.TypedValue
|
||||
import android.util.AttributeSet
|
||||
import android.view.HapticFeedbackConstants
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import app.revanced.extension.shared.StringRef.str
|
||||
import app.revanced.extension.shared.Utils
|
||||
import app.revanced.extension.youtube.swipecontrols.SwipeControlsConfigurationProvider
|
||||
import app.revanced.extension.youtube.swipecontrols.misc.SwipeControlsOverlay
|
||||
import app.revanced.extension.youtube.swipecontrols.misc.applyDimension
|
||||
import kotlin.math.min
|
||||
import kotlin.math.round
|
||||
|
||||
/**
|
||||
* main overlay layout for volume and brightness swipe controls
|
||||
*
|
||||
* @param context context to create in
|
||||
* Main overlay layout for displaying volume and brightness level with both circular and rectangular progress bars.
|
||||
*/
|
||||
class SwipeControlsOverlayLayout(
|
||||
context: Context,
|
||||
private val config: SwipeControlsConfigurationProvider,
|
||||
) : RelativeLayout(context), SwipeControlsOverlay {
|
||||
/**
|
||||
* DO NOT use this, for tools only
|
||||
*/
|
||||
|
||||
constructor(context: Context) : this(context, SwipeControlsConfigurationProvider(context))
|
||||
|
||||
private val feedbackTextView: TextView
|
||||
private val autoBrightnessIcon: Drawable
|
||||
private val manualBrightnessIcon: Drawable
|
||||
private val mutedVolumeIcon: Drawable
|
||||
private val normalVolumeIcon: Drawable
|
||||
// Drawable icons for brightness and volume
|
||||
private val autoBrightnessIcon: Drawable = getDrawable("revanced_ic_sc_brightness_auto")
|
||||
private val lowBrightnessIcon: Drawable = getDrawable("revanced_ic_sc_brightness_low")
|
||||
private val mediumBrightnessIcon: Drawable = getDrawable("revanced_ic_sc_brightness_medium")
|
||||
private val highBrightnessIcon: Drawable = getDrawable("revanced_ic_sc_brightness_high")
|
||||
private val fullBrightnessIcon: Drawable = getDrawable("revanced_ic_sc_brightness_full")
|
||||
private val mutedVolumeIcon: Drawable = getDrawable("revanced_ic_sc_volume_mute")
|
||||
private val lowVolumeIcon: Drawable = getDrawable("revanced_ic_sc_volume_low")
|
||||
private val normalVolumeIcon: Drawable = getDrawable("revanced_ic_sc_volume_normal")
|
||||
private val fullVolumeIcon: Drawable = getDrawable("revanced_ic_sc_volume_high")
|
||||
|
||||
private fun getDrawable(name: String, width: Int, height: Int): Drawable {
|
||||
return resources.getDrawable(
|
||||
// Function to retrieve drawable resources by name
|
||||
private fun getDrawable(name: String): Drawable {
|
||||
val drawable = resources.getDrawable(
|
||||
Utils.getResourceIdentifier(context, name, "drawable"),
|
||||
context.theme,
|
||||
).apply {
|
||||
setTint(config.overlayForegroundColor)
|
||||
setBounds(
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
height,
|
||||
)
|
||||
}
|
||||
)
|
||||
drawable.setTint(config.overlayTextColor)
|
||||
return drawable
|
||||
}
|
||||
|
||||
// Initialize progress bars
|
||||
private val circularProgressView: CircularProgressView
|
||||
private val horizontalProgressView: HorizontalProgressView
|
||||
|
||||
init {
|
||||
// init views
|
||||
val feedbackTextViewPadding = 2.applyDimension(context, TypedValue.COMPLEX_UNIT_DIP)
|
||||
val compoundIconPadding = 4.applyDimension(context, TypedValue.COMPLEX_UNIT_DIP)
|
||||
feedbackTextView = TextView(context).apply {
|
||||
layoutParams = LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
).apply {
|
||||
// Initialize circular progress bar
|
||||
circularProgressView = CircularProgressView(
|
||||
context,
|
||||
config.overlayBackgroundOpacity,
|
||||
config.overlayShowOverlayMinimalStyle,
|
||||
config.overlayProgressColor,
|
||||
config.overlayFillBackgroundPaint,
|
||||
config.overlayTextColor
|
||||
).apply {
|
||||
layoutParams = LayoutParams(300, 300).apply {
|
||||
addRule(CENTER_IN_PARENT, TRUE)
|
||||
setPadding(
|
||||
feedbackTextViewPadding,
|
||||
feedbackTextViewPadding,
|
||||
feedbackTextViewPadding,
|
||||
feedbackTextViewPadding,
|
||||
)
|
||||
}
|
||||
background = GradientDrawable().apply {
|
||||
cornerRadius = 8f
|
||||
setColor(config.overlayTextBackgroundColor)
|
||||
}
|
||||
setTextColor(config.overlayForegroundColor)
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_SP, config.overlayTextSize.toFloat())
|
||||
compoundDrawablePadding = compoundIconPadding
|
||||
visibility = GONE
|
||||
visibility = GONE // Initially hidden
|
||||
}
|
||||
addView(feedbackTextView)
|
||||
addView(circularProgressView)
|
||||
|
||||
// get icons scaled, assuming square icons
|
||||
val iconHeight = round(feedbackTextView.lineHeight * .8).toInt()
|
||||
autoBrightnessIcon = getDrawable("revanced_ic_sc_brightness_auto", iconHeight, iconHeight)
|
||||
manualBrightnessIcon = getDrawable("revanced_ic_sc_brightness_manual", iconHeight, iconHeight)
|
||||
mutedVolumeIcon = getDrawable("revanced_ic_sc_volume_mute", iconHeight, iconHeight)
|
||||
normalVolumeIcon = getDrawable("revanced_ic_sc_volume_normal", iconHeight, iconHeight)
|
||||
// Initialize rectangular progress bar
|
||||
val screenWidth = resources.displayMetrics.widthPixels
|
||||
val layoutWidth = (screenWidth * 2 / 3).toInt() // 2/3 of screen width
|
||||
horizontalProgressView = HorizontalProgressView(
|
||||
context,
|
||||
config.overlayBackgroundOpacity,
|
||||
config.overlayShowOverlayMinimalStyle,
|
||||
config.overlayProgressColor,
|
||||
config.overlayFillBackgroundPaint,
|
||||
config.overlayTextColor
|
||||
).apply {
|
||||
layoutParams = LayoutParams(layoutWidth, 100).apply {
|
||||
addRule(CENTER_HORIZONTAL)
|
||||
topMargin = 40 // Top margin
|
||||
}
|
||||
visibility = GONE // Initially hidden
|
||||
}
|
||||
addView(horizontalProgressView)
|
||||
}
|
||||
|
||||
// Handler and callback for hiding progress bars
|
||||
private val feedbackHideHandler = Handler(Looper.getMainLooper())
|
||||
private val feedbackHideCallback = Runnable {
|
||||
feedbackTextView.visibility = GONE
|
||||
circularProgressView.visibility = GONE
|
||||
horizontalProgressView.visibility = GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* show the feedback view for a given time
|
||||
*
|
||||
* @param message the message to show
|
||||
* @param icon the icon to use
|
||||
* Displays the progress bar with the appropriate value, icon, and type (brightness or volume).
|
||||
*/
|
||||
private fun showFeedbackView(message: String, icon: Drawable) {
|
||||
private fun showFeedbackView(value: String, progress: Int, max: Int, icon: Drawable, isBrightness: Boolean) {
|
||||
feedbackHideHandler.removeCallbacks(feedbackHideCallback)
|
||||
feedbackHideHandler.postDelayed(feedbackHideCallback, config.overlayShowTimeoutMillis)
|
||||
feedbackTextView.apply {
|
||||
text = message
|
||||
setCompoundDrawablesRelative(
|
||||
icon,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
)
|
||||
|
||||
val viewToShow = if (config.isCircularProgressBar) circularProgressView else horizontalProgressView
|
||||
viewToShow.apply {
|
||||
setProgress(progress, max, value, isBrightness)
|
||||
this.icon = icon
|
||||
visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
// Handle volume change
|
||||
override fun onVolumeChanged(newVolume: Int, maximumVolume: Int) {
|
||||
showFeedbackView(
|
||||
"$newVolume",
|
||||
if (newVolume > 0) normalVolumeIcon else mutedVolumeIcon,
|
||||
)
|
||||
val volumePercentage = (newVolume.toFloat() / maximumVolume) * 100
|
||||
val icon = when {
|
||||
newVolume == 0 -> mutedVolumeIcon
|
||||
volumePercentage < 33 -> lowVolumeIcon
|
||||
volumePercentage < 66 -> normalVolumeIcon
|
||||
else -> fullVolumeIcon
|
||||
}
|
||||
showFeedbackView("$newVolume", newVolume, maximumVolume, icon, isBrightness = false)
|
||||
}
|
||||
|
||||
// Handle brightness change
|
||||
override fun onBrightnessChanged(brightness: Double) {
|
||||
if (config.shouldLowestValueEnableAutoBrightness && brightness <= 0) {
|
||||
showFeedbackView(
|
||||
str("revanced_swipe_lowest_value_enable_auto_brightness_overlay_text"),
|
||||
autoBrightnessIcon,
|
||||
)
|
||||
} else if (brightness >= 0) {
|
||||
showFeedbackView("${round(brightness).toInt()}%", manualBrightnessIcon)
|
||||
showFeedbackView("Auto", 0, 100, autoBrightnessIcon, isBrightness = true)
|
||||
} else {
|
||||
val brightnessValue = round(brightness).toInt()
|
||||
val icon = when {
|
||||
brightnessValue < 25 -> lowBrightnessIcon
|
||||
brightnessValue < 50 -> mediumBrightnessIcon
|
||||
brightnessValue < 75 -> highBrightnessIcon
|
||||
else -> fullBrightnessIcon
|
||||
}
|
||||
showFeedbackView("$brightnessValue%", brightnessValue, 100, icon, isBrightness = true)
|
||||
}
|
||||
}
|
||||
|
||||
// Begin swipe session
|
||||
override fun onEnterSwipeSession() {
|
||||
if (config.shouldEnableHapticFeedback) {
|
||||
@Suppress("DEPRECATION")
|
||||
@ -143,3 +150,233 @@ class SwipeControlsOverlayLayout(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract base class for progress views to reduce code duplication.
|
||||
*/
|
||||
/**
|
||||
* Abstract base class for progress views to reduce code duplication.
|
||||
*/
|
||||
abstract class AbstractProgressView(
|
||||
context: Context,
|
||||
protected val overlayBackgroundOpacity: Int,
|
||||
protected val overlayShowOverlayMinimalStyle: Boolean,
|
||||
protected val overlayProgressColor: Int,
|
||||
protected val overlayFillBackgroundPaint: Int,
|
||||
protected val overlayTextColor: Int,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : View(context, attrs, defStyleAttr) {
|
||||
|
||||
// Combined paint creation function for both fill and stroke styles
|
||||
private fun createPaint(color: Int, style: Paint.Style = Paint.Style.FILL, strokeCap: Paint.Cap = Paint.Cap.BUTT, strokeWidth: Float = 0f) = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
this.style = style
|
||||
this.color = color
|
||||
this.strokeCap = strokeCap
|
||||
this.strokeWidth = strokeWidth
|
||||
}
|
||||
|
||||
// Initialize paints
|
||||
public val backgroundPaint = createPaint(overlayBackgroundOpacity, style = Paint.Style.FILL)
|
||||
public val progressPaint = createPaint(overlayProgressColor, style = Paint.Style.STROKE, strokeCap = Paint.Cap.ROUND, strokeWidth = 20f)
|
||||
public val fillBackgroundPaint = createPaint(overlayFillBackgroundPaint, style = Paint.Style.FILL)
|
||||
public val textPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
color = overlayTextColor
|
||||
textAlign = Paint.Align.CENTER
|
||||
textSize = 30f // Can adjust based on need
|
||||
}
|
||||
|
||||
|
||||
protected var progress = 0
|
||||
protected var maxProgress = 100
|
||||
protected var displayText: String = "0"
|
||||
protected var isBrightness = true
|
||||
public var icon: Drawable? = null
|
||||
|
||||
init {
|
||||
// Stroke widths are now set in createPaint for progressPaint and fillBackgroundPaint
|
||||
}
|
||||
|
||||
fun setProgress(value: Int, max: Int, text: String, isBrightnessMode: Boolean) {
|
||||
progress = value
|
||||
maxProgress = max
|
||||
displayText = text
|
||||
isBrightness = isBrightnessMode
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
// Base class implementation can be empty
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom view for rendering a circular progress indicator with text and icon.
|
||||
*/
|
||||
class CircularProgressView(
|
||||
context: Context,
|
||||
overlayBackgroundOpacity: Int,
|
||||
overlayShowOverlayMinimalStyle: Boolean,
|
||||
overlayProgressColor: Int,
|
||||
overlayFillBackgroundPaint: Int,
|
||||
overlayTextColor: Int,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AbstractProgressView(
|
||||
context,
|
||||
overlayBackgroundOpacity,
|
||||
overlayShowOverlayMinimalStyle,
|
||||
overlayProgressColor,
|
||||
overlayFillBackgroundPaint,
|
||||
overlayTextColor,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
private val rectF = RectF()
|
||||
|
||||
init {
|
||||
textPaint.textSize = 40f // Override default text size for horizontal view
|
||||
progressPaint.strokeWidth = 20f
|
||||
fillBackgroundPaint.strokeWidth = 20f
|
||||
progressPaint.strokeCap = Paint.Cap.ROUND
|
||||
fillBackgroundPaint.strokeCap = Paint.Cap.BUTT
|
||||
progressPaint.style = Paint.Style.STROKE
|
||||
fillBackgroundPaint.style = Paint.Style.STROKE
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
|
||||
val size = min(width, height).toFloat()
|
||||
rectF.set(20f, 20f, size - 20f, size - 20f)
|
||||
|
||||
canvas.drawOval(rectF, fillBackgroundPaint) // Draw the outer ring.
|
||||
canvas.drawCircle(width / 2f, height / 2f, size / 3, backgroundPaint) // Draw the inner circle.
|
||||
|
||||
// Select the paint for drawing based on whether it's brightness or volume.
|
||||
val sweepAngle = (progress.toFloat() / maxProgress) * 360
|
||||
canvas.drawArc(rectF, -90f, sweepAngle, false, progressPaint) // Draw the progress arc.
|
||||
|
||||
// Draw the icon in the center.
|
||||
icon?.let {
|
||||
val iconSize = if (overlayShowOverlayMinimalStyle) 100 else 80
|
||||
val iconX = (width - iconSize) / 2
|
||||
val iconY = (height / 2) - if (overlayShowOverlayMinimalStyle) 50 else 80
|
||||
it.setBounds(iconX, iconY, iconX + iconSize, iconY + iconSize)
|
||||
it.draw(canvas)
|
||||
}
|
||||
|
||||
// If not in icon-only mode, draw the text inside the ring.
|
||||
if (!overlayShowOverlayMinimalStyle) {
|
||||
canvas.drawText(displayText, width / 2f, height / 2f + 60f, textPaint)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom view for rendering a rectangular progress bar with icons and text.
|
||||
*/
|
||||
class HorizontalProgressView(
|
||||
context: Context,
|
||||
overlayBackgroundOpacity: Int,
|
||||
overlayShowOverlayMinimalStyle: Boolean,
|
||||
overlayProgressColor: Int,
|
||||
overlayFillBackgroundPaint: Int,
|
||||
overlayTextColor: Int,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AbstractProgressView(
|
||||
context,
|
||||
overlayBackgroundOpacity,
|
||||
overlayShowOverlayMinimalStyle,
|
||||
overlayProgressColor,
|
||||
overlayFillBackgroundPaint,
|
||||
overlayTextColor,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
|
||||
private val iconSize = 60f
|
||||
private val padding = 40f
|
||||
|
||||
init {
|
||||
textPaint.textSize = 30f // Override default text size for horizontal view
|
||||
progressPaint.strokeWidth = 0f
|
||||
progressPaint.strokeCap = Paint.Cap.BUTT
|
||||
progressPaint.style = Paint.Style.FILL
|
||||
fillBackgroundPaint.style = Paint.Style.FILL
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
|
||||
val width = width.toFloat()
|
||||
val height = height.toFloat()
|
||||
|
||||
// Radius for rounded corners
|
||||
val cornerRadius = min(width, height) / 2
|
||||
|
||||
// Calculate the total width for the elements
|
||||
val minimalElementWidth = 5 * padding + iconSize
|
||||
|
||||
// Calculate the starting point (X) to center the elements
|
||||
val minimalStartX = (width - minimalElementWidth) / 2
|
||||
|
||||
// Draw the background
|
||||
if (!overlayShowOverlayMinimalStyle) {
|
||||
canvas.drawRoundRect(0f, 0f, width, height, cornerRadius, cornerRadius, backgroundPaint)
|
||||
} else {
|
||||
canvas.drawRoundRect(minimalStartX, 0f, minimalStartX + minimalElementWidth, height, cornerRadius, cornerRadius, backgroundPaint)
|
||||
}
|
||||
|
||||
if (!overlayShowOverlayMinimalStyle) {
|
||||
// Draw the fill background
|
||||
val startX = 2 * padding + iconSize
|
||||
val endX = width - 4 * padding
|
||||
val fillWidth = endX - startX
|
||||
|
||||
canvas.drawRoundRect(
|
||||
startX,
|
||||
height / 2 - 5f,
|
||||
endX,
|
||||
height / 2 + 5f,
|
||||
10f, 10f,
|
||||
fillBackgroundPaint
|
||||
)
|
||||
|
||||
// Draw the progress
|
||||
val progressWidth = (progress.toFloat() / maxProgress) * fillWidth
|
||||
canvas.drawRoundRect(
|
||||
startX,
|
||||
height / 2 - 5f,
|
||||
startX + progressWidth,
|
||||
height / 2 + 5f,
|
||||
10f, 10f,
|
||||
progressPaint
|
||||
)
|
||||
}
|
||||
|
||||
// Draw the icon
|
||||
icon?.let {
|
||||
val iconX = if (!overlayShowOverlayMinimalStyle) {
|
||||
padding
|
||||
} else {
|
||||
padding + minimalStartX
|
||||
}
|
||||
val iconY = height / 2 - iconSize / 2
|
||||
it.setBounds(iconX.toInt(), iconY.toInt(), (iconX + iconSize).toInt(), (iconY + iconSize).toInt())
|
||||
it.draw(canvas)
|
||||
}
|
||||
|
||||
// Draw the text on the right
|
||||
val textX = if (!overlayShowOverlayMinimalStyle) {
|
||||
width - 2 * padding
|
||||
} else {
|
||||
minimalStartX + minimalElementWidth - 2 * padding
|
||||
}
|
||||
val textY = height / 2 + textPaint.textSize / 3
|
||||
|
||||
// Draw the text
|
||||
canvas.drawText(displayText, textX, textY, textPaint)
|
||||
}
|
||||
}
|
||||
|
@ -42,9 +42,10 @@ private val swipeControlsResourcePatch = resourcePatch {
|
||||
SwitchPreference("revanced_swipe_haptic_feedback"),
|
||||
SwitchPreference("revanced_swipe_save_and_restore_brightness"),
|
||||
SwitchPreference("revanced_swipe_lowest_value_enable_auto_brightness"),
|
||||
TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER),
|
||||
SwitchPreference("revanced_swipe_show_circular_overlay"),
|
||||
SwitchPreference("revanced_swipe_overlay_minimal_style"),
|
||||
TextPreference("revanced_swipe_overlay_background_opacity", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER),
|
||||
)
|
||||
|
||||
@ -53,7 +54,12 @@ private val swipeControlsResourcePatch = resourcePatch {
|
||||
ResourceGroup(
|
||||
"drawable",
|
||||
"revanced_ic_sc_brightness_auto.xml",
|
||||
"revanced_ic_sc_brightness_manual.xml",
|
||||
"revanced_ic_sc_brightness_full.xml",
|
||||
"revanced_ic_sc_brightness_high.xml",
|
||||
"revanced_ic_sc_brightness_low.xml",
|
||||
"revanced_ic_sc_brightness_medium.xml",
|
||||
"revanced_ic_sc_volume_high.xml",
|
||||
"revanced_ic_sc_volume_low.xml",
|
||||
"revanced_ic_sc_volume_mute.xml",
|
||||
"revanced_ic_sc_volume_normal.xml",
|
||||
),
|
||||
|
@ -489,11 +489,15 @@ This feature is only available for older devices"</string>
|
||||
</patch>
|
||||
<patch id="interaction.swipecontrols.swipeControlsResourcePatch">
|
||||
<string name="revanced_swipe_brightness_title">Enable brightness gesture</string>
|
||||
<string name="revanced_swipe_brightness_summary_on">Brightness swipe is enabled</string>
|
||||
<string name="revanced_swipe_brightness_summary_off">Brightness swipe is disabled</string>
|
||||
<string name="revanced_swipe_brightness_summary_on">"Fullscreen brightness swipe is enabled
|
||||
|
||||
Adjust brightness by swiping vertically on the left side of the screen"</string>
|
||||
<string name="revanced_swipe_brightness_summary_off">Fullscreen brightness swipe is disabled</string>
|
||||
<string name="revanced_swipe_volume_title">Enable volume gesture</string>
|
||||
<string name="revanced_swipe_volume_summary_on">Volume swipe is enabled</string>
|
||||
<string name="revanced_swipe_volume_summary_off">Volume swipe is disabled</string>
|
||||
<string name="revanced_swipe_volume_summary_on">"Fullscreen volume swipe is enabled
|
||||
|
||||
Adjust volume by swiping vertically on the right side of the screen"</string>
|
||||
<string name="revanced_swipe_volume_summary_off">Fullscreen volume swipe is disabled</string>
|
||||
<string name="revanced_swipe_press_to_engage_title">Enable press-to-swipe gesture</string>
|
||||
<string name="revanced_swipe_press_to_engage_summary_on">Press-to-swipe is enabled</string>
|
||||
<string name="revanced_swipe_press_to_engage_summary_off">Press-to-swipe is disabled</string>
|
||||
@ -506,16 +510,19 @@ This feature is only available for older devices"</string>
|
||||
<string name="revanced_swipe_lowest_value_enable_auto_brightness_title">Enable auto-brightness gesture</string>
|
||||
<string name="revanced_swipe_lowest_value_enable_auto_brightness_summary_on">Swiping down to the lowest value of the brightness gesture enable auto-brightness</string>
|
||||
<string name="revanced_swipe_lowest_value_enable_auto_brightness_summary_off">Swiping down to the lowest value does not enable auto-brightness</string>
|
||||
<string name="revanced_swipe_lowest_value_enable_auto_brightness_overlay_text">Auto</string>
|
||||
<string name="revanced_swipe_overlay_timeout_title">Swipe overlay timeout</string>
|
||||
<string name="revanced_swipe_overlay_timeout_summary">The amount of milliseconds the overlay is visible</string>
|
||||
<string name="revanced_swipe_text_overlay_size_title">Swipe overlay text size</string>
|
||||
<string name="revanced_swipe_text_overlay_size_summary">The text size for swipe overlay</string>
|
||||
<string name="revanced_swipe_overlay_background_opacity_title">Swipe overlay background opacity</string>
|
||||
<string name="revanced_swipe_overlay_background_opacity_summary">Opacity value between 0-100</string>
|
||||
<string name="revanced_swipe_overlay_background_opacity_invalid_toast">Swipe opacity must be between 0-100</string>
|
||||
<string name="revanced_swipe_threshold_title">Swipe magnitude threshold</string>
|
||||
<string name="revanced_swipe_threshold_summary">The amount of threshold for swipe to occur</string>
|
||||
<string name="revanced_swipe_show_circular_overlay_title">Show circular overlay</string>
|
||||
<string name="revanced_swipe_show_circular_overlay_summary_on">Circular overlay is shown</string>
|
||||
<string name="revanced_swipe_show_circular_overlay_summary_off">Horizontal overlay is shown</string>
|
||||
<string name="revanced_swipe_overlay_minimal_style_title">Enable minimal style</string>
|
||||
<string name="revanced_swipe_overlay_minimal_style_summary_on">Minimal overlay style is enabled</string>
|
||||
<string name="revanced_swipe_overlay_minimal_style_summary_off">Minimal overlay style is disabled</string>
|
||||
<string name="revanced_swipe_change_video_title">Enable swipe to change videos</string>
|
||||
<string name="revanced_swipe_change_video_summary_on">Swiping in fullscreen mode will change to the next/previous video</string>
|
||||
<string name="revanced_swipe_change_video_summary_off">Swiping in fullscreen mode will not change to the next/previous video</string>
|
||||
|
@ -1,7 +1,5 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_auto/materialsymbolsoutlined/brightness_auto_wght300_24px.xml
|
||||
Changes made: Icon has been resized.
|
||||
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
@ -19,12 +17,12 @@ Copyright 2022 Google
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:tint="#000000"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="m 7.4662814,16.525036 h 1.4401493 l 1.0355546,-2.77594 h 4.1725927 l 1.035554,2.77594 h 1.427112 L 12.643941,6.3437048 H 11.377836 Z M 10.36403,12.561274 11.943437,8.166757 h 0.113126 l 1.601184,4.394517 z M 12,24 8.4496001,20.484415 H 3.5155855 V 15.5504 L 0,12 3.5155855,8.4496001 V 3.5155855 H 8.4496001 L 12,0 15.5504,3.5155855 h 4.934015 V 8.4496001 L 24,12 20.484415,15.5504 v 4.934015 H 15.5504 Z m 0,-2.384298 2.828148,-2.828148 h 3.959406 V 14.828148 L 21.615702,12 18.787554,9.1718524 V 5.2124457 H 14.828148 L 12,2.3842981 9.1718524,5.2124457 H 5.2124457 V 9.1718524 L 2.3842981,12 5.2124457,14.828148 v 3.959406 H 9.1718524 Z M 12,12 Z"/>
|
||||
android:pathData="M8,16H9.275L10.175,13.55H13.875L14.775,16H16.05L12.575,7H11.45ZM10.55,12.5 L11.95,8.6H12.05L13.475,12.5ZM12,22.6 L8.85,19.5H4.5V15.15L1.4,12L4.5,8.85V4.5H8.85L12,1.4L15.15,4.5H19.5V8.85L22.6,12L19.5,15.15V19.5H15.15ZM12,12ZM12,20.5 L14.5,18H18V14.5L20.5,12L18,9.5V6H14.5L12,3.5L9.5,6H6V9.5L3.5,12L6,14.5V18H9.5Z"/>
|
||||
</vector>
|
||||
|
@ -0,0 +1,29 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_high/materialsymbolsoutlined/brightness_high_wght300_24px.xml
|
||||
Changes made: The center circle of the icon has been edited.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,22.6 L8.85,19.5 L4.5,19.5 L4.5,15.15 L1.4,12 L4.5,8.85 L4.5,4.5 L8.85,4.5 L12,1.4 L15.15,4.5 L19.5,4.5 L19.5,8.85 L22.6,12 L19.5,15.15 L19.5,19.5 L15.15,19.5 Z M12,18 C13.6667,18,15.0833,17.4167,16.25,16.25 C17.4167,15.0833,18,13.6667,18,12 C18,10.3333,17.4167,8.91667,16.25,7.75 C15.0833,6.58333,13.6667,6,12,6 C10.3333,6,8.91667,6.58333,7.75,7.75 C6.58333,8.91667,6,10.3333,6,12 C6,13.6667,6.58333,15.0833,7.75,16.25 C8.91667,17.4167,10.3333,18,12,18 Z M12,20.5 L14.5,18 L18,18 L18,14.5 L20.5,12 L18,9.5 L18,6 L14.5,6 L12,3.5 L9.5,6 L6,6 L6,9.5 L3.5,12 L6,14.5 L6,18 L9.5,18 Z"/>
|
||||
</vector>
|
@ -0,0 +1,29 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_high/materialsymbolsoutlined/brightness_high_wght300_24px.xml
|
||||
Changes made: The center circle of the icon has been edited.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,1.40039 L8.84961,4.5 L4.5,4.5 L4.5,8.84961 L1.40039,12 L4.5,15.1504 L4.5,19.5 L8.84961,19.5 L12,22.5996 L15.1504,19.5 L19.5,19.5 L19.5,15.1504 L22.5996,12 L19.5,8.84961 L19.5,4.5 L15.1504,4.5 L12,1.40039 Z M12,3.5 L14.5,6 L18,6 L18,9.5 L20.5,12 L18,14.5 L18,18 L14.5,18 L12,20.5 L9.5,18 L6,18 L6,14.5 L3.5,12 L6,9.5 L6,6 L9.5,6 L12,3.5 Z M12,6 L12,12 L6,12 C6,13.6667,6.58334,15.0833,7.75,16.25 C8.91666,17.4167,10.3333,18,12,18 C13.6667,18,15.0833,17.4167,16.25,16.25 C17.4167,15.0833,18,13.6667,18,12 C18,10.3333,17.4167,8.91667,16.25,7.75 C15.0833,6.58333,13.6667,6,12,6 Z"/>
|
||||
</vector>
|
@ -1,7 +1,6 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_6/materialsymbolsoutlined/brightness_6_wght300_24px.xml
|
||||
Changes made: Icon has been resized.
|
||||
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_medium/materialsymbolsoutlined/brightness_medium_wght300_24px.xml
|
||||
Changes made: The center circle of the icon has been edited.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
@ -19,12 +18,12 @@ Copyright 2022 Google
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:tint="#000000"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M 12,24 8.4471678,20.484415 H 3.5155855 V 15.552832 L 0,12 3.5155855,8.4471678 V 3.5155855 H 8.4471678 L 12,0 15.552832,3.5155855 h 4.931583 V 8.4471678 L 24,12 20.484415,15.552832 v 4.931583 h -4.931583 z m 0,-6.778844 q 2.16243,0 3.691807,-1.527171 1.529349,-1.5272 1.529349,-3.693985 0,-2.1667853 -1.527171,-3.693985 Q 14.166785,6.7788436 12,6.7788436 Z m 0,4.394546 2.828148,-2.828148 h 3.959406 V 14.828148 L 21.615702,12 18.787554,9.1718524 V 5.2124457 H 14.828148 L 12,2.3842981 9.1718524,5.2124457 H 5.2124457 V 9.1718524 L 2.3842981,12 5.2124457,14.828148 v 3.959406 H 9.1718524 Z M 12,12 Z"/>
|
||||
android:pathData="M12,1.40039 L8.84961,4.5 L4.5,4.5 L4.5,8.84961 L1.40039,12 L4.5,15.1504 L4.5,19.5 L8.84961,19.5 L12,22.5996 L15.1504,19.5 L19.5,19.5 L19.5,15.1504 L22.5996,12 L19.5,8.84961 L19.5,4.5 L15.1504,4.5 L12,1.40039 Z M12,3.5 L14.5,6 L18,6 L18,9.5 L20.5,12 L18,14.5 L18,18 L14.5,18 L12,20.5 L9.5,18 L6,18 L6,14.5 L3.5,12 L6,9.5 L6,6 L9.5,6 L12,3.5 Z M12,6 L12,12 L18,12 C18,10.3333,17.4167,8.91667,16.25,7.75 C15.0833,6.58333,13.6667,6,12,6 Z"/>
|
||||
</vector>
|
@ -0,0 +1,28 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/brightness_medium/materialsymbolsoutlined/brightness_medium_wght300_24px.xml
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,22.6 L8.85,19.5H4.5V15.15L1.4,12L4.5,8.85V4.5H8.85L12,1.4L15.15,4.5H19.5V8.85L22.6,12L19.5,15.15V19.5H15.15ZM12,18Q14.5,18 16.25,16.25Q18,14.5 18,12Q18,9.5 16.25,7.75Q14.5,6 12,6ZM12,20.5 L14.5,18H18V14.5L20.5,12L18,9.5V6H14.5L12,3.5L9.5,6H6V9.5L3.5,12L6,14.5V18H9.5ZM12,12Z"/>
|
||||
</vector>
|
@ -0,0 +1,29 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/volume_up/materialsymbolsoutlined/volume_up_wght300_24px.xml
|
||||
Changes made: The icon has been moved to the left relative to the center.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M14.2,20.1 L14.2,18.55 Q16.35,17.875,17.675,16.062 Q19,14.25,19,11.975 Q19,9.7,17.675,7.887 Q16.35,6.075,14.2,5.4 L14.2,3.85 Q16.975,4.6,18.737,6.85 Q20.5,9.1,20.5,11.975 Q20.5,14.85,18.737,17.1 Q16.975,19.35,14.2,20.1 Z M3.8,14.5 L3.8,9.5 L7.525,9.5 L11.8,5.2 L11.8,18.8 L7.525,14.5 Z M14.2,15.65 L14.2,8.3 Q15.15,8.825,15.725,9.825 Q16.3,10.825,16.3,12 Q16.3,13.175,15.725,14.15 Q15.15,15.125,14.2,15.65 Z M10.3,8.85 L8.15,11 L5.3,11 L5.3,13 L8.15,13 L10.3,15.15 Z M7.8,12 Z"/>
|
||||
</vector>
|
@ -0,0 +1,29 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/volume_mute/materialsymbolsoutlined/volume_mute_wght300_24px.xml
|
||||
Changes made: The icon has been moved to the left relative to the center.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M3.8,14.5 L3.8,9.5 L7.5,9.5 L11.8,5.2 L11.8,18.8 L7.5,14.5 Z M5.3,13 L8.15,13 L10.3,15.15 L10.3,8.85 L8.15,11 L5.3,11 Z M7.8,12 Z"/>
|
||||
</vector>
|
@ -1,7 +1,5 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/volume_off/materialsymbolsoutlined/volume_off_wght300_24px.xml
|
||||
Changes made: Icon has been resized.
|
||||
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
@ -19,12 +17,12 @@ Copyright 2022 Google
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:tint="#000000"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M 1.3652344 0 L 0 1.3652344 L 6.0546875 7.4179688 L 5.3359375 8.1367188 L 0 8.1367188 L 0 15.326172 L 5.3359375 15.326172 L 11.501953 21.492188 L 11.501953 12.867188 L 18.115234 19.480469 C 17.187378 20.219468 16.127746 20.783449 14.931641 21.164062 L 14.931641 23.392578 C 16.718114 22.913978 18.280985 22.111217 19.625 20.990234 L 22.634766 24 L 24 22.634766 L 1.3652344 0 z M 14.931641 0 L 14.931641 2.2285156 C 17.005369 2.8883985 18.67609 4.0858861 19.943359 5.8222656 C 21.210655 7.5586214 21.84375 9.5165598 21.84375 11.695312 C 21.84375 13.233865 21.521966 14.660986 20.888672 15.978516 L 22.478516 17.568359 C 23.487911 15.792744 24 13.836404 24 11.695312 C 24 8.928565 23.157439 6.467159 21.472656 4.3105469 C 19.787875 2.1539106 17.608115 0.71703359 14.931641 0 z M 11.501953 1.9707031 L 9.1914062 4.28125 L 11.501953 6.5917969 L 11.501953 1.9707031 z M 14.931641 6.40625 L 14.931641 10.021484 L 17.851562 12.941406 C 17.928942 12.549171 17.972656 12.14709 17.972656 11.732422 C 17.972656 10.624629 17.708722 9.590407 17.179688 8.6328125 C 16.650675 7.6752422 15.901216 6.9334278 14.931641 6.40625 z M 7.5917969 8.9570312 L 9.3457031 10.710938 L 9.3457031 16.261719 L 6.2539062 13.169922 L 2.15625 13.169922 L 2.15625 10.294922 L 6.2539062 10.294922 L 7.5917969 8.9570312 z"/>
|
||||
android:pathData="M19.475,22.15 L16.45,19.125Q15.95,19.45 15.375,19.7Q14.8,19.95 14.175,20.1V18.55Q14.5,18.45 14.8,18.325Q15.1,18.2 15.375,18.05L11.8,14.45V18.8L7.5,14.5H3.8V9.5H6.825L2,4.65L3.05,3.6L20.525,21.075ZM18.975,16.725 L17.9,15.65Q18.425,14.85 18.7,13.912Q18.975,12.975 18.975,11.975Q18.975,9.7 17.65,7.887Q16.325,6.075 14.175,5.4V3.85Q16.975,4.6 18.725,6.85Q20.475,9.1 20.475,11.975Q20.475,13.3 20.088,14.5Q19.7,15.7 18.975,16.725ZM9.3,11.975ZM15.925,13.675 L14.175,11.925V8.3Q15.175,8.85 15.738,9.85Q16.3,10.85 16.3,12Q16.3,12.45 16.2,12.862Q16.1,13.275 15.925,13.675ZM11.8,9.525 L9.625,7.375 11.8,5.2ZM10.3,15.15V12.95L8.325,11H5.3V13H8.15Z"/>
|
||||
</vector>
|
||||
|
@ -1,7 +1,6 @@
|
||||
<!--
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/volume_up/materialsymbolsoutlined/volume_up_wght300_24px.xml
|
||||
Changes made: Icon has been resized.
|
||||
|
||||
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/volume_down/materialsymbolsoutlined/volume_down_wght300_24px.xml
|
||||
Changes made: The icon has been moved to the left relative to the center.
|
||||
|
||||
Copyright 2022 Google
|
||||
|
||||
@ -19,12 +18,12 @@ Copyright 2022 Google
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:tint="#000000"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="m 14.930914,23.39174 v -2.22855 q 3.110602,-0.989852 5.011514,-3.594493 1.900948,-2.604606 1.900948,-5.872827 0,-3.2682212 -1.900948,-5.8728269 Q 18.041516,3.2184014 14.930914,2.2285499 V 0 Q 18.945639,1.0755802 21.47282,4.3106241 24,7.5456321 24,11.69587 q 0,4.150238 -2.52718,7.385246 -2.527181,3.235044 -6.541906,4.310624 z M 0,15.326272 V 8.1373576 H 5.3363847 L 11.502271,1.9715077 V 21.492122 l -6.1658863,-6.16585 z m 14.930914,1.659003 V 6.4064653 q 1.454368,0.7907885 2.247888,2.2271839 0.793556,1.4364318 0.793556,3.0981658 0,1.639628 -0.800457,3.051149 -0.800458,1.411522 -2.240987,2.202311 z M 9.3456105,7.2027534 6.2543463,10.294018 H 2.1566241 v 2.875594 h 4.0977222 l 3.0912642,3.091264 z M 5.7511173,11.731815 Z"/>
|
||||
android:pathData="M3.8,14.5 L3.8,9.5 L7.5,9.5 L11.8,5.2 L11.8,18.8 L7.5,14.5 Z M14.175,15.65 L14.175,8.3 Q15.15,8.825,15.725,9.825 Q16.3,10.825,16.3,12 Q16.3,13.175,15.725,14.15 Q15.15,15.125,14.175,15.65 Z M10.3,8.85 L8.15,11 L5.3,11 L5.3,13 L8.15,13 L10.3,15.15 Z M7.8,12 Z"/>
|
||||
</vector>
|
||||
|
Loading…
x
Reference in New Issue
Block a user