Skip to content

Commit

Permalink
Rewrite custom listview class in kotlin & bump version
Browse files Browse the repository at this point in the history
Signed-off-by: starry69 <[email protected]>
  • Loading branch information
starry-shivam committed Jan 12, 2023
1 parent e215d89 commit e488939
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 51 deletions.
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.starry.greenstash"
minSdk 24
targetSdk 32
versionCode 9
versionName "1.8"
versionCode 10
versionName "1.9"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.starry.greenstash.others

import android.content.Context
import android.util.AttributeSet
import android.widget.ListView

class ExpandableListView : ListView {
var isExpanded = false

constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(
context,
attrs,
defStyle
)

public override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
// HACK! TAKE THAT ANDROID!
if (isExpanded) {
// Calculate entire height by providing a very large height hint.
// But do not use the highest 2 bits of this integer; those are
// reserved for the MeasureSpec mode.
val expandSpec = MeasureSpec.makeMeasureSpec(Int.MAX_VALUE shr 2, MeasureSpec.AT_MOST)
super.onMeasure(widthMeasureSpec, expandSpec)
val params = layoutParams
params.height = measuredHeight
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
}
}
}
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Some under the hood improvements & fixes.
- Updated few dependencies.
- We now have a telegram group! Join us at https://t.me/PotApps

0 comments on commit e488939

Please sign in to comment.