I want to anim part of items in listView. Animation is described in code.
Whats the best way to do this without overloading mainThread?
@Override
public View getView(int position, View convertView, ViewGroup parent) {
StockExchangeModel stockExchangeModel = mStockExchangeModels.get(position);
ViewHolder holder;
if (convertView == null){
convertView = ((LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.item_stock_exchange, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (stockExchangeModel.isNeedAnim()){
// blink color RED
// wait 0.2s
// return to start color
// wait 0.2s
// blink color RED
// wait 0.2s
// return to start color
}
holder.value.setText(String.format("%.2f",stockExchangeModel.getValue()));
holder.change.setText(stockExchangeModel.getChange());
holder.name.setText(stockExchangeModel.getName());
return convertView;
}