mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +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.ListPreference;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||||
|
import android.support.v7.preference.PreferenceGroup;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.acra.ACRA;
|
import org.acra.ACRA;
|
||||||
@@ -149,9 +150,17 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
Preference testData = findPreference("pref_key_test_data");
|
if (IS_DEBUG_BUILD) {
|
||||||
if (!IS_DEBUG_BUILD) {
|
findPreference("pref_key_explode").setOnPreferenceClickListener(
|
||||||
testData.setVisible(false);
|
preference -> {
|
||||||
|
throw new RuntimeException("Boom!");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
PreferenceGroup testing =
|
||||||
|
findPreference("pref_key_explode").getParent();
|
||||||
|
if (testing == null) throw new AssertionError();
|
||||||
|
testing.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|||||||
@@ -111,21 +111,29 @@
|
|||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:layout="@layout/preferences_category"
|
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
|
<Preference
|
||||||
android:key="pref_key_send_feedback"
|
android:key="pref_key_test_data"
|
||||||
android:title="@string/send_feedback"/>
|
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>
|
</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>
|
</PreferenceScreen>
|
||||||
|
|||||||
Reference in New Issue
Block a user