Skip to content

Commit

Permalink
Merge pull request #21492 from wordpress-mobile/issue/21490-missing-s…
Browse files Browse the repository at this point in the history
…ocial-icons

Missing social icons
  • Loading branch information
nbradbury authored Nov 25, 2024
2 parents e5124f3 + 976f972 commit 0ceef78
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ enum class PublicizeServiceIcon(
val serviceId: String,
@DrawableRes val iconResId: Int,
) {
BLUESKY("bluesky", R.drawable.ic_social_bluesky),
FACEBOOK("facebook", R.drawable.ic_social_facebook),
INSTAGRAM("instagram-business", R.drawable.ic_social_instagram),
LINKEDIN("linkedin", R.drawable.ic_social_linkedin),
MASTODON("mastodon", R.drawable.ic_social_mastodon),
NEXTDOOR("nextdoor", R.drawable.ic_social_nextdoor),
THREADS("threads", R.drawable.ic_social_threads),
TUMBLR("tumblr", R.drawable.ic_social_tumblr),
TWITTER("twitter", R.drawable.ic_social_twitter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,19 @@ public void onBindViewHolder(final SharingViewHolder holder, int position) {
holder.mTxtService.setText(service.getLabel());
final PublicizeServiceIcon icon = PublicizeServiceIcon.fromServiceId(service.getId());
if (icon != null) {
holder.mImgIcon.setVisibility(View.VISIBLE);
mImageManager.load(holder.mImgIcon, icon.getIconResId());
} else {
holder.mImgIcon.setVisibility(View.INVISIBLE);
holder.mImgIcon.setImageResource(R.drawable.ic_social_generic);
}

if (connections.size() > 0) {
holder.mTxtUser.setText(connections.getUserDisplayNames());
holder.mTxtUser.setVisibility(View.VISIBLE);
String userNames = connections.getUserDisplayNames();
if (userNames.isEmpty()) {
holder.mTxtUser.setVisibility(View.GONE);
} else {
holder.mTxtUser.setText(connections.getUserDisplayNames());
holder.mTxtUser.setVisibility(View.VISIBLE);
}
holder.mImgIcon.clearColorFilter();
holder.mImgIcon.setImageAlpha(255);
} else {
Expand Down Expand Up @@ -200,6 +205,7 @@ protected Boolean doInBackground(Void... params) {
return !(mTmpServices.isSameAs(mServices) && mTmpConnections.isSameAs(mConnections));
}

@SuppressLint("NotifyDataSetChanged")
@Override
protected void onPostExecute(Boolean result) {
if (result) {
Expand Down
13 changes: 13 additions & 0 deletions WordPress/src/main/res/drawable-night/ic_social_threads.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="124dp"
android:height="141dp"
android:viewportHeight="141"
android:viewportWidth="124">
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M63.09,141L63.05,141C41.97,140.86 25.77,133.92 14.89,120.39C5.21,108.33 0.21,91.57 0.04,70.55L0.04,70.46C0.21,49.43 5.21,32.68 14.9,20.63C25.77,7.08 41.99,0.14 63.05,0L63.13,0C79.29,0.11 92.8,4.26 103.3,12.32C113.17,19.91 120.12,30.71 123.95,44.44L111.94,47.79C105.44,24.52 89,12.63 63.07,12.45C45.96,12.58 33,17.95 24.59,28.41C16.72,38.21 12.65,52.37 12.5,70.5C12.65,88.63 16.72,102.79 24.6,112.59C33.02,123.07 45.97,128.44 63.09,128.55C78.52,128.44 88.73,124.84 97.22,116.54C106.91,107.06 106.74,95.43 103.63,88.35C101.81,84.18 98.49,80.71 94.02,78.07C92.89,86.01 90.36,92.44 86.46,97.29C81.25,103.76 73.86,107.3 64.52,107.81C57.44,108.19 50.62,106.53 45.34,103.1C39.08,99.05 35.42,92.88 35.02,85.69C34.64,78.69 37.43,72.26 42.85,67.58C48.03,63.11 55.32,60.49 63.93,60C70.28,59.64 76.22,59.93 81.7,60.83C80.97,56.47 79.5,53 77.3,50.51C74.27,47.07 69.6,45.32 63.41,45.27C63.36,45.27 63.3,45.27 63.24,45.27C58.27,45.27 51.52,46.64 47.23,53.03L36.89,46.11C42.65,37.56 52,32.85 63.24,32.85C63.33,32.85 63.41,32.85 63.5,32.85C82.29,32.96 93.5,44.46 94.61,64.51C95.25,64.78 95.88,65.06 96.5,65.34C105.27,69.46 111.68,75.69 115.06,83.38C119.75,94.07 120.19,111.52 105.95,125.43C95.06,136.07 81.86,140.88 63.13,141ZM68.99,72.32C67.57,72.32 66.13,72.36 64.64,72.45C53.84,73.05 47.1,78 47.48,85.04C47.88,92.41 56.03,95.84 63.86,95.41C71.07,95.04 80.45,92.23 82.03,73.62C78.04,72.76 73.68,72.32 68.99,72.32ZM68.99,72.32"
android:strokeColor="#FFFFFF"
tools:ignore="VectorPath" />
</vector>
11 changes: 11 additions & 0 deletions WordPress/src/main/res/drawable/ic_social_bluesky.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportHeight="64"
android:viewportWidth="64">
<path
android:fillColor="#1185FE"
android:fillType="nonZero"
android:pathData="M21.945,19.695C26.012,22.75 30.395,28.945 32,32.27C33.605,28.945 37.988,22.75 42.055,19.695C44.992,17.488 49.75,15.781 49.75,21.211C49.75,22.293 49.125,30.32 48.762,31.617C47.492,36.148 42.883,37.305 38.77,36.605C45.957,37.824 47.773,41.875 43.832,45.918C36.344,53.605 33.07,43.992 32.227,41.531C32.074,41.082 32,40.867 32,41.043C32,40.867 31.926,41.082 31.773,41.531C30.93,43.992 27.656,53.613 20.168,45.926C16.227,41.875 18.043,37.824 25.23,36.605C21.117,37.305 16.508,36.148 15.23,31.617C14.875,30.32 14.25,22.293 14.25,21.211C14.25,15.781 19.008,17.488 21.945,19.695ZM21.945,19.695"
android:strokeColor="#00000000" />
</vector>
7 changes: 7 additions & 0 deletions WordPress/src/main/res/drawable/ic_social_generic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<vector android:autoMirrored="true" android:height="24dp"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="?attr/colorOnSurface"
android:pathData="M15.5,9.5a1,1 0,1 0,0 -2,1 1,0 0,0 0,2zM15.5,11a2.5,2.5 0,1 0,0 -5,2.5 2.5,0 0,0 0,5zM13.25,17v-2a2.75,2.75 0,0 0,-2.75 -2.75h-4A2.75,2.75 0,0 0,3.75 15v2h1.5v-2c0,-0.69 0.56,-1.25 1.25,-1.25h4c0.69,0 1.25,0.56 1.25,1.25v2h1.5zM20.25,15v2h-1.5v-2c0,-0.69 -0.56,-1.25 -1.25,-1.25L15,13.75v-1.5h2.5A2.75,2.75 0,0 1,20.25 15zM9.5,8.5a1,1 0,1 1,-2 0,1 1,0 0,1 2,0zM11,8.5a2.5,2.5 0,1 1,-5 0,2.5 2.5,0 0,1 5,0z"/>
</vector>
9 changes: 9 additions & 0 deletions WordPress/src/main/res/drawable/ic_social_nextdoor.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="M2.5,3.8c-0.4,0 -0.8,0.3 -0.8,0.7v3c0,2.3 2,4.3 4.3,4.3h0.8v7.7c0,0.4 0.3,0.8 0.7,0.8h4c0.4,0 0.8,-0.4 0.8,-0.8v-8a2.3,2.3 0,0 1,4.4 0v8c0,0.4 0.4,0.8 0.8,0.8h4c0.4,0 0.8,-0.4 0.8,-0.8v-8A7.8,7.8 0,0 0,8 7.2a0.8,0.8 0,0 1,-0.8 -0.7v-2c0,-0.4 -0.3,-0.8 -0.7,-0.8h-4Z"
android:fillColor="#8BC94D"/>
</vector>
13 changes: 13 additions & 0 deletions WordPress/src/main/res/drawable/ic_social_threads.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="124dp"
android:height="141dp"
android:viewportHeight="141"
android:viewportWidth="124">
<path
android:fillColor="#000000"
android:fillType="nonZero"
android:pathData="M63.09,141L63.05,141C41.97,140.86 25.77,133.92 14.89,120.39C5.21,108.33 0.21,91.57 0.04,70.55L0.04,70.46C0.21,49.43 5.21,32.68 14.9,20.63C25.77,7.08 41.99,0.14 63.05,0L63.13,0C79.29,0.11 92.8,4.26 103.3,12.32C113.17,19.91 120.12,30.71 123.95,44.44L111.94,47.79C105.44,24.52 89,12.63 63.07,12.45C45.96,12.58 33,17.95 24.59,28.41C16.72,38.21 12.65,52.37 12.5,70.5C12.65,88.63 16.72,102.79 24.6,112.59C33.02,123.07 45.97,128.44 63.09,128.55C78.52,128.44 88.73,124.84 97.22,116.54C106.91,107.06 106.74,95.43 103.63,88.35C101.81,84.18 98.49,80.71 94.02,78.07C92.89,86.01 90.36,92.44 86.46,97.29C81.25,103.76 73.86,107.3 64.52,107.81C57.44,108.19 50.62,106.53 45.34,103.1C39.08,99.05 35.42,92.88 35.02,85.69C34.64,78.69 37.43,72.26 42.85,67.58C48.03,63.11 55.32,60.49 63.93,60C70.28,59.64 76.22,59.93 81.7,60.83C80.97,56.47 79.5,53 77.3,50.51C74.27,47.07 69.6,45.32 63.41,45.27C63.36,45.27 63.3,45.27 63.24,45.27C58.27,45.27 51.52,46.64 47.23,53.03L36.89,46.11C42.65,37.56 52,32.85 63.24,32.85C63.33,32.85 63.41,32.85 63.5,32.85C82.29,32.96 93.5,44.46 94.61,64.51C95.25,64.78 95.88,65.06 96.5,65.34C105.27,69.46 111.68,75.69 115.06,83.38C119.75,94.07 120.19,111.52 105.95,125.43C95.06,136.07 81.86,140.88 63.13,141ZM68.99,72.32C67.57,72.32 66.13,72.36 64.64,72.45C53.84,73.05 47.1,78 47.48,85.04C47.88,92.41 56.03,95.84 63.86,95.41C71.07,95.04 80.45,92.23 82.03,73.62C78.04,72.76 73.68,72.32 68.99,72.32ZM68.99,72.32"
android:strokeColor="#00000000"
tools:ignore="VectorPath" />
</vector>

0 comments on commit 0ceef78

Please sign in to comment.