-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
362 additions
and
66 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
android/app/src/main/java/github/tornaco/android/thanos/main/NavDataBindingAdapters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package github.tornaco.android.thanos.main; | ||
|
||
import android.graphics.drawable.Drawable; | ||
import android.graphics.drawable.LayerDrawable; | ||
import android.widget.ImageView; | ||
|
||
import androidx.appcompat.content.res.AppCompatResources; | ||
import androidx.core.content.ContextCompat; | ||
import androidx.databinding.BindingAdapter; | ||
|
||
import java.util.Objects; | ||
|
||
import github.tornaco.android.thanos.R; | ||
import github.tornaco.android.thanos.dashboard.Tile; | ||
|
||
public class NavDataBindingAdapters { | ||
|
||
@BindingAdapter("android:navTile") | ||
public static void setCircleBgTint(ImageView imageView, Tile tile) { | ||
try { | ||
LayerDrawable layerDrawable = (LayerDrawable) AppCompatResources.getDrawable(imageView.getContext(), tile.getIconRes()); | ||
Drawable findDrawableByLayerId = Objects.requireNonNull(layerDrawable).findDrawableByLayerId(R.id.settings_ic_foreground); | ||
if (findDrawableByLayerId != null) { | ||
findDrawableByLayerId.setTint(ContextCompat.getColor(imageView.getContext(), tile.getThemeColor())); | ||
layerDrawable.setDrawableByLayerId(R.id.settings_ic_foreground, findDrawableByLayerId); | ||
} | ||
imageView.setImageDrawable(layerDrawable); | ||
} catch (Throwable ignored) { | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
android/app/src/main/res/drawable/ic_nav_activity_replacement.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3dbcaaa4" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_guide_fill" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3def9a9a" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_baseline_work_outline_24" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3d90ce02" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_phone_lock_line" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3dffb320" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_apps_2_line" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3dffb320" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_refresh_line" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3df18072" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_forbid_line" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3dc8e6c9" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_rocket_line" | ||
android:gravity="center" /> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="oval"> | ||
<size | ||
android:width="40dp" | ||
android:height="40dp" /> | ||
<solid android:color="#3dba68c8" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:id="@+id/settings_ic_foreground" | ||
android:drawable="@drawable/ic_chat_1_line" | ||
android:gravity="center" /> | ||
</layer-list> |
Oops, something went wrong.