use of com.mypopsy.drawable.DrawerArrowDrawable in project ToggleDrawable by renaudcerrato.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContainer = (ViewGroup) findViewById(R.id.container_cardview);
mContainer.getBackground().setAlpha(0);
mContainer.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() != MotionEvent.ACTION_DOWN)
return false;
if (!isFaded)
return false;
toggle();
return true;
}
});
mSeekBar = ((SeekBar) findViewById(R.id.seekbar));
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
for (ToggleDrawable drawable : mToggleDrawables) drawable.setProgress(progress / (float) seekBar.getMax());
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
add(new SearchArrowDrawable(this));
add(new SearchCrossDrawable(this));
add(new DrawerArrowDrawable(this));
add(new MyCustomToggleDrawable(this));
}
Aggregations