Skip to content

Commit

Permalink
Fix for Android 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
knirirr committed Jun 7, 2015
1 parent 7d1902c commit fc78ce0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion beecount/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 20
versionCode 103
versionCode 104
}
/*
buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion beecount/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.knirirr.beecount"
android:largeHeap="true"
android:versionName="2.3.7">
android:versionName="2.3.7-r1">


<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand Down
10 changes: 9 additions & 1 deletion beecount/src/main/java/com/knirirr/beecount/AutoFitText.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Paint;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
Expand Down Expand Up @@ -92,7 +93,14 @@ public void onGlobalLayout() {
// make an initial call to onSizeChanged to make sure that refitText is triggered
onSizeChanged(AutoFitText.this.getWidth(), AutoFitText.this.getHeight(), 0, 0);
// Remove the LayoutListener immediately so we don't run into an infinite loop
AutoFitText.this.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
{
AutoFitText.this.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
else
{
AutoFitText.this.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
}
});
}
Expand Down
4 changes: 4 additions & 0 deletions beecount/src/main/res/raw/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</style>
</head>
<body>
$ 2.3.7-r1
% Version 2.3.7-r1
_ 2015-06-07
* Fix for small bug on Android 4.0.4 and below.
$ 2.3.7
% Version 2.3.7
_ 2015-06-07
Expand Down

0 comments on commit fc78ce0

Please sign in to comment.