Cherish: FOD icon picker [2/2]

* Adapt for CherishOS support
* Add a footer to explain how users can add their own icons
This commit is contained in:
00day0
2019-12-16 21:46:12 +01:00
committed by Hung Phan
parent e9dcd06e4d
commit 814c31b7b0
19 changed files with 502 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="120dp"
android:height="120dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:fillColor="#bfd9d9d9"
android:fillType="evenOdd"
android:pathData="M50,100C77.614,100 100,77.614 100,50C100,22.386 77.614,0 50,0C22.386,0 0,22.386 0,50C0,77.614 22.386,100 50,100ZM70.499,22.676C70.751,22.82 71.039,22.892 71.327,22.892C71.975,22.892 72.587,22.532 72.911,21.884C73.379,21.02 73.055,19.94 72.155,19.472C64.811,15.692 58.115,14 50.447,14C42.707,14 35.363,15.872 28.667,19.508C27.803,19.976 27.479,21.092 27.947,21.956C28.451,22.82 29.531,23.144 30.395,22.676C36.551,19.292 43.319,17.6 50.447,17.6C57.611,17.6 63.587,19.112 70.499,22.676ZM18.767,41.468C19.091,41.684 19.451,41.792 19.811,41.792C20.387,41.792 20.927,41.54 21.215,41.036C24.455,36.5 28.559,32.9 33.455,30.38C43.751,25.052 56.963,25.052 67.295,30.344C72.155,32.828 76.259,36.392 79.499,40.928C80.075,41.756 81.191,41.936 82.019,41.36C82.847,40.784 83.027,39.632 82.451,38.84C78.887,33.836 74.351,29.912 68.951,27.14C57.611,21.308 43.139,21.344 31.835,27.176C26.435,29.948 21.899,33.908 18.335,38.948C17.759,39.776 17.939,40.892 18.767,41.468ZM41.051,84.704C41.375,85.064 41.843,85.244 42.311,85.244C42.779,85.244 43.247,85.064 43.643,84.704C44.327,83.984 44.327,82.868 43.643,82.148C40.871,79.34 39.287,77.576 36.983,73.436C34.787,69.548 33.635,64.76 33.635,59.576C33.635,50.864 41.159,43.772 50.411,43.772C59.663,43.772 67.187,50.864 67.187,59.576C67.187,60.584 67.979,61.376 68.987,61.376C69.995,61.376 70.787,60.584 70.787,59.576C70.787,48.884 61.643,40.172 50.411,40.172C39.179,40.172 30.035,48.884 30.035,59.576C30.035,65.372 31.331,70.772 33.815,75.2C36.227,79.556 37.919,81.572 41.051,84.704ZM56.963,75.38C60.059,77.504 63.839,78.584 68.123,78.584C68.627,78.584 70.427,78.548 72.479,78.152C73.487,77.972 74.135,77.036 73.955,76.064C73.775,75.056 72.839,74.408 71.867,74.588C70.427,74.84 68.987,74.948 68.123,74.948C64.523,74.948 61.535,74.12 58.979,72.392C54.587,69.44 51.995,64.652 51.995,59.576C51.995,58.568 51.203,57.776 50.195,57.776C49.187,57.776 48.395,58.568 48.395,59.576C48.395,65.84 51.599,71.744 56.963,75.38ZM60.419,85.928C60.563,85.964 60.743,86 60.887,86C61.643,86 62.399,85.46 62.579,84.632C62.831,83.696 62.291,82.688 61.319,82.436C56.243,81.032 52.967,79.16 49.547,75.776C45.191,71.456 42.815,65.696 42.815,59.54C42.815,55.688 46.163,52.556 50.303,52.556C54.443,52.556 57.791,55.688 57.791,59.54C57.791,65.372 62.759,70.124 68.879,70.124C74.999,70.124 79.967,65.372 79.967,59.54C79.967,43.988 66.647,31.352 50.267,31.352C38.639,31.352 28.019,37.868 23.231,47.912C21.611,51.332 20.783,55.256 20.783,59.576C20.783,64.436 21.647,69.116 23.411,73.832C23.735,74.732 24.779,75.236 25.715,74.876C26.651,74.552 27.119,73.508 26.759,72.572C24.599,66.812 24.347,62.384 24.347,59.576C24.347,55.832 25.067,52.412 26.471,49.496C30.683,40.676 40.043,34.988 50.267,34.988C64.667,34.988 76.367,46.004 76.367,59.576C76.367,63.428 73.019,66.56 68.879,66.56C64.739,66.56 61.391,63.428 61.391,59.576C61.391,53.744 56.423,48.992 50.303,48.992C44.183,48.992 39.215,53.744 39.215,59.576C39.215,66.704 41.987,73.364 47.027,78.368C50.951,82.22 54.695,84.344 60.419,85.928Z" />
</vector>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:strokeColor="?android:attr/colorAccent"
android:strokeLineCap="round"
android:strokeWidth="2.36863613"
android:pathData="M84.958,68.627C85.988,60.353 85.723,51.776 83.984,43.152l-0.01,0.001C81.401,30.388 72.122,20.687 60.546,16.976M54.635,15.64C50.907,15.136 47.033,15.235 43.138,16.021 24.367,19.805 12.22,38.088 16.004,56.858l0.012,-0.003c0.657,3.257 -0.363,6.461 -2.461,8.725m64.558,12.332c2.021,-7.581 2.861,-15.563 2.348,-23.695m-0.658,-6.239c-0.19,-1.281 -0.414,-2.563 -0.673,-3.847l-0.006,-0C75.879,28.04 60.206,17.627 44.116,20.871 31.75,23.365 22.737,33.198 20.699,44.921m-0.411,6.261c0.064,1.554 0.25,3.124 0.567,4.698l0.015,-0.004c1.111,5.509 -0.976,10.92 -4.98,14.313m2.796,4.109c5.596,-4.496 8.556,-11.878 7.038,-19.4l-0.019,0.004C23.821,45.556 27.465,36.379 34.386,30.759m5.262,-3.27c1.705,-0.782 3.527,-1.381 5.446,-1.767 7.582,-1.529 15.053,0.581 20.604,5.127m4.327,4.577c2.038,2.797 3.519,6.068 4.249,9.683l0.002,0.001c2.693,13.354 1.351,26.585 -3.181,38.433m-6.89,3.445c1.797,-3.688 3.247,-7.556 4.317,-11.553m1.331,-6.167C71.084,61.787 71.007,53.962 69.419,46.089l0.003,-0.002C67.258,35.354 56.804,28.408 46.072,30.572 35.339,32.737 28.393,43.191 30.558,53.924l0.023,-0.005c0.514,2.549 0.617,5.086 0.354,7.541m-1.535,6.307c-1.548,3.986 -4.109,7.527 -7.43,10.248M57.572,88.888C64.71,76.719 67.572,61.984 64.564,47.068l0.007,-0.003C63.676,42.627 60.893,39.052 57.227,37.008m-6.073,-1.837c-1.341,-0.105 -2.719,-0.028 -4.103,0.252 -8.054,1.624 -13.266,9.468 -11.642,17.523l0.028,-0.005C37.632,63.834 33.573,74.536 25.731,81.327m25.524,8.278c4.958,-7.245 8.174,-15.674 9.192,-24.604m0.348,-6.282C60.785,55.2 60.432,51.629 59.71,48.047l0.011,-0.004c-1.083,-5.374 -6.318,-8.853 -11.693,-7.769 -4.015,0.809 -6.971,3.935 -7.758,7.706m0.397,6.213C42.219,65.652 37.938,76.719 29.959,84.184m15.348,5.169C53.909,78.346 57.833,63.792 54.855,49.025l0.015,-0.005c-0.544,-2.696 -3.169,-4.44 -5.864,-3.896 -2.695,0.544 -4.439,3.169 -3.896,5.865l0.035,-0.006c1.109,5.501 1.021,10.967 -0.084,16.126m-1.829,6.091c-1.941,4.974 -4.868,9.513 -8.592,13.331m5.122,1.755C48.637,78.183 52.863,64.202 50,50.004m-38.825,7.829c0.115,0.569 0.241,1.132 0.379,1.69m78.074,-8.72c0.054,-2.841 -0.197,-5.731 -0.782,-8.632m-0.021,0.004C86.734,31.809 80.775,23.21 72.752,17.58M67.422,14.427C59.859,10.715 51.057,9.376 42.16,11.17 32.053,13.207 23.627,18.923 17.994,26.642m-3.281,5.328c-3.941,7.697 -5.402,16.731 -3.56,25.867" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The Evolution X Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<corners android:radius="8dp"/>
<stroke android:width="2dp" android:color="@color/fod_item_background_stroke_color"/>
</shape>

View File

@@ -1,8 +1,23 @@
<vector android:height="24dp" android:viewportHeight="426.667"
android:viewportWidth="426.667" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M133.529,352.213c-12.907,-23.147 -19.733,-51.52 -19.733,-82.24c0,-51.627 44.693,-93.653 99.52,-93.653c54.933,0 99.52,42.027 99.52,93.653c0,5.867 4.8,10.667 10.667,10.667s10.667,-4.8 10.667,-10.667c0,-63.467 -54.187,-114.987 -120.853,-114.987S92.462,206.613 92.462,269.973c0,34.347 7.787,66.453 22.507,92.693c14.4,25.707 24.427,37.547 42.88,56.213c2.133,2.133 4.8,3.2 7.573,3.2c2.667,0 5.44,-0.96 7.36,-3.2c4.267,-4.053 4.267,-10.88 0.107,-15.04C156.462,387.307 147.289,376.747 133.529,352.213z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M94.702,51.413c36.587,-19.947 76.48,-30.08 118.827,-30.08c42.453,0 77.973,9.067 118.827,30.187c1.6,0.747 3.2,1.173 4.907,1.173h0c3.84,0 7.573,-2.133 9.493,-5.76c2.667,-5.227 0.64,-11.733 -4.587,-14.4C298.649,10.027 258.969,0 213.529,0c-45.867,0 -89.28,10.987 -129.067,32.64c-5.227,2.88 -7.04,9.28 -4.267,14.507C83.075,52.373 89.475,54.187 94.702,51.413z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M212.569,103.04c-68.8,0 -131.733,38.507 -160.213,98.027c-9.707,20.16 -14.613,43.413 -14.613,69.013c0,28.8 5.12,56.32 15.573,84.373c2.133,5.547 8.213,8.32 13.76,6.293c5.547,-2.133 8.32,-8.213 6.293,-13.76C60.675,312.96 59.182,286.72 59.182,270.08c0,-22.4 4.16,-42.56 12.48,-59.84c24.96,-52.267 80.32,-85.973 141.013,-85.973c85.227,0 154.56,65.387 154.56,145.813c0,22.933 -19.947,41.493 -44.373,41.493s-44.373,-18.667 -44.373,-41.493c0,-34.667 -29.44,-62.827 -65.707,-62.827s-65.707,28.16 -65.707,62.827c0,42.133 16.427,81.707 46.187,111.36c23.04,22.933 45.227,35.52 79.253,44.8c0.853,0.32 1.813,0.427 2.773,0.427c4.693,0 8.96,-3.093 10.24,-7.787c1.6,-5.653 -1.813,-11.52 -7.467,-13.12c-30.08,-8.213 -49.707,-19.307 -69.867,-39.36c-25.707,-25.6 -39.893,-59.84 -39.893,-96.213c0,-22.933 19.947,-41.493 44.373,-41.493s44.373,18.667 44.373,41.493c0,34.667 29.547,62.827 65.707,62.827c36.16,0 65.707,-28.16 65.707,-62.827C388.462,178.027 309.529,103.04 212.569,103.04z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M403.395,147.2c-21.227,-29.653 -48.107,-52.907 -80,-69.333c-67.2,-34.56 -152.96,-34.453 -220.053,0.213c-32,16.533 -58.987,40 -80.107,69.867c-3.413,4.8 -2.24,11.413 2.56,14.827c1.92,1.28 4.053,1.92 6.187,1.92c3.307,0 6.613,-1.493 8.747,-4.373c19.093,-27.093 43.52,-48.32 72.427,-63.253c61.12,-31.573 139.307,-31.68 200.533,-0.213c28.8,14.72 53.12,35.84 72.32,62.72c3.413,4.8 10.133,5.867 14.933,2.453C405.742,158.613 406.809,152 403.395,147.2z"/>
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M340.569,359.253c-8.533,1.493 -17.173,2.027 -22.293,2.027c-21.333,0 -39.04,-5.013 -54.08,-15.253c-25.92,-17.6 -41.387,-45.973 -41.387,-75.947c0,-5.867 -4.8,-10.667 -10.667,-10.667s-10.667,4.8 -10.667,10.667c0,37.12 18.987,72.107 50.667,93.653c18.453,12.48 40.747,18.88 66.133,18.88c2.987,0 13.547,-0.107 26.027,-2.347c5.76,-1.067 9.707,-6.613 8.64,-12.373S346.329,358.187 340.569,359.253z"/>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 crDroid Android Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M11.83,1.73C8.43,1.79 6.23,3.32 6.23,3.32C5.95,3.5 5.88,3.91 6.07,4.19C6.27,4.5 6.66,4.55 6.96,4.34C6.96,4.34 11.27,1.15 17.46,4.38C17.75,4.55 18.14,4.45 18.31,4.15C18.5,3.85 18.37,3.47 18.03,3.28C16.36,2.4 14.78,1.96 13.36,1.8C12.83,1.74 12.32,1.72 11.83,1.73M12.22,4.34C6.26,4.26 3.41,9.05 3.41,9.05C3.22,9.34 3.3,9.72 3.58,9.91C3.87,10.1 4.26,10 4.5,9.68C4.5,9.68 6.92,5.5 12.2,5.59C17.5,5.66 19.82,9.65 19.82,9.65C20,9.94 20.38,10.04 20.68,9.87C21,9.69 21.07,9.31 20.9,9C20.9,9 18.15,4.42 12.22,4.34M11.5,6.82C9.82,6.94 8.21,7.55 7,8.56C4.62,10.53 3.1,14.14 4.77,19C4.88,19.33 5.24,19.5 5.57,19.39C5.89,19.28 6.07,18.92 5.95,18.6V18.6C4.41,14.13 5.78,11.2 7.8,9.5C9.77,7.89 13.25,7.5 15.84,9.1C17.11,9.9 18.1,11.28 18.6,12.64C19.11,14 19.08,15.32 18.67,15.94C18.25,16.59 17.4,16.83 16.65,16.64C15.9,16.45 15.29,15.91 15.26,14.77C15.23,13.06 13.89,12 12.5,11.84C11.16,11.68 9.61,12.4 9.21,14C8.45,16.92 10.36,21.07 14.78,22.45C15.11,22.55 15.46,22.37 15.57,22.04C15.67,21.71 15.5,21.35 15.15,21.25C11.32,20.06 9.87,16.43 10.42,14.29C10.66,13.33 11.5,13 12.38,13.08C13.25,13.18 14,13.7 14,14.79C14.05,16.43 15.12,17.54 16.34,17.85C17.56,18.16 18.97,17.77 19.72,16.62C20.5,15.45 20.37,13.8 19.78,12.21C19.18,10.61 18.07,9.03 16.5,8.04C14.96,7.08 13.19,6.7 11.5,6.82M11.86,9.25V9.26C10.08,9.32 8.3,10.24 7.28,12.18C5.96,14.67 6.56,17.21 7.44,19.04C8.33,20.88 9.54,22.1 9.54,22.1C9.78,22.35 10.17,22.35 10.42,22.11C10.67,21.87 10.67,21.5 10.43,21.23C10.43,21.23 9.36,20.13 8.57,18.5C7.78,16.87 7.3,14.81 8.38,12.77C9.5,10.67 11.5,10.16 13.26,10.67C15.04,11.19 16.53,12.74 16.5,15.03C16.46,15.38 16.71,15.68 17.06,15.7C17.4,15.73 17.7,15.47 17.73,15.06C17.79,12.2 15.87,10.13 13.61,9.47C13.04,9.31 12.45,9.23 11.86,9.25M12.08,14.25C11.73,14.26 11.46,14.55 11.47,14.89C11.47,14.89 11.5,16.37 12.31,17.8C13.15,19.23 14.93,20.59 18.03,20.3C18.37,20.28 18.64,20 18.62,19.64C18.6,19.29 18.3,19.03 17.91,19.06C15.19,19.31 14.04,18.28 13.39,17.17C12.74,16.07 12.72,14.88 12.72,14.88C12.72,14.53 12.44,14.25 12.08,14.25Z" />
</vector>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The Evolution X Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<corners android:radius="8dp"/>
<stroke android:width="2dp" android:color="?android:attr/textColorSecondary"/>
</shape>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The Evolution X Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center">
<ImageButton
android:id="@+id/fodiconone_button"
android:layout_width="@dimen/fod_picker_item_size"
android:layout_height="@dimen/fod_picker_item_size"
android:src="@drawable/fod_icon_default"
android:scaleType="centerInside"
android:padding="@dimen/fod_picker_item_padding"
android:layout_margin="@dimen/fod_picker_item_margin"
android:background="@drawable/fod_picker_item_background"/>
<ImageButton
android:id="@+id/fodicontwo_button"
android:layout_width="@dimen/fod_picker_item_size"
android:layout_height="@dimen/fod_picker_item_size"
android:src="@drawable/fod_icon_default_1"
android:scaleType="centerInside"
android:padding="@dimen/fod_picker_item_padding"
android:layout_margin="@dimen/fod_picker_item_margin"
android:background="@drawable/fod_picker_item_background"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center">
<ImageButton
android:id="@+id/fodiconthree_button"
android:layout_width="@dimen/fod_picker_item_size"
android:layout_height="@dimen/fod_picker_item_size"
android:src="@drawable/fod_icon_default_2"
android:scaleType="centerInside"
android:padding="@dimen/fod_picker_item_padding"
android:layout_margin="@dimen/fod_picker_item_margin"
android:background="@drawable/fod_picker_item_background"/>
<ImageButton
android:id="@+id/fodiconfour_button"
android:layout_width="@dimen/fod_picker_item_size"
android:layout_height="@dimen/fod_picker_item_size"
android:src="@drawable/fod_icon_default_3"
android:scaleType="centerInside"
android:padding="@dimen/fod_picker_item_padding"
android:layout_margin="@dimen/fod_picker_item_margin"
android:background="@drawable/fod_picker_item_background"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<color name="fod_item_background_stroke_color">#555555</color>
</resources>

View File

@@ -454,4 +454,8 @@
<!-- Heads up options -->
<string name="less_boring_heads_up_title">Ít nhàm chán heads up</string>
<string name="less_boring_heads_up_summary">Chỉ hiển thị các ứng dụng quay số, ứng dụng nhắn tin và báo thức</string>
<!-- FOD icon picker -->
<string name="fod_icon_picker_title">Chọn biểu tượng FOD</string>
<string name="fod_icon_picker_summary">Chọn biểu thượng yêu thích vân tay của bạn</string>
<string name="fod_icon_picker_footer">Để thêm biểu tượng của riêng bạn, hãy chọn biểu tượng trên cùng bên trái và sử dụng ứng dụng Tùy chỉnh OnePlus 6T FP để chọn biểu tượng bạn muốn.</string>
</resources>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2020 The CherishOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<color name="fod_item_background_stroke_color">#d6d6d6</color>
</resources>

View File

@@ -18,4 +18,8 @@
<resources>
<dimen name="picker_circle_preview_size">26dp</dimen>
<dimen name="alert_dialog_padding_material">20dp</dimen>
<dimen name="fod_picker_item_margin">20dp</dimen>
<dimen name="fod_picker_item_size">100dp</dimen>
<dimen name="fod_picker_item_padding">20dp</dimen>
</resources>

View File

@@ -510,5 +510,11 @@
<!-- Heads up options -->
<string name="less_boring_heads_up_title">Less boring heads up</string>
<string name="less_boring_heads_up_summary">Show heads up only for dialer, messaging and alarm app</string>
<!-- FOD icon picker -->
<string name="fod_title">FOD</string>
<string name="fod_icon_picker_title">FOD icon picker</string>
<string name="fod_icon_picker_summary">Choose your favorite fingerprint icon</string>
<string name="fod_icon_picker_footer">In order to add your own icon, select the top left icon and use the OnePlus 6T FP Customizer app to select the icon you want.</string>
</resources>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 CherishOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/fod_icon_picker_title">
<!-- Preview -->
<com.cherish.settings.preferences.FODIconPicker
android:key="fod_icon"
android:layout="@layout/fod_picker_preference"
android:selectable="false"/>
</PreferenceScreen>

View File

@@ -93,6 +93,21 @@
settings:interval="5"
android:defaultValue="100"/>
</PreferenceCategory>
<!-- FOD -->
<PreferenceCategory
android:key="fod"
android:title="@string/fod_title">
<!-- FOD icon picker -->
<Preference
android:key="fod_icon_picker_category"
android:icon="@drawable/ic_fingerprint"
android:title="@string/fod_icon_picker_title"
android:summary="@string/fod_icon_picker_summary"
android:fragment="com.cherish.settings.fragments.FODIconPickerFragment" />
</PreferenceCategory>
<SwitchPreference
android:key="fingerprint_success_vib"
android:icon="@drawable/ic_fingerprint"

View File

@@ -17,4 +17,4 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
</PreferenceScreen>
</PreferenceScreen>

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2020 The CherishOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments;
import android.content.res.Resources;
import android.os.Bundle;
import android.provider.Settings;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
public class FODIconPickerFragment extends SettingsPreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.cherish_settings_fod_picker);
getActivity().getActionBar().setTitle(R.string.fod_icon_picker_title);
mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.fod_icon_picker_footer);
}
@Override
public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
}
}

View File

@@ -44,9 +44,11 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener {
private static final String FINGERPRINT_VIB = "fingerprint_success_vib";
private static final String FOD_ICON_PICKER_CATEGORY = "fod_icon_picker_category";
private FingerprintManager mFingerprintManager;
private SwitchPreference mFingerprintVib;
private Preference mFODIconPicker;
@Override
public void onCreate(Bundle icicle) {
@@ -56,6 +58,12 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
ContentResolver resolver = getActivity().getContentResolver();
final PreferenceScreen prefScreen = getPreferenceScreen();
Resources resources = getResources();
mFODIconPicker = (Preference) findPreference(FOD_ICON_PICKER_CATEGORY);
if (mFODIconPicker != null
&& !getResources().getBoolean(com.android.internal.R.bool.config_supportsInDisplayFingerprint)) {
prefScreen.removePreference(mFODIconPicker);
}
mFingerprintManager = (FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
mFingerprintVib = (SwitchPreference) findPreference(FINGERPRINT_VIB);

View File

@@ -0,0 +1,151 @@
/*
* Copyright (C) 2020 CherishOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.preferences;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import androidx.core.content.res.TypedArrayUtils;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import com.android.settings.R;
import com.android.settingslib.Utils;
import com.android.settingslib.widget.LayoutPreference;
public class FODIconPicker extends LayoutPreference {
private boolean mAllowDividerAbove;
private boolean mAllowDividerBelow;
private View mRootView;
private static ImageButton ButtonOne;
private static ImageButton ButtonTwo;
private static ImageButton ButtonThree;
private static ImageButton ButtonFour;
private static final String TAG = "FODIconPicker";
public FODIconPicker(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, 0 /* defStyleAttr */);
}
public FODIconPicker(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs, defStyleAttr);
}
private void init(Context context, AttributeSet attrs, int defStyleAttr) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Preference);
mAllowDividerAbove = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerAbove,
R.styleable.Preference_allowDividerAbove, false);
mAllowDividerBelow = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerBelow,
R.styleable.Preference_allowDividerBelow, false);
a.recycle();
a = context.obtainStyledAttributes(
attrs, R.styleable.Preference, defStyleAttr, 0);
int layoutResource = a.getResourceId(R.styleable.Preference_android_layout, 0);
if (layoutResource == 0) {
throw new IllegalArgumentException("LayoutPreference requires a layout to be defined");
}
a.recycle();
// Need to create view now so that findViewById can be called immediately.
final View view = LayoutInflater.from(getContext())
.inflate(layoutResource, null, false);
setView(view, context);
}
private void setView(View view, Context context) {
setLayoutResource(R.layout.layout_preference_frame);
mRootView = view;
setShouldDisableView(false);
ButtonOne = findViewById(R.id.fodiconone_button);
ButtonTwo = findViewById(R.id.fodicontwo_button);
ButtonThree = findViewById(R.id.fodiconthree_button);
ButtonFour = findViewById(R.id.fodiconfour_button);
int defaultfodicon = Settings.System.getInt(
context.getContentResolver(), Settings.System.FOD_ICON, 0);
if (defaultfodicon==0) {
updateHighlightedItem(ButtonOne, context);
} else if (defaultfodicon==1) {
updateHighlightedItem(ButtonTwo, context);
} else if (defaultfodicon==2) {
updateHighlightedItem(ButtonThree, context);
} else if (defaultfodicon==3) {
updateHighlightedItem(ButtonFour, context);
}
ButtonOne.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(0, context);
updateHighlightedItem(ButtonOne, context);
}
});
ButtonTwo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(1, context);
updateHighlightedItem(ButtonTwo, context);
}
});
ButtonThree.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(2, context);
updateHighlightedItem(ButtonThree, context);
}
});
ButtonFour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(3, context);
updateHighlightedItem(ButtonFour, context);
}
});
}
private void updateSettings(int fodicon, Context context) {
Settings.System.putInt(context.getContentResolver(), Settings.System.FOD_ICON, fodicon);
}
private void updateHighlightedItem(ImageButton activebutton, Context context) {
int defaultcolor = context.getResources().getColor(R.color.fod_item_background_stroke_color);
ColorStateList defaulttint = ColorStateList.valueOf(defaultcolor);
ButtonOne.setBackgroundTintList(defaulttint);
ButtonTwo.setBackgroundTintList(defaulttint);
ButtonThree.setBackgroundTintList(defaulttint);
ButtonFour.setBackgroundTintList(defaulttint);
activebutton.setBackgroundTintList(Utils.getColorAttr(getContext(), android.R.attr.colorAccent));
}
}