From 102e8ff8cf252ab9a93a26cafd299009d3a7b019 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 1 Sep 2019 03:51:31 -0400 Subject: [PATCH] android: frontend: Further simplify show FPS overlay text. --- .../citra_android/fragments/EmulationFragment.java | 13 ++++++------- .../app/src/main/res/layout/fragment_emulation.xml | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_android/fragments/EmulationFragment.java b/src/android/app/src/main/java/org/citra/citra_android/fragments/EmulationFragment.java index 7d7bc5bcc..fe6ecac37 100644 --- a/src/android/app/src/main/java/org/citra/citra_android/fragments/EmulationFragment.java +++ b/src/android/app/src/main/java/org/citra/citra_android/fragments/EmulationFragment.java @@ -18,8 +18,6 @@ import android.widget.Button; import android.widget.TextView; import android.widget.Toast; -import java.text.DecimalFormat; - import org.citra.citra_android.NativeLibrary; import org.citra.citra_android.R; import org.citra.citra_android.activities.EmulationActivity; @@ -190,12 +188,13 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C perfStatsUpdater = () -> { - final DecimalFormat df = new DecimalFormat("#.#"); - double[] perfStats = NativeLibrary.GetPerfStats(); - mPerfStats.setText(String.format("FPS: %s Speed: %s%%", df.format(perfStats[FPS]), - df.format(perfStats[SPEED] * 100.0))); + final double[] perfStats = NativeLibrary.GetPerfStats(); + if (perfStats[FPS] > 0) { + mPerfStats.setText(String.format("FPS: %d Speed: %d%%", (int)(perfStats[FPS] + 0.5), + (int)(perfStats[SPEED] * 100.0 + 0.5))); + } - perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 2000 /* 1s */); + perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 3000); }; perfStatsUpdateHandler.post(perfStatsUpdater); diff --git a/src/android/app/src/main/res/layout/fragment_emulation.xml b/src/android/app/src/main/res/layout/fragment_emulation.xml index 5f2f453fa..3901b9801 100644 --- a/src/android/app/src/main/res/layout/fragment_emulation.xml +++ b/src/android/app/src/main/res/layout/fragment_emulation.xml @@ -29,7 +29,6 @@ android:linksClickable="false" android:longClickable="false" android:shadowColor="@android:color/black" - android:text="TextView" android:textColor="@android:color/white" android:textSize="12sp" />