Skip to content

Commit 1b5edeb

Browse files
committed
WIP: updated colors and themes according to Zebra new brand
1 parent 48165b4 commit 1b5edeb

27 files changed

+155
-131
lines changed

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/EntryChoiceActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
432432

433433
} else {
434434
// For Android 14 and below
435-
window.setStatusBarColor(getColor(R.color.zebra));
435+
window.setStatusBarColor(androidx.appcompat.R.attr.colorPrimary);
436436
}
437437
}
438438

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/SplashActivity.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,15 @@
77
import android.os.Bundle;
88
import android.os.Handler;
99
import android.os.Looper;
10-
import android.util.Log;
1110
import android.view.View;
1211
import android.view.Window;
1312
import android.view.WindowManager;
1413
import android.widget.TextView;
1514

16-
import androidx.activity.EdgeToEdge;
1715
import androidx.appcompat.app.AppCompatActivity;
1816
import androidx.core.content.ContextCompat;
19-
import androidx.core.graphics.Insets;
20-
import androidx.core.view.ViewCompat;
21-
import androidx.core.view.WindowInsetsCompat;
2217

23-
import com.zebra.ai_multibarcodes_capture.helpers.Constants;
2418
import com.zebra.ai_multibarcodes_capture.helpers.LocaleHelper;
25-
import com.zebra.ai_multibarcodes_capture.helpers.LogUtils;
2619

2720
import static com.zebra.ai_multibarcodes_capture.helpers.Constants.*;
2821

@@ -106,7 +99,7 @@ private void configureSystemBars() {
10699
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
107100

108101
// Set status bar color to zebra blue
109-
window.setStatusBarColor(ContextCompat.getColor(this, R.color.zebra));
102+
window.setStatusBarColor(ContextCompat.getColor(this, R.color.zebra_pantone_285));
110103

111104
// Set navigation bar color to black for consistent theming
112105
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/dataeditor/BarcodeDataEditorActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) {
7676
private void configureSystemBars() {
7777
Window window = getWindow();
7878
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
79-
window.setStatusBarColor(ContextCompat.getColor(this, R.color.zebra));
79+
window.setStatusBarColor(ContextCompat.getColor(this, R.color.zebra_pantone_285));
8080
window.setNavigationBarColor(ContextCompat.getColor(this, android.R.color.black));
8181
}
8282

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/java/CapturedBarcodesActivity.java

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,28 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
412412
holder.quantityTextView.setText(context.getString(R.string.quantity_label, barcode.quantity));
413413
holder.dateTextView.setText(context.getString(R.string.date_label, barcodeDateString));
414414

415+
// Get current theme
416+
SharedPreferences sharedPreferences = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE);
417+
String theme = sharedPreferences.getString(SHARED_PREFERENCES_THEME, SHARED_PREFERENCES_THEME_DEFAULT);
418+
boolean isModernTheme = "modern".equals(theme);
419+
415420
if(barcode.loaded == false)
416421
{
417-
holder.foregroundContainer.setBackgroundColor(context.getColor(R.color.pastelbluelight));
422+
// New barcode: dark green for modern theme, light blue for legacy theme
423+
if (isModernTheme) {
424+
holder.foregroundContainer.setBackgroundColor(context.getColor(R.color.zebra_pantone_5747));
425+
} else {
426+
holder.foregroundContainer.setBackgroundColor(context.getColor(R.color.zebra_pantone_285));
427+
}
418428
}
419429
else
420430
{
421-
holder.foregroundContainer.setBackgroundColor(Color.WHITE);
431+
// Existing barcode: black for modern theme, white for legacy theme
432+
if (isModernTheme) {
433+
holder.foregroundContainer.setBackgroundColor(context.getColor(R.color.zebra_black));
434+
} else {
435+
holder.foregroundContainer.setBackgroundColor(Color.WHITE);
436+
}
422437
}
423438
}
424439

@@ -1055,7 +1070,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
10551070
));
10561071

10571072
// Set the status bar color using ContextCompat
1058-
statusBarView.setBackgroundColor(getColor(R.color.zebra));
1073+
statusBarView.setBackgroundColor(androidx.appcompat.R.attr.colorPrimary);
10591074

10601075
// Add the view to the activity's content view group
10611076
addContentView(statusBarView, statusBarView.getLayoutParams());
@@ -1065,8 +1080,10 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
10651080
});
10661081

10671082
} else {
1068-
// For Android 14 and below
1069-
window.setStatusBarColor(getColor(R.color.zebra));
1083+
// For Android 14 and below - use theme primary color
1084+
android.util.TypedValue typedValue = new android.util.TypedValue();
1085+
getTheme().resolveAttribute(androidx.appcompat.R.attr.colorPrimary, typedValue, true);
1086+
window.setStatusBarColor(typedValue.data);
10701087
}
10711088
}
10721089

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/sessionmanagement/SessionViewerActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
546546
));
547547

548548
// Set the status bar color using ContextCompat
549-
statusBarView.setBackgroundColor(getColor(R.color.zebra));
549+
statusBarView.setBackgroundColor(androidx.appcompat.R.attr.colorPrimary);
550550

551551
// Add the view to the activity's content view group
552552
addContentView(statusBarView, statusBarView.getLayoutParams());
@@ -557,7 +557,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
557557

558558
} else {
559559
// For Android 14 and below
560-
window.setStatusBarColor(getColor(R.color.zebra));
560+
window.setStatusBarColor(androidx.appcompat.R.attr.colorPrimary);
561561
}
562562
}
563563

AI_MultiBarcodes_Capture/src/main/java/com/zebra/ai_multibarcodes_capture/settings/SettingsActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
11511151
));
11521152

11531153
// Set the status bar color using ContextCompat
1154-
statusBarView.setBackgroundColor(getColor(R.color.zebra));
1154+
statusBarView.setBackgroundColor(androidx.appcompat.R.attr.colorPrimary);
11551155

11561156
// Add the view to the activity's content view group
11571157
addContentView(statusBarView, statusBarView.getLayoutParams());
@@ -1162,7 +1162,7 @@ public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
11621162

11631163
} else {
11641164
// For Android 14 and below
1165-
window.setStatusBarColor(getColor(R.color.zebra));
1165+
window.setStatusBarColor(getColor(R.color.zebra_pantone_285));
11661166
}
11671167
}
11681168

AI_MultiBarcodes_Capture/src/main/res/drawable/badge_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<corners android:radius="12dp" />
66
<stroke
77
android:width="1dp"
8-
android:color="@color/zebra" />
8+
android:color="@color/zebra_pantone_285" />
99
</shape>

AI_MultiBarcodes_Capture/src/main/res/drawable/ic_delete_blue_24dp.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
android:height="24dp"
55
android:viewportWidth="24"
66
android:viewportHeight="24"
7-
android:tint="@color/zebra">
7+
android:tint="@color/zebra_pantone_285">
88

99
<path
10-
android:fillColor="@color/zebra"
10+
android:fillColor="@color/zebra_pantone_285"
1111
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
1212
</vector>

AI_MultiBarcodes_Capture/src/main/res/drawable/ic_flag_generic.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:height="16dp"
55
android:viewportWidth="24"
66
android:viewportHeight="16"
7-
android:tint="@color/zebra">
7+
android:tint="@color/zebra_pantone_285">
88
<path
99
android:fillColor="@android:color/white"
1010
android:pathData="M14.4,6L14,4H5v17h2v-7h5.6l0.4,2h7V6z"/>

AI_MultiBarcodes_Capture/src/main/res/drawable/ic_globe.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:height="24dp"
55
android:viewportWidth="24"
66
android:viewportHeight="24"
7-
android:tint="@color/zebra">
7+
android:tint="@color/zebra_pantone_285">
88
<path
99
android:fillColor="@android:color/white"
1010
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM11,19.93c-3.95,-0.49 -7,-3.85 -7,-7.93 0,-0.62 0.08,-1.21 0.21,-1.79L9,15v1c0,1.1 0.9,2 2,2v1.93zM17.9,17.39c-0.26,-0.81 -1,-1.39 -1.9,-1.39h-1v-3c0,-0.55 -0.45,-1 -1,-1H8v-2h2c0.55,0 1,-0.45 1,-1V7h2c1.1,0 2,-0.9 2,-2v-0.41c2.93,1.19 5,4.06 5,7.41 0,2.08 -0.8,3.97 -2.1,5.39z"/>

0 commit comments

Comments
 (0)