@@ -0,0 +1,2734 @@
+package com.comuf.revonline.custompreferences.preference;%0A%0Aimport android.content.Context;%0Aimport android.content.res.TypedArray;%0Aimport android.preference.CheckBoxPreference;%0Aimport android.preference.Preference;%0Aimport android.preference.TwoStatePreference;%0Aimport android.util.AttributeSet;%0Aimport android.util.Log;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.LinearLayout;%0Aimport android.widget.SeekBar;%0Aimport android.widget.Toast;%0A%0Apublic class SliderPreference extends Preference%0A%7B%0A    private final static String TAG = %22SliderPreference%22;%0A%0A    private int sliderValue;%0A%0A    public SliderPreference(Context context, AttributeSet attrs, int defStyle)%0A    %7B%0A        super(context, attrs, defStyle);%0A    %7D%0A%0A    public SliderPreference(Context context, AttributeSet attrs)%0A    %7B%0A        super(context, attrs);%0A    %7D%0A%0A    public SliderPreference(Context context)%0A    %7B%0A        super(context);%0A    %7D%0A%0A    @Override%0A    protected View onCreateView(ViewGroup parent)%0A    %7B%0A        View view = super.onCreateView(parent);%0A%0A        LinearLayout linearLayout = new LinearLayout(getContext());%0A        linearLayout.setOrientation(LinearLayout.VERTICAL);%0A        linearLayout.addView(view);%0A%0A        SeekBar seekBar = new SeekBar(getContext());%0A        seekBar.setOnSeekBarChangeListener(seekBarChangeListener);%0A        seekBar.setProgress(sliderValue);%0A%0A        linearLayout.addView(seekBar);%0A        return linearLayout;%0A    %7D%0A%0A    @Override%0A    protected void onSetInitialValue(boolean restorePersistedValue, Object defaultValue)%0A    %7B%0A        if (restorePersistedValue)%0A        %7B%0A            sliderValue = getPersistedInt(0);%0A        %7D%0A        else%0A        %7B%0A            if (defaultValue == null)%0A            %7B%0A                sliderValue = 0;%0A            %7D%0A            else%0A            %7B%0A                sliderValue = Integer.parseInt(defaultValue.toString());%0A            %7D%0A        %7D%0A%0A        Log.d(TAG, %22Restore value to: %22 + sliderValue);%0A    %7D%0A%0A    @Override%0A    protected Object onGetDefaultValue(TypedArray a, int index)%0A    %7B%0A        return a.getInt(index, 0);%0A    %7D%0A%0A    private SeekBar.OnSeekBarChangeListener seekBarChangeListener = new SeekBar.OnSeekBarChangeListener()%0A    %7B%0A        @Override%0A        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)%0A        %7B%0A        %7D%0A%0A        @Override%0A        public void onStartTrackingTouch(SeekBar seekBar)%0A        %7B%0A%0A        %7D%0A%0A        @Override%0A        public void onStopTrackingTouch(SeekBar seekBar)%0A        %7B%0A            int progress = seekBar.getProgress();%0A%0A            persistInt(progress);%0A            sliderValue = progress;%0A%0A            Log.d(TAG, %22Persist progress value: %22 + progress);%0A        %7D%0A    %7D;%0A%7D%0A

Create SliderPreference.java