forked from organicmaps/organicmaps
Merge pull request #1240 from trashkalmar/data-version
[android] add: Data version in About screen.
This commit is contained in:
commit
fa06b86797
11 changed files with 43 additions and 1 deletions
|
@ -935,6 +935,12 @@ extern "C"
|
|||
frm()->UpdateSavedDataVersion();
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_Framework_nativeGetDataVersion(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
return frm()->GetCurrentDataVersion();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_Framework_getDrawScale(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,14 @@
|
|||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
tools:text="Version: 5.0.0"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/data_version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body4"
|
||||
tools:text="Data: 151215"/>
|
||||
|
||||
<TextView android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
|
|
|
@ -301,6 +301,8 @@
|
|||
<string name="show_on_backscreen">Показать на втором экране</string>
|
||||
<!-- Prints version number in About dialog -->
|
||||
<string name="version">Версия: %s</string>
|
||||
<!-- Data version in «About» screen -->
|
||||
<string name="data_version">Версия данных: %d</string>
|
||||
<!-- Confirmation in downloading countries dialog -->
|
||||
<string name="are_you_sure">Вы уверены, что хотите продолжить?</string>
|
||||
<!-- Title for tracks category in bookmarks manager -->
|
||||
|
|
|
@ -303,6 +303,8 @@
|
|||
<string name="show_on_backscreen">Show on Back screen</string>
|
||||
<!-- Prints version number in About dialog -->
|
||||
<string name="version">Version: %s</string>
|
||||
<!-- Data version in «About» screen -->
|
||||
<string name="data_version">Data version: %d</string>
|
||||
<!-- Confirmation in downloading countries dialog -->
|
||||
<string name="are_you_sure">Are you sure you want to continue?</string>
|
||||
<!-- Title for tracks category in bookmarks manager -->
|
||||
|
|
|
@ -96,6 +96,8 @@ public class Framework
|
|||
|
||||
public native static void nativeUpdateSavedDataVersion();
|
||||
|
||||
public native static long nativeGetDataVersion();
|
||||
|
||||
public native static void nativeClearApiPoints();
|
||||
|
||||
public native static void injectData(SearchResult searchResult, long index);
|
||||
|
|
|
@ -12,6 +12,7 @@ import android.view.ViewGroup;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.widget.BaseShadowController;
|
||||
import com.mapswithme.maps.widget.ObservableScrollView;
|
||||
|
@ -46,6 +47,9 @@ public class AboutFragment extends BaseSettingsFragment
|
|||
((TextView) mFrame.findViewById(R.id.version))
|
||||
.setText(getString(R.string.version, BuildConfig.VERSION_NAME));
|
||||
|
||||
((TextView) mFrame.findViewById(R.id.data_version))
|
||||
.setText(getString(R.string.data_version, Framework.nativeGetDataVersion()));
|
||||
|
||||
mFrame.findViewById(R.id.web).setOnClickListener(this);
|
||||
mFrame.findViewById(R.id.blog).setOnClickListener(this);
|
||||
mFrame.findViewById(R.id.facebook).setOnClickListener(this);
|
||||
|
|
|
@ -467,6 +467,9 @@
|
|||
/* Prints version number in About dialog */
|
||||
"version" = "Version: %@";
|
||||
|
||||
/* Data version in «About» screen */
|
||||
"data_version" = "Data version: %d";
|
||||
|
||||
/* Confirmation in downloading countries dialog */
|
||||
"are_you_sure" = "Are you sure you want to continue?";
|
||||
|
||||
|
|
|
@ -467,6 +467,9 @@
|
|||
/* Prints version number in About dialog */
|
||||
"version" = "Версия: %@";
|
||||
|
||||
/* Data version in «About» screen */
|
||||
"data_version" = "Версия данных: %d";
|
||||
|
||||
/* Confirmation in downloading countries dialog */
|
||||
"are_you_sure" = "Вы уверены, что хотите продолжить?";
|
||||
|
||||
|
|
|
@ -1796,6 +1796,11 @@ void Framework::UpdateSavedDataVersion()
|
|||
Settings::Set("DataVersion", m_storage.GetCurrentDataVersion());
|
||||
}
|
||||
|
||||
int64_t Framework::GetCurrentDataVersion()
|
||||
{
|
||||
return m_storage.GetCurrentDataVersion();
|
||||
}
|
||||
|
||||
void Framework::BuildRoute(m2::PointD const & finish, uint32_t timeoutSec)
|
||||
{
|
||||
ASSERT_THREAD_CHECKER(m_threadChecker, ("BuildRoute"));
|
||||
|
|
|
@ -480,10 +480,11 @@ private:
|
|||
public:
|
||||
//@}
|
||||
|
||||
/// @name Map updates
|
||||
/// @name Data versions
|
||||
//@{
|
||||
bool IsDataVersionUpdated();
|
||||
void UpdateSavedDataVersion();
|
||||
int64_t GetCurrentDataVersion();
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
|
|
@ -4957,6 +4957,12 @@
|
|||
nb = Versjon: %@
|
||||
fi = Versio: %@
|
||||
|
||||
[data_version]
|
||||
tags = ios,android
|
||||
comment = Data version in «About» screen
|
||||
en = Data version: %d
|
||||
ru = Версия данных: %d
|
||||
|
||||
[are_you_sure]
|
||||
tags = android,tizen
|
||||
comment = Confirmation in downloading countries dialog
|
||||
|
|
Loading…
Add table
Reference in a new issue