Skip to content

Commit fa501a4

Browse files
author
Julian Kast
committed
Fixed Formatting
1 parent 01020db commit fa501a4

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void initializeActivity(Intent intent){
168168
String warningMsg = intent.getStringExtra(KEY_LOCKSCREEN_WARNING_MSG);
169169
if (mIsDismissible) {
170170
setLockscreenWarningMessage(warningMsg);
171-
} else if(!useWhiteIconAndTextColor){
171+
} else if (!useWhiteIconAndTextColor) {
172172
setTextColorBlack();
173173
}
174174
}
@@ -182,7 +182,7 @@ private void setSdlLogo() {
182182
ImageView lockScreen_iv = findViewById(R.id.lockscreen_image);
183183
Drawable sdlIcon = getResources().getDrawable(R.drawable.sdl_logo_black);
184184
// Checks color contrast and determines if the logo should be black or white
185-
if(useWhiteIconAndTextColor){
185+
if (useWhiteIconAndTextColor) {
186186
int color = Color.parseColor("#ffffff");
187187

188188
int red = (color & 0xFF0000) / 0xFFFF;
@@ -203,7 +203,7 @@ private void setSdlLogo() {
203203
/**
204204
* Changes the text color to white on the lockScreen
205205
*/
206-
private void setTextColorBlack(){
206+
private void setTextColorBlack() {
207207
TextView tv = findViewById(R.id.lockscreen_text);
208208
tv.setTextColor(Color.parseColor("#000000"));
209209
}
@@ -213,17 +213,17 @@ private void setTextColorBlack(){
213213
* should be white or black
214214
* @return True if Background and Icon should be white, False if black
215215
*/
216-
private boolean shouldUseWhiteForegroundForBackgroundColor(){
216+
private boolean shouldUseWhiteForegroundForBackgroundColor() {
217217
float r = Color.red(backgroundColor) / 255f;
218218
float b = Color.blue(backgroundColor) / 255f;
219219
float g = Color.green(backgroundColor) / 255f;
220220

221221
// http://stackoverflow.com/a/3943023
222-
r = (r<= 0.3928f) ? (r /12.92f) : (float)Math.pow(((r + 0.055f) / 1.055f), 2.4f);
223-
g = (g<= 0.3928f) ? (g /12.92f) : (float)Math.pow(((g + 0.055f) / 1.055f), 2.4f);
224-
b = (b<= 0.3928f) ? (b /12.92f) : (float)Math.pow(((b + 0.055f) / 1.055f), 2.4f);
222+
r = (r <= 0.3928f) ? (r / 12.92f) : (float) Math.pow(((r + 0.055f) / 1.055f), 2.4f);
223+
g = (g <= 0.3928f) ? (g / 12.92f) : (float) Math.pow(((g + 0.055f) / 1.055f), 2.4f);
224+
b = (b <= 0.3928f) ? (b / 12.92f) : (float) Math.pow(((b + 0.055f) / 1.055f), 2.4f);
225225

226-
float luminescence = 0.2126f * r +0.7152f * g + 0.0722f * b;
226+
float luminescence = 0.2126f * r + 0.7152f * g + 0.0722f * b;
227227
return luminescence <= 0.179;
228228
}
229229

@@ -259,7 +259,7 @@ private void setDeviceLogo(Bitmap deviceLogo) {
259259
private void setLockscreenWarningMessage(String msg) {
260260
TextView tv = findViewById(R.id.lockscreen_text);
261261
if (tv != null) {
262-
if(!useWhiteIconAndTextColor){
262+
if (!useWhiteIconAndTextColor) {
263263
tv.setTextColor(Color.parseColor("#000000"));
264264
}
265265
tv.setText(msg != null ? msg : getString(R.string.default_lockscreen_warning_message));

0 commit comments

Comments
 (0)