Skip to content

Commit

Permalink
Merge pull request #167 from OSHeden/patch-1
Browse files Browse the repository at this point in the history
Ko-fi as social media icon
  • Loading branch information
sarsamurmu authored Apr 10, 2024
2 parents b435e7a + dcb667f commit 7e48748
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/src/main/java/candybar/lib/helpers/UrlHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static Drawable getSocialIcon(@NonNull Context context, @NonNull Type typ
return getTintedDrawable(context, R.drawable.ic_toolbar_googleplay, color);
case INSTAGRAM:
return getTintedDrawable(context, R.drawable.ic_toolbar_instagram, color);
case KOFI:
return getTintedDrawable(context, R.drawable.ic_toolbar_kofi, color);
case MASTODON:
return getTintedDrawable(context, R.drawable.ic_toolbar_mastodon, color);
case MATRIX:
Expand Down Expand Up @@ -103,6 +105,8 @@ public static Type getType(String url) {
return Type.GOOGLEPLAY;
} else if (url.contains("instagram.")) {
return Type.INSTAGRAM;
} else if (url.contains("ko-fi.")) {
return Type.KOFI;
} else if (url.contains("mastodon.")|| url.contains("mstdn.")|| url.contains("mas.")|| url.contains("todon.")|| url.contains("fosstodon.")|| url.contains("troet.")|| url.contains("chaos.")|| url.contains("floss.")) {
return Type.MASTODON;
} else if (url.contains("matrix.")) {
Expand Down Expand Up @@ -133,6 +137,7 @@ public enum Type {
GITLAB,
GOOGLEPLAY,
INSTAGRAM,
KOFI,
MASTODON,
MATRIX,
PINTEREST,
Expand Down
9 changes: 9 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_kofi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3.071,19.594C3.042,19.59 2.958,19.578 2.882,19.568 2.554,19.524 2.072,19.367 1.796,19.215 1.31,18.947 0.913,18.532 0.695,18.063 0.551,17.752 0.466,17.433 0.429,17.063 0.389,16.667 0.369,14.311 0.369,9.981L0.369,5.568 0.406,5.431C0.533,4.973 0.836,4.628 1.233,4.489l0.144,-0.05 8.305,-0.005c5.921,-0.004 8.376,0 8.553,0.014 1.263,0.096 2.405,0.548 3.404,1.347 1.26,1.007 2.004,2.696 2.004,4.547 0,0.248 -0.01,0.485 -0.028,0.641 -0.269,2.42 -1.984,4.279 -4.515,4.893 -0.481,0.117 -0.956,0.183 -1.455,0.202l-0.291,0.011 -0.013,0.171c-0.018,0.245 -0.09,0.658 -0.158,0.903 -0.224,0.819 -0.679,1.472 -1.312,1.883 -0.367,0.239 -0.876,0.439 -1.246,0.49 -0.074,0.01 -0.844,0.024 -1.822,0.034 -1.824,0.017 -9.649,0.037 -9.734,0.025zM10.989,18.697c1.713,-0.01 3.227,-0.024 3.363,-0.033 0.213,-0.013 0.274,-0.024 0.43,-0.075 0.685,-0.226 1.142,-0.64 1.416,-1.283 0.171,-0.402 0.257,-0.859 0.284,-1.516 0.015,-0.351 0.053,-0.441 0.23,-0.537l0.089,-0.049 0.482,-0.005c0.661,-0.006 1.087,-0.056 1.631,-0.189 0.709,-0.173 1.331,-0.454 1.896,-0.852 0.226,-0.159 0.355,-0.269 0.579,-0.488 1.089,-1.067 1.556,-2.55 1.311,-4.165C22.531,8.396 22.086,7.461 21.402,6.777 21.026,6.4 20.451,6.007 19.935,5.774 19.433,5.547 18.849,5.393 18.279,5.338 18.151,5.326 15.514,5.32 9.814,5.32c-7.691,0 -8.282,0.002 -8.338,0.029 -0.078,0.037 -0.167,0.161 -0.201,0.281 -0.051,0.183 -0.03,9.625 0.025,11.049 0.017,0.443 0.038,0.585 0.127,0.837 0.196,0.561 0.661,0.955 1.325,1.124 0.088,0.022 0.207,0.047 0.265,0.056 0.15,0.022 4.31,0.022 7.972,0.002zM8.775,16.171C8.742,16.148 8.563,15.994 8.44,15.883 7.086,14.652 6.569,14.166 5.867,13.463 5.283,12.879 5.02,12.586 4.855,12.334 4.573,11.903 4.378,11.386 4.301,10.859 4.263,10.603 4.275,10.136 4.325,9.922 4.476,9.276 4.829,8.831 5.431,8.531 5.633,8.431 5.875,8.355 6.131,8.311c0.271,-0.046 0.746,-0.037 1.009,0.019 0.596,0.128 1.121,0.409 1.578,0.844 0.086,0.082 0.165,0.149 0.176,0.149 0.011,0 0.091,-0.064 0.177,-0.142 0.669,-0.602 1.398,-0.921 2.109,-0.921 0.836,-0 1.663,0.465 2.047,1.152 0.213,0.381 0.312,0.861 0.271,1.31 -0.038,0.411 -0.135,0.738 -0.338,1.133 -0.141,0.274 -0.27,0.453 -0.573,0.794 -0.273,0.307 -1.713,1.756 -2.256,2.27 -0.668,0.632 -1.27,1.188 -1.339,1.234 -0.079,0.054 -0.157,0.06 -0.219,0.018zM16.969,13.344c-0.196,-0.021 -0.316,-0.098 -0.387,-0.249l-0.04,-0.086 -0,-2.765 -0,-2.765 0.048,-0.092c0.052,-0.1 0.162,-0.188 0.274,-0.22 0.082,-0.023 1.296,-0.023 1.5,-0 0.68,0.076 1.219,0.334 1.694,0.811 0.263,0.264 0.404,0.457 0.539,0.737 0.241,0.499 0.333,1.017 0.292,1.649 -0.074,1.141 -0.487,1.941 -1.275,2.468 -0.281,0.188 -0.786,0.417 -1.011,0.458 -0.271,0.049 -1.343,0.085 -1.634,0.054zM18.299,12.436c0.175,-0.019 0.411,-0.102 0.628,-0.222 0.698,-0.386 1.033,-0.989 1.081,-1.948C20.043,9.556 19.864,9.039 19.433,8.604 19.181,8.35 18.903,8.191 18.544,8.095 18.392,8.055 18.348,8.051 17.897,8.044l-0.483,-0.008v2.22,2.22l0.364,-0.011c0.2,-0.006 0.435,-0.019 0.522,-0.028z"
android:fillColor="#000000"/>
</vector>

0 comments on commit 7e48748

Please sign in to comment.