From 9eefbad7d6b39378b0271eb3b9a76705c5105d17 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Tue, 20 Feb 2018 16:40:03 +0100 Subject: [PATCH] Fix lint issues --- app/build.gradle | 3 +- app/src/main/AndroidManifest.xml | 124 ++++++++++-------- .../dissem/apps/abit/AddressDetailFragment.kt | 4 +- .../java/ch/dissem/apps/abit/Identicon.kt | 4 +- .../apps/abit/ImportIdentitiesFragment.kt | 2 +- .../java/ch/dissem/apps/abit/ListHolder.kt | 2 +- .../java/ch/dissem/apps/abit/MainActivity.kt | 3 +- .../dissem/apps/abit/MessageDetailFragment.kt | 2 +- .../abit/notification/ErrorNotification.kt | 2 +- .../notification/NewMessageNotification.kt | 2 +- .../apps/abit/repository/AndroidInventory.kt | 4 +- .../AndroidProofOfWorkRepository.kt | 16 +-- .../dissem/apps/abit/repository/SqlHelper.kt | 4 +- .../apps/abit/service/BitmessageService.kt | 2 - .../apps/abit/service/ProofOfWorkService.kt | 1 - .../abit/service/StartupNodeOnWifiService.kt | 1 - .../apps/abit/synchronization/SyncService.kt | 1 - .../ch/dissem/apps/abit/util/Drawables.kt | 2 +- .../ch/dissem/apps/abit/util/Observable.kt | 2 +- .../ch/dissem/apps/abit/util/PRNGFixes.java | 60 ++++----- app/src/main/res/layout/contact_row.xml | 4 +- .../dialog_add_deterministic_identity.xml | 23 ++-- app/src/main/res/layout/message_row.xml | 1 + .../main/res/layout/select_identity_row.xml | 18 +-- app/src/main/res/values/styles.xml | 2 +- app/src/main/res/xml/file_paths.xml | 2 +- app/src/main/res/xml/preferences.xml | 56 ++++---- .../AndroidAddressRepositoryTest.kt | 4 +- .../repository/AndroidInventoryTest.kt | 15 ++- .../repository/AndroidLabelRepositoryTest.kt | 3 +- .../AndroidMessageRepositoryTest.kt | 5 +- .../repository/AndroidNodeRegistryTest.kt | 4 +- .../AndroidProofOfWorkRepositoryTest.kt | 2 +- 33 files changed, 191 insertions(+), 189 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 97321b4..4495a2c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,8 @@ dependencies { implementation "com.android.support:appcompat-v7:$supportVersion" implementation "com.android.support:preference-v7:$supportVersion" implementation "com.android.support:cardview-v7:$supportVersion" - implementation "com.android.support:support-v4:$supportVersion" + implementation "com.android.support:support-v13:$supportVersion" + implementation "com.android.support:preference-v14:$supportVersion" implementation "com.android.support:design:$supportVersion" implementation "com.android.support:multidex:1.0.2" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ddca7b0..cc7f881 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,32 +1,32 @@ - + - - - - - - - - - + + + + + + + + + + android:supportsRtl="true" + android:theme="@style/AppTheme"> - + - + + android:value=".MainActivity" /> + android:value=".MainActivity" /> + android:theme="@style/Theme.AppCompat.Light.Dialog" /> + android:value=".MainActivity" /> - + - - - + + + - + - + - + - + - + - + - + - + - - - + + + - - + + + android:value=".MainActivity" /> - + + android:scheme="file" /> - - + + + android:exported="false" /> + android:exported="false" /> + android:syncable="true" /> - + + android:resource="@xml/authenticator" /> - + + android:resource="@xml/syncadapter" /> + android:exported="false" /> - + - + + - + + + android:exported="true" + android:permission="android.permission.BIND_JOB_SERVICE" /> + android:value=".MainActivity" /> diff --git a/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt b/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt index 9a4ea03..af66c9e 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt @@ -204,7 +204,7 @@ class AddressDetailFragment : Fragment() { * The fragment argument representing the item ID that this fragment * represents. */ - val ARG_ITEM = "item" - val EXPORT_POSTFIX = ".keys.dat" + const val ARG_ITEM = "item" + const val EXPORT_POSTFIX = ".keys.dat" } } diff --git a/app/src/main/java/ch/dissem/apps/abit/Identicon.kt b/app/src/main/java/ch/dissem/apps/abit/Identicon.kt index 172c22d..595158f 100644 --- a/app/src/main/java/ch/dissem/apps/abit/Identicon.kt +++ b/app/src/main/java/ch/dissem/apps/abit/Identicon.kt @@ -92,7 +92,7 @@ class Identicon(input: BitmessageAddress) : Drawable() { override fun getOpacity() = PixelFormat.TRANSPARENT companion object { - private val SIZE = 9 - private val CENTER_COLUMN = 5 + private const val SIZE = 9 + private const val CENTER_COLUMN = 5 } } diff --git a/app/src/main/java/ch/dissem/apps/abit/ImportIdentitiesFragment.kt b/app/src/main/java/ch/dissem/apps/abit/ImportIdentitiesFragment.kt index c65b3ed..5cbdf4e 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ImportIdentitiesFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ImportIdentitiesFragment.kt @@ -72,6 +72,6 @@ class ImportIdentitiesFragment : Fragment() { } companion object { - val WIF_DATA = "wif_data" + const val WIF_DATA = "wif_data" } } diff --git a/app/src/main/java/ch/dissem/apps/abit/ListHolder.kt b/app/src/main/java/ch/dissem/apps/abit/ListHolder.kt index a72ad87..ca07057 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ListHolder.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ListHolder.kt @@ -19,7 +19,7 @@ package ch.dissem.apps.abit /** * @author Christian Basler */ -interface ListHolder { +interface ListHolder { fun updateList(label: L) fun setActivateOnItemClick(activateOnItemClick: Boolean) diff --git a/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt b/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt index 6c77f0f..ae95bde 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt @@ -507,7 +507,8 @@ class MainActivity : AppCompatActivity(), ListSelectionListener { fun setDetailView(fragment: Fragment) { if (hasDetailPane) { - supportFragmentManager.beginTransaction() + supportFragmentManager + .beginTransaction() .replace(R.id.message_detail_container, fragment) .commit() } diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt index 44f73b3..6e08ad2 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.kt @@ -298,7 +298,7 @@ class MessageDetailFragment : Fragment() { * The fragment argument representing the item ID that this fragment * represents. */ - val ARG_ITEM = "item" + const val ARG_ITEM = "item" fun isInTrash(item: Plaintext?) = item?.labels?.any { it.type == Label.Type.TRASH } == true } diff --git a/app/src/main/java/ch/dissem/apps/abit/notification/ErrorNotification.kt b/app/src/main/java/ch/dissem/apps/abit/notification/ErrorNotification.kt index 052c638..749fe71 100644 --- a/app/src/main/java/ch/dissem/apps/abit/notification/ErrorNotification.kt +++ b/app/src/main/java/ch/dissem/apps/abit/notification/ErrorNotification.kt @@ -55,6 +55,6 @@ class ErrorNotification(ctx: Context) : AbstractNotification(ctx) { override val notificationId = ERROR_NOTIFICATION_ID companion object { - val ERROR_NOTIFICATION_ID = 4 + const val ERROR_NOTIFICATION_ID = 4 } } diff --git a/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.kt b/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.kt index fc14f76..3328d26 100644 --- a/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.kt +++ b/app/src/main/java/ch/dissem/apps/abit/notification/NewMessageNotification.kt @@ -128,7 +128,7 @@ class NewMessageNotification(ctx: Context) : AbstractNotification(ctx) { override val notificationId = NEW_MESSAGE_NOTIFICATION_ID companion object { - private val NEW_MESSAGE_NOTIFICATION_ID = 1 + private const val NEW_MESSAGE_NOTIFICATION_ID = 1 private val SPAN_EMPHASIS = StyleSpan(Typeface.BOLD) } } diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidInventory.kt b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidInventory.kt index b381654..673f246 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidInventory.kt +++ b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidInventory.kt @@ -54,7 +54,7 @@ class AndroidInventory(private val sql: SqlHelper) : Inventory { private fun getCache(stream: Long): MutableMap { fun addToCache(stream: Long): MutableMap { val result: MutableMap = ConcurrentHashMap() - cache.put(stream, result) + cache[stream] = result val projection = arrayOf(COLUMN_HASH, COLUMN_EXPIRES) @@ -149,7 +149,7 @@ class AndroidInventory(private val sql: SqlHelper) : Inventory { sql.writableDatabase.insertOrThrow(TABLE_NAME, null, values) - getCache(objectMessage.stream).put(iv, objectMessage.expiresTime) + getCache(objectMessage.stream)[iv] = objectMessage.expiresTime } catch (e: SQLiteConstraintException) { LOG.trace(e.message, e) } diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidProofOfWorkRepository.kt b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidProofOfWorkRepository.kt index f7510c2..b6963a1 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidProofOfWorkRepository.kt +++ b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidProofOfWorkRepository.kt @@ -125,13 +125,13 @@ class AndroidProofOfWorkRepository(private val sql: SqlHelper) : ProofOfWorkRepo companion object { private val LOG = LoggerFactory.getLogger(AndroidProofOfWorkRepository::class.java) - private val TABLE_NAME = "POW" - private val COLUMN_INITIAL_HASH = "initial_hash" - private val COLUMN_DATA = "data" - private val COLUMN_VERSION = "version" - private val COLUMN_NONCE_TRIALS_PER_BYTE = "nonce_trials_per_byte" - private val COLUMN_EXTRA_BYTES = "extra_bytes" - private val COLUMN_EXPIRATION_TIME = "expiration_time" - private val COLUMN_MESSAGE_ID = "message_id" + private const val TABLE_NAME = "POW" + private const val COLUMN_INITIAL_HASH = "initial_hash" + private const val COLUMN_DATA = "data" + private const val COLUMN_VERSION = "version" + private const val COLUMN_NONCE_TRIALS_PER_BYTE = "nonce_trials_per_byte" + private const val COLUMN_EXTRA_BYTES = "extra_bytes" + private const val COLUMN_EXPIRATION_TIME = "expiration_time" + private const val COLUMN_MESSAGE_ID = "message_id" } } diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/SqlHelper.kt b/app/src/main/java/ch/dissem/apps/abit/repository/SqlHelper.kt index 588b117..faa0205 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/SqlHelper.kt +++ b/app/src/main/java/ch/dissem/apps/abit/repository/SqlHelper.kt @@ -90,7 +90,7 @@ class SqlHelper(private val ctx: Context) : SQLiteOpenHelper(ctx, DATABASE_NAME, companion object { // If you change the database schema, you must increment the database version. - private val DATABASE_VERSION = 7 - val DATABASE_NAME = "jabit.db" + private const val DATABASE_VERSION = 7 + const val DATABASE_NAME = "jabit.db" } } diff --git a/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt b/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt index 31c0a88..2ce3b3f 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt +++ b/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt @@ -25,11 +25,9 @@ import android.net.ConnectivityManager import android.os.Handler import ch.dissem.apps.abit.notification.NetworkNotification import ch.dissem.apps.abit.notification.NetworkNotification.Companion.NETWORK_NOTIFICATION_ID -import ch.dissem.apps.abit.util.NetworkUtils import ch.dissem.apps.abit.util.Preferences import ch.dissem.bitmessage.BitmessageContext import ch.dissem.bitmessage.utils.Property -import org.jetbrains.anko.connectivityManager /** * Define a Service that returns an IBinder for the diff --git a/app/src/main/java/ch/dissem/apps/abit/service/ProofOfWorkService.kt b/app/src/main/java/ch/dissem/apps/abit/service/ProofOfWorkService.kt index 4d8b3e7..57365d8 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/ProofOfWorkService.kt +++ b/app/src/main/java/ch/dissem/apps/abit/service/ProofOfWorkService.kt @@ -19,7 +19,6 @@ package ch.dissem.apps.abit.service import android.app.Service import android.content.Intent import android.os.Binder -import android.os.IBinder import android.support.v4.content.ContextCompat import ch.dissem.apps.abit.notification.ProofOfWorkNotification import ch.dissem.apps.abit.notification.ProofOfWorkNotification.Companion.ONGOING_NOTIFICATION_ID diff --git a/app/src/main/java/ch/dissem/apps/abit/service/StartupNodeOnWifiService.kt b/app/src/main/java/ch/dissem/apps/abit/service/StartupNodeOnWifiService.kt index 0e1d557..5a3ee01 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/StartupNodeOnWifiService.kt +++ b/app/src/main/java/ch/dissem/apps/abit/service/StartupNodeOnWifiService.kt @@ -2,7 +2,6 @@ package ch.dissem.apps.abit.service import android.app.job.JobParameters import android.app.job.JobService -import android.content.Intent import android.os.Build import android.support.annotation.RequiresApi import ch.dissem.apps.abit.util.NetworkUtils diff --git a/app/src/main/java/ch/dissem/apps/abit/synchronization/SyncService.kt b/app/src/main/java/ch/dissem/apps/abit/synchronization/SyncService.kt index ba4c570..a1b581e 100644 --- a/app/src/main/java/ch/dissem/apps/abit/synchronization/SyncService.kt +++ b/app/src/main/java/ch/dissem/apps/abit/synchronization/SyncService.kt @@ -18,7 +18,6 @@ package ch.dissem.apps.abit.synchronization import android.app.Service import android.content.Intent -import android.os.IBinder /** * Define a Service that returns an IBinder for the diff --git a/app/src/main/java/ch/dissem/apps/abit/util/Drawables.kt b/app/src/main/java/ch/dissem/apps/abit/util/Drawables.kt index 1aa4863..5905cbf 100644 --- a/app/src/main/java/ch/dissem/apps/abit/util/Drawables.kt +++ b/app/src/main/java/ch/dissem/apps/abit/util/Drawables.kt @@ -44,7 +44,7 @@ import java.io.ByteArrayOutputStream object Drawables { private val LOG = LoggerFactory.getLogger(Drawables::class.java) - private val QR_CODE_SIZE = 350 + private const val QR_CODE_SIZE = 350 fun addIcon(ctx: Context, menu: Menu, menuItem: Int, icon: IIcon): MenuItem { val item = menu.findItem(menuItem) diff --git a/app/src/main/java/ch/dissem/apps/abit/util/Observable.kt b/app/src/main/java/ch/dissem/apps/abit/util/Observable.kt index 1e35955..e384fde 100644 --- a/app/src/main/java/ch/dissem/apps/abit/util/Observable.kt +++ b/app/src/main/java/ch/dissem/apps/abit/util/Observable.kt @@ -25,7 +25,7 @@ class Observable(value: T) { * To prevent memory leaks, the observer must be removed if it isn't used anymore. */ fun addObserver(key: Any, observer: (T) -> Unit) { - observers.put(key, observer) + observers[key] = observer } /** diff --git a/app/src/main/java/ch/dissem/apps/abit/util/PRNGFixes.java b/app/src/main/java/ch/dissem/apps/abit/util/PRNGFixes.java index 47fef8b..38bda8b 100644 --- a/app/src/main/java/ch/dissem/apps/abit/util/PRNGFixes.java +++ b/app/src/main/java/ch/dissem/apps/abit/util/PRNGFixes.java @@ -44,7 +44,7 @@ public final class PRNGFixes { private static final int VERSION_CODE_JELLY_BEAN = 16; private static final int VERSION_CODE_JELLY_BEAN_MR2 = 18; private static final byte[] BUILD_FINGERPRINT_AND_DEVICE_SERIAL = - getBuildFingerprintAndDeviceSerial(); + getBuildFingerprintAndDeviceSerial(); /** * Hidden constructor to prevent instantiation. @@ -70,7 +70,7 @@ public final class PRNGFixes { */ private static void applyOpenSSLFix() throws SecurityException { if ((Build.VERSION.SDK_INT < VERSION_CODE_JELLY_BEAN) - || (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2)) { + || (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2)) { // No need to apply the fix return; } @@ -78,18 +78,18 @@ public final class PRNGFixes { try { // Mix in the device- and invocation-specific seed. Class.forName("org.apache.harmony.xnet.provider.jsse.NativeCrypto") - .getMethod("RAND_seed", byte[].class) - .invoke(null, (Object) generateSeed()); + .getMethod("RAND_seed", byte[].class) + .invoke(null, (Object) generateSeed()); // Mix output of Linux PRNG into OpenSSL's PRNG int bytesRead = (Integer) Class.forName( - "org.apache.harmony.xnet.provider.jsse.NativeCrypto") - .getMethod("RAND_load_file", String.class, long.class) - .invoke(null, "/dev/urandom", 1024); + "org.apache.harmony.xnet.provider.jsse.NativeCrypto") + .getMethod("RAND_load_file", String.class, long.class) + .invoke(null, "/dev/urandom", 1024); if (bytesRead != 1024) { throw new IOException( - "Unexpected number of bytes read from Linux PRNG: " - + bytesRead); + "Unexpected number of bytes read from Linux PRNG: " + + bytesRead); } } catch (Exception e) { throw new SecurityException("Failed to seed OpenSSL PRNG", e); @@ -104,7 +104,7 @@ public final class PRNGFixes { * @throws SecurityException if the fix is needed but could not be applied. */ private static void installLinuxPRNGSecureRandom() - throws SecurityException { + throws SecurityException { if (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2) { // No need to apply the fix return; @@ -113,11 +113,11 @@ public final class PRNGFixes { // Install a Linux PRNG-based SecureRandom implementation as the // default, if not yet installed. Provider[] secureRandomProviders = - Security.getProviders("SecureRandom.SHA1PRNG"); + Security.getProviders("SecureRandom.SHA1PRNG"); if ((secureRandomProviders == null) - || (secureRandomProviders.length < 1) - || (!LinuxPRNGSecureRandomProvider.class.equals( - secureRandomProviders[0].getClass()))) { + || (secureRandomProviders.length < 1) + || (!LinuxPRNGSecureRandomProvider.class.equals( + secureRandomProviders[0].getClass()))) { Security.insertProviderAt(new LinuxPRNGSecureRandomProvider(), 1); } @@ -126,10 +126,10 @@ public final class PRNGFixes { // by the Linux PRNG-based SecureRandom implementation. SecureRandom rng1 = new SecureRandom(); if (!LinuxPRNGSecureRandomProvider.class.equals( - rng1.getProvider().getClass())) { + rng1.getProvider().getClass())) { throw new SecurityException( - "new SecureRandom() backed by wrong Provider: " - + rng1.getProvider().getClass()); + "new SecureRandom() backed by wrong Provider: " + + rng1.getProvider().getClass()); } SecureRandom rng2; @@ -139,10 +139,10 @@ public final class PRNGFixes { throw new SecurityException("SHA1PRNG not available", e); } if (!LinuxPRNGSecureRandomProvider.class.equals( - rng2.getProvider().getClass())) { + rng2.getProvider().getClass())) { throw new SecurityException( - "SecureRandom.getInstance(\"SHA1PRNG\") backed by wrong" - + " Provider: " + rng2.getProvider().getClass()); + "SecureRandom.getInstance(\"SHA1PRNG\") backed by wrong" + + " Provider: " + rng2.getProvider().getClass()); } } @@ -152,11 +152,11 @@ public final class PRNGFixes { */ private static class LinuxPRNGSecureRandomProvider extends Provider { - public LinuxPRNGSecureRandomProvider() { + LinuxPRNGSecureRandomProvider() { super("LinuxPRNG", - 1.0, - "A Linux-specific random number provider that uses" - + " /dev/urandom"); + 1.0, + "A Linux-specific random number provider that uses" + + " /dev/urandom"); // Although /dev/urandom is not a SHA-1 PRNG, some apps // explicitly request a SHA1PRNG SecureRandom and we thus need to // prevent them from getting the default implementation whose output @@ -225,7 +225,7 @@ public final class PRNGFixes { // On a small fraction of devices /dev/urandom is not writable. // Log and ignore. Log.w(PRNGFixes.class.getSimpleName(), - "Failed to mix seed into " + URANDOM_FILE); + "Failed to mix seed into " + URANDOM_FILE); } finally { mSeeded = true; } @@ -249,7 +249,7 @@ public final class PRNGFixes { } } catch (IOException e) { throw new SecurityException( - "Failed to read from " + URANDOM_FILE, e); + "Failed to read from " + URANDOM_FILE, e); } } @@ -269,10 +269,10 @@ public final class PRNGFixes { // output being pulled into this process prematurely. try { sUrandomIn = new DataInputStream( - new FileInputStream(URANDOM_FILE)); + new FileInputStream(URANDOM_FILE)); } catch (IOException e) { throw new SecurityException("Failed to open " - + URANDOM_FILE + " for reading", e); + + URANDOM_FILE + " for reading", e); } } return sUrandomIn; @@ -297,7 +297,7 @@ public final class PRNGFixes { try { ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream(); DataOutputStream seedBufferOut = - new DataOutputStream(seedBuffer); + new DataOutputStream(seedBuffer); seedBufferOut.writeLong(System.currentTimeMillis()); seedBufferOut.writeLong(System.nanoTime()); seedBufferOut.writeInt(Process.myPid()); @@ -341,4 +341,4 @@ public final class PRNGFixes { throw new RuntimeException("UTF-8 encoding not supported"); } } -} \ No newline at end of file +} diff --git a/app/src/main/res/layout/contact_row.xml b/app/src/main/res/layout/contact_row.xml index 491f39f..3cf9f9d 100644 --- a/app/src/main/res/layout/contact_row.xml +++ b/app/src/main/res/layout/contact_row.xml @@ -37,11 +37,11 @@ android:layout_alignTop="@+id/avatar" android:layout_toEndOf="@+id/avatar" android:ellipsize="end" - android:lines="1" android:paddingBottom="0dp" android:paddingLeft="8dp" android:paddingRight="8dp" android:paddingTop="0dp" + android:singleLine="true" android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" tools:text="Name" /> @@ -53,9 +53,9 @@ android:layout_alignBottom="@+id/avatar" android:layout_toEndOf="@+id/avatar" android:ellipsize="marquee" - android:lines="1" android:paddingLeft="8dp" android:paddingRight="8dp" + android:singleLine="true" android:textAppearance="?android:attr/textAppearanceSmall" tools:text="BM-2cW0000000000000000000000000000000" /> diff --git a/app/src/main/res/layout/dialog_add_deterministic_identity.xml b/app/src/main/res/layout/dialog_add_deterministic_identity.xml index 5df7bfa..cdcfc76 100644 --- a/app/src/main/res/layout/dialog_add_deterministic_identity.xml +++ b/app/src/main/res/layout/dialog_add_deterministic_identity.xml @@ -1,5 +1,4 @@ - - - + tools:layout_constraintTop_creator="1" /> @@ -48,7 +46,7 @@ android:id="@+id/label" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/label"/> + android:hint="@string/label" /> @@ -64,7 +62,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/passphrase" - android:inputType="textMultiLine"/> + android:inputType="textMultiLine" /> @@ -82,7 +80,8 @@ android:ems="10" android:hint="@string/number_of_identities" android:inputType="number" - android:text="1"/> + android:text="1" + tools:ignore="HardcodedText" /> @@ -92,7 +91,7 @@ android:layout_height="wrap_content" android:text="@string/shorter" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintTop_toBottomOf="@id/number_of_identities_wrapper"/> + app:layout_constraintTop_toBottomOf="@id/number_of_identities_wrapper" />