Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f7696b4afc
7 changed files with 92 additions and 73 deletions
|
@ -7,5 +7,7 @@
|
||||||
|
|
||||||
<include layout="@layout/free_version_banner"/>
|
<include layout="@layout/free_version_banner"/>
|
||||||
|
|
||||||
|
<include layout="@layout/progress_with_two_texts"/>
|
||||||
|
|
||||||
<include layout="@layout/download_items_list"/>
|
<include layout="@layout/download_items_list"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -3,6 +3,7 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/freeVersionBanner"
|
android:id="@+id/freeVersionBanner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -156,19 +157,21 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<Button
|
<net.osmand.plus.widgets.ButtonEx
|
||||||
android:id="@+id/getFullVersionButton"
|
android:id="@+id/getFullVersionButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
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:id="@+id/laterButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="LATER"/>
|
osmand:textAllCapsCompat="true"
|
||||||
|
android:text="@string/later"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
android:background="?attr/bg_card"
|
android:background="?attr/bg_card"
|
||||||
android:padding="10dp">
|
android:padding="10dp"
|
||||||
|
android:id="@+id/downloadProgressLayout">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
|
|
@ -26,48 +26,7 @@
|
||||||
layout="@layout/free_version_banner"
|
layout="@layout/free_version_banner"
|
||||||
android:background="#F00"/>
|
android:background="#F00"/>
|
||||||
|
|
||||||
<LinearLayout
|
<include layout="@layout/progress_with_two_texts"/>
|
||||||
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>
|
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragmentContainer"
|
android:id="@+id/fragmentContainer"
|
||||||
|
|
50
OsmAnd/res/layout/progress_with_two_texts.xml
Normal file
50
OsmAnd/res/layout/progress_with_two_texts.xml
Normal 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>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2004,4 +2004,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
||||||
<string name="buy">BUY</string>
|
<string name="buy">BUY</string>
|
||||||
<string name="activate_seamarks_plugin">Please activate Seamarks plugin</string>
|
<string name="activate_seamarks_plugin">Please activate Seamarks plugin</string>
|
||||||
<string name="activate_srtm_plugin">Please activate SRTM 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>
|
</resources>
|
||||||
|
|
|
@ -1,29 +1,5 @@
|
||||||
package net.osmand.plus.download;
|
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;
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
|
@ -51,6 +27,31 @@ import android.widget.ListAdapter;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
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 {
|
public class DownloadActivity extends BaseDownloadActivity {
|
||||||
|
|
||||||
|
@ -286,7 +287,7 @@ public class DownloadActivity extends BaseDownloadActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateOnlyProgress) {
|
if (updateOnlyProgress) {
|
||||||
if (!basicProgressAsyncTask.isIndeterminate()) {
|
if (basicProgressAsyncTask != null && !basicProgressAsyncTask.isIndeterminate()) {
|
||||||
progressPercent.setText(basicProgressAsyncTask.getProgressPercentage() + "%");
|
progressPercent.setText(basicProgressAsyncTask.getProgressPercentage() + "%");
|
||||||
determinateProgressBar.setProgress(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) {
|
public void updateProgress(boolean isFinished, boolean indeterminate, int percent, String message) {
|
||||||
if(isFinished) {
|
if(isFinished) {
|
||||||
downloadProgressLayout.setVisibility(View.GONE);
|
downloadProgressLayout.setVisibility(View.GONE);
|
||||||
// TODO BUG restore free version
|
freeVersionBanner.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
if (freeVersionBanner.getVisibility() == View.VISIBLE) {
|
if (freeVersionBanner.getVisibility() == View.VISIBLE) {
|
||||||
freeVersionBanner.setVisibility(View.GONE);
|
freeVersionBanner.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
downloadProgressLayout.setVisibility(View.VISIBLE);
|
downloadProgressLayout.setVisibility(View.VISIBLE);
|
||||||
|
progressBar.setIndeterminate(indeterminate);
|
||||||
if(indeterminate) {
|
if(indeterminate) {
|
||||||
// TODO
|
// TODO
|
||||||
leftTextView.setText(message);
|
leftTextView.setText(message);
|
||||||
|
|
Loading…
Reference in a new issue