Skip to content

Commit

Permalink
Merge pull request #78 from fcaronte/master
Browse files Browse the repository at this point in the history
Fix Verge status bar position // Always show seconds on unlocked screen as for stock watchface
  • Loading branch information
GreatApo committed Apr 6, 2020
2 parents cf1a032 + 5de5855 commit 8a41a77
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Expand Up @@ -78,7 +78,7 @@ public void onCreate() {
super.onCreate();
}

private void status_bar(boolean isOn, int left, int top){
private void status_bar(boolean isOn, float left, float top){
// Show it or... show it off screen :P
if(isOn) {
notifyStatusBarPosition(
Expand Down
Expand Up @@ -53,8 +53,8 @@ public LoadSettings(Context context){
public boolean no_0_on_hour_first_digit;
public boolean wind_direction_as_arrows;
public boolean status_bar;
public int status_barLeft;
public int status_barTop;
public float status_barLeft;
public float status_barTop;
public boolean low_power;
public float low_powerLeft;
public float low_powerTop;
Expand Down Expand Up @@ -593,8 +593,8 @@ private void defaultParameters(){
this.no_0_on_hour_first_digit = sharedPreferences.getBoolean( "no_0_on_hour_first_digit", context.getResources().getBoolean(R.bool.no_0_on_hour_first_digit));
this.wind_direction_as_arrows = sharedPreferences.getBoolean( "wind_direction_as_arrows", context.getResources().getBoolean(R.bool.wind_direction_as_arrows));
this.status_bar = sharedPreferences.getBoolean( "status_bar", context.getResources().getBoolean(R.bool.status_bar));
this.status_barLeft = (int) scale*sharedPreferences.getInt( "status_barLeft", context.getResources().getInteger(R.integer.status_left));
this.status_barTop = (int) scale*sharedPreferences.getInt( "status_barTop", context.getResources().getInteger(R.integer.status_top));
this.status_barLeft = scale*sharedPreferences.getInt( "status_barLeft", context.getResources().getInteger(R.integer.status_left));
this.status_barTop = scale*sharedPreferences.getInt( "status_barTop", context.getResources().getInteger(R.integer.status_top));
this.low_power = sharedPreferences.getBoolean( "low_power", context.getResources().getBoolean(R.bool.low_power));
this.low_powerLeft = scale*sharedPreferences.getInt( "low_powerLeft", context.getResources().getInteger(R.integer.low_power_left));
this.low_powerTop = scale*sharedPreferences.getInt( "low_powerTop", context.getResources().getInteger(R.integer.low_power_top));
Expand Down Expand Up @@ -694,7 +694,7 @@ private void defaultParameters(){
}
// Seconds
this.secondsBool = sharedPreferences.getBoolean("secondsBool", res.getIdentifier("seconds", "array", context.getPackageName())!=0) && Util.needSlptRefreshSecond(context);
if(this.secondsBool) {
//if(this.secondsBool) { (Always draw seconds with unlocked screen as for stock watchface)
TypedArray seconds = res.obtainTypedArray(res.getIdentifier("seconds", "array", context.getPackageName()));
i = 0;
this.secondsFontSize = scale*sharedPreferences.getFloat("secondsFontSize", seconds.getDimension(i++, 0));
Expand All @@ -709,7 +709,7 @@ private void defaultParameters(){
if(this.white_bg) this.secondsColor = inverted_text_color;
this.secondsAlignLeft = sharedPreferences.getBoolean("secondsAlignLeft", seconds.getBoolean(i, false));
seconds.recycle();
}
//}
// am_pm
/*
String time_format = Settings.System.getString(context.getContentResolver(), "time_12_24");
Expand Down
Expand Up @@ -278,9 +278,9 @@ public void onDrawDigital(Canvas canvas, float width, float height, float center
canvas.drawText(Util.formatTime(minutes), settings.minutesLeft, settings.minutesTop, this.minutesFont);

// Draw Seconds
if (settings.secondsBool) {
//if (settings.secondsBool) { (Always draw seconds with unlocked screen as for stock watchface)
canvas.drawText(Util.formatTime(seconds), settings.secondsLeft, settings.secondsTop, this.secondsFont);
}
//}

// : indicator Draw + Flashing
if (settings.indicatorBool) {
Expand Down Expand Up @@ -312,12 +312,12 @@ public void onDrawDigital(Canvas canvas, float width, float height, float center
canvas.rotate((float) (minutes * 6), 160.0f + (settings.isVerge()?20f:0f), 159.0f + (settings.isVerge()?20f:0f));
canvas.drawBitmap(this.minuteHand, centerX - this.minuteHand.getWidth() / 2f, centerY - this.minuteHand.getHeight() / 2f, null);
canvas.restore();
if (settings.secondsBool) {
//if (settings.secondsBool) { (Always draw seconds with unlocked screen as for stock watchface)
canvas.save();
canvas.rotate((float) (seconds * 6), 160.0f + (settings.isVerge() ? 20f : 0f), 159.0f + (settings.isVerge() ? 20f : 0f));
canvas.drawBitmap(this.secondsHand, centerX - this.secondsHand.getWidth() / 2f, centerY - this.secondsHand.getHeight() / 2f, null);
canvas.restore();
}
//}
}

// JAVA calendar get/show time library
Expand Down

0 comments on commit 8a41a77

Please sign in to comment.