forked from organicmaps/organicmaps
Removed guide icon from Download Contry UI.
This commit is contained in:
parent
a82dbb9dc5
commit
896a568b46
2 changed files with 43 additions and 77 deletions
|
@ -1,63 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight" >
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" >
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/flagContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/country_flag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingLeft="@dimen/dp_x_3"
|
||||
android:paddingRight="@dimen/dp_x_3"
|
||||
android:scaleType="center" />
|
||||
|
||||
<!-- Invisible by default -->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/guide_available"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left"
|
||||
android:paddingLeft="@dimen/dp_x_1"
|
||||
android:paddingTop="@dimen/dp_x_1"
|
||||
android:src="@drawable/ic_guide_mark"
|
||||
android:visibility="invisible" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/flagContainer"
|
||||
android:maxLines="2"
|
||||
android:paddingRight="@dimen/dp_x_3"
|
||||
android:textAppearance="@style/Holo.TextAppearance.Large.Light" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/download_progress"
|
||||
style="@style/Holo.ProgressBar.Horizontal.Light"
|
||||
android:layout_width="match_parent"
|
||||
<ImageView
|
||||
android:id="@+id/country_flag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="-7dp"
|
||||
android:max="100"
|
||||
android:padding="0dp" />
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:paddingLeft="@dimen/dp_x_3"
|
||||
android:paddingRight="@dimen/dp_x_3"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/country_flag"
|
||||
android:maxLines="2"
|
||||
android:paddingRight="@dimen/dp_x_3"
|
||||
android:textAppearance="@style/Holo.TextAppearance.Large.Light"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/download_progress"
|
||||
style="@style/Holo.ProgressBar.Horizontal.Light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="-7dp"
|
||||
android:max="100"
|
||||
android:padding="0dp"/>
|
||||
|
||||
</FrameLayout>
|
|
@ -1,10 +1,5 @@
|
|||
package com.mapswithme.country;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
@ -39,6 +34,11 @@ import com.mapswithme.util.UiUtils;
|
|||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.statistics.Statistics;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/// ListView adapter
|
||||
class DownloadAdapter extends BaseAdapter
|
||||
{
|
||||
|
@ -374,14 +374,12 @@ class DownloadAdapter extends BaseAdapter
|
|||
{
|
||||
public TextView mName = null;
|
||||
public ImageView mFlag = null;
|
||||
public ImageView mGuide = null;
|
||||
public ProgressBar mProgress = null;
|
||||
|
||||
void initFromView(View v)
|
||||
{
|
||||
mName = (TextView) v.findViewById(R.id.title);
|
||||
mFlag = (ImageView) v.findViewById(R.id.country_flag);
|
||||
mGuide = (ImageView) v.findViewById(R.id.guide_available);
|
||||
mProgress = (ProgressBar) v.findViewById(R.id.download_progress);
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +455,6 @@ class DownloadAdapter extends BaseAdapter
|
|||
// this part if only for downloadable items
|
||||
if (type != TYPE_COUNTRY_GROUP)
|
||||
{
|
||||
populateForGuide(position, holder);
|
||||
setUpProgress(holder, type, position);
|
||||
}
|
||||
}
|
||||
|
@ -509,19 +506,6 @@ class DownloadAdapter extends BaseAdapter
|
|||
holder.mName.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null);
|
||||
}
|
||||
|
||||
private void populateForGuide(int position, DownloadAdapter.ViewHolder holder)
|
||||
{
|
||||
if (mHasGoogleStore)
|
||||
{
|
||||
final CountryItem item = getItem(position);
|
||||
final GuideInfo gi = Framework.getGuideInfoForIndexWithApiCheck(item.mCountryIdx);
|
||||
if (gi != null)
|
||||
UiUtils.show(holder.mGuide);
|
||||
else
|
||||
UiUtils.hide(holder.mGuide);
|
||||
}
|
||||
}
|
||||
|
||||
/// Get list item position by index(g, c, r).
|
||||
/// @return -1 If no such item in display list.
|
||||
private int getItemPosition(Index idx)
|
||||
|
|
Loading…
Add table
Reference in a new issue