Skip to content

Commit

Permalink
5 more sites
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnnno committed Nov 7, 2023
1 parent f7ff059 commit 025e8af
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
27 changes: 26 additions & 1 deletion library/src/main/java/candybar/lib/helpers/UrlHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,22 @@ public static Drawable getSocialIcon(@NonNull Context context, @NonNull Type typ
return getTintedDrawable(context, R.drawable.ic_toolbar_bluesky, color);
case DRIBBBLE:
return getTintedDrawable(context, R.drawable.ic_toolbar_dribbble, color);
case DISCORD:
return getTintedDrawable(context, R.drawable.ic_toolbar_discord, color);
case FACEBOOK:
return getTintedDrawable(context, R.drawable.ic_toolbar_facebook, color);
case GITHUB:
return getTintedDrawable(context, R.drawable.ic_toolbar_github, color);
case GITLAB:
return getTintedDrawable(context, R.drawable.ic_toolbar_gitlab, color);
case GOOGLEPLAY:
return getTintedDrawable(context, R.drawable.ic_toolbar_googleplay, color);
case INSTAGRAM:
return getTintedDrawable(context, R.drawable.ic_toolbar_instagram, color);
case MASTODON:
return getTintedDrawable(context, R.drawable.ic_toolbar_mastodon, color);
case MATRIX:
return getTintedDrawable(context, R.drawable.ic_toolbar_matrix, color);
case PINTEREST:
return getTintedDrawable(context, R.drawable.ic_toolbar_pinterest, color);
case THREADS:
Expand All @@ -61,6 +69,8 @@ public static Drawable getSocialIcon(@NonNull Context context, @NonNull Type typ
return getTintedDrawable(context, R.drawable.ic_toolbar_x, color);
case TELEGRAM:
return getTintedDrawable(context, R.drawable.ic_toolbar_telegram, color);
case TIKTOK:
return getTintedDrawable(context, R.drawable.ic_toolbar_tiktok, color);
default:
return getTintedDrawable(context, R.drawable.ic_toolbar_website, color);
}
Expand All @@ -81,14 +91,22 @@ public static Type getType(String url) {
return Type.BLUESKY;
} else if (url.contains("dribbble.")) {
return Type.DRIBBBLE;
} else if (url.contains("discord.")) {
return Type.DISCORD;
} else if (url.contains("facebook.")) {
return Type.FACEBOOK;
} else if (url.contains("github.")) {
return Type.GITHUB;
} else if (url.contains("gitlab.")) {
return Type.GITLAB;
} else if (url.contains("play.google.")) {
return Type.GOOGLEPLAY;
} else if (url.contains("instagram.")) {
return Type.INSTAGRAM;
} else if (url.contains("mastodon.")|| url.contains("mstdn.")|| url.contains("mas.")|| url.contains("fosstodon.")|| url.contains("troet.")|| url.contains("chaos.")|| url.contains("floss.")) {
} 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.")) {
return Type.MATRIX;
} else if (url.contains("pinterest.")) {
return Type.PINTEREST;
} else if (url.contains("twitter.")|| url.contains("x.")) {
Expand All @@ -97,6 +115,8 @@ public static Type getType(String url) {
return Type.THREADS;
} else if (url.contains("t.me/") || url.contains("telegram.me/")) {
return Type.TELEGRAM;
} else if (url.contains("tiktok.")) {
return Type.TIKTOK;
} else {
return Type.UNKNOWN;
}
Expand All @@ -107,14 +127,19 @@ public enum Type {
BEHANCE,
BLUESKY,
DRIBBBLE,
DISCORD,
FACEBOOK,
GITHUB,
GITLAB,
GOOGLEPLAY,
INSTAGRAM,
MASTODON,
MATRIX,
PINTEREST,
THREADS,
TWITTER,
TELEGRAM,
TIKTOK,
UNKNOWN,
INVALID
}
Expand Down
10 changes: 10 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_discord.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="m18.9556,5.6932c-1.3038,-0.5963 -2.6885,-1.0309 -4.1338,-1.2735 -0.1819,0.3133 -0.3841,0.7378 -0.5256,1.0714 -1.5373,-0.2224 -3.0634,-0.2224 -4.5795,0 -0.1415,-0.3335 -0.3538,-0.758 -0.5256,-1.0714 -1.4554,0.2426 -2.8401,0.6772 -4.1348,1.2735 -2.6177,3.8609 -3.3252,7.6308 -2.9715,11.3502 1.7384,1.2634 3.4162,2.0316 5.0647,2.5369 0.4043,-0.5458 0.7681,-1.132 1.0815,-1.7485 -0.5963,-0.2224 -1.1623,-0.4953 -1.7081,-0.8187 0.1415,-0.101 0.283,-0.2122 0.4144,-0.3234 3.2949,1.506 6.8637,1.506 10.1182,0 0.1415,0.1112 0.2729,0.2224 0.4144,0.3234 -0.5458,0.3234 -1.1118,0.5963 -1.7081,0.8187 0.3133,0.6165 0.6772,1.2027 1.0814,1.7485 1.6475,-0.5054 3.3354,-1.2736 5.0647,-2.5369 0.4346,-4.3056 -0.6883,-8.0452 -2.9523,-11.3502ZM8.6858,14.7491c-0.9905,0 -1.7991,-0.8995 -1.7991,-2.0012s0.7884,-2.0012 1.7991,-2.0012c1.0006,0 1.8192,0.8996 1.799,2.0012 0,1.1017 -0.7984,2.0012 -1.799,2.0012ZM15.3272,14.7491c-0.9905,0 -1.8001,-0.8995 -1.8001,-2.0012s0.7894,-2.0012 1.8001,-2.0012c1.0006,0 1.8192,0.8996 1.799,2.0012 0,1.1017 -0.7883,2.0012 -1.799,2.0012Z"
android:strokeWidth="0"/>
</vector>
10 changes: 10 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_gitlab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="m21.9625,13.3224l-1.1183,-3.4458 -2.22,-6.8242c-0.1125,-0.3525 -0.6083,-0.3525 -0.7225,0l-2.22,6.8225h-7.3633l-2.2192,-6.8225c-0.1133,-0.3525 -0.6117,-0.3525 -0.7242,-0.0025l-2.22,6.8242 -1.1183,3.4483c-0.1008,0.3125 0.0117,0.6575 0.2758,0.8525l9.6875,7.0367 9.6875,-7.0358c0.265,-0.1958 0.3775,-0.5392 0.275,-0.8533"
android:strokeWidth="0"/>
</vector>
22 changes: 22 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_googleplay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="m15.22,16.6376l-8.8751,5.0501c-0.1625,0.1 -0.3375,0.175 -0.5187,0.225 -0.9875,0.2813 -2.0125,-0.1375 -2.5313,-0.9625l8.1563,-8.0501 3.7688,3.7375Z"
android:strokeWidth="0"/>
<path
android:fillColor="#FF000000"
android:pathData="m19.87,13.9876l-3.5188,2.0125 -4.0125,-3.975 4.0313,-3.9813 3.5125,2.0125h-0.0125c0.4,0.2125 0.7312,0.5375 0.9375,0.9375 0.5688,1.0875 0.15,2.4313 -0.9375,2.9938Z"
android:strokeWidth="0"/>
<path
android:fillColor="#FF000000"
android:pathData="M10.5574,12.0188l-7.6188,7.5189l0,-15.069l7.6188,7.5501z"
android:strokeWidth="0"/>
<path
android:fillColor="#FF000000"
android:pathData="m15.245,7.4l-3.7938,3.7438L3.2886,3.0563c0.4062,-0.6438 1.125,-1.0563 1.9188,-1.0563 0.4125,0.0062 0.8188,0.1125 1.1688,0.3187l8.8688,5.0813Z"
android:strokeWidth="0"/>
</vector>
18 changes: 18 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_matrix.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="m3.5269,3.4577v17.0846h1.3731v1.4577h-2.9V2h2.9v1.4577h-1.3731Z"
android:strokeWidth="0"/>
<path
android:fillColor="#FF000000"
android:pathData="m8.3962,8.5077v0.9654h0.0269c0.2577,-0.3692 0.5692,-0.6538 0.9308,-0.8538 0.3615,-0.2038 0.7808,-0.3038 1.25,-0.3038 0.45,0 0.8615,0.0885 1.2346,0.2615 0.3731,0.1731 0.6538,0.4846 0.85,0.9231 0.2115,-0.3115 0.5,-0.5885 0.8615,-0.8269s0.7923,-0.3577 1.2885,-0.3577c0.3769,0 0.7269,0.0462 1.05,0.1385 0.3231,0.0923 0.5962,0.2385 0.8269,0.4423s0.4077,0.4654 0.5385,0.7923c0.1269,0.3269 0.1923,0.7192 0.1923,1.1808v4.7731h-1.9577v-4.0423c0,-0.2385 -0.0077,-0.4654 -0.0269,-0.6769s-0.0692,-0.3962 -0.15,-0.55c-0.0846,-0.1577 -0.2038,-0.2808 -0.3654,-0.3731s-0.3808,-0.1385 -0.6538,-0.1385c-0.2769,0 -0.5,0.0538 -0.6692,0.1577 -0.1692,0.1077 -0.3038,0.2423 -0.4,0.4154 -0.0962,0.1692 -0.1615,0.3615 -0.1923,0.5808 -0.0308,0.2154 -0.05,0.4346 -0.05,0.6538v3.9731h-1.9577v-4c0,-0.2115 -0.0038,-0.4192 -0.0154,-0.6269 -0.0077,-0.2077 -0.05,-0.3962 -0.1192,-0.5731 -0.0692,-0.1731 -0.1846,-0.3154 -0.3462,-0.4192s-0.3962,-0.1577 -0.7115,-0.1577c-0.0923,0 -0.2154,0.0192 -0.3654,0.0615s-0.3,0.1192 -0.4423,0.2346 -0.2654,0.2808 -0.3654,0.4962c-0.1,0.2154 -0.15,0.5 -0.15,0.85v4.1385h-1.9577v-7.1385h1.8462Z"
android:strokeWidth="0"/>
<path
android:fillColor="#FF000000"
android:pathData="m20.4731,20.5423V3.4577h-1.3731v-1.4577h2.9v20h-2.9v-1.4577h1.3731Z"
android:strokeWidth="0"/>
</vector>
10 changes: 10 additions & 0 deletions library/src/main/res/drawable/ic_toolbar_tiktok.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="m18.183,6.0669c-1.1318,-0.7059 -1.9473,-1.8705 -2.1864,-3.2335 -0.0228,-0.1303 -0.0403,-0.2614 -0.0525,-0.393v-0.4403h-3.445v13.6726c-0.0055,1.5937 -1.2996,2.8843 -2.8958,2.8843 -0.4686,0 -0.911,-0.1112 -1.3028,-0.3087 0,0 0,0 0,-0.0001 -0.9449,-0.4767 -1.5929,-1.4553 -1.5929,-2.5854 0,-1.5984 1.2963,-2.8943 2.8958,-2.8943 0.3064,0 0.6018,0.0477 0.8789,0.1356v-2.724s0,0 0.0001,0v-0.7756c-0.2879,-0.0393 -0.5781,-0.0591 -0.8686,-0.0589 -3.4965,0 -6.3309,2.8328 -6.3309,6.3271 0,2.1905 1.1137,4.1209 2.8061,5.2567 0.0002,0.0002 0.0003,0.0004 0.0005,0.0006 1.0072,0.676 2.2197,1.0702 3.5242,1.0702 3.4962,0 6.3305,-2.8329 6.3305,-6.3274v-6.9857c1.3455,0.961 2.9932,1.5265 4.7728,1.5265v-3.4231c-0.8958,0.0014 -1.774,-0.2494 -2.5341,-0.7236h0Z"
android:strokeWidth="0"/>
</vector>

0 comments on commit 025e8af

Please sign in to comment.