ソースを参照

Add dark/light aware high-res conversation icons for share:password and document

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 3 年 前
コミット
c4057b7ac4

+ 4 - 6
app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java

@@ -199,15 +199,13 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
             switch (objectType) {
                 case "share:password":
                     shouldLoadAvatar = false;
-                    holder.dialogAvatar.getHierarchy().setImage(new BitmapDrawable(DisplayUtils
-                            .getRoundedBitmapFromVectorDrawableResource(context.getResources(),
-                                    R.drawable.ic_file_password_request)), 100, true);
+                    holder.dialogAvatar.setImageDrawable(ContextCompat.getDrawable(context,
+                                                                                   R.drawable.ic_circular_lock));
                     break;
                 case "file":
                     shouldLoadAvatar = false;
-                    holder.dialogAvatar.getHierarchy().setImage(new BitmapDrawable(DisplayUtils
-                            .getRoundedBitmapFromVectorDrawableResource(context.getResources(),
-                                    R.drawable.ic_file_icon)), 100, true);
+                    holder.dialogAvatar.setImageDrawable(ContextCompat.getDrawable(context,
+                                                                                   R.drawable.ic_circular_document));
                     break;
                 default:
                     break;

+ 35 - 0
app/src/main/res/drawable-night/ic_circular_document.xml

@@ -0,0 +1,35 @@
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Andy Scherzinger
+  ~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:autoMirrored="true"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="#2C2C2C"
+        android:fillType="nonZero"
+        android:pathData="M12,0C5.4168,0 0,5.4168 0,12C0,18.5832 5.4168,24 12,24C18.5832,24 24,18.5832 24,12C24,5.4168 18.5832,0 12,0Z" />
+    <path
+        android:fillColor="#ffffff"
+        android:fillType="nonZero"
+        android:pathData="M7.4167,6C7.1833,6 7,6.1833 7,6.4167L7,17.25C7,17.4833 7.1833,17.6667 7.4167,17.6667L16.5833,17.6667C16.8167,17.6667 17,17.4833 17,17.25L17,8.5L14.5,6L7.4167,6ZM8.6667,7.6667L13.6667,7.6667L13.6667,8.5L8.6667,8.5L8.6667,7.6667ZM8.6667,10.1667L12.8333,10.1667L12.8333,11L8.6667,11L8.6667,10.1667ZM8.6667,12.6667L15.3333,12.6667L15.3333,13.5L8.6667,13.5L8.6667,12.6667ZM8.6667,15.1667L12,15.1667L12,16L8.6667,16L8.6667,15.1667Z" />
+</vector>

+ 35 - 0
app/src/main/res/drawable-night/ic_circular_lock.xml

@@ -0,0 +1,35 @@
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Andy Scherzinger
+  ~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:autoMirrored="true"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="#2C2C2C"
+        android:fillType="nonZero"
+        android:pathData="M12,0C5.4168,0 0,5.4168 0,12C0,18.5832 5.4168,24 12,24C18.5832,24 24,18.5832 24,12C24,5.4168 18.5832,0 12,0Z" />
+    <path
+        android:fillColor="#ffffff"
+        android:fillType="nonZero"
+        android:pathData="M12,15.1C11.1675,15.1 10.5,14.425 10.5,13.6C10.5,12.7675 11.1675,12.1 12,12.1C12.8228,12.1 13.5,12.7773 13.5,13.6C13.5,14.4228 12.8228,15.1 12,15.1M16.5,17.35L16.5,9.85L7.5,9.85L7.5,17.35L16.5,17.35M16.5,8.35C17.3228,8.35 18,9.0273 18,9.85L18,17.35C18,18.1728 17.3228,18.85 16.5,18.85L7.5,18.85C6.6675,18.85 6,18.175 6,17.35L6,9.85C6,9.0175 6.6675,8.35 7.5,8.35L8.25,8.35L8.25,6.85C8.25,4.7927 9.9427,3.1 12,3.1C14.0573,3.1 15.75,4.7927 15.75,6.85L15.75,8.35L16.5,8.35M12,4.6C10.7655,4.6 9.75,5.6155 9.75,6.85L9.75,8.35L14.25,8.35L14.25,6.85C14.25,5.6155 13.2345,4.6 12,4.6Z" />
+</vector>

+ 35 - 0
app/src/main/res/drawable/ic_circular_document.xml

@@ -0,0 +1,35 @@
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Andy Scherzinger
+  ~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:autoMirrored="true"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="#DBDBDB"
+        android:fillType="nonZero"
+        android:pathData="M12,0C5.4168,0 0,5.4168 0,12C0,18.5832 5.4168,24 12,24C18.5832,24 24,18.5832 24,12C24,5.4168 18.5832,0 12,0Z" />
+    <path
+        android:fillColor="#ffffff"
+        android:fillType="nonZero"
+        android:pathData="M7.4167,6C7.1833,6 7,6.1833 7,6.4167L7,17.25C7,17.4833 7.1833,17.6667 7.4167,17.6667L16.5833,17.6667C16.8167,17.6667 17,17.4833 17,17.25L17,8.5L14.5,6L7.4167,6ZM8.6667,7.6667L13.6667,7.6667L13.6667,8.5L8.6667,8.5L8.6667,7.6667ZM8.6667,10.1667L12.8333,10.1667L12.8333,11L8.6667,11L8.6667,10.1667ZM8.6667,12.6667L15.3333,12.6667L15.3333,13.5L8.6667,13.5L8.6667,12.6667ZM8.6667,15.1667L12,15.1667L12,16L8.6667,16L8.6667,15.1667Z" />
+</vector>

+ 35 - 0
app/src/main/res/drawable/ic_circular_lock.xml

@@ -0,0 +1,35 @@
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Andy Scherzinger
+  ~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:autoMirrored="true"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path
+        android:fillColor="#DBDBDB"
+        android:fillType="nonZero"
+        android:pathData="M12,0C5.4168,0 0,5.4168 0,12C0,18.5832 5.4168,24 12,24C18.5832,24 24,18.5832 24,12C24,5.4168 18.5832,0 12,0Z" />
+    <path
+        android:fillColor="#ffffff"
+        android:fillType="nonZero"
+        android:pathData="M12,15.1C11.1675,15.1 10.5,14.425 10.5,13.6C10.5,12.7675 11.1675,12.1 12,12.1C12.8228,12.1 13.5,12.7773 13.5,13.6C13.5,14.4228 12.8228,15.1 12,15.1M16.5,17.35L16.5,9.85L7.5,9.85L7.5,17.35L16.5,17.35M16.5,8.35C17.3228,8.35 18,9.0273 18,9.85L18,17.35C18,18.1728 17.3228,18.85 16.5,18.85L7.5,18.85C6.6675,18.85 6,18.175 6,17.35L6,9.85C6,9.0175 6.6675,8.35 7.5,8.35L8.25,8.35L8.25,6.85C8.25,4.7927 9.9427,3.1 12,3.1C14.0573,3.1 15.75,4.7927 15.75,6.85L15.75,8.35L16.5,8.35M12,4.6C10.7655,4.6 9.75,5.6155 9.75,6.85L9.75,8.35L14.25,8.35L14.25,6.85C14.25,5.6155 13.2345,4.6 12,4.6Z" />
+</vector>

+ 0 - 30
app/src/main/res/drawable/ic_file_icon.xml

@@ -1,30 +0,0 @@
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<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="#D5D5D5" android:fillType="nonZero"
-        android:pathData="M0,0l24,0l0,24l-24,0z" android:strokeAlpha="0"
-        android:strokeColor="#000000" android:strokeWidth="1"/>
-    <path android:fillColor="#FFFFFF" android:fillType="nonZero"
-        android:pathData="M6.4825,5C6.2123,5 6,5.2123 6,5.4825L6,18.0275C6,18.2977 6.2123,18.51 6.4825,18.51L17.0975,18.51C17.3677,18.51 17.58,18.2977 17.58,18.0275L17.58,7.895L14.685,5L6.4825,5ZM7.93,6.93L13.72,6.93L13.72,7.895L7.93,7.895L7.93,6.93ZM7.93,9.825L12.755,9.825L12.755,10.79L7.93,10.79L7.93,9.825ZM7.93,12.72L15.65,12.72L15.65,13.685L7.93,13.685L7.93,12.72ZM7.93,15.615L11.79,15.615L11.79,16.58L7.93,16.58L7.93,15.615Z"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-</vector>

+ 0 - 30
app/src/main/res/drawable/ic_file_password_request.xml

@@ -1,30 +0,0 @@
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<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="#D5D5D5" android:fillType="nonZero"
-        android:pathData="M0,0l24,0l0,24l-24,0z" android:strokeAlpha="0"
-        android:strokeColor="#000000" android:strokeWidth="1"/>
-    <path android:fillColor="#FFFFFF" android:fillType="nonZero"
-        android:pathData="M15.8787,9.9394L15.1731,9.9394L15.1731,8.5281C15.1731,6.5806 13.5925,5 11.645,5C9.6975,5 8.1169,6.5806 8.1169,8.5281L8.1169,9.9394L7.4113,9.9394C6.6351,9.9394 6,10.5744 6,11.3506L6,18.4069C6,19.1831 6.6351,19.8181 7.4113,19.8181L15.8787,19.8181C16.6549,19.8181 17.29,19.1831 17.29,18.4069L17.29,11.3506C17.29,10.5744 16.6549,9.9394 15.8787,9.9394ZM9.5281,8.5281C9.5281,7.3568 10.4737,6.4113 11.645,6.4113C12.8163,6.4113 13.7619,7.3568 13.7619,8.5281L13.7619,9.9394L9.5281,9.9394L9.5281,8.5281ZM15.8787,18.4069L7.4113,18.4069L7.4113,11.3506L15.8787,11.3506L15.8787,18.4069ZM11.645,16.29C12.4212,16.29 13.0562,15.6549 13.0562,14.8787C13.0562,14.1026 12.4212,13.4675 11.645,13.4675C10.8688,13.4675 10.2338,14.1026 10.2338,14.8787C10.2338,15.6549 10.8688,16.29 11.645,16.29Z"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-</vector>

+ 10 - 0
drawable_resources/other/circular_document.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
+    <g transform="matrix(1.2,0,0,1.2,-2.4,-2.4)">
+        <path d="M12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2Z" style="fill-rule:nonzero;"/>
+    </g>
+    <g transform="matrix(0.833333,0,0,0.833333,5.33333,5.16667)">
+        <path d="M2.5,1C2.22,1 2,1.22 2,1.5L2,14.5C2,14.78 2.22,15 2.5,15L13.5,15C13.78,15 14,14.78 14,14.5L14,4L11,1L2.5,1ZM4,3L10,3L10,4L4,4L4,3ZM4,6L9,6L9,7L4,7L4,6ZM4,9L12,9L12,10L4,10L4,9ZM4,12L8,12L8,13L4,13L4,12Z" style="fill:white;fill-rule:nonzero;"/>
+    </g>
+</svg>

+ 10 - 0
drawable_resources/other/circular_lock.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
+    <g transform="matrix(1.2,0,0,1.2,-2.4,-2.4)">
+        <path d="M12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2Z" style="fill-rule:nonzero;"/>
+    </g>
+    <g transform="matrix(0.75,0,0,0.75,3,2.35)">
+        <path d="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13C13.097,13 14,13.903 14,15C14,16.097 13.097,17 12,17M18,20L18,10L6,10L6,20L18,20M18,8C19.097,8 20,8.903 20,10L20,20C20,21.097 19.097,22 18,22L6,22C4.89,22 4,21.1 4,20L4,10C4,8.89 4.89,8 6,8L7,8L7,6C7,3.257 9.257,1 12,1C14.743,1 17,3.257 17,6L17,8L18,8M12,3C10.354,3 9,4.354 9,6L9,8L15,8L15,6C15,4.354 13.646,3 12,3Z" style="fill:white;fill-rule:nonzero;"/>
+    </g>
+</svg>