Hiding test button from release build.

This commit is contained in:
2021-10-09 23:03:06 +01:00
parent 0653507928
commit f68a4ca706
3 changed files with 3 additions and 4 deletions

View File

@@ -62,13 +62,12 @@ android {
versionName "2.2" versionName "2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "bool", "debug_visible", "false"
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
resValue "string", "debug_visibility", "gone"
manifestPlaceholders = [ manifestPlaceholders = [
appIcon: "@drawable/icon", appIcon: "@drawable/icon",
appIconRound: "@drawable/icon", appIconRound: "@drawable/icon",
@@ -77,7 +76,7 @@ android {
} }
debug { debug {
applicationIdSuffix ".debug" applicationIdSuffix ".debug"
resValue "string", "debug_visibility", "visible" resValue "bool", "debug_visible", "true"
manifestPlaceholders = [ manifestPlaceholders = [
appIcon: "@drawable/icon_debug", appIcon: "@drawable/icon_debug",
appIconRound: "@drawable/icon_debug", appIconRound: "@drawable/icon_debug",

View File

@@ -35,6 +35,7 @@ public class PuzzleBoardFragment extends Fragment
{ {
gameState = theApp().state(); gameState = theApp().state();
binding = FragmentPuzzleBoardBinding.inflate(inflater, container, false); binding = FragmentPuzzleBoardBinding.inflate(inflater, container, false);
binding.btnTest.setVisibility(getResources().getBoolean(R.bool.debug_visible) ? View.VISIBLE : View.GONE);
return binding.getRoot(); return binding.getRoot();
} }

View File

@@ -62,7 +62,6 @@
android:layout_weight="0" android:layout_weight="0"
android:background="@color/transparent" android:background="@color/transparent"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:visibility="visible"
android:text="test" /> android:text="test" />