Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-10-06 10:57:50 +02:00
commit 8dddbb0d11
8 changed files with 17 additions and 35 deletions

View file

@ -2,6 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center_vertical"
@ -9,13 +10,15 @@
android:paddingLeft="@dimen/list_header_padding"
android:paddingRight="@dimen/list_header_padding">
<TextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/section_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:maxLines="1"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"
tools:text="World Regions"/>
</LinearLayout>

View file

@ -11,8 +11,6 @@
android:layout_height="@dimen/list_item_height"
android:layout_gravity="center_vertical"
android:drawablePadding="24dp"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:textColor="?android:textColorPrimary"

View file

@ -64,8 +64,6 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dashFavIconMargin"
android:background="?attr/dashboard_button"
android:focusable="false"
android:focusableInTouchMode="false"
tools:src="@drawable/ic_action_import"
tools:visibility="visible"
android:visibility="gone"/>
@ -76,7 +74,7 @@
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="4dp"
android:text="BUY"
android:text="@string/buy"
android:visibility="gone"/>
</LinearLayout>

View file

@ -34,7 +34,7 @@
<dimen name="list_header_text_left_margin">12dp</dimen>
<dimen name="list_header_bottom_margin">8dp</dimen>
<dimen name="favorites_icon_right_margin">18dp</dimen>
<dimen name="favorites_icon_right_margin">24dp</dimen>
<dimen name="local_index_check_right_margin">10dp</dimen>
<dimen name="favorites_icon_top_margin">13dp</dimen>
<dimen name="dialog_elements_vertical_margin">16dp</dimen>

View file

@ -2000,4 +2000,5 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="downloading_number_of_files">Downloading - %1$d file</string>
<string name="show_free_version_banner">Show free version banner</string>
<string name="show_free_version_banner_description">Even if you have paid version you still can see free version banner</string>
<string name="buy">BUY</string>
</resources>

View file

@ -15,7 +15,6 @@ import net.osmand.access.AccessibleToast;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.WorldRegion;
import net.osmand.plus.download.BaseDownloadActivity;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.DownloadActivityType;
import net.osmand.plus.download.IndexItem;
@ -113,19 +112,9 @@ public class ItemViewHolder {
} else {
descrTextView.setText(indexItem.getSizeDescription(context));
}
// TODO replace with imageView.
rightImageButton.setVisibility(View.VISIBLE);
rightImageButton.setImageDrawable(getContextIcon(context, R.drawable.ic_action_import));
rightImageButton.setTag(R.id.index_item, indexItem);
rightImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((BaseDownloadActivity) v.getContext())
.startDownload((IndexItem) v.getTag(R.id.index_item));
// progressBar.setVisibility(View.VISIBLE);
// rightImageButton.setImageDrawable(getContextIcon(context,
// R.drawable.ic_action_remove_dark));
}
});
progressBar.setVisibility(View.GONE);
if (rightButtonAction != RightButtonAction.UNKNOWN) {

View file

@ -19,7 +19,9 @@ import net.osmand.plus.Version;
import net.osmand.plus.WorldRegion;
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import net.osmand.plus.download.BaseDownloadActivity;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.srtmplugin.SRTMPlugin;
@ -93,9 +95,13 @@ public class RegionItemsFragment extends OsmandExpandableListFragment {
((RegionDialogFragment) getParentFragment())
.onRegionSelected(region.getRegionId());
return true;
} else {
return false;
} else if (obj instanceof ItemsListBuilder.ResourceItem) {
IndexItem indexItem = ((ItemsListBuilder.ResourceItem) obj).getIndexItem();
((BaseDownloadActivity) getActivity())
.startDownload(indexItem);
return true;
}
return false;
}
private void expandAllGroups() {
@ -233,12 +239,6 @@ public class RegionItemsFragment extends OsmandExpandableListFragment {
}
}
TypedValue typedValue = new TypedValue();
Resources.Theme theme = getActivity().getTheme();
theme.resolveAttribute(R.attr.bg_color, typedValue, true);
int mainBackgroundColor = typedValue.resourceId;
convertView.setBackgroundResource(mainBackgroundColor);
return convertView;
}

View file

@ -251,12 +251,6 @@ public class WorldItemsFragment extends OsmandExpandableListFragment {
viewHolder.textView.setCompoundDrawablesWithIntrinsicBounds(iconLeft, null, null, null);
viewHolder.textView.setText(item.getName());
TypedValue typedValue = new TypedValue();
Resources.Theme theme = getActivity().getTheme();
theme.resolveAttribute(R.attr.bg_color, typedValue, true);
int mainBackgroundColor = typedValue.resourceId;
convertView.setBackgroundResource(mainBackgroundColor);
} else if (groupPosition == worldMapsIndex) {
ItemsListBuilder.ResourceItem item = (ItemsListBuilder.ResourceItem) child;
ItemViewHolder viewHolder;
@ -272,7 +266,6 @@ public class WorldItemsFragment extends OsmandExpandableListFragment {
viewHolder.setNauticalPluginDisabled(nauticalPluginDisabled);
viewHolder.setFreeVersion(freeVersion);
viewHolder.bindIndexItem(item.getIndexItem(), getDownloadActivity(), false, false);
} else if (groupPosition == voicePromptsIndex) {
String item = (String)child;
SimpleViewHolder viewHolder;