mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Merge branch 'crash-button' into 'master'
Add crash button to UI in debug mode See merge request akwizgran/briar!801
This commit is contained in:
@@ -12,6 +12,7 @@ import android.support.v7.preference.CheckBoxPreference;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
import android.support.v7.preference.PreferenceGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.acra.ACRA;
|
||||
@@ -149,9 +150,17 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
return true;
|
||||
});
|
||||
|
||||
Preference testData = findPreference("pref_key_test_data");
|
||||
if (!IS_DEBUG_BUILD) {
|
||||
testData.setVisible(false);
|
||||
if (IS_DEBUG_BUILD) {
|
||||
findPreference("pref_key_explode").setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
throw new RuntimeException("Boom!");
|
||||
}
|
||||
);
|
||||
} else {
|
||||
PreferenceGroup testing =
|
||||
findPreference("pref_key_explode").getParent();
|
||||
if (testing == null) throw new AssertionError();
|
||||
testing.setVisible(false);
|
||||
}
|
||||
|
||||
loadSettings();
|
||||
|
||||
@@ -111,21 +111,29 @@
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/preferences_category"
|
||||
android:title="@string/feedback_settings_title">
|
||||
android:title="@string/feedback_settings_title"/>
|
||||
|
||||
<Preference
|
||||
android:key="pref_key_send_feedback"
|
||||
android:title="@string/send_feedback"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/preferences_category"
|
||||
android:title="Testing">
|
||||
|
||||
<Preference
|
||||
android:key="pref_key_send_feedback"
|
||||
android:title="@string/send_feedback"/>
|
||||
android:key="pref_key_test_data"
|
||||
android:title="Create Test Data">
|
||||
|
||||
<intent
|
||||
android:targetClass="org.briarproject.briar.android.test.TestDataActivity"
|
||||
android:targetPackage="@string/app_package"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="pref_key_explode"
|
||||
android:title="Crash"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<Preference
|
||||
android:key="pref_key_test_data"
|
||||
android:title="Create Test Data">
|
||||
|
||||
<intent
|
||||
android:targetClass="org.briarproject.briar.android.test.TestDataActivity"
|
||||
android:targetPackage="@string/app_package"/>
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
Reference in New Issue
Block a user