Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-10-06 17:14:14 +02:00
commit f7696b4afc
7 changed files with 92 additions and 73 deletions

View file

@ -7,5 +7,7 @@
<include layout="@layout/free_version_banner"/>
<include layout="@layout/progress_with_two_texts"/>
<include layout="@layout/download_items_list"/>
</LinearLayout>

View file

@ -3,6 +3,7 @@
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:id="@+id/freeVersionBanner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -156,19 +157,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/getFullVersionButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="GET FULL VERSION"/>
osmand:textAllCapsCompat="true"
android:text="@string/get_full_version"/>
<Button
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/laterButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="LATER"/>
osmand:textAllCapsCompat="true"
android:text="@string/later"/>
</LinearLayout>
</LinearLayout>

View file

@ -15,7 +15,8 @@
android:orientation="vertical"
android:layout_margin="4dp"
android:background="?attr/bg_card"
android:padding="10dp">
android:padding="10dp"
android:id="@+id/downloadProgressLayout">
<LinearLayout
android:layout_width="fill_parent"

View file

@ -26,48 +26,7 @@
layout="@layout/free_version_banner"
android:background="#F00"/>
<LinearLayout
android:id="@+id/downloadProgressLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:orientation="vertical"
android:padding="10dp"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/leftTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
tools:text="@string/device_memory"/>
<TextView
android:id="@+id/rightTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:text="@string/free"/>
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:progressDrawable="?attr/size_progress_bar"/>
</LinearLayout>
<include layout="@layout/progress_with_two_texts"/>
<FrameLayout
android:id="@+id/fragmentContainer"

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/downloadProgressLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:orientation="vertical"
android:padding="10dp"
android:visibility="gone"
tools:visibility="visible"
tools:showIn="@layout/maps_in_category_fragment">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/leftTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
tools:text="@string/device_memory"/>
<TextView
android:id="@+id/rightTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:text="@string/free"/>
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:progressDrawable="?attr/size_progress_bar"/>
</LinearLayout>

View file

@ -2004,4 +2004,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="buy">BUY</string>
<string name="activate_seamarks_plugin">Please activate Seamarks plugin</string>
<string name="activate_srtm_plugin">Please activate SRTM plugin</string>
<string name="later">Later</string>
<string name="get_full_version">Get full version</string>
</resources>

View file

@ -1,29 +1,5 @@
package net.osmand.plus.download;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.osmand.IndexConstants;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.LocalIndexInfo;
import net.osmand.plus.activities.OsmAndListFragment;
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.base.BasicProgressAsyncTask;
import net.osmand.plus.download.items.WorldItemsFragment;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.ActivityNotFoundException;
@ -51,6 +27,31 @@ import android.widget.ListAdapter;
import android.widget.ProgressBar;
import android.widget.TextView;
import net.osmand.IndexConstants;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.LocalIndexInfo;
import net.osmand.plus.activities.OsmAndListFragment;
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.base.BasicProgressAsyncTask;
import net.osmand.plus.download.items.WorldItemsFragment;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class DownloadActivity extends BaseDownloadActivity {
@ -286,7 +287,7 @@ public class DownloadActivity extends BaseDownloadActivity {
}
if (updateOnlyProgress) {
if (!basicProgressAsyncTask.isIndeterminate()) {
if (basicProgressAsyncTask != null && !basicProgressAsyncTask.isIndeterminate()) {
progressPercent.setText(basicProgressAsyncTask.getProgressPercentage() + "%");
determinateProgressBar.setProgress(basicProgressAsyncTask.getProgressPercentage());
}
@ -675,12 +676,13 @@ public class DownloadActivity extends BaseDownloadActivity {
public void updateProgress(boolean isFinished, boolean indeterminate, int percent, String message) {
if(isFinished) {
downloadProgressLayout.setVisibility(View.GONE);
// TODO BUG restore free version
freeVersionBanner.setVisibility(View.VISIBLE);
} else {
if (freeVersionBanner.getVisibility() == View.VISIBLE) {
freeVersionBanner.setVisibility(View.GONE);
}
downloadProgressLayout.setVisibility(View.VISIBLE);
progressBar.setIndeterminate(indeterminate);
if(indeterminate) {
// TODO
leftTextView.setText(message);