Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
- baseline update.
- eradicate ButtonOrder.
- eradicate VectorRaster.
- eradicate HardcodedText.
  • Loading branch information
alan-signal committed Nov 9, 2019
1 parent 4e66db5 commit 7348237
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 38 deletions.
7 changes: 0 additions & 7 deletions lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 3.3.2" client="gradle" variant="playRelease" version="3.3.2">

<issue
id="LintError"
message="Unexpected failure during lint analysis of JobManager.java (this is a bug in lint or one of the libraries it depends on)&#xA;&#xA;Stack: `NullPointerException:ClsFileImpl.getMirror(ClsFileImpl.java:342)←ClsElementImpl.getMirror(ClsElementImpl.java:159)←ClsElementImpl.getText(ClsElementImpl.java:202)←InferenceSession.argConstraints(InferenceSession.java:1817)←InferenceSession.isFunctionalTypeMoreSpecific(InferenceSession.java:1748)←InferenceSession.isFunctionalTypeMoreSpecificOnExpression(InferenceSession.java:1729)←JavaMethodsConflictResolver.isFunctionalTypeMoreSpecific(JavaMethodsConflictResolver.java:776)←JavaMethodsConflictResolver.isTypeMoreSpecific(JavaMethodsConflictResolver.java:670)`&#xA;&#xA;You can set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout.">
<location
file="src/org/thoughtcrime/securesms/jobmanager/JobManager.java"/>
</issue>

<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
Expand Down
3 changes: 3 additions & 0 deletions lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<issue id="ImpliedQuantity" severity="warning" />

<issue id="CanvasSize" severity="error" />
<issue id="HardcodedText" severity="error" />
<issue id="VectorRaster" severity="error" />
<issue id="ButtonOrder" severity="error" />

<issue id="RestrictedApi" severity="error">
<ignore path="src/org/thoughtcrime/securesms/mediasend/camerax/VideoCapture.java" />
Expand Down
14 changes: 8 additions & 6 deletions res/drawable/ic_group_large.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<vector android:height="260dp"
android:width="260dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/core_grey_20" android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/core_grey_20"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z" />
</vector>
10 changes: 5 additions & 5 deletions res/drawable/ic_map_marker.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="438.536"
android:viewportHeight="438.536">
<path
android:pathData="M322.621,42.825C294.073,14.272 259.619,0 219.268,0c-40.353,0 -74.803,14.275 -103.353,42.825c-28.549,28.549 -42.825,63 -42.825,103.353c0,20.749 3.14,37.782 9.419,51.106l104.21,220.986c2.856,6.276 7.283,11.225 13.278,14.838c5.996,3.617 12.419,5.428 19.273,5.428c6.852,0 13.278,-1.811 19.273,-5.428c5.996,-3.613 10.513,-8.562 13.559,-14.838l103.918,-220.986c6.282,-13.324 9.424,-30.358 9.424,-51.106C365.449,105.825 351.176,71.378 322.621,42.825zM270.942,197.855c-14.273,14.272 -31.497,21.411 -51.674,21.411s-37.401,-7.139 -51.678,-21.411c-14.275,-14.277 -21.414,-31.501 -21.414,-51.678c0,-20.175 7.139,-37.402 21.414,-51.675c14.277,-14.275 31.504,-21.414 51.678,-21.414c20.177,0 37.401,7.139 51.674,21.414c14.274,14.272 21.413,31.5 21.413,51.675C292.355,166.352 285.217,183.575 270.942,197.855z"
android:fillColor="#2090ea"/>
<path
android:fillColor="#2090ea"
android:pathData="M322.621,42.825C294.073,14.272 259.619,0 219.268,0c-40.353,0 -74.803,14.275 -103.353,42.825c-28.549,28.549 -42.825,63 -42.825,103.353c0,20.749 3.14,37.782 9.419,51.106l104.21,220.986c2.856,6.276 7.283,11.225 13.278,14.838c5.996,3.617 12.419,5.428 19.273,5.428c6.852,0 13.278,-1.811 19.273,-5.428c5.996,-3.613 10.513,-8.562 13.559,-14.838l103.918,-220.986c6.282,-13.324 9.424,-30.358 9.424,-51.106C365.449,105.825 351.176,71.378 322.621,42.825zM270.942,197.855c-14.273,14.272 -31.497,21.411 -51.674,21.411s-37.401,-7.139 -51.678,-21.411c-14.275,-14.277 -21.414,-31.501 -21.414,-51.678c0,-20.175 7.139,-37.402 21.414,-51.675c14.277,-14.275 31.504,-21.414 51.678,-21.414c20.177,0 37.401,7.139 51.674,21.414c14.274,14.272 21.413,31.5 21.413,51.675C292.355,166.352 285.217,183.575 270.942,197.855z" />
</vector>
11 changes: 8 additions & 3 deletions res/drawable/ic_person_large.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<vector android:height="260dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="260dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/core_grey_20" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/core_grey_20"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z" />
</vector>
6 changes: 4 additions & 2 deletions res/layout/attachment_type_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand Down Expand Up @@ -223,7 +224,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AttachmentTypeLabel"
android:text=" "/>
android:text=" "
tools:ignore="HardcodedText" />

</LinearLayout>

Expand Down
8 changes: 4 additions & 4 deletions res/layout/conversation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:windowBackground"
android:paddingStart="5dip"
android:text="160/160 (1)"
android:visibility="gone" />

android:paddingStart="5dp"
android:visibility="gone"
tools:text="160/160 (1)"
tools:visibility="visible" />

<ViewStub
android:id="@+id/emoji_drawer_stub"
Expand Down
11 changes: 6 additions & 5 deletions res/layout/database_migration_activity.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">

<FrameLayout
android:layout_width="fill_parent"
Expand Down Expand Up @@ -94,7 +95,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:text="0/100"
tools:text="0/100"
android:textSize="12.0sp" />

<TextView
Expand Down
8 changes: 4 additions & 4 deletions res/layout/webrtc_call_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@
android:maxWidth="250dp">

<Button
android:id="@+id/accept_safety_numbers"
android:id="@+id/cancel_safety_numbers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="@string/WebRtcCallScreen_accept" />
android:text="@android:string/cancel" />

<Button
android:id="@+id/cancel_safety_numbers"
android:id="@+id/accept_safety_numbers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel" />
android:text="@string/WebRtcCallScreen_accept" />

</LinearLayout>

Expand Down
6 changes: 4 additions & 2 deletions res/menu/conversation_list_search.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
<menu xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/action_filter_search"
android:title=" "
app:actionViewClass="org.thoughtcrime.securesms.components.SearchView"
app:showAsAction="collapseActionView|always" />
app:showAsAction="collapseActionView|always"
tools:ignore="HardcodedText" />

</menu>

0 comments on commit 7348237

Please sign in to comment.