Skip to content

Commit

Permalink
update V2.7
Browse files Browse the repository at this point in the history
fixed interval of 300ms for display values
  • Loading branch information
woheller69 committed Jan 17, 2024
1 parent 3ab3e39 commit eb2a10f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
| [<img src="https://github.com/woheller69/audio-analyzer-for-android/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.audio_analyzer_for_android/) |[<img src="https://github.com/woheller69/lavatories/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.lavatories/) | [<img src="https://github.com/woheller69/TimeLapseCamera/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.TimeLapseCam/) |
| **Arity** | **omWeather** | **solXpect** |
| [<img src="https://github.com/woheller69/arity/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.arity/) | [<img src="https://github.com/woheller69/omweather/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.omweather/) | [<img src="https://github.com/woheller69/solXpect/blob/main/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.solxpect/) |
| **gptAssist** | | |
| [<img src="https://github.com/woheller69/gptassist/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.gptassist/) | | |
| **gptAssist** | **dumpSeeker** | **huggingAssist** |
| [<img src="https://github.com/woheller69/gptassist/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.gptassist/) | [<img src="https://github.com/woheller69/dumpseeker/blob/main/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.dumpseeker/) | [<img src="https://github.com/woheller69/huggingassist/blob/master/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.hugassist/) |
| **FREE Browser** | | |
| [<img src="https://github.com/woheller69/browser/blob/newmaster/fastlane/metadata/android/en-US/images/icon.png" width="50">](https://f-droid.org/packages/org.woheller69.browser/) | | |

# Bubble: Spirit level and ruler

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.woheller69.level"
minSdkVersion 16
targetSdkVersion 33
versionCode 26
versionName "2.6"
versionCode 27
versionName "2.7"
vectorDrawables.useSupportLibrary true
}

Expand Down
20 changes: 14 additions & 6 deletions app/src/main/java/org/woheller69/level/painter/LevelPainter.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.woheller69.level.painter;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
Expand Down Expand Up @@ -125,7 +123,10 @@ public class LevelPainter implements Runnable {
private float angle1raw;
private float angle2;
private float angle2raw;
private double n, teta, l;
private static float angle1DispValue = 0;
private static float angle2DispValue = 0;
private static long angleDispUpdateTime = 0L;
private static final long angleDispInterval = 300L;
/**
* Orientation
*/
Expand Down Expand Up @@ -404,6 +405,13 @@ private void updatePhysics() {
private void doDraw(Canvas canvas) {
canvas.save();

// decouple display speed from sensor speed
if ((System.currentTimeMillis() - angleDispUpdateTime) > angleDispInterval) {
angle1DispValue = angle1;
angle2DispValue = angle2;
angleDispUpdateTime = System.currentTimeMillis();
}

canvas.drawColor(backgroundColor);

if (orientation == Orientation.LANDING) {
Expand Down Expand Up @@ -444,7 +452,7 @@ private void doDraw(Canvas canvas) {
displayRect.centerY() + lcdHeight / 2.0f,
lcdBackgroundPaint);
canvas.drawText(
displayFormat.format(angle2),
displayFormat.format(angle2DispValue),
middleX - (displayRect.width() + displayGap - arrowWidth) / 2.0f - displayPadding,
displayRect.centerY() + lcdHeight / 2.0f,
lcdForegroundPaint);
Expand All @@ -467,7 +475,7 @@ private void doDraw(Canvas canvas) {
displayRect.centerY() + lcdHeight / 2.0f,
lcdBackgroundPaint);
canvas.drawText(
displayFormat.format(angle1),
displayFormat.format(angle1DispValue),
middleX + displayGap + (displayRect.width() - arrowWidth) / 2.0f,
displayRect.centerY() + lcdHeight / 2.0f,
lcdForegroundPaint);
Expand Down Expand Up @@ -530,7 +538,7 @@ private void doDraw(Canvas canvas) {
displayRect.centerY() + lcdHeight / 2.0f,
lcdBackgroundPaint);
canvas.drawText(
displayFormat.format(angle1),
displayFormat.format(angle1DispValue),
middleX,
displayRect.centerY() + lcdHeight / 2.0f,
lcdForegroundPaint);
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GUI verbessert
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GUI improvement

0 comments on commit eb2a10f

Please sign in to comment.