Fixed various lint issues
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
android:versionCode="21"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="7" />
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:targetSdkVersion="14" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.location"
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembernames class * {
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
}
|
||||
|
||||
-keepclasseswithmembernames class * {
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:drawable/title_bar"
|
||||
android:orientation="horizontal" >
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="ContentDescription" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/close"
|
||||
@@ -18,7 +20,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="test"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<ImageView
|
||||
@@ -27,6 +28,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/delete"
|
||||
android:src="@android:drawable/stat_sys_data_bluetooth" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,32 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent" >
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/msg_scrollview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/msg_scrollview"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip"
|
||||
>
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello"
|
||||
/>
|
||||
android:text="@string/hello" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/ok_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@android:string/ok"
|
||||
android:id="@+id/ok_button"
|
||||
android:layout_below="@id/msg"/>
|
||||
android:layout_below="@id/msg"
|
||||
android:text="@android:string/ok" />
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -24,6 +24,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@string/add_feature"
|
||||
android:src="@android:drawable/ic_menu_add" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/widget_get_location_button"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="15dip"
|
||||
android:background="@drawable/icon"
|
||||
android:layout_marginBottom="15dip"/>
|
||||
android:contentDescription="@string/start_location_service" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -25,7 +25,6 @@
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="6dip"
|
||||
android:paddingRight="6dip"
|
||||
android:text="test"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
@@ -35,8 +34,7 @@
|
||||
android:layout_alignLeft="@id/android:id/text1"
|
||||
android:layout_below="@id/android:id/text1"
|
||||
android:paddingLeft="6dip"
|
||||
android:paddingRight="6dip"
|
||||
android:text="test" />
|
||||
android:paddingRight="6dip" />
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -24,8 +24,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
class="com.TwentyCodes.android.LocationRinger.ui.fragments.AboutRingerFragment$ListeningEditText"
|
||||
android:capitalize="words"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView
|
||||
@@ -41,7 +41,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
class="com.TwentyCodes.android.LocationRinger.ui.fragments.AboutRingerFragment$ListeningEditText"
|
||||
android:capitalize="sentences"
|
||||
android:inputType="textMultiLine" />
|
||||
android:inputType="textCapSentences" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -31,6 +31,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/mark_my_location"
|
||||
android:src="@android:drawable/ic_menu_myplaces" />
|
||||
|
||||
<ImageButton
|
||||
@@ -39,6 +40,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/my_location"
|
||||
android:src="@android:drawable/ic_menu_mylocation" />
|
||||
|
||||
<ImageButton
|
||||
@@ -47,6 +49,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/map_mode"
|
||||
android:src="@android:drawable/ic_menu_mapmode" />
|
||||
|
||||
<ImageButton
|
||||
@@ -55,6 +58,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/search"
|
||||
android:src="@android:drawable/ic_menu_search" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@string/new_ringer"
|
||||
android:src="@android:drawable/ic_menu_add" />
|
||||
|
||||
<ListView
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:cursorVisible="false"
|
||||
android:editable="false"
|
||||
android:focusable="false" />
|
||||
android:focusable="false"
|
||||
android:inputType="none" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
android:showAsAction="always"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="@string/settings"/>
|
||||
<item
|
||||
android:id="@+id/backup"
|
||||
|
||||
@@ -89,5 +89,8 @@
|
||||
<string name="ringer_name">Ringer Name</string>
|
||||
<string name="start_location_service">Start Location Service</string>
|
||||
<string name="select_tone">Select Tone</string>
|
||||
<string name="mark_my_location">Mark my location</string>
|
||||
<string name="my_location">My location</string>
|
||||
<string name="map_mode">Map Mode</string>
|
||||
|
||||
</resources>
|
||||
@@ -318,7 +318,7 @@ public class RingerProcessingService extends Service {
|
||||
final GeoPoint point = new GeoPoint((int) (mLocation.getLatitude() * 1E6), (int) (mLocation.getLongitude()*1E6));
|
||||
if(Debug.DEBUG){
|
||||
Log.d(TAG, "Processing ringers");
|
||||
Log.d(TAG, "Current location "+(int) (mLocation.getLatitude() * 1E6)+", "+(int) (mLocation.getLongitude() * 1E6)+" @ "+ new Float(mLocation.getAccuracy()) / 1000+"km");
|
||||
Log.d(TAG, "Current location "+(int) (mLocation.getLatitude() * 1E6)+", "+(int) (mLocation.getLongitude() * 1E6)+" @ "+ Float.valueOf(mLocation.getAccuracy()) / 1000+"km");
|
||||
}
|
||||
|
||||
final Cursor c = mDb.getAllRingers();
|
||||
@@ -332,7 +332,7 @@ public class RingerProcessingService extends Service {
|
||||
final ContentValues info = this.mDb.getRingerInfo(c.getString(0));
|
||||
if(info.containsKey(RingerDatabase.KEY_LOCATION) && info.containsKey(RingerDatabase.KEY_RADIUS)){
|
||||
final String[] pointInfo = info.getAsString(RingerDatabase.KEY_LOCATION).split(",");
|
||||
if(GeoUtils.isIntersecting(point, new Float(mLocation.getAccuracy()) / 1000, new GeoPoint(Integer.parseInt(pointInfo[0]), Integer.parseInt(pointInfo[1])), new Float(info.getAsInteger(RingerDatabase.KEY_RADIUS)) / 1000, Debug.FUDGE_FACTOR)){
|
||||
if(GeoUtils.isIntersecting(point, Float.valueOf(mLocation.getAccuracy()) / 1000, new GeoPoint(Integer.parseInt(pointInfo[0]), Integer.parseInt(pointInfo[1])), new Float(info.getAsInteger(RingerDatabase.KEY_RADIUS)) / 1000, Debug.FUDGE_FACTOR)){
|
||||
c.close();
|
||||
getRinger(ringer, index);
|
||||
isDeafult = false;
|
||||
|
||||
@@ -9,6 +9,7 @@ package com.TwentyCodes.android.LocationRinger.ui;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentValues;
|
||||
@@ -64,6 +65,7 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
|
||||
* (non-Javadoc)
|
||||
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
protected void onCreate(Bundle arg0) {
|
||||
super.onCreate(arg0);
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.FileChannel;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
@@ -149,6 +150,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
||||
return intent;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void onCreate(final Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
@@ -39,31 +39,31 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
private ListeningEditText mRingerName;
|
||||
private ListeningEditText mRingerDescription;
|
||||
private ToggleButton mRingerEnabled;
|
||||
private OnContentChangedListener mListener;
|
||||
private ContentValues mInfo;
|
||||
private ContentValues mRinger;
|
||||
private final OnContentChangedListener mListener;
|
||||
private final ContentValues mInfo;
|
||||
private final ContentValues mRinger;
|
||||
|
||||
public AboutRingerFragment(ContentValues ringer, ContentValues info, OnContentChangedListener listener){
|
||||
public AboutRingerFragment(final ContentValues ringer, final ContentValues info, final OnContentChangedListener listener){
|
||||
this.mInfo = info;
|
||||
this.mRinger = ringer;
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
|
||||
if(this.mListener != null){
|
||||
ContentValues info = new ContentValues();
|
||||
final ContentValues info = new ContentValues();
|
||||
info.put(RingerDatabase.KEY_IS_ENABLED, isChecked);
|
||||
this.mListener.onRingerContentChanged(info);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
|
||||
|
||||
this.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
|
||||
View view = inflater.inflate(R.layout.ringer_about_fragment, container, false);
|
||||
final View view = inflater.inflate(R.layout.ringer_about_fragment, container, false);
|
||||
|
||||
if(Debug.DEBUG){
|
||||
for(Entry<String,Object> item : this.mInfo.valueSet())
|
||||
@@ -110,6 +110,7 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
public static class ListeningEditText extends EditText{
|
||||
private String mKey;
|
||||
private OnContentChangedListener mListener;
|
||||
private final ContentValues mTemp;
|
||||
|
||||
/**
|
||||
* Creates a new ListeningEditText
|
||||
@@ -118,6 +119,7 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
*/
|
||||
public ListeningEditText(Context context) {
|
||||
super(context);
|
||||
this.mTemp = new ContentValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,6 +130,7 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
*/
|
||||
public ListeningEditText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this.mTemp = new ContentValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,6 +142,7 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
*/
|
||||
public ListeningEditText(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
this.mTemp = new ContentValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,12 +153,11 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
||||
public void onDraw(Canvas canvas){
|
||||
super.onDraw(canvas);
|
||||
if(mListener != null){
|
||||
ContentValues info = new ContentValues();
|
||||
info.put(this.mKey, this.getText().toString());
|
||||
mTemp.put(this.mKey, this.getText().toString());
|
||||
if(this.mKey.equals(RingerDatabase.KEY_RINGER_NAME))
|
||||
this.mListener.onRingerContentChanged(info);
|
||||
this.mListener.onRingerContentChanged(mTemp);
|
||||
else
|
||||
this.mListener.onInfoContentChanged(info);
|
||||
this.mListener.onInfoContentChanged(mTemp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC
|
||||
|
||||
if(f instanceof BaseFeatureFragment){
|
||||
final int id = ((BaseFeatureFragment) f).getFragmentId();
|
||||
mAdded.remove(new Integer(id));
|
||||
mAdded.remove(Integer.valueOf(id));
|
||||
|
||||
/*
|
||||
* we need to notify our parent activity that the feature have been removed.
|
||||
|
||||
Reference in New Issue
Block a user