Addressing lint issues

pull/437/head
Alex Baker 8 years ago
parent c5767134b8
commit 110f2ac19b

@ -3,8 +3,5 @@
<issue id="InconsistentArrays" severity="error"/>
<issue id="MissingTranslation" severity="ignore"/>
<issue id="MissingQuantity" severity="ignore"/>
<issue id="InvalidPackage" severity="ignore"/>
<issue id="NewApi" severity="ignore"/>
<issue id="ValidFragment" severity="ignore"/>
<issue id="ImpliedQuantity" severity="ignore"/>
</lint>

@ -89,6 +89,7 @@
android:required="false" />
<application
tools:ignore="GoogleAppIndexingWarning"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Tasks"

@ -539,7 +539,9 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
TYPE model;
try {
model = cls.newInstance();
} catch (IllegalAccessException | InstantiationException e) {
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InstantiationException e) {
throw new RuntimeException(e);
}
model.setValues = source.readParcelable(ContentValues.class.getClassLoader());

@ -86,7 +86,9 @@ public class DatabaseDao<TYPE extends AbstractModel> {
TYPE instance;
try {
instance = modelClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
instance.readPropertiesFromCursor(cursor);

@ -134,7 +134,7 @@ public class Database {
try {
database.execSQL(sql);
} catch (SQLiteException e) {
Timber.e(e, "SQL Error: " + sql);
Timber.e(e, "SQL Error: %s", sql);
}
}

@ -5,6 +5,7 @@
*/
package com.todoroo.astrid.files;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
@ -202,6 +203,7 @@ public class FilesControlSet extends TaskEditControlFragment {
}
}
@SuppressLint("NewApi")
private void showFile(final TaskAttachment m) {
final String fileType = m.containsNonNullValue(TaskAttachment.CONTENT_TYPE) ? m.getContentType() : TaskAttachment.FILE_TYPE_OTHER;
final String filePath = m.getFilePath();

@ -5,6 +5,7 @@
*/
package com.todoroo.astrid.tags;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -151,6 +152,7 @@ public final class TagsControlSet extends TaskEditControlFragment {
newTagLayout = (LinearLayout) dialogView.findViewById(R.id.newTags);
tagListView = (ListView) dialogView.findViewById(R.id.existingTags);
tagListView.setAdapter(new ArrayAdapter<TagData>(getActivity(), R.layout.simple_list_item_multiple_choice_themed, allTags) {
@SuppressLint("NewApi")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
CheckedTextView view = (CheckedTextView) super.getView(position, convertView, parent);

@ -1,5 +1,6 @@
package org.tasks;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.ContentUris;
@ -298,6 +299,7 @@ public class Notifier {
return true;
}
@SuppressLint("NewApi")
private void activateNotification(int ringTimes, int notificationId, Notification notification, String text) {
if (preferences.getBoolean(R.string.p_rmd_persistent, true)) {
notification.flags |= Notification.FLAG_NO_CLEAR;

@ -1,5 +1,6 @@
package org.tasks.activities;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.Intent;
import android.net.Uri;
@ -33,6 +34,7 @@ public class CameraActivity extends InjectingAppCompatActivity {
private File output;
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

@ -1,5 +1,6 @@
package org.tasks.dialogs;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
@ -68,6 +69,7 @@ public class ColorPickerDialog extends InjectingDialogFragment {
final LayoutInflater inflater = theme.getLayoutInflater(context);
adapter = new ArrayAdapter<String>(context, R.layout.color_selection_row, themes) {
@SuppressLint("NewApi")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = (TextView) (convertView == null

@ -1,5 +1,6 @@
package org.tasks.locale;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
@ -101,6 +102,7 @@ public class Locale {
return languageOverride;
}
@SuppressLint("NewApi")
public Context createConfigurationContext(Context context) {
return hasUserOverrides
? context.createConfigurationContext(getLocaleConfiguration())
@ -116,6 +118,7 @@ public class Locale {
return configuration;
}
@SuppressLint("NewApi")
public void applyOverrideConfiguration(ContextThemeWrapper wrapper) {
if (hasUserOverrides) {
wrapper.applyOverrideConfiguration(getLocaleConfiguration());
@ -162,6 +165,7 @@ public class Locale {
'}';
}
@SuppressLint("NewApi")
public void applyDirectionality(Dialog dialog) {
if (hasUserOverrides) {
dialog.findViewById(android.R.id.content).setLayoutDirection(appDirectionality);

@ -1,5 +1,6 @@
package org.tasks.scheduling;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
@ -31,6 +32,7 @@ public class AlarmManager {
wakeup(adjustForQuietHours(time), pendingIntent);
}
@SuppressLint("NewApi")
public void wakeup(long time, PendingIntent pendingIntent) {
if (preferences.isDozeNotificationEnabled()) {
alarmManager.setExactAndAllowWhileIdle(android.app.AlarmManager.RTC_WAKEUP, time, pendingIntent);
@ -41,6 +43,7 @@ public class AlarmManager {
}
}
@SuppressLint("NewApi")
public void noWakeup(long time, PendingIntent pendingIntent) {
if (preferences.isDozeNotificationEnabled()) {
alarmManager.setExactAndAllowWhileIdle(android.app.AlarmManager.RTC, time, pendingIntent);

@ -1,5 +1,6 @@
package org.tasks.themes;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.res.Resources;
@ -54,6 +55,7 @@ public class ThemeColor {
this.isDark = isDark;
}
@SuppressLint("NewApi")
public void applyStatusBarColor(Activity activity) {
if (atLeastLollipop()) {
activity.getWindow().setStatusBarColor(getColorPrimaryDark());
@ -65,6 +67,7 @@ public class ThemeColor {
}
}
@SuppressLint("NewApi")
public void applyStatusBarColor(DrawerLayout drawerLayout) {
if (atLeastLollipop()) {
drawerLayout.setStatusBarBackgroundColor(getColorPrimaryDark());
@ -85,6 +88,7 @@ public class ThemeColor {
theme.applyStyle(style, true);
}
@SuppressLint("NewApi")
public void applyTaskDescription(Activity activity, String description) {
if (atLeastLollipop()) {
activity.setTaskDescription(new ActivityManager.TaskDescription(description, null, getPrimaryColor()));

@ -1,4 +1,5 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -15,14 +16,16 @@
android:id="@+id/master_dual"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="60" />
android:layout_weight="60"
tools:ignore="InconsistentLayout" />
<!-- Task Edit -->
<FrameLayout
android:id="@+id/detail_dual"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="40" />
android:layout_weight="40"
tools:ignore="InconsistentLayout" />
</LinearLayout>

@ -30,7 +30,7 @@
<TextView
android:id="@+id/reminder_title"
android:layout_width="fill_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
android:textSize="24sp"

@ -24,7 +24,7 @@
<TextView
android:id="@+id/reminder_title"
android:layout_width="fill_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
android:textSize="24sp"

@ -20,7 +20,7 @@
android:scrollbars="vertical"
android:cacheColorHint="#00000000"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:drawSelectorOnTop="false"

@ -20,7 +20,7 @@
<AutoCompleteTextView android:id="@+id/text1"
android:hint="@string/new_tag"
android:layout_width="fill_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"

@ -1,4 +1,5 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -7,7 +8,8 @@
<FrameLayout
android:id="@+id/single_pane"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
tools:ignore="InconsistentLayout" />
<include layout="@layout/navigation_drawer" />

@ -339,7 +339,6 @@
<string name="show_hidden">Покажи скрити</string>
<string name="show_completed">Покажи завършени</string>
<string name="reverse">Обратно</string>
<string name="task_count">%s Задачи</string>
<string name="get_plugins">Покупки в приложението</string>
<string name="no_application_found">Не е намерено приложение за отваряне на прикачения файл</string>
<string name="add_attachment">Добавяне на прикачен файл</string>

@ -327,7 +327,6 @@
<string name="show_hidden">Ausgeblendet anzeigen</string>
<string name="show_completed">Erledigt anzeigen</string>
<string name="reverse">Rückgangig</string>
<string name="task_count">%s Aufgaben</string>
<string name="get_plugins">In-App Käufe</string>
<string name="no_application_found">Keine Anwendung zum Öffnen des Anhangs gefunden</string>
<string name="add_attachment">Anhang hinzufügen</string>

@ -335,7 +335,6 @@
<string name="show_hidden">Mostrar oculto</string>
<string name="show_completed">Mostrar completado</string>
<string name="reverse">Invertir</string>
<string name="task_count">%s Tareas</string>
<string name="get_plugins">Compras en la aplicación</string>
<string name="no_application_found">No se ha encontrado una aplicación para abrir el archivo adjunto</string>
<string name="add_attachment">Adjuntar archivo</string>

@ -329,7 +329,6 @@
<string name="show_hidden">Afficher les tâches cachées</string>
<string name="show_completed">Afficher les tâches terminées</string>
<string name="reverse">Inverser</string>
<string name="task_count">%s Tâches</string>
<string name="get_plugins">Achats intégrés à l\'application</string>
<string name="no_application_found">Aucune application trouvée pour ouvrir la pièce jointe</string>
<string name="add_attachment">Ajouter une pièce jointe</string>

@ -124,5 +124,4 @@
<string name="filter_settings">Szűrő beállítások</string>
<string name="show_hidden">Rejtettek mutatása</string>
<string name="show_completed">Befejezettek mutatása</string>
<string name="task_count">%s feladatok</string>
</resources>

@ -332,7 +332,6 @@
<string name="show_hidden">Mostra nascoste</string>
<string name="show_completed">Mostra completate</string>
<string name="reverse">Contrario</string>
<string name="task_count">%s Attività</string>
<string name="get_plugins">Acquisti nell\'app.</string>
<string name="no_application_found">Nessuna applicazione in grado di aprire l\'allegato </string>
<string name="add_attachment">Aggiungi allegato</string>

@ -337,7 +337,6 @@
<string name="show_hidden">הצגת משימות נסתרות</string>
<string name="show_completed">הצגת משימות שבוצעו</string>
<string name="reverse">אחורה</string>
<string name="task_count">%s משימות</string>
<string name="get_plugins">רכישות בתוך הישום</string>
<string name="no_application_found">לא נמצאה אפליקצה לפתיחת הקובץ</string>
<string name="add_attachment">הוספ/י קובץ</string>

@ -337,7 +337,6 @@
<string name="show_hidden">非表示を表示</string>
<string name="show_completed">完了を表示</string>
<string name="reverse">逆順</string>
<string name="task_count">%s タスク</string>
<string name="get_plugins">アプリ内課金</string>
<string name="no_application_found">添付ファイルを開くアプリケーションが見つかりません</string>
<string name="add_attachment">添付ファイルを追加</string>

@ -334,7 +334,6 @@
<string name="show_hidden">숨겨진 일정 표시</string>
<string name="show_completed">완료된 일정 표시</string>
<string name="reverse">반전</string>
<string name="task_count">%s 일정</string>
<string name="get_plugins">인앱 결제</string>
<string name="no_application_found">첨부 파일을 열 수 있는 앱이 발견되지 않았습니다</string>
<string name="add_attachment">첨부파일 추가</string>

@ -332,7 +332,6 @@
<string name="show_hidden">Toon verborgen</string>
<string name="show_completed">Toon voltooide</string>
<string name="reverse">Omgekeerde</string>
<string name="task_count">%s Taken</string>
<string name="get_plugins">In-app aankopen</string>
<string name="no_application_found">Geen applicatie gevonden om de bijlage te openen</string>
<string name="add_attachment">Bijlage toevoegen</string>

@ -311,7 +311,6 @@
<string name="show_hidden">Mostrar ocultas</string>
<string name="show_completed">Mostrar terminadas</string>
<string name="reverse">Reverter</string>
<string name="task_count">%s tarefas</string>
<string name="sync_interval_disable">desativar</string>
<string name="sync_interval_one_hour">cada hora</string>
<string name="sync_interval_three_hours">cada 3 horas</string>

@ -336,7 +336,6 @@
<string name="show_hidden">Показать скрытые</string>
<string name="show_completed">Показать выполненные</string>
<string name="reverse"> Реверс</string>
<string name="task_count">%s задач</string>
<string name="get_plugins">Покупки в приложении</string>
<string name="no_application_found">Не найдено приложение, позволяющее открыть прикреплённый файл</string>
<string name="add_attachment">Прикрепить файл</string>

@ -293,7 +293,6 @@
<string name="filter_settings">Nastavenie filtra</string>
<string name="show_hidden">Zobraziť skryté</string>
<string name="show_completed">Zobraziť dokončené</string>
<string name="task_count">%s úlohy</string>
<string name="sync_interval_disable">zakázať</string>
<string name="sync_interval_one_hour">každú hodinu</string>
<string name="sync_interval_three_hours">každé tri hodiny</string>

@ -336,7 +336,6 @@
<string name="show_hidden">Visa dolda</string>
<string name="show_completed">Visa slutförda</string>
<string name="reverse">Omvänt</string>
<string name="task_count">%s Uppgifter</string>
<string name="get_plugins">Köp i app</string>
<string name="no_application_found">Ingen applikation hittades för att öppna bilagan</string>
<string name="add_attachment">Bifoga filer</string>

@ -335,7 +335,6 @@
<string name="show_hidden">Показати приховані</string>
<string name="show_completed">Показати завершені</string>
<string name="reverse">Реверс</string>
<string name="task_count">%s Завдань</string>
<string name="get_plugins">Покупки в застосунку</string>
<string name="no_application_found">Не знайдено програми для відкриття вкладення</string>
<string name="add_attachment">Додати вкладення</string>

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="task_list_container">
<item name="android:clipToPadding">false</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:paddingStart">0dp</item>
<item name="android:paddingStart" tools:ignore="NewApi">0dp</item>
<item name="android:paddingRight">@dimen/elevation_padding</item>
<item name="android:paddingEnd">@dimen/elevation_padding</item>
<item name="android:paddingEnd" tools:ignore="NewApi">@dimen/elevation_padding</item>
</style>
</resources>

@ -798,7 +798,7 @@ File %1$s contained %2$s.\n\n
<string name="show_hidden">Show hidden</string>
<string name="show_completed">Show completed</string>
<string name="reverse">Reverse</string>
<string name="task_count">%s Tasks</string>
<string name="task_count">%d tasks</string>
<string name="get_plugins">In-app purchases</string>
<string name="no_application_found">No application found to open attachment</string>
<string name="add_attachment">Add attachment</string>

@ -1,4 +1,4 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
<!-- ========================================================== General -->
@ -104,7 +104,7 @@
<style name="task_edit_row_divider" parent="horizontal_divider">
<item name="android:layout_marginLeft">@dimen/keyline_content_inset</item>
<item name="android:layout_marginStart">@dimen/keyline_content_inset</item>
<item name="android:layout_marginStart" tools:ignore="NewApi">@dimen/keyline_content_inset</item>
<item name="android:layout_gravity">end|bottom</item>
</style>

Loading…
Cancel
Save