use of com.daimajia.easing.Skill in project AnimationEasingFunctions by daimajia.
the class EasingAdapter method getView.
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
Object o = getItem(i);
BaseEasingMethod b = ((Skill) o).getMethod(1000);
int start = b.getClass().getName().lastIndexOf(".") + 1;
String name = b.getClass().getName().substring(start);
View v = LayoutInflater.from(mContext).inflate(R.layout.item, null);
TextView tv = (TextView) v.findViewById(R.id.list_item_text);
tv.setText(name);
v.setTag(o);
return v;
}
use of com.daimajia.easing.Skill in project AnimationEasingFunctions by daimajia.
the class MyActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mEasingList = (ListView) findViewById(R.id.easing_list);
mAdapter = new EasingAdapter(this);
mEasingList.setAdapter(mAdapter);
mTarget = findViewById(R.id.target);
mHistory = (DrawView) findViewById(R.id.history);
mEasingList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
mHistory.clear();
Skill s = (Skill) view.getTag();
AnimatorSet set = new AnimatorSet();
mTarget.setTranslationX(0);
mTarget.setTranslationY(0);
set.playTogether(Glider.glide(s, 1200, ObjectAnimator.ofFloat(mTarget, "translationY", 0, dipToPixels(MyActivity.this, -(160 - 3))), new BaseEasingMethod.EasingListener() {
@Override
public void on(float time, float value, float start, float end, float duration) {
mHistory.drawPoint(time, duration, value - dipToPixels(MyActivity.this, 60));
}
}));
set.setDuration(1200);
set.start();
}
});
}
Aggregations