Skip to content

Commit a87a7e6

Browse files
committed
Fix some Lint warnings
1 parent 6f83eff commit a87a7e6

File tree

7 files changed

+47
-34
lines changed

7 files changed

+47
-34
lines changed

res/layout/number_picker_dialog.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@
1717
-->
1818

1919
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
20-
android:orientation="horizontal"
21-
android:gravity="center"
20+
xmlns:tools="http://schemas.android.com/tools"
2221
android:layout_width="match_parent"
23-
android:layout_height="wrap_content" >
22+
android:layout_height="wrap_content"
23+
android:gravity="center"
24+
android:orientation="horizontal"
25+
tools:ignore="NewApi" >
2426

2527
<NumberPicker
2628
android:id="@+id/number_picker"
2729
android:layout_width="wrap_content"
2830
android:layout_height="wrap_content"
2931
android:focusable="true"
3032
android:focusableInTouchMode="true" />
31-
33+
3234
<TextView
3335
android:id="@+id/unit"
3436
android:layout_width="wrap_content"

res/layout/preference_header_item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:layout_gravity="center" />
3333

3434
<RelativeLayout
35-
android:layout_width="wrap_content"
35+
android:layout_width="0dp"
3636
android:layout_height="wrap_content"
3737
android:layout_marginLeft="2dip"
3838
android:layout_marginRight="6dip"
Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- Copyright (C) 2006 The Android Open Source Project
2+
<!--
3+
Copyright (C) 2006 The Android Open Source Project
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -16,55 +17,59 @@
1617

1718
<!-- Layout of a header item in PreferenceActivity. -->
1819
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:tools="http://schemas.android.com/tools"
1921
android:layout_width="match_parent"
2022
android:layout_height="wrap_content"
21-
android:minHeight="48dp"
2223
android:background="?android:attr/activatedBackgroundIndicator"
2324
android:gravity="center_vertical"
24-
android:paddingRight="?android:attr/scrollbarSize">
25+
android:minHeight="48dp"
26+
android:paddingRight="?android:attr/scrollbarSize"
27+
tools:ignore="NewApi" >
2528

2629
<ImageView
2730
android:id="@+id/icon"
2831
android:layout_width="wrap_content"
2932
android:layout_height="wrap_content"
33+
android:layout_gravity="center"
3034
android:layout_marginLeft="6dip"
31-
android:layout_marginRight="6dip"
32-
android:layout_gravity="center" />
35+
android:layout_marginRight="6dip" />
3336

3437
<RelativeLayout
35-
android:layout_width="wrap_content"
38+
android:layout_width="0dp"
3639
android:layout_height="wrap_content"
40+
android:layout_marginBottom="6dip"
3741
android:layout_marginLeft="2dip"
3842
android:layout_marginRight="6dip"
3943
android:layout_marginTop="6dip"
40-
android:layout_marginBottom="6dip"
41-
android:layout_weight="1">
44+
android:layout_weight="1" >
4245

43-
<TextView android:id="@+android:id/title"
46+
<TextView
47+
android:id="@+android:id/title"
4448
android:layout_width="wrap_content"
4549
android:layout_height="wrap_content"
46-
android:singleLine="true"
47-
android:textAppearance="?android:attr/textAppearanceMedium"
4850
android:ellipsize="marquee"
49-
android:fadingEdge="horizontal" />
51+
android:fadingEdge="horizontal"
52+
android:singleLine="true"
53+
android:textAppearance="?android:attr/textAppearanceMedium" />
5054

51-
<TextView android:id="@+android:id/summary"
55+
<TextView
56+
android:id="@+android:id/summary"
5257
android:layout_width="wrap_content"
5358
android:layout_height="wrap_content"
54-
android:layout_below="@android:id/title"
5559
android:layout_alignLeft="@android:id/title"
56-
android:textAppearance="?android:attr/textAppearanceSmall"
60+
android:layout_below="@android:id/title"
5761
android:ellipsize="end"
58-
android:maxLines="2" />
59-
62+
android:maxLines="2"
63+
android:textAppearance="?android:attr/textAppearanceSmall" />
6064
</RelativeLayout>
6165

62-
<Switch android:id="@+id/switchWidget"
63-
android:layout_width="wrap_content"
64-
android:layout_height="wrap_content"
65-
android:layout_gravity="center"
66-
android:padding="8dip"
67-
android:focusable="false"
68-
android:clickable="true" />
66+
<Switch
67+
android:id="@+id/switchWidget"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
70+
android:layout_gravity="center"
71+
android:clickable="true"
72+
android:focusable="false"
73+
android:padding="8dip" />
6974

70-
</LinearLayout>
75+
</LinearLayout>

src/com/noshufou/android/su/SuResultReceiver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
******************************************************************************/
1616
package com.noshufou.android.su;
1717

18-
import com.noshufou.android.su.service.ResultService;
19-
import com.noshufou.android.su.util.Util;
20-
2118
import android.content.BroadcastReceiver;
2219
import android.content.Context;
2320
import android.content.Intent;
2421

22+
import com.noshufou.android.su.service.ResultService;
23+
import com.noshufou.android.su.util.Util;
24+
2525
public class SuResultReceiver extends BroadcastReceiver {
2626

2727
@Override

src/com/noshufou/android/su/preferences/PreferenceEnabler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.noshufou.android.su.preferences;
22

3+
import android.annotation.TargetApi;
34
import android.content.Context;
45
import android.content.SharedPreferences;
56
import android.preference.PreferenceManager;
67
import android.widget.CompoundButton;
78
import android.widget.Switch;
89

10+
@TargetApi(14)
911
public class PreferenceEnabler implements CompoundButton.OnCheckedChangeListener,
1012
SharedPreferences.OnSharedPreferenceChangeListener {
1113
private static final String TAG = "PreferencesEnabler";

src/com/noshufou/android/su/preferences/PreferencesActivityHC.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import android.annotation.TargetApi;
67
import android.content.Context;
78
import android.nfc.NfcAdapter;
89
import android.os.Build;
@@ -11,7 +12,6 @@
1112
import android.view.LayoutInflater;
1213
import android.view.View;
1314
import android.view.ViewGroup;
14-
import android.view.Window;
1515
import android.widget.ArrayAdapter;
1616
import android.widget.ImageView;
1717
import android.widget.ListAdapter;
@@ -23,6 +23,7 @@
2323
import com.noshufou.android.su.R;
2424
import com.noshufou.android.su.util.Util;
2525

26+
@TargetApi(11)
2627
public class PreferencesActivityHC extends SherlockPreferenceActivity {
2728

2829
private List<Header> mHeaders;
@@ -135,6 +136,7 @@ public boolean hasStableIds() {
135136
return true;
136137
}
137138

139+
@TargetApi(14)
138140
public HeaderAdapter(Context context, List<Header> objects) {
139141
super(context, 0, objects);
140142
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

src/com/noshufou/android/su/widget/NumberPickerDialog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.noshufou.android.su.widget;
1919

20+
import android.annotation.TargetApi;
2021
import android.app.AlertDialog;
2122
import android.content.Context;
2223
import android.content.DialogInterface;
@@ -32,6 +33,7 @@
3233
/**
3334
* A dialog that prompts the user for the message deletion limits.
3435
*/
36+
@TargetApi(11)
3537
public class NumberPickerDialog extends AlertDialog implements OnClickListener {
3638

3739
private static final String NUMBER = "number";

0 commit comments

Comments
 (0)