Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
25f4196a48
6 changed files with 31 additions and 13 deletions
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:insetLeft="56dp">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<size android:height="1dp"/>
|
||||||
|
<solid android:color="#F00"/>
|
||||||
|
<!--<solid android:color="@color/dashboard_divider_light"/>-->
|
||||||
|
</shape>
|
||||||
|
</inset>
|
|
@ -14,11 +14,8 @@
|
||||||
android:id="@+id/tab_layout"
|
android:id="@+id/tab_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/bg_color"
|
|
||||||
app:layout_scrollFlags="scroll"
|
app:layout_scrollFlags="scroll"
|
||||||
app:tabIndicatorColor="?attr/pstsIndicatorColor"
|
android:background="@color/osmand_orange"/>
|
||||||
app:tabSelectedTextColor="?attr/pstsIndicatorColor"
|
|
||||||
app:tabTextColor="@android:color/darker_gray"/>
|
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/viewpager"
|
android:id="@+id/viewpager"
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:footerDividersEnabled="false"
|
||||||
android:groupIndicator="@null"
|
android:groupIndicator="@null"
|
||||||
|
android:headerDividersEnabled="false"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".liveupdates.LiveUpdatesFragment"/>
|
tools:context=".liveupdates.LiveUpdatesFragment"/>
|
||||||
|
<!--android:childDivider="@drawable/live_updates_expendable_list_divider"-->
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:background="?attr/bg_color">
|
|
||||||
|
|
||||||
<include layout="@layout/shadow_bottom"/>
|
<include layout="@layout/shadow_bottom"/>
|
||||||
|
|
||||||
|
@ -17,11 +16,10 @@
|
||||||
<include layout="@layout/shadow_top"/>
|
<include layout="@layout/shadow_top"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:background="?attr/bg_color"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textSize="@dimen/default_list_text_size"
|
android:textSize="@dimen/default_list_text_size"
|
||||||
|
android:lines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
tools:text="Belarus"/>
|
tools:text="Belarus"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.DEFAULT_LAST_CHECK;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.TimeOfDay;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.TimeOfDay;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.UpdateFrequency;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.UpdateFrequency;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.formatDateTime;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.formatDateTime;
|
||||||
|
@ -39,6 +40,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getNameToDisplay;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceDownloadViaWiFi;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceDownloadViaWiFi;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceForLocalIndex;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceForLocalIndex;
|
||||||
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceTimeOfDayToUpdate;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceTimeOfDayToUpdate;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
|
||||||
|
@ -72,10 +74,12 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
||||||
final IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager();
|
final IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager();
|
||||||
final long timestamp = changesManager.getTimestamp(fileNameWithoutExtension);
|
final long timestamp = changesManager.getTimestamp(fileNameWithoutExtension);
|
||||||
String lastUpdateDate = formatDateTime(getActivity(), timestamp);
|
String lastUpdateDate = formatDateTime(getActivity(), timestamp);
|
||||||
final long mapTimestamp = changesManager.getMapTimestamp(fileNameWithoutExtension);
|
final long lastCheck = preferenceLastCheck(localIndexInfo, getSettings()).get();
|
||||||
String lastCheckDate = formatDateTime(getActivity(), mapTimestamp);
|
String lastCheckDate = formatDateTime(getActivity(), lastCheck != DEFAULT_LAST_CHECK
|
||||||
lastMapChangeTextView.setText(getString(R.string.last_map_change, lastCheckDate));
|
? lastCheck : timestamp);
|
||||||
lastUpdateTextView.setText(getString(R.string.last_update, lastUpdateDate));
|
lastMapChangeTextView.setText(getString(R.string.last_map_change, lastUpdateDate));
|
||||||
|
lastUpdateTextView.setText(getString(R.string.last_update, lastCheckDate));
|
||||||
|
|
||||||
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
|
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
|
||||||
preferenceForLocalIndex(localIndexInfo, getSettings());
|
preferenceForLocalIndex(localIndexInfo, getSettings());
|
||||||
final OsmandSettings.CommonPreference<Boolean> downloadViaWiFiPreference =
|
final OsmandSettings.CommonPreference<Boolean> downloadViaWiFiPreference =
|
||||||
|
@ -125,7 +129,12 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
||||||
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
if (liveUpdatePreference.get() != liveUpdatesSwitch.isChecked()) {
|
||||||
|
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
||||||
|
if (liveUpdatesSwitch.isChecked()) {
|
||||||
|
runLiveUpdate(localIndexInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
downloadViaWiFiPreference.set(downloadOverWiFiCheckBox.isChecked());
|
downloadViaWiFiPreference.set(downloadOverWiFiCheckBox.isChecked());
|
||||||
|
|
||||||
final int updateFrequencyInt = updateFrequencySpinner.getSelectedItemPosition();
|
final int updateFrequencyInt = updateFrequencySpinner.getSelectedItemPosition();
|
||||||
|
|
Loading…
Reference in a new issue