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

Commit ba01d026 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bug fix: Settings: HotspotPreference.java"

parents 6d538dcf a4e07a9c
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class HotspotPreference extends Preference implements OnCheckedChangeList
    private TextView mSubSummary;
    private Context mContext;
    private boolean mSwitchEnabled;

    private CharSequence mSummary;
    public HotspotPreference(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mContext = context;
@@ -67,12 +67,21 @@ public class HotspotPreference extends Preference implements OnCheckedChangeList
    @Override
    public void onBindViewHolder(PreferenceViewHolder view) {
        super.onBindViewHolder(view);
        if (mSubSummary == null) {
            mSubSummary = (TextView) view.findViewById(R.id.subsummary);
            if (mSummary != null && !mSummary.toString().isEmpty()) {
                mSubSummary.setVisibility(View.VISIBLE);
            } else {
                mSubSummary.setVisibility(View.GONE);
            }
            mSubSummary.setText(mSummary);
        }
        if (mSwitch == null) {
            mSwitch = (Switch) view.findViewById(R.id.switchWidget);
            mSwitch.setOnCheckedChangeListener(this);
            setChecked(mSwitchEnabled);
        }
    }


    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -81,6 +90,7 @@ public class HotspotPreference extends Preference implements OnCheckedChangeList
    }

    public void setSummary(CharSequence summary) {
        mSummary = summary;
        if (mSubSummary == null) {
            return;
        }