use of com.marshalchen.common.uimodule.easing.Skill in project UltimateAndroid by cymcsg.
the class EasingActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.easing_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(EasingActivity.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(EasingActivity.this, 60));
}
}));
set.setDuration(1200);
set.start();
}
});
}
use of com.marshalchen.common.uimodule.easing.Skill in project UltimateAndroid by cymcsg.
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.easing_item, null);
TextView tv = (TextView) v.findViewById(R.id.list_item_text);
tv.setText(name);
v.setTag(o);
return v;
}
Aggregations