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

Commit 14514118 authored by Romain Hunault's avatar Romain Hunault
Browse files

Add submenu for supporters

parent dc96bdb5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@

    <!-- Contributors -->
    <string name="e_contributors_title">/e/ contributors</string>
    <string name="e_supporters_title">/e/ supporters</string>
    <string name="lineageos_contributors_title">LineageOS contributors</string>


+5 −1
Original line number Diff line number Diff line
@@ -12,5 +12,9 @@
        android:key="e_contributors"
        android:title="@string/e_contributors_title" />

</PreferenceScreen>
    <!-- /e/ Supporters (web) -->
    <PreferenceScreen
        android:key="e_supporters"
        android:title="@string/e_supporters_title" />

</PreferenceScreen>
+13 −21
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings;

import android.content.Intent;
@@ -23,14 +7,15 @@ import android.util.Log;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceGroup;

import com.android.internal.logging.nano.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);
@@ -44,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);

            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) {
@@ -57,4 +50,3 @@ public class Contributors extends SettingsPreferenceFragment {
        return super.onPreferenceTreeClick(preference);
    }
}