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

Commit 73c0dd89 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Revert "Use accent color in UI"

This reverts commit 0d2971dd.
parent 2d0430fe
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -28,11 +28,8 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SyncStatusObserver;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.ContactsContract;
@@ -50,14 +47,11 @@ import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.widget.ImageButton;
@@ -117,7 +111,6 @@ public class PeopleActivity extends AppCompatContactsActivity implements
        DrawerFragmentListener,
        SelectAccountDialogFragment.Listener {

    public static int ACCENT_COLOR = 0;
    /** Possible views of Contacts app. */
    public enum ContactsView {
        NONE,
@@ -420,8 +413,6 @@ public class PeopleActivity extends AppCompatContactsActivity implements
            Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate finish");
        }
        getWindow().setBackgroundDrawable(null);

        ACCENT_COLOR=fetchAccentColor();
    }

    @Override
@@ -1301,30 +1292,4 @@ public class PeopleActivity extends AppCompatContactsActivity implements
    }


    /*
     * get Accent color from OS
     * */

    private int fetchAccentColor() {
        TypedValue typedValue = new TypedValue();

        TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent });
        int color = a.getColor(0, 0);

        a.recycle();
        Log.e("TAG", "accent Colour  #"+Integer.toHexString(color));

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(color);
        }

        getSupportActionBar().setBackgroundDrawable(
                new ColorDrawable(color));
        return color;
    }



}
+0 −4
Original line number Diff line number Diff line
@@ -44,8 +44,6 @@ import com.android.contactsbind.ObjectFactory;
import java.util.ArrayList;
import java.util.List;

import static com.android.contacts.activities.PeopleActivity.ACCENT_COLOR;

public class DrawerAdapter extends BaseAdapter {

    private static final int VIEW_TYPE_PRIMARY_ITEM = 0;
@@ -407,7 +405,6 @@ public class DrawerAdapter extends BaseAdapter {
    private void updateSelectedStatus(TextView textView, ImageView imageView, boolean activated) {
        textView.setTextAppearance(mActivity, activated
                ? TYPEFACE_STYLE_ACTIVATE : TYPEFACE_STYLE_INACTIVE);

        if (activated) {
                    imageView.setColorFilter(ACCENT_COLOR,
                            PorterDuff.Mode.SRC_ATOP);
@@ -415,7 +412,6 @@ public class DrawerAdapter extends BaseAdapter {
        } else {
            imageView.clearColorFilter();
        }

    }

    private void notifyChangeAndRebuildList() {
+2 −5
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
import android.widget.TextView;

import com.android.contacts.R;
import com.android.contacts.activities.PeopleActivity;
import com.android.contacts.model.AccountTypeManager;
import com.android.contacts.model.ValuesDelta;
import com.android.contacts.model.account.AccountInfo;
@@ -594,10 +593,8 @@ public class CustomContactListFilterActivity extends Activity implements
            final int textColor = mContext.getResources().getColor(isExpanded
                    ? R.color.dialtacts_theme_color
                    : R.color.account_filter_text_color);
           // text1.setTextColor(textColor);
            // text2.setTextColor(textColor);
            text1.setTextColor(PeopleActivity.ACCENT_COLOR);
            text2.setTextColor(PeopleActivity.ACCENT_COLOR);
            text1.setTextColor(textColor);
            text2.setTextColor(textColor);

            return convertView;
        }