forked from organicmaps/organicmaps
Fixes
This commit is contained in:
parent
7674e04bfd
commit
088d6bc1e8
2 changed files with 10 additions and 11 deletions
|
@ -41,7 +41,7 @@ public class DownloadedAdapter extends BaseDownloadAdapter implements ActiveCoun
|
|||
view = convertView;
|
||||
holder = (ViewHolder) view.getTag();
|
||||
}
|
||||
if (position == mInProgressCount)
|
||||
if (position == mInProgressCount && containsOutdated())
|
||||
holder.mName.setText(mActivity.getString(R.string.downloader_outdated_maps));
|
||||
else
|
||||
holder.mName.setText(mActivity.getString(R.string.downloader_uptodate_maps));
|
||||
|
@ -112,9 +112,8 @@ public class DownloadedAdapter extends BaseDownloadAdapter implements ActiveCoun
|
|||
|
||||
private boolean isHeader(int position)
|
||||
{
|
||||
return (containsOutdated() && position == mInProgressCount) ||
|
||||
(!containsOutdated() && containsDownloaded() && position == mInProgressCount) ||
|
||||
(containsOutdated() && containsDownloaded() && position == mInProgressCount + mOutdatedCount + 1);
|
||||
return ((containsOutdated() || containsUpdated()) && position == mInProgressCount) ||
|
||||
(containsOutdated() && containsUpdated() && position == mInProgressCount + mOutdatedCount + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,7 +139,7 @@ public class DownloadedAdapter extends BaseDownloadAdapter implements ActiveCoun
|
|||
return mOutdatedCount != 0;
|
||||
}
|
||||
|
||||
protected boolean containsDownloaded()
|
||||
protected boolean containsUpdated()
|
||||
{
|
||||
return mUpdatedCount != 0;
|
||||
}
|
||||
|
@ -162,11 +161,11 @@ public class DownloadedAdapter extends BaseDownloadAdapter implements ActiveCoun
|
|||
if (position < newGroupEnd)
|
||||
return ActiveCountryTree.GROUP_NEW;
|
||||
|
||||
final int outdatedGroupEnd = newGroupEnd + mOutdatedCount + 1;
|
||||
final int outdatedGroupEnd = containsOutdated() ? newGroupEnd + mOutdatedCount + 1 : newGroupEnd;
|
||||
if (position < outdatedGroupEnd)
|
||||
return ActiveCountryTree.GROUP_OUT_OF_DATE;
|
||||
|
||||
final int updatedGroupEnd = outdatedGroupEnd + mUpdatedCount + 1;
|
||||
final int updatedGroupEnd = containsUpdated() ? outdatedGroupEnd + mUpdatedCount + 1 : outdatedGroupEnd;
|
||||
if (position < updatedGroupEnd)
|
||||
return ActiveCountryTree.GROUP_UP_TO_DATE;
|
||||
|
||||
|
@ -179,11 +178,11 @@ public class DownloadedAdapter extends BaseDownloadAdapter implements ActiveCoun
|
|||
if (position < newGroupEnd)
|
||||
return position;
|
||||
|
||||
final int outdatedGroupEnd = newGroupEnd + mOutdatedCount + 1;
|
||||
final int outdatedGroupEnd = containsOutdated() ? newGroupEnd + mOutdatedCount + 1 : newGroupEnd;
|
||||
if (position < outdatedGroupEnd)
|
||||
return position - newGroupEnd - 1;
|
||||
|
||||
final int updatedGroupEnd = outdatedGroupEnd + mUpdatedCount + 1;
|
||||
final int updatedGroupEnd = containsUpdated() ? outdatedGroupEnd + mUpdatedCount + 1 : outdatedGroupEnd;
|
||||
if (position < updatedGroupEnd)
|
||||
return position - outdatedGroupEnd - 1;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class Framework
|
|||
void onRoutingError(boolean isSuccess, String message, boolean openDownloader);
|
||||
}
|
||||
|
||||
public interface ButProListener
|
||||
public interface BuyProListener
|
||||
{
|
||||
void onBuyPro();
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public class Framework
|
|||
public native static LocationState.RoutingInfo nativeGetRouteFollowingInfo();
|
||||
|
||||
public native static void nativeSetRoutingListener(RoutingListener listener);
|
||||
public native static void nativeSetBuyProListener(ButProListener listener);
|
||||
public native static void nativeSetBuyProListener(BuyProListener listener);
|
||||
//@}
|
||||
|
||||
public native static String nativeGetCountryNameIfAbsent(double lat, double lon);
|
||||
|
|
Loading…
Add table
Reference in a new issue