Fixed various lint issues
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -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