From 30231c7deb2683fa39fe0175d71257b705846097 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Tue, 8 Jan 2019 16:14:01 +0100 Subject: [PATCH] Cleanup --- app/sampledata/features.json | 4 +++- .../highlightlist/HighlightListFragment.kt | 4 ++-- .../util/helper/CharSequenceHelper.kt | 6 +++--- .../util/lists/AsyncListDiffer.kt | 2 +- .../util/ui/ColorChooserDialog.java | 18 +++++++---------- .../main/res/layout/preferences_license.xml | 4 +--- .../res/layout/widget_missing_feature.xml | 4 ++-- app/src/main/res/raw/license_apache_2.html | 2 +- app/src/main/res/raw/license_cc_0.html | 2 +- .../main/res/raw/license_cc_by_sa_3_0.html | 2 +- app/src/main/res/raw/license_dracula.html | 2 +- app/src/main/res/raw/license_emojijava.html | 2 +- app/src/main/res/raw/license_gpl_v3.html | 2 +- app/src/main/res/raw/license_gruvbox.html | 2 +- .../res/raw/license_materialdesignicons.html | 6 ++++-- .../main/res/raw/license_materialdialogs.html | 2 +- app/src/main/res/raw/license_solarized.html | 2 +- app/src/main/res/raw/license_threetenbp.html | 2 +- .../quassel/syncables/IgnoreListManager.kt | 4 ++-- .../libquassel/session/ProtocolHandler.kt | 1 - .../libquassel/util/ExpressionMatch.kt | 7 +++++++ lint.xml | 3 --- .../malheur/collectors/DeviceCollector.kt | 6 ------ .../de/kuschku/malheur/data/DeviceInfo.kt | 1 - .../util/helper/ObservableHelper.kt | 20 +++++++------------ 25 files changed, 49 insertions(+), 61 deletions(-) diff --git a/app/sampledata/features.json b/app/sampledata/features.json index febda7e54..9b813e3c8 100644 --- a/app/sampledata/features.json +++ b/app/sampledata/features.json @@ -1,4 +1,5 @@ -[ +{ + "data": [ { "name": "SynchronizedMarkerLine", "description": "Required for synchronizing the last position in channels" @@ -60,3 +61,4 @@ "description": "Required for receiving past notifications after connecting" } ] +} diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightListFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightListFragment.kt index a804785d7..ab8a624de 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightListFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/highlightlist/HighlightListFragment.kt @@ -135,8 +135,8 @@ class HighlightListFragment : SettingsFragment(), SettingsFragment.Savable, if (this.ruleManager == null) { this.ruleManager = Pair(it, it.copy()) this.ruleManager?.let { (_, data) -> - rulesAdapter.list = data.highlightRuleList().filter { it.isInverse == false } - ignoreRulesAdapter.list = data.highlightRuleList().filter { it.isInverse == true } + rulesAdapter.list = data.highlightRuleList().filter { !it.isInverse } + ignoreRulesAdapter.list = data.highlightRuleList().filter { it.isInverse } highlightNickType.setSelection(highlightNickTypeAdapter.indexOf(data.highlightNick()) ?: 0) isCaseSensitive.isChecked = data.nicksCaseSensitive() diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/helper/CharSequenceHelper.kt b/app/src/main/java/de/kuschku/quasseldroid/util/helper/CharSequenceHelper.kt index a6c68d6d8..ed275a83a 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/helper/CharSequenceHelper.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/helper/CharSequenceHelper.kt @@ -130,15 +130,15 @@ private fun CharSequence.findAnyOf(strings: Collection<String>, startIndex: Int, private fun CharSequence.rangesDelimitedBy(delimiters: Array<out String>, startIndex: Int = 0, ignoreCase: Boolean = false, limit: Int = 0): Sequence<IntRange> { - require(limit >= 0, { "Limit must be non-negative, but was $limit." }) + require(limit >= 0) { "Limit must be non-negative, but was $limit." } val delimitersList = delimiters.asList() return DelimitedRangesSequence( - this, startIndex, limit, { startIndex -> + this, startIndex, limit) { startIndex -> findAnyOf( delimitersList, startIndex, ignoreCase = ignoreCase, last = false )?.let { it.first to it.second.length } - }) + } } fun CharSequence.splitToSequence(vararg delimiters: String, ignoreCase: Boolean = false, diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/lists/AsyncListDiffer.kt b/app/src/main/java/de/kuschku/quasseldroid/util/lists/AsyncListDiffer.kt index fd6a15b7e..0bd12a412 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/lists/AsyncListDiffer.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/lists/AsyncListDiffer.kt @@ -28,7 +28,7 @@ import java.util.* * * * It can be connected to a - * [RecyclerView.Adapter][android.support.v7.widget.RecyclerView.Adapter], and will signal the + * [RecyclerView.Adapter][androidx.recyclerview.widget.RecyclerView.Adapter], and will signal the * adapter of changes between sumbitted lists. * * diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/ui/ColorChooserDialog.java b/app/src/main/java/de/kuschku/quasseldroid/util/ui/ColorChooserDialog.java index c6e1b68bb..28d6ac96b 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/ui/ColorChooserDialog.java +++ b/app/src/main/java/de/kuschku/quasseldroid/util/ui/ColorChooserDialog.java @@ -19,7 +19,6 @@ package de.kuschku.quasseldroid.util.ui; -import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; @@ -466,8 +465,6 @@ public class ColorChooserDialog extends DialogFragment customColorHex.addTextChangedListener(customColorTextWatcher); customColorRgbListener = new SeekBar.OnSeekBarChangeListener() { - - @SuppressLint("DefaultLocale") @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { @@ -478,20 +475,20 @@ public class ColorChooserDialog extends DialogFragment customSeekR.getProgress(), customSeekG.getProgress(), customSeekB.getProgress()); - customColorHex.setText(String.format("%08X", color)); + customColorHex.setText(String.format(Locale.US, "%08X", color)); } else { int color = Color.rgb( customSeekR.getProgress(), customSeekG.getProgress(), customSeekB.getProgress()); - customColorHex.setText(String.format("%06X", 0xFFFFFF & color)); + customColorHex.setText(String.format(Locale.US, "%06X", 0xFFFFFF & color)); } } - customSeekAValue.setText(String.format("%d", customSeekA.getProgress())); - customSeekRValue.setText(String.format("%d", customSeekR.getProgress())); - customSeekGValue.setText(String.format("%d", customSeekG.getProgress())); - customSeekBValue.setText(String.format("%d", customSeekB.getProgress())); + customSeekAValue.setText(String.format(Locale.US, "%d", customSeekA.getProgress())); + customSeekRValue.setText(String.format(Locale.US, "%d", customSeekR.getProgress())); + customSeekGValue.setText(String.format(Locale.US, "%d", customSeekG.getProgress())); + customSeekBValue.setText(String.format(Locale.US, "%d", customSeekB.getProgress())); } @Override @@ -785,7 +782,6 @@ public class ColorChooserDialog extends DialogFragment return position; } - @SuppressLint("DefaultLocale") @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { @@ -800,7 +796,7 @@ public class ColorChooserDialog extends DialogFragment } else { child.setSelected(topIndex() == position); } - child.setTag(String.format("%d:%d", position, color)); + child.setTag(String.format(Locale.US, "%d:%d", position, color)); child.setOnClickListener(ColorChooserDialog.this); child.setOnLongClickListener(ColorChooserDialog.this); return convertView; diff --git a/app/src/main/res/layout/preferences_license.xml b/app/src/main/res/layout/preferences_license.xml index 77850080a..a69fa831f 100644 --- a/app/src/main/res/layout/preferences_license.xml +++ b/app/src/main/res/layout/preferences_license.xml @@ -18,7 +18,6 @@ --> <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"> @@ -28,6 +27,5 @@ style="@style/Widget.RtlConformTextView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:padding="16dp" - tools:text="@string/license_apache_2" /> + android:padding="16dp" /> </androidx.core.widget.NestedScrollView> diff --git a/app/src/main/res/layout/widget_missing_feature.xml b/app/src/main/res/layout/widget_missing_feature.xml index c7eae4a51..2531fff29 100644 --- a/app/src/main/res/layout/widget_missing_feature.xml +++ b/app/src/main/res/layout/widget_missing_feature.xml @@ -45,7 +45,7 @@ android:layout_height="wrap_content" android:textColor="?colorTextPrimary" android:textSize="16sp" - tools:text="@sample/features.json/name" /> + tools:text="@sample/features.json/data/name" /> <TextView android:id="@+id/description" @@ -54,6 +54,6 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?colorTextSecondary" - tools:text="@sample/features.json/description" /> + tools:text="@sample/features.json/data/description" /> </LinearLayout> </LinearLayout> diff --git a/app/src/main/res/raw/license_apache_2.html b/app/src/main/res/raw/license_apache_2.html index 6cc1dc53c..32dfcadf4 100644 --- a/app/src/main/res/raw/license_apache_2.html +++ b/app/src/main/res/raw/license_apache_2.html @@ -23,4 +23,4 @@ <p><strong>6. Trademarks</strong>. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.</p> <p><strong>7. Disclaimer of Warranty</strong>. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.</p> <p><strong>8. Limitation of Liability</strong>. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.</p> -<p><strong>9. Accepting Warranty or Additional Liability</strong>. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.</p> \ No newline at end of file +<p><strong>9. Accepting Warranty or Additional Liability</strong>. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.</p> diff --git a/app/src/main/res/raw/license_cc_0.html b/app/src/main/res/raw/license_cc_0.html index 04dd94059..cc9bfdd98 100644 --- a/app/src/main/res/raw/license_cc_0.html +++ b/app/src/main/res/raw/license_cc_0.html @@ -18,4 +18,4 @@ <p>a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.</p> <p>b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.</p> <p>c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.</p> -<p>d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.</p> \ No newline at end of file +<p>d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.</p> diff --git a/app/src/main/res/raw/license_cc_by_sa_3_0.html b/app/src/main/res/raw/license_cc_by_sa_3_0.html index e39fc6a3d..17d58c1e1 100644 --- a/app/src/main/res/raw/license_cc_by_sa_3_0.html +++ b/app/src/main/res/raw/license_cc_by_sa_3_0.html @@ -43,4 +43,4 @@ <p>c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</p> <p>d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.</p> <p>e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.</p> -<p>f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.</p> \ No newline at end of file +<p>f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.</p> diff --git a/app/src/main/res/raw/license_dracula.html b/app/src/main/res/raw/license_dracula.html index 8a40d5862..298a00ffe 100644 --- a/app/src/main/res/raw/license_dracula.html +++ b/app/src/main/res/raw/license_dracula.html @@ -2,4 +2,4 @@ <p>Copyright (c) 2016 Dracula Theme</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> \ No newline at end of file +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_emojijava.html b/app/src/main/res/raw/license_emojijava.html index e3f0b3317..ca0bc1d94 100644 --- a/app/src/main/res/raw/license_emojijava.html +++ b/app/src/main/res/raw/license_emojijava.html @@ -2,4 +2,4 @@ <p>Copyright (c) 2014-present Vincent DURMONT vdurmont@gmail.com</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> \ No newline at end of file +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_gpl_v3.html b/app/src/main/res/raw/license_gpl_v3.html index 1039ed5fe..a211d3260 100644 --- a/app/src/main/res/raw/license_gpl_v3.html +++ b/app/src/main/res/raw/license_gpl_v3.html @@ -107,4 +107,4 @@ <h4>16. Limitation of Liability.</h4> <p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p> <h4>17. Interpretation of Sections 15 and 16.</h4> -<p>If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.</p> \ No newline at end of file +<p>If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.</p> diff --git a/app/src/main/res/raw/license_gruvbox.html b/app/src/main/res/raw/license_gruvbox.html index 01548e3c2..a45fc6ec2 100644 --- a/app/src/main/res/raw/license_gruvbox.html +++ b/app/src/main/res/raw/license_gruvbox.html @@ -1,4 +1,4 @@ <h2>The MIT License (MIT)</h2> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> \ No newline at end of file +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_materialdesignicons.html b/app/src/main/res/raw/license_materialdesignicons.html index 13ad1c871..80060eb60 100644 --- a/app/src/main/res/raw/license_materialdesignicons.html +++ b/app/src/main/res/raw/license_materialdesignicons.html @@ -1,4 +1,6 @@ -<p>Copyright (c) 2014, Austin Andrews (<a href="http://materialdesignicons.com/">http://materialdesignicons.com/<a/>), with Reserved Font Name Material Design Icons.</p> +<p>Copyright (c) 2014, Austin Andrews (<a href="http://materialdesignicons.com/"> + http://materialdesignicons.com/</a>), with Reserved Font Name Material Design Icons. +</p> <p>Copyright (c) 2014, Google (<a href="http://www.google.com/design/">http://www.google.com/design/</a>) uses the license at <a href="https://github.com/google/material-design-icons/blob/master/LICENSE">https://github.com/google/material-design-icons/blob/master/LICENSE</a></p> <p>This Font Software is licensed under the SIL Open Font License, Version 1.1.</p> <p>This license is copied below, and is also available with a FAQ at: <a href="http://scripts.sil.org/OFL">http://scripts.sil.org/OFL</a></p> @@ -23,4 +25,4 @@ <h3>TERMINATION</h3> <p>This license becomes null and void if any of the above conditions are not met.</p> <h3>DISCLAIMER</h3> -<p>THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.</p> \ No newline at end of file +<p>THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_materialdialogs.html b/app/src/main/res/raw/license_materialdialogs.html index b05b50473..d5ac4c91e 100644 --- a/app/src/main/res/raw/license_materialdialogs.html +++ b/app/src/main/res/raw/license_materialdialogs.html @@ -2,4 +2,4 @@ <p>Copyright (c) 2014-2016 Aidan Michael Follestad</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> \ No newline at end of file +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_solarized.html b/app/src/main/res/raw/license_solarized.html index c66b8ff6a..8af1a1293 100644 --- a/app/src/main/res/raw/license_solarized.html +++ b/app/src/main/res/raw/license_solarized.html @@ -2,4 +2,4 @@ <p>Copyright (c) 2011 Ethan Schoonover</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> \ No newline at end of file +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> diff --git a/app/src/main/res/raw/license_threetenbp.html b/app/src/main/res/raw/license_threetenbp.html index 2b1621d6d..1dc029c55 100644 --- a/app/src/main/res/raw/license_threetenbp.html +++ b/app/src/main/res/raw/license_threetenbp.html @@ -5,4 +5,4 @@ <p>1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</p> <p>2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</p> <p>3. Neither the name of JSR-310 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</p> -<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p> \ No newline at end of file +<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p> diff --git a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IgnoreListManager.kt b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IgnoreListManager.kt index 1c1dcb05b..1c21378bf 100644 --- a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IgnoreListManager.kt +++ b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IgnoreListManager.kt @@ -85,7 +85,7 @@ class IgnoreListManager constructor( scopeList.size != size || scopeRuleList.size != size || isActiveList.size != size) return - _ignoreList = List(size, { + _ignoreList = List(size) { IgnoreListItem( type = ignoreTypeList[it].value(0), ignoreRule = ignoreRuleList[it] ?: "", @@ -95,7 +95,7 @@ class IgnoreListManager constructor( scopeRule = scopeRuleList[it] ?: "", isActive = isActiveList[it].value(false) ) - }) + } } override fun addIgnoreListItem(type: Int, ignoreRule: String, isRegEx: Boolean, strictness: Int, diff --git a/lib/src/main/java/de/kuschku/libquassel/session/ProtocolHandler.kt b/lib/src/main/java/de/kuschku/libquassel/session/ProtocolHandler.kt index 8775eb8f1..57f99ae94 100644 --- a/lib/src/main/java/de/kuschku/libquassel/session/ProtocolHandler.kt +++ b/lib/src/main/java/de/kuschku/libquassel/session/ProtocolHandler.kt @@ -31,7 +31,6 @@ import de.kuschku.libquassel.util.compatibility.LoggingHandler.Companion.log import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.DEBUG import java.io.Closeable -@Suppress("LeakingThis") abstract class ProtocolHandler( private val exceptionHandler: (Throwable) -> Unit ) : SignalProxy, AuthHandler, Closeable { diff --git a/lib/src/main/java/de/kuschku/libquassel/util/ExpressionMatch.kt b/lib/src/main/java/de/kuschku/libquassel/util/ExpressionMatch.kt index b488df311..9b705d094 100644 --- a/lib/src/main/java/de/kuschku/libquassel/util/ExpressionMatch.kt +++ b/lib/src/main/java/de/kuschku/libquassel/util/ExpressionMatch.kt @@ -163,6 +163,13 @@ class ExpressionMatch : Serializable { _sourceCaseSensitive == other._sourceCaseSensitive } + override fun hashCode(): Int { + var result = _sourceExpression.hashCode() + result = 31 * result + _sourceMode.hashCode() + result = 31 * result + _sourceCaseSensitive.hashCode() + return result + } + private fun cacheRegEx() { _matchRegExActive = false _matchInvertRegExActive = false diff --git a/lint.xml b/lint.xml index 089fa173d..c9a8cdd98 100644 --- a/lint.xml +++ b/lint.xml @@ -28,9 +28,6 @@ <issue id="UnusedResources" severity="ignore" /> <issue id="ObsoleteLintCustomCheck" severity="ignore" /> - <!-- Because otherwise I can’t use the legacy icon in the settings --> - <issue id="IconDuplicates" severity="ignore" /> - <!-- Because this doesn’t work when using splash themes --> <issue id="Overdraw" severity="ignore" /> diff --git a/malheur/src/main/java/de/kuschku/malheur/collectors/DeviceCollector.kt b/malheur/src/main/java/de/kuschku/malheur/collectors/DeviceCollector.kt index d83e86eb6..556aedf42 100644 --- a/malheur/src/main/java/de/kuschku/malheur/collectors/DeviceCollector.kt +++ b/malheur/src/main/java/de/kuschku/malheur/collectors/DeviceCollector.kt @@ -19,10 +19,8 @@ package de.kuschku.malheur.collectors -import android.annotation.SuppressLint import android.app.Application import android.os.Build -import android.provider.Settings import de.kuschku.malheur.CrashContext import de.kuschku.malheur.config.DeviceConfig import de.kuschku.malheur.data.DeviceInfo @@ -32,7 +30,6 @@ import java.io.File class DeviceCollector(private val application: Application) : Collector<DeviceInfo, DeviceConfig> { private val displayCollector = DisplayCollector(application) - @SuppressLint("HardwareIds") override fun collect(context: CrashContext, config: DeviceConfig): DeviceInfo { return DeviceInfo( build = collectIf(config.build) { @@ -41,9 +38,6 @@ class DeviceCollector(private val application: Application) : Collector<DeviceIn version = collectIf(config.version) { reflectionCollectConstants(Build.VERSION::class.java) }, - installationId = collectIf(config.installationId) { - Settings.Secure.getString(application.contentResolver, Settings.Secure.ANDROID_ID) - }, processor = collectIf(config.processor) { readProcInfo() }, diff --git a/malheur/src/main/java/de/kuschku/malheur/data/DeviceInfo.kt b/malheur/src/main/java/de/kuschku/malheur/data/DeviceInfo.kt index 97c21db03..51a8a9d3f 100644 --- a/malheur/src/main/java/de/kuschku/malheur/data/DeviceInfo.kt +++ b/malheur/src/main/java/de/kuschku/malheur/data/DeviceInfo.kt @@ -22,7 +22,6 @@ package de.kuschku.malheur.data data class DeviceInfo( val build: Map<String, Any?>?, val version: Map<String, Any?>?, - val installationId: String?, val processor: String?, val display: DisplayInfo? ) diff --git a/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/ObservableHelper.kt b/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/ObservableHelper.kt index 4b87953bd..c6a3e36d5 100644 --- a/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/ObservableHelper.kt +++ b/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/ObservableHelper.kt @@ -47,33 +47,27 @@ inline fun <T> Flowable<T>.toLiveData( inline fun <reified A, B> combineLatest( a: ObservableSource<A>, b: ObservableSource<B> -): Observable<Pair<A, B>> = Observable.combineLatest(a, b, BiFunction(::Pair)) +): Observable<Pair<A, B>> = + Observable.combineLatest(a, b, BiFunction(::Pair)) inline fun <reified A, B, C> combineLatest( a: ObservableSource<A>, b: ObservableSource<B>, c: ObservableSource<C> -): Observable<Triple<A, B, C>> = Observable.combineLatest( - listOf(a, b, c), - { (t0, t1, t2) -> +): Observable<Triple<A, B, C>> = + Observable.combineLatest(listOf(a, b, c)) { (t0, t1, t2) -> Triple(t0, t1, t2) as Triple<A, B, C> } -) inline fun <reified A, B, C, D> combineLatest( a: ObservableSource<A>, b: ObservableSource<B>, c: ObservableSource<C>, d: ObservableSource<D> -): Observable<Tuple4<A, B, C, D>> = Observable.combineLatest( - listOf(a, b, c, d), - { (t0, t1, t2, t3) -> - Tuple4(t0, - t1, - t2, - t3) as Tuple4<A, B, C, D> +): Observable<Tuple4<A, B, C, D>> = + Observable.combineLatest(listOf(a, b, c, d)) { (t0, t1, t2, t3) -> + Tuple4(t0, t1, t2, t3) as Tuple4<A, B, C, D> } -) inline fun <reified T> combineLatest(sources: Iterable<ObservableSource<out T>?>) = Observable.combineLatest(sources) { t -> t.toList() as List<T> } -- GitLab