Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit a63de65

Browse files
committed
Resolve existing lint issues throughout the project.
1 parent 38a580e commit a63de65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+113
-47
lines changed

app/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ repositories {
1717

1818
android {
1919
compileSdkVersion 24
20+
//noinspection GradleDependency
2021
buildToolsVersion "23.0.2"
2122
defaultConfig {
2223
applicationId "com.zulip.android"
2324
minSdkVersion 13
25+
//noinspection OldTargetApi
2426
targetSdkVersion 23
2527

2628
versionCode 25
@@ -58,6 +60,10 @@ android {
5860
}
5961
productFlavors {
6062
}
63+
64+
lintOptions {
65+
abortOnError true
66+
}
6167
}
6268

6369
dependencies {
@@ -75,6 +81,7 @@ dependencies {
7581
compile 'commons-lang:commons-lang:2.6'
7682
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
7783
compile 'com.squareup.picasso:picasso:2.5.2'
84+
//noinspection GradleCompatible
7885
compile 'com.android.support:customtabs:23.3.0'
7986
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
8087
transitive = true;

app/lint.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
<issue id="GradleDependency" severity="ignore"/>
4+
<issue id="GradleDynamicVersion" severity="ignore"/>
5+
<issue id="GradleOverrides" severity="ignore"/>
6+
<issue id="OldTargetApi" severity="ignore"/>
7+
<!-- Change the severity of hardcoded strings to "error"
8+
when #260 is merged-->
9+
<issue id="HardcodedText" severity="ignore" />
10+
<issue id="IconDensities" severity="ignore"/>
11+
<issue id="InvalidPackage" severity="ignore"/>
12+
<issue id="UnusedResources" severity="error">
13+
<ignore path="**/ic_person_24dp.png"/>
14+
<ignore path="**/ic_search_24dp.png"/>
15+
</issue>
16+
17+
</lint>

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
android:allowBackup="false"
2626
android:icon="@drawable/ic_launcher"
2727
android:label="@string/app_name"
28-
android:theme="@style/AppTheme.DayNight.NoActionBar" >
28+
android:theme="@style/AppTheme.DayNight.NoActionBar"
29+
android:supportsRtl="false"
30+
tools:ignore="GoogleAppIndexingWarning">
2931
<activity
3032
android:name=".activities.ZulipActivity"
3133
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

app/src/main/java/com/zulip/android/activities/BaseActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99

10-
public class BaseActivity extends AppCompatActivity {
10+
public abstract class BaseActivity extends AppCompatActivity {
1111

1212
protected ZulipApp getApp() {
1313
return ZulipApp.get();

app/src/main/java/com/zulip/android/activities/RecyclerMessageAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public Object getItem(int position) {
553553
/**
554554
* Return the size of the list with including or excluding footer
555555
* @param includeFooter true to return the size including footer or false to return size excluding footer.
556-
* @return
556+
* @return size of list
557557
*/
558558
public int getItemCount(boolean includeFooter) {
559559
if (includeFooter) return getItemCount();

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ protected void onNewIntent(Intent intent) {
723723
* Function invoked when a user shares an image with the zulip app
724724
* @param intent passed to the activity with action SEND
725725
*/
726+
@SuppressLint("InlinedApi")
726727
private void handleSentImage(Intent intent) {
727728
mImageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
728729
if (mImageUri != null) {
@@ -932,6 +933,7 @@ private void displayFAB(boolean show) {
932933
}
933934
}
934935

936+
@SuppressLint("NewApi")
935937
public void hideView(final View view) {
936938
ViewPropertyAnimator animator = view.animate()
937939
.translationY((view instanceof AppBarLayout) ? -1 * view.getHeight() : view.getHeight())
@@ -959,6 +961,7 @@ public void onAnimationRepeat(Animator animator) {
959961
animator.start();
960962
}
961963

964+
@SuppressLint("NewApi")
962965
public void showView(final View view) {
963966
ViewPropertyAnimator animator = view.animate()
964967
.translationY(0)
@@ -1338,7 +1341,7 @@ private Cursor makeStreamCursor(CharSequence streamName)
13381341

13391342
/**
13401343
* Creates a cursor to get the topics in the stream in
1341-
* @param stream
1344+
* @param stream from which topics similar to {@param subject} are selected
13421345
* @param subject Filter out subject containing this string
13431346
*/
13441347
private Cursor makeSubjectCursor(CharSequence stream, CharSequence subject)

app/src/main/java/com/zulip/android/models/Message.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ public Spanned getFormattedContent(ZulipApp app) {
513513
* Copied from Html.fromHtml
514514
*
515515
* @param source HTML to be formatted
516-
* @param app
516+
* @param app {@link ZulipApp}
517517
* @return Span
518518
*/
519519
public static Spanned formatContent(String source, final ZulipApp app) {

app/src/main/java/com/zulip/android/models/Person.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.Comparator;
1919
import java.util.HashMap;
2020
import java.util.List;
21+
import java.util.Locale;
2122
import java.util.Map;
2223

2324
@DatabaseTable(tableName = "people")
@@ -113,7 +114,7 @@ public boolean getIsBot() {
113114

114115
private void setEmail(String email) {
115116
if (email != null) {
116-
this.email = email.toLowerCase();
117+
this.email = email.toLowerCase(Locale.US);
117118
}
118119
}
119120

@@ -194,7 +195,7 @@ public Person mapRow(String[] columnNames,
194195
Boolean.parseBoolean(resultColumns[4]),
195196
Boolean.parseBoolean(resultColumns[5]));
196197
}
197-
}, email.toLowerCase());
198+
}, email.toLowerCase(Locale.US));
198199

199200
// we only care about the first result
200201
Person returnValue = rawResults.getFirstResult();
@@ -283,23 +284,23 @@ public int compare(Person a, Person b) {
283284
final int inactiveTimeout = 2 * 60;
284285

285286
if (aPresence == null && bPresence == null) {
286-
return a.getName().toLowerCase()
287-
.compareTo(b.getName().toLowerCase());
287+
return a.getName().toLowerCase(Locale.US)
288+
.compareTo(b.getName().toLowerCase(Locale.US));
288289
} else if (aPresence == null) {
289290
return 1;
290291
} else if (bPresence == null) {
291292
return -1;
292293
} else if (aPresence.getAge() > inactiveTimeout
293294
&& bPresence.getAge() > inactiveTimeout) {
294-
return a.getName().toLowerCase()
295-
.compareTo(b.getName().toLowerCase());
295+
return a.getName().toLowerCase(Locale.US)
296+
.compareTo(b.getName().toLowerCase(Locale.US));
296297
} else if (aPresence.getAge() > inactiveTimeout) {
297298
return 1;
298299
} else if (bPresence.getAge() > inactiveTimeout) {
299300
return -1;
300301
} else if (aPresence.getStatus() == bPresence.getStatus()) {
301-
return a.getName().toLowerCase()
302-
.compareTo(b.getName().toLowerCase());
302+
return a.getName().toLowerCase(Locale.US)
303+
.compareTo(b.getName().toLowerCase(Locale.US));
303304
} else if (aPresence.getStatus() == PresenceType.ACTIVE) {
304305
return -1;
305306
} else {

app/src/main/java/com/zulip/android/networking/AsyncGetEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public void run() {
279279

280280
/**
281281
* Handles any event returned by the server that we care about.
282-
* @param events
282+
* @param events sent by server
283283
*/
284284
private void processEvents(GetEventResponse events) {
285285
// In task thread

app/src/main/java/com/zulip/android/networking/AsyncStatusUpdate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class AsyncStatusUpdate extends ZulipAsyncPushTask {
2929
/**
3030
* Declares a new HumbugAsyncPushTask, passing the activity as context.
3131
*
32-
* @param activity
32+
* @param activity {@link android.app.Activity}
3333
*/
3434
public AsyncStatusUpdate(ZulipActivity activity) {
3535
super((ZulipApp) activity.getApplication());

0 commit comments

Comments
 (0)