From df41609135f0b7a574b00bfcf632d01016c42031 Mon Sep 17 00:00:00 2001 From: istiakshihab Date: Tue, 19 Oct 2021 23:49:14 +0600 Subject: [PATCH 1/3] Added New Icon Tint Feature --- .../java/com/pd/snickers/MainActivity.java | 10 +++++ app/src/main/res/layout/content_example.xml | 24 +++++++++- app/src/main/res/values/strings.xml | 1 + .../main/java/com/pd/chocobar/ChocoBar.java | 45 ++++++++++++------- documentation/documentation-java.md | 12 +++++ 5 files changed, 75 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/pd/snickers/MainActivity.java b/app/src/main/java/com/pd/snickers/MainActivity.java index 7449ee1..9e6de89 100644 --- a/app/src/main/java/com/pd/snickers/MainActivity.java +++ b/app/src/main/java/com/pd/snickers/MainActivity.java @@ -96,6 +96,7 @@ protected void onCreate(Bundle savedInstanceState) { .setIcon(R.mipmap.ic_launcher) .setActivity(MainActivity.this) .setDuration(ChocoBar.LENGTH_INDEFINITE) + .setIconTint(Color.WHITE) .build() .show()); @@ -127,6 +128,15 @@ protected void onCreate(Bundle savedInstanceState) { .infoGray() .show()); + findViewById(R.id.button_custom_tint).setOnClickListener(v-> ChocoBar.builder() + .setView(v) + .centerText() + .setDuration(ChocoBar.LENGTH_LONG) + .setIconTint(Color.CYAN) + .setText("Custom Cyan Tinted Icon") + .infoGray() + .show()); + findViewById(R.id.button_next).setOnClickListener(v -> { Intent secondaryActivityIntent = new Intent(this, SecondaryActivity.class); startActivity(secondaryActivityIntent); diff --git a/app/src/main/res/layout/content_example.xml b/app/src/main/res/layout/content_example.xml index 2c2758f..3773faf 100644 --- a/app/src/main/res/layout/content_example.xml +++ b/app/src/main/res/layout/content_example.xml @@ -271,18 +271,38 @@ android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:text="@string/info_gray" - app:layout_constraintBottom_toTopOf="@+id/button_next" + app:layout_constraintBottom_toTopOf="@+id/custom_tint" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/button_blocked" /> +