Commit 41bfd88b authored by Romain Hunault's avatar Romain Hunault

Add submenu for supporters

parent 37eb6f45
......@@ -7963,6 +7963,7 @@
<string name="micro_g">MicroG</string>
<string name="e_contributors_title">/e/ contributors</string>
<string name="e_supporters_title">/e/ supporters</string>
<string name="lineageos_contributors_title">LineageOS contributors</string>
<string name="elicense_title">/e/ legal</string>
......
......@@ -13,4 +13,10 @@
android:key="e_contributors"
android:title="@string/e_contributors_title" />
<!-- /e/ Supporters (web) -->
<PreferenceScreen
android:key="e_supporters"
android:title="@string/e_supporters_title" />
</PreferenceScreen>
......@@ -12,8 +12,10 @@ import com.android.internal.logging.MetricsProto.MetricsEvent;
public class Contributors extends SettingsPreferenceFragment {
private static final String LOG_TAG = "Contributors";
private static final String URL_E_CONTRIBUTORS = "https://e.foundation/support-us/#halloffame";
private static final String URL_E_CONTRIBUTORS = "https://e.foundation/about-e/#the-e-team";
private static final String KEY_E_CONTRIBUTORS = "e_contributors";
private static final String URL_E_SUPPORTERS = "https://e.foundation/support-us/#halloffame";
private static final String KEY_E_SUPPORTERS = "e_supporters";
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
......@@ -27,10 +29,18 @@ public class Contributors extends SettingsPreferenceFragment {
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) {
if (preference.getKey().equals(KEY_E_CONTRIBUTORS)
|| preference.getKey().equals(KEY_E_SUPPORTERS) ) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse(URL_E_CONTRIBUTORS));
if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) {
intent.setData(Uri.parse(URL_E_CONTRIBUTORS));
} else if (preference.getKey().equals(KEY_E_SUPPORTERS)) {
intent.setData(Uri.parse(URL_E_SUPPORTERS));
}
try {
startActivity(intent);
} catch (Exception e) {
......@@ -38,5 +48,24 @@ public class Contributors extends SettingsPreferenceFragment {
}
}
return super.onPreferenceTreeClick(preference);
if (preference.getKey().equals(KEY_E_CONTRIBUTORS)
|| preference.getKey().equals(KEY_E_SUPPORTERS) ) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) {
intent.setData(Uri.parse(URL_E_CONTRIBUTORS));
} else if (preference.getKey().equals(KEY_E_SUPPORTERS)) {
intent.setData(Uri.parse(URL_E_SUPPORTERS));
}
try {
startActivity(intent);
} catch (Exception e) {
Log.e(LOG_TAG, "Unable to start activity " + intent.toString());
}
}
return super.onPreferenceTreeClick(preference);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment