Skip to content

Commit

Permalink
Feature/lint fixes (#18)
Browse files Browse the repository at this point in the history
* Disable backup

* Surpress warnings in these un-compiled files

* Remove unused resources

* Fix spelling
  • Loading branch information
westonal authored Feb 9, 2018
1 parent 0f663d9 commit 3723760
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 33 deletions.
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.github.novacrypto.novawallet">

<application
android:name=".WalletApplication"
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal class NumericTree(private val depth: Int = 0) {
}

fun save(word: String) {
internalSave(numberize(word), word)
internalSave(word.toKeypadDigits(), word)
}

private fun internalSave(key: String, wholeWord: String) {
Expand Down Expand Up @@ -78,8 +78,8 @@ internal class NumericTree(private val depth: Int = 0) {
private set
}

internal fun numberize(word: String): String {
val wordNormalized = Normalizer.normalize(word, Normalizer.Form.NFD)
internal fun String.toKeypadDigits(): String {
val wordNormalized = Normalizer.normalize(this, Normalizer.Form.NFD)
val sb = StringBuilder()
for (c in wordNormalized.toCharArray()) {
when (c) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private fun givenPartialMnemonicInput(mnemonic: String, additional: String = "")
private fun numberizeAndAccept(englishString: String): String {
val root = English.INSTANCE.toNumericTree()
return englishString.split(" ")
.map { it to numberize(it) }
.map { it to it.toKeypadDigits() }
.joinToString(",") {
it.second + ('a' + root.find(it.second).top3.indexOf(it.first))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class NumericTreeTests {
private fun findAllWordsAndNoMoreThan3IdenticalSequences(wordList: WordList) {
val root = wordList.toNumericTree()
for (word in wordList.toIterable()) {
val key = numberize(word)
val key = word.toKeypadDigits()
val node = root.find(key)
node.words `should contain` word
node.exactMatches `should contain` word
Expand Down
1 change: 1 addition & 0 deletions ideaShared/copyright/GNU_GPLv3.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--suppress XmlUnboundNsPrefix -->
<component name="CopyrightManager">
<copyright>
<option name="notice" value=" NovaWallet, Cryptocurrency Wallet for Android&#10; Copyright (C) 2018 Alan Evans, NovaCrypto&#10;&#10; This program is free software: you can redistribute it and/or modify&#10; it under the terms of the GNU General Public License as published by&#10; the Free Software Foundation, either version 3 of the License, or&#10; (at your option) any later version.&#10;&#10; This program is distributed in the hope that it will be useful,&#10; but WITHOUT ANY WARRANTY; without even the implied warranty of&#10; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10; GNU General Public License for more details.&#10;&#10; You should have received a copy of the GNU General Public License&#10; along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.&#10;&#10; Original source: https://github.com/NovaCrypto/NovaWallet&#10; You can contact the authors via github issues." />
Expand Down
1 change: 1 addition & 0 deletions ideaShared/copyright/profiles_settings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--suppress XmlUnboundNsPrefix -->
<component name="CopyrightManager">
<settings default="GNU GPLv3" />
</component>
24 changes: 0 additions & 24 deletions qrscanner/src/main/res/values/dimens.xml

This file was deleted.

3 changes: 1 addition & 2 deletions qrscanner/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
-->

<resources>
<string name="app_name">QrScanner</string>
<string name="title_activity_scan_qr">Scan Qr Code</string>
</resources>
</resources>

0 comments on commit 3723760

Please sign in to comment.