forked from organicmaps/organicmaps
[AND] Clean-up
This commit is contained in:
parent
bbbcebc7c6
commit
3dd6c438bd
1 changed files with 2 additions and 7 deletions
|
@ -26,7 +26,7 @@ import com.mapswithme.util.UiUtils;
|
|||
|
||||
|
||||
public class BookmarkListAdapter extends BaseAdapter
|
||||
implements LocationService.Listener
|
||||
implements LocationService.Listener
|
||||
{
|
||||
private final Activity mContext;
|
||||
private final BookmarkCategory mCategory;
|
||||
|
@ -98,13 +98,11 @@ public class BookmarkListAdapter extends BaseAdapter
|
|||
sectionView = convertView;
|
||||
sectionName = (TextView) sectionView.getTag();
|
||||
}
|
||||
|
||||
final int sectionIndex = getSectionForPosition(position);
|
||||
sectionName.setText(getSections().get(sectionIndex));
|
||||
return sectionView;
|
||||
}
|
||||
|
||||
|
||||
if (convertView == null)
|
||||
{
|
||||
final int lId = type == TYPE_BMK ? R.layout.list_item_bookmark : R.layout.list_item_track;
|
||||
|
@ -133,7 +131,7 @@ public class BookmarkListAdapter extends BaseAdapter
|
|||
public Object getItem(int position)
|
||||
{
|
||||
if (getItemViewType(position) == TYPE_TRACK)
|
||||
return mCategory.getTrack(position - 1); // minus ONE section
|
||||
return mCategory.getTrack(position - 1);
|
||||
else
|
||||
return mCategory.getBookmark(position - 1
|
||||
- (isSectionEmpty(SECTION_TRACKS) ? 0 : mCategory.getTracksCount() + 1));
|
||||
|
@ -158,12 +156,9 @@ public class BookmarkListAdapter extends BaseAdapter
|
|||
mLocation.correctCompassAngles(mContext.getWindowManager().getDefaultDisplay(), north);
|
||||
final double ret = (north[1] >= 0.0 ? north[1] : north[0]);
|
||||
|
||||
// if difference is more than 1 degree
|
||||
if (mNorth == -1 || Math.abs(mNorth - ret) > 0.02)
|
||||
{
|
||||
mNorth = ret;
|
||||
//Log.d(TAG, "Compass updated, north = " + m_north);
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue