Skip to content
Snippets Groups Projects
Verified Commit 30231c7d authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Cleanup

parent 5901d33b
Branches
Tags
No related merge requests found
Showing
with 35 additions and 38 deletions
[ {
"data": [
{ {
"name": "SynchronizedMarkerLine", "name": "SynchronizedMarkerLine",
"description": "Required for synchronizing the last position in channels" "description": "Required for synchronizing the last position in channels"
...@@ -60,3 +61,4 @@ ...@@ -60,3 +61,4 @@
"description": "Required for receiving past notifications after connecting" "description": "Required for receiving past notifications after connecting"
} }
] ]
}
...@@ -135,8 +135,8 @@ class HighlightListFragment : SettingsFragment(), SettingsFragment.Savable, ...@@ -135,8 +135,8 @@ class HighlightListFragment : SettingsFragment(), SettingsFragment.Savable,
if (this.ruleManager == null) { if (this.ruleManager == null) {
this.ruleManager = Pair(it, it.copy()) this.ruleManager = Pair(it, it.copy())
this.ruleManager?.let { (_, data) -> this.ruleManager?.let { (_, data) ->
rulesAdapter.list = data.highlightRuleList().filter { it.isInverse == false } rulesAdapter.list = data.highlightRuleList().filter { !it.isInverse }
ignoreRulesAdapter.list = data.highlightRuleList().filter { it.isInverse == true } ignoreRulesAdapter.list = data.highlightRuleList().filter { it.isInverse }
highlightNickType.setSelection(highlightNickTypeAdapter.indexOf(data.highlightNick()) highlightNickType.setSelection(highlightNickTypeAdapter.indexOf(data.highlightNick())
?: 0) ?: 0)
isCaseSensitive.isChecked = data.nicksCaseSensitive() isCaseSensitive.isChecked = data.nicksCaseSensitive()
......
...@@ -130,15 +130,15 @@ private fun CharSequence.findAnyOf(strings: Collection<String>, startIndex: Int, ...@@ -130,15 +130,15 @@ private fun CharSequence.findAnyOf(strings: Collection<String>, startIndex: Int,
private fun CharSequence.rangesDelimitedBy(delimiters: Array<out String>, startIndex: Int = 0, private fun CharSequence.rangesDelimitedBy(delimiters: Array<out String>, startIndex: Int = 0,
ignoreCase: Boolean = false, ignoreCase: Boolean = false,
limit: Int = 0): Sequence<IntRange> { 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() val delimitersList = delimiters.asList()
return DelimitedRangesSequence( return DelimitedRangesSequence(
this, startIndex, limit, { startIndex -> this, startIndex, limit) { startIndex ->
findAnyOf( findAnyOf(
delimitersList, startIndex, ignoreCase = ignoreCase, last = false delimitersList, startIndex, ignoreCase = ignoreCase, last = false
)?.let { it.first to it.second.length } )?.let { it.first to it.second.length }
}) }
} }
fun CharSequence.splitToSequence(vararg delimiters: String, ignoreCase: Boolean = false, fun CharSequence.splitToSequence(vararg delimiters: String, ignoreCase: Boolean = false,
......
...@@ -28,7 +28,7 @@ import java.util.* ...@@ -28,7 +28,7 @@ import java.util.*
* *
* *
* It can be connected to a * 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. * adapter of changes between sumbitted lists.
* *
* *
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
package de.kuschku.quasseldroid.util.ui; package de.kuschku.quasseldroid.util.ui;
import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -466,8 +465,6 @@ public class ColorChooserDialog extends DialogFragment ...@@ -466,8 +465,6 @@ public class ColorChooserDialog extends DialogFragment
customColorHex.addTextChangedListener(customColorTextWatcher); customColorHex.addTextChangedListener(customColorTextWatcher);
customColorRgbListener = customColorRgbListener =
new SeekBar.OnSeekBarChangeListener() { new SeekBar.OnSeekBarChangeListener() {
@SuppressLint("DefaultLocale")
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) { if (fromUser) {
...@@ -478,20 +475,20 @@ public class ColorChooserDialog extends DialogFragment ...@@ -478,20 +475,20 @@ public class ColorChooserDialog extends DialogFragment
customSeekR.getProgress(), customSeekR.getProgress(),
customSeekG.getProgress(), customSeekG.getProgress(),
customSeekB.getProgress()); customSeekB.getProgress());
customColorHex.setText(String.format("%08X", color)); customColorHex.setText(String.format(Locale.US, "%08X", color));
} else { } else {
int color = int color =
Color.rgb( Color.rgb(
customSeekR.getProgress(), customSeekR.getProgress(),
customSeekG.getProgress(), customSeekG.getProgress(),
customSeekB.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())); customSeekAValue.setText(String.format(Locale.US, "%d", customSeekA.getProgress()));
customSeekRValue.setText(String.format("%d", customSeekR.getProgress())); customSeekRValue.setText(String.format(Locale.US, "%d", customSeekR.getProgress()));
customSeekGValue.setText(String.format("%d", customSeekG.getProgress())); customSeekGValue.setText(String.format(Locale.US, "%d", customSeekG.getProgress()));
customSeekBValue.setText(String.format("%d", customSeekB.getProgress())); customSeekBValue.setText(String.format(Locale.US, "%d", customSeekB.getProgress()));
} }
@Override @Override
...@@ -785,7 +782,6 @@ public class ColorChooserDialog extends DialogFragment ...@@ -785,7 +782,6 @@ public class ColorChooserDialog extends DialogFragment
return position; return position;
} }
@SuppressLint("DefaultLocale")
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) { if (convertView == null) {
...@@ -800,7 +796,7 @@ public class ColorChooserDialog extends DialogFragment ...@@ -800,7 +796,7 @@ public class ColorChooserDialog extends DialogFragment
} else { } else {
child.setSelected(topIndex() == position); 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.setOnClickListener(ColorChooserDialog.this);
child.setOnLongClickListener(ColorChooserDialog.this); child.setOnLongClickListener(ColorChooserDialog.this);
return convertView; return convertView;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
--> -->
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scrollbars="vertical"> android:scrollbars="vertical">
...@@ -28,6 +27,5 @@ ...@@ -28,6 +27,5 @@
style="@style/Widget.RtlConformTextView" style="@style/Widget.RtlConformTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="16dp" />
tools:text="@string/license_apache_2" />
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?colorTextPrimary" android:textColor="?colorTextPrimary"
android:textSize="16sp" android:textSize="16sp"
tools:text="@sample/features.json/name" /> tools:text="@sample/features.json/data/name" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
...@@ -54,6 +54,6 @@ ...@@ -54,6 +54,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?colorTextSecondary" android:textColor="?colorTextSecondary"
tools:text="@sample/features.json/description" /> tools:text="@sample/features.json/data/description" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<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>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 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> <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>
......
...@@ -85,7 +85,7 @@ class IgnoreListManager constructor( ...@@ -85,7 +85,7 @@ class IgnoreListManager constructor(
scopeList.size != size || scopeRuleList.size != size || isActiveList.size != size) scopeList.size != size || scopeRuleList.size != size || isActiveList.size != size)
return return
_ignoreList = List(size, { _ignoreList = List(size) {
IgnoreListItem( IgnoreListItem(
type = ignoreTypeList[it].value(0), type = ignoreTypeList[it].value(0),
ignoreRule = ignoreRuleList[it] ?: "", ignoreRule = ignoreRuleList[it] ?: "",
...@@ -95,7 +95,7 @@ class IgnoreListManager constructor( ...@@ -95,7 +95,7 @@ class IgnoreListManager constructor(
scopeRule = scopeRuleList[it] ?: "", scopeRule = scopeRuleList[it] ?: "",
isActive = isActiveList[it].value(false) isActive = isActiveList[it].value(false)
) )
}) }
} }
override fun addIgnoreListItem(type: Int, ignoreRule: String, isRegEx: Boolean, strictness: Int, override fun addIgnoreListItem(type: Int, ignoreRule: String, isRegEx: Boolean, strictness: Int,
......
...@@ -31,7 +31,6 @@ import de.kuschku.libquassel.util.compatibility.LoggingHandler.Companion.log ...@@ -31,7 +31,6 @@ import de.kuschku.libquassel.util.compatibility.LoggingHandler.Companion.log
import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.DEBUG import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.DEBUG
import java.io.Closeable import java.io.Closeable
@Suppress("LeakingThis")
abstract class ProtocolHandler( abstract class ProtocolHandler(
private val exceptionHandler: (Throwable) -> Unit private val exceptionHandler: (Throwable) -> Unit
) : SignalProxy, AuthHandler, Closeable { ) : SignalProxy, AuthHandler, Closeable {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment