Compare commits

...

4 Commits

Author SHA1 Message Date
kunfei
796d3cdfce
Merge b6b6718177 into 5336adc035 2024-05-15 20:06:39 +08:00
dependabot[bot]
5336adc035
Bump pnpm/action-setup from 3 to 4 (#3930)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 3 to 4.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v3...v4)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 20:06:20 +08:00
Horis
72ad27ea84 优化 2024-05-14 09:33:56 +08:00
Xwite
b6b6718177 Bump cronet from 123.0.6312.80 to 124.0.6367.171
- Changes in the [Git log](https://chromium.googlesource.com/chromium/src/+log/123.0.6312.80..124.0.6367.171)
2024-05-13 01:30:10 +00:00
10 changed files with 14 additions and 32 deletions

View File

@ -27,7 +27,7 @@ jobs:
with:
node-version: 16
- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
{"arm64-v8a":"bbf2c50d1ebf0763d451b08e290a3244","armeabi-v7a":"ecb872f7b1b5342f4d7c36262bec0600","x86":"4da4832b89e2412d808c5b1ecdc24e3d","x86_64":"62080f051db02ed0e939affb39ce67fb","version":"123.0.6312.80"}
{"x86":"a9d092828a1a33ed43b3030e16353e9a","armeabi-v7a":"522f2f5304bf9250a43edc56bfff0fb4","x86_64":"bc89c549d18bcd26fef8e82fbad4a7cd","arm64-v8a":"ad9209119e3e74e532d07256b6e4e0ba","version":"124.0.6367.171"}

View File

@ -13,6 +13,7 @@
* 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源!
**2024/02/27**
* 更新cronet: 124.0.6367.171
* 更新cronet: 123.0.6312.80
* 更新cronet: 123.0.6312.40

View File

@ -6,10 +6,8 @@ import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Rect
import android.graphics.Typeface
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.os.Build
import android.text.StaticLayout
import android.text.style.LineHeightSpan
import android.util.AttributeSet
import androidx.annotation.ColorInt
import androidx.appcompat.widget.AppCompatTextView
@ -29,13 +27,6 @@ class BatteryView @JvmOverloads constructor(
private val outFrame = Rect()
private val polar = Rect()
private val canvasRecorder = CanvasRecorderFactory.create()
private val batterySpan = LineHeightSpan { _, _, _, _, _, fm ->
fm.top = -22
fm.ascent = -28
fm.descent = 7
fm.bottom = 1
fm.leading = 0
}
var isBattery = false
set(value) {
field = value
@ -48,6 +39,9 @@ class BatteryView @JvmOverloads constructor(
init {
setPadding(4.dpToPx(), 3.dpToPx(), 6.dpToPx(), 3.dpToPx())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
isFallbackLineSpacing = false
}
batteryPaint.strokeWidth = 1f.dpToPx()
batteryPaint.isAntiAlias = true
batteryPaint.color = paint.color
@ -69,9 +63,9 @@ class BatteryView @JvmOverloads constructor(
fun setBattery(battery: Int, text: String? = null) {
this.battery = battery
if (text.isNullOrEmpty()) {
setText(getBatteryText(battery.toString()))
setText(battery.toString())
} else {
setText(getBatteryText("$text $battery"))
setText("$text $battery")
}
}
@ -84,17 +78,16 @@ class BatteryView @JvmOverloads constructor(
if (AppConfig.optimizeRender) {
canvasRecorder.recordIfNeededThenDraw(canvas, width, height) {
super.onDraw(this)
if (!isBattery) return@recordIfNeededThenDraw
drawBattery(this)
}
} else {
super.onDraw(canvas)
if (!isBattery) return
drawBattery(canvas)
}
}
private fun drawBattery(canvas: Canvas) {
if (!isBattery) return
layout.getLineBounds(0, outFrame)
val batteryStart = layout
.getPrimaryHorizontal(text.length - battery.toString().length)
@ -120,22 +113,10 @@ class BatteryView @JvmOverloads constructor(
canvas.drawRect(polar, batteryPaint)
}
private fun getBatteryText(text: CharSequence?): SpannableStringBuilder? {
if (text == null) {
return null
}
return SpannableStringBuilder(text).apply {
setSpan(batterySpan, 0, text.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
}
@Suppress("UNNECESSARY_SAFE_CALL")
override fun invalidate() {
super.invalidate()
kotlin.runCatching {
canvasRecorder.invalidate()
}
canvasRecorder?.invalidate()
}
}

View File

@ -42,7 +42,7 @@ android.defaults.buildfeatures.shaders=false
# and none from the library's dependencies, thereby reducing the size of the R class for that library.
android.nonTransitiveRClass=true
# https://chromiumdash.appspot.com/releases?platform=Android
CronetVersion=123.0.6312.80
CronetMainVersion=123.0.0.0
CronetVersion=124.0.6367.171
CronetMainVersion=124.0.0.0
android.injected.testOnly=false
android.nonFinalResIds=true