Skip to content

Commit

Permalink
fix: Updated colours to match Zeta (#5)
Browse files Browse the repository at this point in the history
chore: Remove unnecessary icons from example app
chore: Add version to example app
feat: Add positive button variant

Authored-by: mikecoomber <[email protected]>
Co-authored-by: thelukewalton <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent 990ec23 commit 91e85d2
Show file tree
Hide file tree
Showing 74 changed files with 374 additions and 852 deletions.
18 changes: 10 additions & 8 deletions app/src/main/java/com/zebra/zdsDemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,21 @@ public void onDrawerOpened(@NonNull View drawerView) {
// Setup Navigation view header and footer
((TextView) navView.getHeaderView(0).findViewById(R.id.title)).setText("Title");
((TextView) navView.getHeaderView(0).findViewById(R.id.subtitle)).setText("Subtitle");
// ((TextView) findViewById(R.id.footer_subtitle)).setText("version " + BuildConfig.VERSION_NAME);

((AppCompatImageView) navView.getHeaderView(0).findViewById(R.id.image)).setImageResource(R.drawable.ic_baseline_emoji_emotions_24);
// x-release-please-start-version
((TextView) findViewById(R.id.footer_subtitle)).setText("ZDS Android v1.0.0");
// x-release-please-end
((AppCompatImageView) navView.getHeaderView(0).findViewById(R.id.image)).setImageResource(R.drawable.ic_happy_round);
((AppCompatImageView) navView.getHeaderView(0).findViewById(R.id.image)).setImageTintList(ColorStateList.valueOf(Color.WHITE));
((ZdsIconButton) navView.getHeaderView(0).findViewById(R.id.action)).setIconTint(ColorStateList.valueOf(Color.WHITE));
((ZdsIconButton) navView.getHeaderView(0).findViewById(R.id.action)).setIconResource(R.drawable.ic_baseline_settings_24);
((ZdsIconButton) navView.getHeaderView(0).findViewById(R.id.action)).setIconResource(R.drawable.ic_settings_round);

setMenuCounter(navView, R.id.buttonsFragment, 24);

// Setup support action bar
ActionBar actionbar = getSupportActionBar();
if (actionbar != null) {
actionbar.setDisplayHomeAsUpEnabled(true);
actionbar.setHomeAsUpIndicator(R.drawable.ic_baseline_menu_24);
actionbar.setHomeAsUpIndicator(R.drawable.ic_hamburger_menu_round);
}

getBanner().setOnClickListener(v -> hideBanner());
Expand Down Expand Up @@ -245,8 +247,8 @@ public ZdsSystemBanner getBanner() {

public void showBanner() {
ZdsSystemBanner.Style style = getBanner().getStyle();
int statusBarColor = R.color.zebra_black_toolbar;
switch(style) {
int statusBarColor = R.color.zebra_toolbar;
switch (style) {
case DEFAULT:
statusBarColor = R.color.zebra_blue_enabled;
break;
Expand All @@ -269,6 +271,6 @@ public void showBanner() {
public void hideBanner() {
((MotionLayout) findViewById(R.id.mainLayout)).transitionToStart();
getBanner().setVisibility(View.GONE);
getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.zebra_black_toolbar));
getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.zebra_toolbar));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void showDialog() {
ZdsDialog.Builder builder = new ZdsDialog.Builder(requireContext());
builder.setTitle("Dialog Title").setContent("Lorem ipsum dolor sit amet, conse ctetur adipiscing elit, sed do eiusm od tempor incididunt ut labore et do lore magna aliqua.");
if (titleImage.isChecked()) {
builder.setIcon(R.drawable.ic_baseline_warning_24);
builder.setIcon(R.drawable.ic_warning_round);
}
if (gravityRadioGroup.getCheckedRadioButtonId() == R.id.gravityLeft) {
builder.setTitleGravity(Gravity.START);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ private void showMenu(View view, DropdownStyle style) {
case COUNTRY:
itemResId = R.layout.dropdown_item_icon;
items.clear();
items.add(new ListPopupItem("Option 1", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 2", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 3", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 4", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 1", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 2", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 3", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 4", R.drawable.ic_flag_round));
break;
case COUNTRY_CONDENSED:
itemResId = R.layout.dropdown_item_icon_condensed;
items.clear();
items.add(new ListPopupItem("Option 1", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 2", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 3", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 4", R.drawable.ic_baseline_flag_24));
items.add(new ListPopupItem("Option 1", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 2", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 3", R.drawable.ic_flag_round));
items.add(new ListPopupItem("Option 4", R.drawable.ic_flag_round));
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public void onBindViewHolder(ZdsListItem.ZdsViewHolder viewHolder, final int pos
viewHolder.getIconRight().setImageTintList(ColorStateList.valueOf(Color.GRAY));

if (imageLeftCheckBox.isChecked()) {
viewHolder.showIconLeft(R.drawable.ic_baseline_star_24);
viewHolder.showIconLeft(R.drawable.ic_star_sharp);
}
else {
viewHolder.hideIconLeft();
}

switch (elementRightRadioGroup.getCheckedRadioButtonId()) {
case R.id.showImageRight:
viewHolder.showIconRight(R.drawable.ic_baseline_star_24);
viewHolder.showIconRight(R.drawable.ic_star_sharp);
break;
case R.id.showMeta:
viewHolder.setMeta("Meta");
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_add_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_delete_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_emoji_emotions_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_flag_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_invert_colors_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_menu_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_more_horiz_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_more_vert_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_sd_card_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_search_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_settings_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_star_24.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_baseline_warning_24.xml

This file was deleted.

66 changes: 16 additions & 50 deletions app/src/main/res/layout/fragment_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Primary"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/materialButtonIconLeft"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -72,7 +72,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Primary.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonIconLeft2"
Expand All @@ -93,7 +93,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Primary"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:iconGravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/materialButtonIconRight"
Expand All @@ -108,7 +108,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Primary.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:iconGravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -163,7 +163,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Variant"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/materialButtonVariantIconLeft"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -177,7 +177,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Variant"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonVariantIconLeft2"
Expand All @@ -192,13 +192,13 @@

<com.zebra.zds.ZdsButton
android:id="@+id/materialButtonVariantIconRight2"
style="@style/Zds.Button.Variant"
style="@style/Zds.Button.Positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Variant"
app:icon="@drawable/ic_baseline_star_24"
android:theme="@style/Zds.Button.Positive"
app:icon="@drawable/ic_star_round"
app:iconGravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/materialButtonVariantIconRight"
Expand All @@ -207,13 +207,13 @@

<com.zebra.zds.ZdsButton
android:id="@+id/materialButtonVariantIconRight"
style="@style/Zds.Button.Variant.Sharp"
style="@style/Zds.Button.Positive.Sharp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Variant"
app:icon="@drawable/ic_baseline_star_24"
android:theme="@style/Zds.Button.Positive"
app:icon="@drawable/ic_star_round"
app:iconGravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -283,7 +283,7 @@
android:enabled="false"
android:text="Button"
android:theme="@style/Zds.Button.Negative"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonDisabled2"
Expand Down Expand Up @@ -317,7 +317,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Outline.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonOutline2"
Expand Down Expand Up @@ -351,7 +351,7 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Outline.Subtle.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonOutlineSubtle2"
Expand Down Expand Up @@ -385,44 +385,10 @@
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Text.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:icon="@drawable/ic_star_round"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonText2"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/textInverseButtonLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.zebra.zds.ZdsButton
android:id="@+id/materialButtonTextInverse2"
style="@style/Zds.Button.Text.Inverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Text.Inverse"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/materialButtonTextInverse"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.zebra.zds.ZdsButton
android:id="@+id/materialButtonTextInverse"
style="@style/Zds.Button.Text.Inverse.Sharp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button"
android:theme="@style/Zds.Button.Text.Inverse.Sharp"
app:icon="@drawable/ic_baseline_star_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/materialButtonTextInverse2"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
Loading

0 comments on commit 91e85d2

Please sign in to comment.