Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-03-10 11:25:21 +01:00
commit 9cf6edd3a4
4 changed files with 14 additions and 6 deletions

View file

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<!--
Disclaimer:
@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="report">Report</string>
<string name="osmo_connect_to_device_tracker_id">Tracker ID</string>
<string name="osmo_connect_to_group_id">Group ID</string>
<string name="osmo_connect">Join</string>

View file

@ -33,6 +33,7 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import net.osmand.map.WorldRegion;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@ -69,7 +70,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFreq
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppListener {
public static final String TITLE = "Live Updates";
public static final int TITLE = R.string.live_updates;
private static final int SUBSCRIPTION_SETTINGS = 5;
public static final Comparator<LocalIndexInfo> LOCAL_INDEX_INFO_COMPARATOR = new Comparator<LocalIndexInfo>() {
@Override

View file

@ -1,6 +1,7 @@
package net.osmand.plus.liveupdates;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
@ -40,7 +41,7 @@ public class OsmLiveActivity extends AbstractDownloadActivity
}
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
pagerAdapter = new LiveUpdatesFragmentPagerAdapter(getSupportFragmentManager());
pagerAdapter = new LiveUpdatesFragmentPagerAdapter(getSupportFragmentManager(), getResources());
viewPager.setAdapter(pagerAdapter);
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
@ -96,11 +97,16 @@ public class OsmLiveActivity extends AbstractDownloadActivity
public static class LiveUpdatesFragmentPagerAdapter extends FragmentPagerAdapter {
private final Fragment[] fragments = new Fragment[]{new LiveUpdatesFragment(),
new ReportsFragment()};
private final String[] titles = new String[]{LiveUpdatesFragment.TITLE,
private static final int[] titleIds = new int[]{LiveUpdatesFragment.TITLE,
ReportsFragment.TITLE};
private final String[] titles;
public LiveUpdatesFragmentPagerAdapter(FragmentManager fm) {
public LiveUpdatesFragmentPagerAdapter(FragmentManager fm, Resources res) {
super(fm);
titles = new String[titleIds.length];
for (int i = 0; i < titleIds.length; i++) {
titles[i] = res.getString(titleIds[i]);
}
}
@Override

View file

@ -40,7 +40,7 @@ import java.util.Calendar;
import java.util.Locale;
public class ReportsFragment extends BaseOsmAndFragment implements CountrySelectionFragment.OnFragmentInteractionListener {
public static final String TITLE = "Report";
public static final int TITLE = R.string.report;
public static final String DOMAIN = "http://download.osmand.net/";
public static final String TOTAL_CHANGES_BY_MONTH_URL_PATTERN = DOMAIN +
"reports/query_report.php?report=total_changes_by_month&month=%s&region=%s";