From f80f4bb5423b5a5034d69538f295fb7df2390a37 Mon Sep 17 00:00:00 2001 From: sigmabeta Date: Mon, 8 Jun 2015 18:07:26 -0400 Subject: [PATCH] Android: Show the version name as a subtitle in the GameGridActivity. --- Source/Android/app/build.gradle | 4 ++++ .../dolphinemu/activities/GameGridActivity.java | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index 56d8a88fbc..6ceec96e30 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -14,7 +14,11 @@ android { applicationId "org.dolphinemu.dolphinemu" minSdkVersion 18 targetSdkVersion 21 + + // TODO This should be set to the Buildbot build number for release builds, and be "1" for debug builds. versionCode 13 + + // TODO This should be set to the string currently provided by NativeLibrary.GetVersionString(). versionName "0.13" } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java index 9e0bc40366..cbb4ab8058 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java @@ -19,6 +19,7 @@ import android.view.View; import android.widget.ImageButton; import android.widget.Toolbar; +import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.adapters.GameAdapter; import org.dolphinemu.dolphinemu.model.GameDatabase; @@ -50,9 +51,10 @@ public final class GameGridActivity extends Activity implements LoaderManager.Lo ImageButton buttonAddDirectory = (ImageButton) findViewById(R.id.button_add_directory); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.grid_games); - // use this setting to improve performance if you know that changes - // in content do not change the layout size of the RecyclerView - //mRecyclerView.setHasFixedSize(true); + // TODO Rather than calling into native code, this should use the commented line below. + // String versionName = BuildConfig.VERSION_NAME; + String versionName = NativeLibrary.GetVersionString(); + toolbar.setSubtitle(versionName); // Specifying the LayoutManager determines how the RecyclerView arranges views. RecyclerView.LayoutManager layoutManager = new GridLayoutManager(this,