Skip to content

Commit

Permalink
Merge pull request #918 from ferredoxin/ketal-patch-1
Browse files Browse the repository at this point in the history
Update Version code
  • Loading branch information
Lagrio authored Jun 9, 2021
2 parents 32a58b9 + e919d21 commit 1b90a17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {
targetSdkVersion 30
versionCode(getTimeStamp.call() as int)
// versionName format: major.minor.accumulation.commit_id
versionName "0.8.19" + (getGitHeadRefsSuffix.call() as String)
versionName "0.8.20" + (getGitHeadRefsSuffix.call() as String)
multiDexEnabled false
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/me/ketal/ui/view/BViewGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import nil.nadph.qnotified.util.Utils.dip2px
import nil.nadph.qnotified.util.Utils.dip2sp

abstract class BViewGroup(context: Context) : ViewGroup(context) {
private val MODE_SHIFT = 30
private val MODE_MASK = 0x3 shl MODE_SHIFT
protected fun View.defaultWidthMeasureSpec(parentView: ViewGroup): Int {
return when (layoutParams.width) {
ViewGroup.LayoutParams.MATCH_PARENT -> parentView.measuredWidth.toExactlyMeasureSpec()
Expand All @@ -52,11 +54,11 @@ abstract class BViewGroup(context: Context) : ViewGroup(context) {
}

protected fun Int.toExactlyMeasureSpec(): Int {
return MeasureSpec.makeMeasureSpec(this, MeasureSpec.EXACTLY)
return makeMeasureSpec(this, MeasureSpec.EXACTLY)
}

protected fun Int.toAtMostMeasureSpec(): Int {
return MeasureSpec.makeMeasureSpec(this, MeasureSpec.AT_MOST)
return makeMeasureSpec(this, MeasureSpec.AT_MOST)
}

protected fun View.autoMeasure() {
Expand Down Expand Up @@ -94,6 +96,9 @@ abstract class BViewGroup(context: Context) : ViewGroup(context) {
protected val Int.dp2sp: Int get() = dip2sp(context, this.toFloat())
protected val View.measuredWidthWithMargins get() = (measuredWidth + marginLeft + marginRight)
protected val View.measuredHeightWithMargins get() = (measuredHeight + marginTop + marginBottom)
protected fun makeMeasureSpec(size: Int, mode: Int): Int {
return size and MODE_MASK.inv() or (mode and MODE_MASK)
}

protected class LayoutParams(width: Int, height: Int) : MarginLayoutParams(width, height)
}
1 change: 1 addition & 0 deletions app/src/main/java/nil/nadph/qnotified/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ public class QQVersion {
public static final long QQ_8_7_0 = 1718;
public static final long QQ_8_7_5 = 1738;
public static final long QQ_8_7_8 = 1758;
public static final long QQ_8_8_0 = 1792;
}

0 comments on commit 1b90a17

Please sign in to comment.