Skip to content

Commit

Permalink
Added the SeekBar to change the parameters of WaveView
Browse files Browse the repository at this point in the history
Affects sample module.
Added SeekBar can change the height which is the trigger of WaveView drop animation.
  • Loading branch information
Jumpei Matsuda committed Nov 16, 2015
1 parent a962b8e commit d7e7f9e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SeekBar;

import java.util.ArrayList;

import jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout;

public class MainActivity extends AppCompatActivity implements WaveSwipeRefreshLayout.OnRefreshListener {
Expand Down Expand Up @@ -38,6 +41,24 @@ private void initView() {
//mWaveSwipeRefreshLayout.setMaxDropHeight(1500);

mListview = (ListView) findViewById(R.id.main_list);

((SeekBar) findViewById(R.id.seekbar_of_drop_height)).setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// ignore
}

@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// ignore
}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {
float scale = (seekBar.getProgress() / 100f);
mWaveSwipeRefreshLayout.setMaxDropHeight((int) (mWaveSwipeRefreshLayout.getHeight() * scale));
}
});
}

private void setSampleData() {
Expand Down
8 changes: 8 additions & 0 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@

</jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout>

<SeekBar
android:id="@+id/seekbar_of_drop_height"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:layout_alignParentBottom="true"
/>

</RelativeLayout>

</LinearLayout>

0 comments on commit d7e7f9e

Please sign in to comment.