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

Commit 8a86d734 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Improve Preference highlighting

- add PreferenceFragment.onBindPreferences() so that we can know
when the binding as been done
- use the Preference's key as a tag for its View (so that we can
locate it latter in the View hierarchy)

Change-Id: Ifb3b30e576048b7464af63643834d278a46a8543
parent 35d7b89b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -329,6 +329,11 @@ public abstract class PreferenceFragment extends Fragment implements
        if (preferenceScreen != null) {
            preferenceScreen.bind(getListView());
        }
        onBindPreferences();
    }

    /** @hide */
    protected void onBindPreferences() {
    }

    /** @hide */
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.preference.Preference.OnPreferenceChangeInternalListener;
@@ -243,6 +242,7 @@ public class PreferenceGroupAdapter extends BaseAdapter
        if (position == mHighlightedPosition && mHighlightedDrawable != null) {
            result.setBackgroundDrawable(mHighlightedDrawable);
        }
        result.setTag(preference.getKey());
        return result;
    }