Browse Source

Bump compile version to 34

transifex
Nicolas Pomepuy 3 years ago
parent
commit
6134de7211
  1. 2
      application/live-plot-graph/src/main/java/org/videolan/liveplotgraph/PlotView.kt
  2. 3
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt
  3. 4
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAudio.kt
  4. 3
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesOptional.kt
  5. 3
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesParentalControl.kt
  6. 2
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt
  7. 3
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt
  8. 2
      application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesVideo.kt
  9. 6
      application/television/src/main/java/org/videolan/television/ui/views/ColorPickerItem.kt
  10. 17
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
  11. 15
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt
  12. 3
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudioControls.kt
  13. 4
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.kt
  14. 4
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesOptional.kt
  15. 3
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesParentalControl.kt
  16. 2
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt
  17. 3
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.kt
  18. 3
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideo.kt
  19. 19
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt
  20. 3
      application/vlc-android/src/org/videolan/vlc/gui/preferences/widgets/PreferencesWidgets.kt
  21. 5
      application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt
  22. 2
      application/vlc-android/src/org/videolan/vlc/gui/view/AutofitButton.kt
  23. 6
      application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt
  24. 20
      application/vlc-android/src/org/videolan/vlc/gui/view/PlayerProgress.kt
  25. 12
      application/vlc-android/src/org/videolan/vlc/gui/view/WidgetHandleView.kt
  26. 2
      build.gradle

2
application/live-plot-graph/src/main/java/org/videolan/liveplotgraph/PlotView.kt

@ -101,7 +101,7 @@ class PlotView : FrameLayout {
listeners.remove(listener)
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
maxsY.clear()

3
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt

@ -230,7 +230,8 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
return super.onPreferenceTreeClick(preference)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"network_caching" -> {
sharedPreferences.edit {

4
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAudio.kt

@ -29,7 +29,6 @@ import android.os.Bundle
import android.text.InputFilter
import android.text.InputType
import android.util.Log
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.preference.CheckBoxPreference
import androidx.preference.EditTextPreference
@ -133,7 +132,8 @@ class PreferencesAudio : BasePreferenceFragment(), SharedPreferences.OnSharedPre
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"aout" -> {
launch { restartLibVLC() }

3
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesOptional.kt

@ -74,7 +74,8 @@ class PreferencesOptional : BasePreferenceFragment(), SharedPreferences.OnShared
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
val enabled = findPreference<CheckBoxPreference>(key)!!.isChecked
FeatureFlagManager.getByKey(key)?.let { FeatureFlagManager.enable(activity,it, enabled) }
}

3
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesParentalControl.kt

@ -84,7 +84,8 @@ class PreferencesParentalControl : BasePreferenceFragment(), SharedPreferences.O
}
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
KEY_SAFE_MODE -> {
Settings.safeMode = sharedPreferences.getBoolean(key, false) && activity.isPinCodeSet()

2
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt

@ -220,7 +220,7 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
preferenceScreen.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
when (key) {
"subtitles_size", "subtitles_bold", "subtitle_text_encoding",
"subtitles_color", "subtitles_color_opacity",

3
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt

@ -89,7 +89,8 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
PREF_TV_UI -> {
Settings.tvUI = sharedPreferences.getBoolean(PREF_TV_UI, false)

2
application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesVideo.kt

@ -66,7 +66,7 @@ class PreferencesVideo : BasePreferenceFragment(), SharedPreferences.OnSharedPre
.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
when (key) {
"preferred_resolution" -> {
launch {

6
application/television/src/main/java/org/videolan/television/ui/views/ColorPickerItem.kt

@ -94,10 +94,10 @@ class ColorPickerItem @JvmOverloads constructor(
*
* @param canvas the view's [Canvas]
*/
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
canvas?.drawCircle(width.toFloat() / 2, height.toFloat() / 2, (width.toFloat() / 2) - 4.dp, outerPaint)
canvas?.drawCircle(width.toFloat() / 2, height.toFloat() / 2, (width.toFloat() / 2) - 5.dp, paint)
canvas.drawCircle(width.toFloat() / 2, height.toFloat() / 2, (width.toFloat() / 2) - 4.dp, outerPaint)
canvas.drawCircle(width.toFloat() / 2, height.toFloat() / 2, (width.toFloat() / 2) - 5.dp, paint)
}

17
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt

@ -44,7 +44,19 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.videolan.medialibrary.interfaces.Medialibrary
import org.videolan.resources.*
import org.videolan.resources.AndroidDevices
import org.videolan.resources.KEY_AUDIO_LAST_PLAYLIST
import org.videolan.resources.KEY_CURRENT_AUDIO
import org.videolan.resources.KEY_CURRENT_AUDIO_RESUME_ARTIST
import org.videolan.resources.KEY_CURRENT_AUDIO_RESUME_THUMB
import org.videolan.resources.KEY_CURRENT_AUDIO_RESUME_TITLE
import org.videolan.resources.KEY_CURRENT_MEDIA
import org.videolan.resources.KEY_CURRENT_MEDIA_RESUME
import org.videolan.resources.KEY_MEDIA_LAST_PLAYLIST
import org.videolan.resources.KEY_MEDIA_LAST_PLAYLIST_RESUME
import org.videolan.resources.ROOM_DATABASE
import org.videolan.resources.SCHEME_PACKAGE
import org.videolan.resources.VLCInstance
import org.videolan.tools.BitmapCache
import org.videolan.tools.Settings
import org.videolan.tools.putSingle
@ -235,7 +247,8 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
return super.onPreferenceTreeClick(preference)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"network_caching" -> {
sharedPreferences.edit {

15
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt

@ -32,7 +32,11 @@ import android.text.InputType
import android.util.Log
import androidx.core.content.edit
import androidx.lifecycle.lifecycleScope
import androidx.preference.*
import androidx.preference.CheckBoxPreference
import androidx.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.TwoStatePreference
import kotlinx.coroutines.launch
import org.videolan.libvlc.util.AndroidUtil
import org.videolan.libvlc.util.HWDecoderUtil
@ -55,7 +59,7 @@ import org.videolan.vlc.providers.PickerType
import org.videolan.vlc.util.LocaleUtil
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
import java.util.Locale
private const val TAG = "VLC/PreferencesAudio"
private const val FILE_PICKER_RESULT_CODE = 10000
@ -151,8 +155,9 @@ class PreferencesAudio : BasePreferenceFragment(), SharedPreferences.OnSharedPre
}
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
if (activity == null) return
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null || activity == null) return
when (key) {
"aout" -> {
lifecycleScope.launch { restartLibVLC() }
@ -173,7 +178,7 @@ class PreferencesAudio : BasePreferenceFragment(), SharedPreferences.OnSharedPre
Log.w(TAG, "Could not parse value: $newValue. Setting $key to $fmtValue", e)
} finally {
if (fmtValue != newValue) {
sharedPreferences.edit {
sharedPreferences?.edit {
// putString will trigger another preference change event. Restart libVLC when it settles.
putString(key, fmtValue)
findPreference<EditTextPreference>(key)?.let { it.text = fmtValue }

3
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudioControls.kt

@ -46,7 +46,8 @@ class PreferencesAudioControls : BasePreferenceFragment(), SharedPreferences.OnS
.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
(activity as? VideoPlayerActivity)?.onChangedControlSetting(key)
when (key) {
KEY_AUDIO_JUMP_DELAY -> {

4
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.kt

@ -185,8 +185,10 @@ class PreferencesFragment : BasePreferenceFragment(), SharedPreferences.OnShared
return true
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
val activity = activity ?: return
if (sharedPreferences == null || key == null) return
when (key) {
"video_action_switch" -> if (!AndroidUtil.isOOrLater && findPreference<ListPreference>(key)?.value == "2"
&& !Permissions.canDrawOverlays(activity))

4
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesOptional.kt

@ -32,7 +32,6 @@ import androidx.preference.PreferenceScreen
import org.videolan.vlc.R
import org.videolan.vlc.gui.dialogs.FeatureFlagWarningDialog
import org.videolan.vlc.gui.dialogs.RenameDialog
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.util.FeatureFlag
import org.videolan.vlc.util.FeatureFlagManager
@ -69,7 +68,8 @@ class PreferencesOptional : BasePreferenceFragment(), SharedPreferences.OnShared
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
val enabled = findPreference<CheckBoxPreference>(key)!!.isChecked
FeatureFlagManager.getByKey(key)?.let { FeatureFlagManager.enable(requireActivity(), it, enabled) }
// if (enabled) UiTools.snacker(requireActivity(), getString(R.string.optional_features_warning))

3
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesParentalControl.kt

@ -74,7 +74,8 @@ class PreferencesParentalControl : BasePreferenceFragment(), SharedPreferences.O
return super.onPreferenceTreeClick(preference)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
KEY_SAFE_MODE -> {
Settings.safeMode = sharedPreferences.getBoolean(key, false) && requireActivity().isPinCodeSet()

2
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt

@ -168,7 +168,7 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
preferenceScreen.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
when (key) {
"subtitles_size", "subtitles_bold", "subtitle_text_encoding",
"subtitles_color", "subtitles_color_opacity",

3
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.kt

@ -130,7 +130,8 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
return super.onPreferenceTreeClick(preference)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"set_locale" -> {
(activity as PreferencesActivity).setRestart()

3
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideo.kt

@ -56,7 +56,8 @@ class PreferencesVideo : BasePreferenceFragment(), SharedPreferences.OnSharedPre
.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"preferred_resolution" -> {
lifecycleScope.launch {

19
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt

@ -27,7 +27,21 @@ import android.os.Bundle
import androidx.preference.Preference
import org.videolan.libvlc.util.AndroidUtil
import org.videolan.resources.AndroidDevices
import org.videolan.tools.*
import org.videolan.tools.AUDIO_BOOST
import org.videolan.tools.ENABLE_BRIGHTNESS_GESTURE
import org.videolan.tools.ENABLE_DOUBLE_TAP_PLAY
import org.videolan.tools.ENABLE_DOUBLE_TAP_SEEK
import org.videolan.tools.ENABLE_SCALE_GESTURE
import org.videolan.tools.ENABLE_SWIPE_SEEK
import org.videolan.tools.ENABLE_VOLUME_GESTURE
import org.videolan.tools.KEY_VIDEO_DOUBLE_TAP_JUMP_DELAY
import org.videolan.tools.KEY_VIDEO_JUMP_DELAY
import org.videolan.tools.KEY_VIDEO_LONG_JUMP_DELAY
import org.videolan.tools.POPUP_KEEPSCREEN
import org.videolan.tools.SCREENSHOT_MODE
import org.videolan.tools.Settings
import org.videolan.tools.VIDEO_HUD_TIMEOUT
import org.videolan.tools.coerceInOrDefault
import org.videolan.vlc.R
import org.videolan.vlc.gui.video.VideoPlayerActivity
@ -72,7 +86,8 @@ class PreferencesVideoControls : BasePreferenceFragment(), SharedPreferences.OnS
.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
(activity as? VideoPlayerActivity)?.onChangedControlSetting(key)
when (key) {
VIDEO_HUD_TIMEOUT -> {

3
application/vlc-android/src/org/videolan/vlc/gui/preferences/widgets/PreferencesWidgets.kt

@ -142,7 +142,8 @@ class PreferencesWidgets : BasePreferenceFragment(), SharedPreferences.OnSharedP
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
if (sharedPreferences == null || key == null) return
when (key) {
"opacity" -> {
model.widget.value?.opacity = sharedPreferences.getInt(key, 100)

5
application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt

@ -137,13 +137,14 @@ class PopupManager constructor(private val service: PlaybackService) : PlaybackS
return false
}
override fun onScroll(p0: MotionEvent, p1: MotionEvent, p2: Float, p3: Float): Boolean {
override fun onScroll(p0: MotionEvent?, p1: MotionEvent, p2: Float, p3: Float): Boolean {
return false
}
override fun onLongPress(e: MotionEvent) {}
override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
if (abs(velocityX) > FLING_STOP_VELOCITY || velocityY > FLING_STOP_VELOCITY) {
stopPlayback()
return true

2
application/vlc-android/src/org/videolan/vlc/gui/view/AutofitButton.kt

@ -51,7 +51,7 @@ class AutofitButton : MaterialButton {
super.onSizeChanged(w, h, oldw, oldh)
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
computeTextSize()
}

6
application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt

@ -6,8 +6,8 @@ import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import androidx.core.content.ContextCompat
import org.videolan.vlc.R
import org.videolan.tools.Settings
import org.videolan.vlc.R
class HalfCircleView : View {
private var isLeft: Boolean = true
@ -49,11 +49,11 @@ class HalfCircleView : View {
}
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
if (!Settings.showTvUi) {
val cx = if (isLeft) -width else width * 2
val cy = height / 2
canvas?.drawCircle(cx.toFloat(), cy.toFloat(), width.toFloat()*2, paint)
canvas.drawCircle(cx.toFloat(), cy.toFloat(), width.toFloat()*2, paint)
}
super.onDraw(canvas)
}

20
application/vlc-android/src/org/videolan/vlc/gui/view/PlayerProgress.kt

@ -25,7 +25,11 @@
package org.videolan.vlc.gui.view
import android.content.Context
import android.graphics.*
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.graphics.RectF
import android.graphics.Region
import android.util.AttributeSet
import android.view.View
import androidx.core.content.ContextCompat
@ -73,7 +77,7 @@ class PlayerProgress : View {
paintProgress.isAntiAlias = true
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
val left = (width.toFloat() - progressWidth.toFloat()) / 2
val right = width - left
val top = yOffset.toFloat()
@ -83,18 +87,18 @@ class PlayerProgress : View {
//draw background
roundedRectanglePath(left, top, right, bottom, radius, radius)
paintBackground.setShadowLayer(6F,0F,0F, shadowColor)
canvas?.drawPath(path, paintBackground)
canvas.drawPath(path, paintBackground)
paintBackground.clearShadowLayer()
paintBackground.color = 0x00000000
canvas?.drawPath(path, paintBackground)
canvas.drawPath(path, paintBackground)
paintBackground.color = backgroundColor
canvas?.drawPath(path, paintBackground)
canvas.drawPath(path, paintBackground)
//draw progress
val clipTop = yOffset + (bottom - top) * (1 - progressPercent)
rectProgress.set(left, clipTop, right, bottom)
canvas?.withClip(rectProgress) {
canvas.withClip(rectProgress) {
clipRect(rectProgress)
}
@ -112,7 +116,7 @@ class PlayerProgress : View {
firstClippingRegion.op(secondClippingRegion, Region.Op.INTERSECT)
paintProgress.color = progressColor
canvas?.drawPath(firstClippingRegion.boundaryPath, paintProgress)
canvas.drawPath(firstClippingRegion.boundaryPath, paintProgress)
//draw boost
if (isDouble && progressPercent > 0.5) {
@ -133,7 +137,7 @@ class PlayerProgress : View {
firstClippingRegion.op(secondClippingRegion, Region.Op.INTERSECT)
paintProgress.color = boostColor
canvas?.drawPath(firstClippingRegion.boundaryPath, paintProgress)
canvas.drawPath(firstClippingRegion.boundaryPath, paintProgress)
}
super.onDraw(canvas)

12
application/vlc-android/src/org/videolan/vlc/gui/view/WidgetHandleView.kt

@ -59,7 +59,7 @@ class WidgetHandleView : View {
paint.isAntiAlias = true
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
val padding = 8.dp.toFloat()
val viewWidth = width
//3.56 is the known ratio of the [R.drawable.vlc_widget_mini] image. 6.dp is two times the stroke size
@ -68,12 +68,12 @@ class WidgetHandleView : View {
val height = height - padding
paint.strokeWidth = 3.dp.toFloat()
paint.style = Paint.Style.STROKE
canvas?.drawRoundRect(hPadding, padding, viewWidth - hPadding, height, 12.dp.toFloat(), 12.dp.toFloat(), paint)
canvas.drawRoundRect(hPadding, padding, viewWidth - hPadding, height, 12.dp.toFloat(), 12.dp.toFloat(), paint)
paint.style = Paint.Style.FILL
canvas?.drawCircle(hPadding, padding + (height / 2), 6.dp.toFloat(), paint)
canvas?.drawCircle(hPadding + (width.toFloat() / 2), padding, 6.dp.toFloat(), paint)
canvas?.drawCircle(hPadding + width.toFloat(), padding + (height / 2), 6.dp.toFloat(), paint)
canvas?.drawCircle(hPadding + (width.toFloat() / 2), height, 6.dp.toFloat(), paint)
canvas.drawCircle(hPadding, padding + (height / 2), 6.dp.toFloat(), paint)
canvas.drawCircle(hPadding + (width.toFloat() / 2), padding, 6.dp.toFloat(), paint)
canvas.drawCircle(hPadding + width.toFloat(), padding + (height / 2), 6.dp.toFloat(), paint)
canvas.drawCircle(hPadding + (width.toFloat() / 2), height, 6.dp.toFloat(), paint)
super.onDraw(canvas)
}
}

2
build.gradle

@ -46,7 +46,7 @@ ext {
medialibraryVersion = vlcMajorVersion == 3 ? '0.13.13-rc10' : '0.13.13-vlc4-rc10'
minSdkVersion = 17
targetSdkVersion = 34
compileSdkVersion = 33
compileSdkVersion = 34
buildToolsVersion = '33.0.1'
androidxLegacyVersion = '1.0.0'
androidxCoreVersion = '1.7.0'

Loading…
Cancel
Save