Don't show max_connections preference in release builds.

This commit is contained in:
Felix Ableitner 2015-07-01 01:56:10 +02:00
parent 939a2a000a
commit a7e78544b4
2 changed files with 5 additions and 3 deletions

View file

@ -82,7 +82,7 @@
<string name="notification_sounds">Notification Sounds</string>
<!-- Preference title (debug only)-->
<string name="max_connections">Maximum Number of Connections</string>
<string name="max_connections" translatable="false">Maximum Number of Connections</string>
<!-- Preference title -->
<string name="report_issue">Report Issue</string>

View file

@ -1,9 +1,9 @@
package com.nutomic.ensichat.fragments
import android.os.Bundle
import android.os.{Build, Bundle}
import android.preference.Preference.OnPreferenceChangeListener
import android.preference.{Preference, PreferenceFragment, PreferenceManager}
import com.nutomic.ensichat.R
import com.nutomic.ensichat.{BuildConfig, R}
import com.nutomic.ensichat.activities.EnsichatActivity
import com.nutomic.ensichat.fragments.SettingsFragment._
import com.nutomic.ensichat.protocol.body.UserName
@ -48,6 +48,8 @@ class SettingsFragment extends PreferenceFragment with OnPreferenceChangeListene
getResources.getString(R.string.default_scan_interval)))
maxConnections.setSummary(pm.getString(MaxConnections,
getResources.getString(R.string.default_max_connections)))
if (!BuildConfig.DEBUG)
getPreferenceScreen.removePreference(maxConnections)
}
/**