Skip to content

Commit

Permalink
Merge pull request #96 from ArcticFoxPro/master
Browse files Browse the repository at this point in the history
更正 Kuikly 标识最早版本不准确的问题,优化设置、实验性功能和本机版本详情对话框界面
  • Loading branch information
klxiaoniu authored Dec 30, 2024
2 parents 91c6627 + 6c2eb61 commit cf741bf
Show file tree
Hide file tree
Showing 45 changed files with 2,306 additions and 545 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
minSdk = 24
targetSdk = 35
versionCode = gitCommitCount
versionName = "1.4.6-$gitCommitHash"
versionName = "1.4.7-$gitCommitHash"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class QverbowApplication : Application() {
const val EARLIEST_QQNT_FRAMEWORK_QQ_VERSION_STABLE = "8.9.63"
const val EARLIEST_QQNT_FRAMEWORK_TIM_VERSION_STABLE = "4.0.0"
const val EARLIEST_UNREAL_ENGINE_QQ_VERSION_STABLE = "8.8.55"
const val EARLIEST_KUIKLY_FRAMEWORK_QQ_VERSION_STABLE = "8.9.73"
const val EARLIEST_KUIKLY_FRAMEWORK_QQ_VERSION_STABLE = "8.9.50"
const val EARLIEST_KUIKLY_FRAMEWORK_TIM_VERSION_STABLE = "4.0.0"
}

Expand Down
227 changes: 136 additions & 91 deletions app/src/main/java/com/xiaoniu/qqversionlist/ui/LocalQQAdapter.kt

Large diffs are not rendered by default.

228 changes: 139 additions & 89 deletions app/src/main/java/com/xiaoniu/qqversionlist/ui/LocalTIMAdapter.kt

Large diffs are not rendered by default.

131 changes: 59 additions & 72 deletions app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
Qverbow Util
Copyright (C) 2023 klxiaoniu
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.xiaoniu.qqversionlist.ui.components.cell

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.core.view.isVisible
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.CellBottomClickBinding

@SuppressLint("CustomViewStyleable")
class CellBottomClick @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private val binding: CellBottomClickBinding =
CellBottomClickBinding.inflate(LayoutInflater.from(context), this, true)

init {
val a = context.obtainStyledAttributes(attrs, R.styleable.Cell, defStyleAttr, 0)
val title = a.getString(R.styleable.Cell_cellTitle)
val iconResId = a.getResourceId(R.styleable.Cell_cellIcon, 0)
val description = a.getString(R.styleable.Cell_cellDescription)
a.recycle()
if (title == null) throw IllegalArgumentException("Title and type are required attributes for CellSwitch.")

binding.title.text = title

if (iconResId != 0) binding.icon.apply {
setImageResource(iconResId)
isVisible = true
} else binding.icon.isVisible = false

if (description != null) binding.description.apply {
text = description
isVisible = true
} else binding.description.isVisible = false

setOnClickListener { v ->
onClick?.invoke(v)
}
}

var onClick: ((View) -> Unit)? = null

fun setCellTitle(title: String) {
binding.title.text = title
}

fun setCellDescription(description: String?) {
if (description == null) binding.description.isVisible = false
else binding.description.apply {
isVisible = true
text = description
}

}

fun setCellIcon(iconResId: Int?) {
if (iconResId == null)
binding.icon.isVisible = false
else binding.icon.apply {
isVisible = true
setImageResource(iconResId)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
Qverbow Util
Copyright (C) 2023 klxiaoniu
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.xiaoniu.qqversionlist.ui.components.cell

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.core.view.isVisible
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.CellBottomSwitchBinding

@SuppressLint("CustomViewStyleable")
class CellBottomSwitch @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private val binding: CellBottomSwitchBinding =
CellBottomSwitchBinding.inflate(LayoutInflater.from(context), this, true)
private var onCheckedChangeListener: ((Boolean) -> Unit)? = null

init {
val a = context.obtainStyledAttributes(attrs, R.styleable.Cell, defStyleAttr, 0)
val title = a.getString(R.styleable.Cell_cellTitle)
val iconResId = a.getResourceId(R.styleable.Cell_cellIcon, 0)
val description = a.getString(R.styleable.Cell_cellDescription)
a.recycle()
if (title == null) throw IllegalArgumentException("Title and type are required attributes for CellSwitch.")

binding.title.text = title

if (iconResId != 0) binding.icon.apply {
setImageResource(iconResId)
isVisible = true
} else binding.icon.isVisible = false

if (description != null) binding.description.apply {
text = description
isVisible = true
} else binding.description.isVisible = false

setOnClickListener { v ->
toggleSwitch()
onClick?.invoke(v)
}
}

var onClick: ((View) -> Unit)? = null

fun setCellTitle(title: String) {
binding.title.text = title
}

fun setCellDescription(description: String?) {
if (description == null) binding.description.isVisible = false
else binding.description.apply {
isVisible = true
text = description
}

}

fun setCellIcon(iconResId: Int?) {
if (iconResId == null)
binding.icon.isVisible = false
else binding.icon.apply {
isVisible = true
setImageResource(iconResId)
}
}

var switchChecked: Boolean
get() = binding.switchCompat.isChecked
set(value) {
binding.switchCompat.isChecked = value
}

var switchEnabled: Boolean
get() = binding.switchCompat.isEnabled
set(value) {
binding.switchCompat.isEnabled = value
}

fun setOnCheckedChangeListener(listener: (Boolean) -> Unit) {
onCheckedChangeListener = listener
}

private fun toggleSwitch() {
val isChecked = !binding.switchCompat.isChecked
val isEnabled = binding.switchCompat.isEnabled
if (isEnabled) {
binding.switchCompat.isChecked = isChecked
onCheckedChangeListener?.invoke(isChecked)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
Qverbow Util
Copyright (C) 2023 klxiaoniu
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.xiaoniu.qqversionlist.ui.components.cell

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.core.view.isVisible
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.CellMiddleClickBinding

@SuppressLint("CustomViewStyleable")
class CellMiddleClick @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private val binding: CellMiddleClickBinding =
CellMiddleClickBinding.inflate(LayoutInflater.from(context), this, true)

init {
val a = context.obtainStyledAttributes(attrs, R.styleable.Cell, defStyleAttr, 0)
val title = a.getString(R.styleable.Cell_cellTitle)
val iconResId = a.getResourceId(R.styleable.Cell_cellIcon, 0)
val description = a.getString(R.styleable.Cell_cellDescription)
a.recycle()
if (title == null) throw IllegalArgumentException("Title and type are required attributes for CellSwitch.")

binding.title.text = title

if (iconResId != 0) binding.icon.apply {
setImageResource(iconResId)
isVisible = true
} else binding.icon.isVisible = false

if (description != null) binding.description.apply {
text = description
isVisible = true
} else binding.description.isVisible = false

setOnClickListener { v ->
onClick?.invoke(v)
}
}

var onClick: ((View) -> Unit)? = null

fun setCellTitle(title: String) {
binding.title.text = title
}

fun setCellDescription(description: String?) {
if (description == null) binding.description.isVisible = false
else binding.description.apply {
isVisible = true
text = description
}

}

fun setCellIcon(iconResId: Int?) {
if (iconResId == null)
binding.icon.isVisible = false
else binding.icon.apply {
isVisible = true
setImageResource(iconResId)
}
}
}
Loading

0 comments on commit cf741bf

Please sign in to comment.