Skip to content

Commit

Permalink
Fixed bug where View would not show inside ScrollView. (#7)
Browse files Browse the repository at this point in the history
Fixed bug where View would not show inside ScrollView.
  • Loading branch information
VladimirWrites committed Jan 16, 2018
1 parent d5c06da commit 9a6574a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
Change Log
==========
Version 1.4.2 *(2018-01-16)*
----------------------------

* Fixed bug where View would not show inside ScrollView. [#5](https://github.com/vlad1m1r990/Lemniscate/issues/5)

Version 1.4.1 *(2018-01-06)*
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -34,7 +34,7 @@ Add to your module's build.gradle:
and to your app build.gradle:

dependencies {
compile 'com.github.vlad1m1r990:Lemniscate:1.4.1'
compile 'com.github.vlad1m1r990:Lemniscate:1.4.2'
}

Usage
Expand Down
4 changes: 2 additions & 2 deletions lemniscate/build.gradle
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 141
versionName "1.4.1"
versionCode 142
versionName "1.4.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Expand Up @@ -180,12 +180,11 @@ abstract class BaseCurveProgressView : View, IBaseCurveProgressView{
}

private fun getViewDimension(mode: Int, viewSize: Float, defaultSize: Float): Float {
return if (mode == View.MeasureSpec.EXACTLY) {
viewSize
} else if (mode == View.MeasureSpec.AT_MOST) {
Math.min(defaultSize, viewSize)
} else {
defaultSize
return when {
viewSize == 0f -> defaultSize
mode == View.MeasureSpec.EXACTLY -> viewSize
mode == View.MeasureSpec.AT_MOST -> Math.min(defaultSize, viewSize)
else -> defaultSize
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/toolbar.xml
Expand Up @@ -8,4 +8,4 @@
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>

0 comments on commit 9a6574a

Please sign in to comment.