Skip to content

Commit bd2da1a

Browse files
committed
Added "Settings page: Experimental" | Close #111.
1 parent 7764b9f commit bd2da1a

File tree

8 files changed

+105
-3
lines changed

8 files changed

+105
-3
lines changed

FlowCrypt/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@
9696
android:label="@string/help_feedback_or_question"
9797
android:screenOrientation="portrait" />
9898

99+
<activity
100+
android:name=".ui.activity.settings.ExperimentalSettingsActivity"
101+
android:label="@string/experimental_settings"
102+
android:screenOrientation="portrait" />
103+
99104
<activity
100105
android:name=".ui.activity.HtmlViewFromAssetsRawActivity"
101106
android:label="@string/app_name"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Business Source License 1.0 © 2017 FlowCrypt Limited ([email protected]).
3+
* Use limitations apply. See https://github.com/FlowCrypt/flowcrypt-android/blob/master/LICENSE
4+
* Contributors: DenBond7
5+
*/
6+
7+
package com.flowcrypt.email.ui.activity.fragment;
8+
9+
import android.os.Bundle;
10+
11+
import com.flowcrypt.email.R;
12+
import com.flowcrypt.email.ui.activity.fragment.base.BasePreferenceFragment;
13+
14+
/**
15+
* @author DenBond7
16+
* Date: 29.09.2017.
17+
* Time: 22:46.
18+
19+
*/
20+
public class ExperimentalSettingsFragment extends BasePreferenceFragment {
21+
@Override
22+
public void onCreatePreferences(Bundle bundle, String s) {
23+
addPreferencesFromResource(R.xml.preferences_experimental_settings);
24+
}
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Business Source License 1.0 © 2017 FlowCrypt Limited ([email protected]).
3+
* Use limitations apply. See https://github.com/FlowCrypt/flowcrypt-android/blob/master/LICENSE
4+
* Contributors: DenBond7
5+
*/
6+
7+
package com.flowcrypt.email.ui.activity.settings;
8+
9+
import android.view.View;
10+
11+
import com.flowcrypt.email.R;
12+
13+
/**
14+
* @author DenBond7
15+
* Date: 29.09.2017.
16+
* Time: 22:42.
17+
18+
*/
19+
public class ExperimentalSettingsActivity extends BaseSettingsActivity {
20+
@Override
21+
public int getContentViewResourceId() {
22+
return R.layout.activity_experimental_settings;
23+
}
24+
25+
@Override
26+
public View getRootView() {
27+
return null;
28+
}
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Business Source License 1.0 © 2017 FlowCrypt Limited ([email protected]).
3+
~ Use limitations apply. See https://github.com/FlowCrypt/flowcrypt-android/blob/master/LICENSE
4+
~ Contributors: DenBond7
5+
-->
6+
7+
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
8+
android:layout_width="match_parent"
9+
android:layout_height="match_parent">
10+
11+
<include layout="@layout/toolbar" />
12+
13+
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
14+
xmlns:app="http://schemas.android.com/apk/res-auto"
15+
android:id="@+id/experimentalSettingsFragment"
16+
android:name="com.flowcrypt.email.ui.activity.fragment.ExperimentalSettingsFragment"
17+
android:layout_width="match_parent"
18+
android:layout_height="match_parent"
19+
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
20+
21+
</android.support.design.widget.CoordinatorLayout>

FlowCrypt/src/main/res/layout/activity_settings.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
-->
66

77
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
8-
xmlns:tools="http://schemas.android.com/tools"
98
android:layout_width="match_parent"
10-
android:layout_height="match_parent"
11-
tools:context="com.flowcrypt.email.ui.activity.ComposeActivity">
9+
android:layout_height="match_parent">
1210

1311
<include layout="@layout/toolbar" />
1412

FlowCrypt/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,7 @@
194194
<string name="settings_not_valid">The settings is not valid</string>
195195
<string name="skip_setup">Skip setup</string>
196196
<string name="crash_the_app">Crash the App</string>
197+
<string name="experimental">Experimental</string>
198+
<string name="experimental_settings">Experimental Settings</string>
199+
<string name="simulate_app_crash">Simulate app crash</string>
197200
</resources>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Business Source License 1.0 © 2017 FlowCrypt Limited ([email protected]).
3+
~ Use limitations apply. See https://github.com/FlowCrypt/flowcrypt-android/blob/master/LICENSE
4+
~ Contributors: DenBond7
5+
-->
6+
7+
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
8+
<Preference
9+
android:layout="@layout/preference_item"
10+
android:title="@string/simulate_app_crash">
11+
<intent
12+
android:targetClass="com.flowcrypt.email"
13+
android:targetPackage="@string/application_id" />
14+
</Preference>
15+
</PreferenceScreen>

FlowCrypt/src/main/res/xml/preferences_main_settings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@
3434
android:targetClass="com.flowcrypt.email.ui.activity.settings.LegalSettingsActivity"
3535
android:targetPackage="@string/application_id" />
3636
</Preference>
37+
38+
<Preference android:title="@string/experimental">
39+
<intent
40+
android:targetClass="com.flowcrypt.email.ui.activity.settings.ExperimentalSettingsActivity"
41+
android:targetPackage="@string/application_id" />
42+
</Preference>
3743
</PreferenceScreen>

0 commit comments

Comments
 (0)