Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-12-28 12:22:23 +01:00
commit 25f4196a48
6 changed files with 31 additions and 13 deletions

View file

@ -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>

View file

@ -14,11 +14,8 @@
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
app:layout_scrollFlags="scroll"
app:tabIndicatorColor="?attr/pstsIndicatorColor"
app:tabSelectedTextColor="?attr/pstsIndicatorColor"
app:tabTextColor="@android:color/darker_gray"/>
android:background="@color/osmand_orange"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"

View file

@ -4,6 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:footerDividersEnabled="false"
android:groupIndicator="@null"
android:headerDividersEnabled="false"
android:orientation="vertical"
tools:context=".liveupdates.LiveUpdatesFragment"/>
<!--android:childDivider="@drawable/live_updates_expendable_list_divider"-->

View file

@ -4,8 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="64dp"
android:orientation="vertical"
android:background="?attr/bg_color">
android:orientation="vertical">
<include layout="@layout/shadow_bottom"/>
@ -17,11 +16,10 @@
<include layout="@layout/shadow_top"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="bottom"
android:background="?attr/bg_color"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="16dp"

View file

@ -31,6 +31,8 @@
android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
android:lines="1"
android:ellipsize="end"
tools:text="Belarus"/>
<TextView

View file

@ -32,6 +32,7 @@ import org.apache.commons.logging.Log;
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.UpdateFrequency;
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.preferenceDownloadViaWiFi;
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.preferenceUpdateFrequency;
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
@ -72,10 +74,12 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
final IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager();
final long timestamp = changesManager.getTimestamp(fileNameWithoutExtension);
String lastUpdateDate = formatDateTime(getActivity(), timestamp);
final long mapTimestamp = changesManager.getMapTimestamp(fileNameWithoutExtension);
String lastCheckDate = formatDateTime(getActivity(), mapTimestamp);
lastMapChangeTextView.setText(getString(R.string.last_map_change, lastCheckDate));
lastUpdateTextView.setText(getString(R.string.last_update, lastUpdateDate));
final long lastCheck = preferenceLastCheck(localIndexInfo, getSettings()).get();
String lastCheckDate = formatDateTime(getActivity(), lastCheck != DEFAULT_LAST_CHECK
? lastCheck : timestamp);
lastMapChangeTextView.setText(getString(R.string.last_map_change, lastUpdateDate));
lastUpdateTextView.setText(getString(R.string.last_update, lastCheckDate));
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
preferenceForLocalIndex(localIndexInfo, getSettings());
final OsmandSettings.CommonPreference<Boolean> downloadViaWiFiPreference =
@ -125,7 +129,12 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
@Override
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());
final int updateFrequencyInt = updateFrequencySpinner.getSelectedItemPosition();