Skip to content

Commit

Permalink
update V2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
woheller69 committed Aug 19, 2023
1 parent 1cd5a11 commit 438c9b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
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 24
versionName "2.4"
versionCode 25
versionName "2.5"
vectorDrawables.useSupportLibrary true
}

Expand Down
17 changes: 4 additions & 13 deletions app/src/main/java/org/woheller69/level/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
} else {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
int progress = sp.getInt("pref_rulercal",100);
int coarseprogress = sp.getInt("pref_rulercoarsecal",4000);
int coarseprogress = sp.getInt("pref_rulercoarsecal",2000);
RelativeLayout rulerLayout = (RelativeLayout) findViewById(R.id.main_layout);
if (rulerCalView == null){
Toast.makeText(this,getString(R.string.calibrate)+" \u25b2\u25bc", Toast.LENGTH_LONG).show();
Expand All @@ -157,10 +157,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
layoutParams.setMargins(rulerLayout.getWidth()*3/8,0,0,0);
rulerCalView.setLayoutParams(layoutParams);
rulerCoarseCalView = new VerticalSeekBar(this);
rulerCoarseCalView.setMax(8000);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
rulerCoarseCalView.setMin(2000);
}
rulerCoarseCalView.setMax(6000);
rulerCoarseCalView.setProgress(coarseprogress);
rulerCoarseCalView.setThumb(ContextCompat.getDrawable(context, R.drawable.ic_coarse));
rulerCoarseCalView.getThumb().setColorFilter(getThemeColor(context,R.attr.colorAccent), PorterDuff.Mode.MULTIPLY);
Expand Down Expand Up @@ -225,7 +222,7 @@ private void showRuler(boolean ruler) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
RelativeLayout rulerLayout = (RelativeLayout) findViewById(R.id.main_layout);
int progress = sp.getInt("pref_rulercal",100);
int coarseProgress = sp.getInt("pref_rulercoarsecal",4000);
int coarseProgress = sp.getInt("pref_rulercoarsecal",2000);
float dpmm = getDpmmCal(progress,coarseProgress);

rulerView = new RulerView(this, dpmm, dpmm*25.4/32);
Expand Down Expand Up @@ -311,7 +308,7 @@ public void onCalibrationSaved(boolean success) {

public float getDpmmCal(int progress, int coarseProgress){
float dpmm = (float) (getResources().getDisplayMetrics().ydpi/25.4);
return dpmm*(1+(progress+coarseProgress-100f-4000f)/5000f);
return dpmm*(1+(progress+coarseProgress-100f-2000f)/5000f);
}

public static int getThemeColor(Context context, int colorResId) {
Expand All @@ -330,12 +327,6 @@ private void setFullscreenMode() {
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
} else {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE|
View.SYSTEM_UI_FLAG_FULLSCREEN|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}
}
}
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Verbesserte Kalibrierung für Lineal
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved calibration for ruler

0 comments on commit 438c9b8

Please sign in to comment.