Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Add submenu for supporters

parent 37eb6f45
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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>
+6 −0
Original line number Diff line number Diff line
@@ -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>
+32 −3
Original line number Diff line number Diff line
@@ -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,37 @@ public class Contributors extends SettingsPreferenceFragment {

    @Override
    public boolean onPreferenceTreeClick(Preference 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);
            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) {