package com.warkiz.indicatorseekbar.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.warkiz.indicatorseekbar.R;
import com.warkiz.widget.IndicatorSeekBar;

/**
 * created by ZhuangGuangquan on  2017/9/6
 */

public class DiscreteFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.discrete, container, false);
        final TextView textView = (TextView) root.findViewById(R.id.discrete_progress);
        final TextView discreteBlockTv = (TextView) root.findViewById(R.id.discrete_block);
        IndicatorSeekBar discrete = (IndicatorSeekBar) root.findViewById(R.id.discrete);

        discrete.setOnSeekChangeListener(new IndicatorSeekBar.OnSeekBarChangeListener() {

            @Override
            public void onProgressChanged(IndicatorSeekBar seekBar, int progress, float progressFloat, boolean fromUserTouch) {
                textView.setText("progress: " + progress);
            }

            @Override
            public void onSectionChanged(IndicatorSeekBar seekBar, int thumbPosOnTick, String tickBelowText, boolean fromUserTouch) {
                discreteBlockTv.setText("thumbPosOnTick: " + thumbPosOnTick + " ;  tickBelowText: " + tickBelowText);
            }

            @Override
            public void onStartTrackingTouch(IndicatorSeekBar seekBar, int thumbPosOnTick) {
            }

            @Override
            public void onStopTrackingTouch(IndicatorSeekBar seekBar) {

            }
        });
        return inflater.inflate(R.layout.discrete, container, false);
    }

}

@@ -412,17 +412,17 @@
 Fragment
- 
+%0A
 %7B%0A%0A    @
@@ -531,16 +531,20 @@
 ceState)
+%0A   
  %7B%0A     
@@ -970,16 +970,24 @@
 stener()
+%0A       
  %7B%0A%0A    
@@ -1121,32 +1121,44 @@
 n fromUserTouch)
+%0A           
  %7B%0A             
@@ -1371,16 +1371,28 @@
 erTouch)
+%0A           
  %7B%0A     
@@ -1631,16 +1631,28 @@
 sOnTick)
+%0A           
  %7B%0A     
@@ -1752,16 +1752,28 @@
 seekBar)
+%0A           
  %7B%0A%0A    
@@ -1813,61 +1813,12 @@
 urn 
-inflater.inflate(R.layout.discrete, container, false)
+root
 ;%0A  

fix return