use of com.mypopsy.drawable.SearchArrowDrawable 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));
}
use of com.mypopsy.drawable.SearchArrowDrawable in project FloatingSearchView by renaudcerrato.
the class MainActivity method updateNavigationIcon.
private void updateNavigationIcon(int itemId) {
Context context = mSearchView.getContext();
Drawable drawable = null;
switch(itemId) {
case R.id.menu_icon_search:
drawable = new SearchArrowDrawable(context);
break;
case R.id.menu_icon_drawer:
drawable = new android.support.v7.graphics.drawable.DrawerArrowDrawable(context);
break;
case R.id.menu_icon_custom:
drawable = new CustomDrawable(context);
break;
}
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(drawable, ViewUtils.getThemeAttrColor(context, R.attr.colorControlNormal));
mSearchView.setIcon(drawable);
}
Aggregations