I have implemented demo.Adjust height as per your requirement.I hope you will get some idea.
MainActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.seekbar_layout);
((SeekBar)findViewById(R.id.sbHeight)).setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
if(progress > 0 && progress < 30)
progress = 40;
else if(progress > 30 && progress < 60)
progress = 60;
else if(progress > 60 && progress < 100)
progress = 80;
if(progress != 0)
setViewHeight(progress);
}
});
((LinearLayout)findViewById(R.id.llHeight)).setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,60));
}
private void setViewHeight(int progress)
{
((LinearLayout)findViewById(R.id.llHeight)).setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,progress));
}
seekbar_layout.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginTop="20dp"
>
<LinearLayout
android:id="@+id/llHeight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#3296ed"
>
</LinearLayout>
</LinearLayout>
<SeekBar
android:id="@+id/sbHeight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:progress="50"
android:layout_marginBottom="140dp"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>