forked from organicmaps/organicmaps
[android] add: Data version in About screen.
This commit is contained in:
parent
7c97bb08a3
commit
85f27fac00
6 changed files with 27 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"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue