I'm generating TextViews on LinearLayout programmatically and I want to display the programmatically generated TextViews with Holo effects while on touch on the LinearLayout
for (int i = 1; i <= 10; i++) {
LinearLayout linLayout= (LinearLayout) findViewById(R.id.sideIndex);
TextView tv = new TextView(this);
tv.setTextColor(getResources().getColor(R.color.white));
// tmpTV.setTypeface(font);
tv.setText(tmpLetter);
tv.setGravity(Gravity.CENTER);
tv.setTextSize(11);
tv.setTextColor(getResources().getColor(R.color.holo_green_light));
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,2);
tv.setLayoutParams(params);
linLayout.addView(tv);
}
I'm able to view the Holo TextViews with this
tv.setTextColor(getResources().getColor(R.color.holo_green_light));
But I want to view the holo effect on TextView after ontouch on the LinearLayout.
below code working fine for a single instance of programmatically generated TextView but I need to display more than one number of text view in Holo after user touch the LinearLayout!
linLayout.setOnTouchListener(new OnTouchListener()
{
public boolean onTouch(View v, MotionEvent event)
{
tv.setTextColor(getResources().getColor(R.color.holo_blue_bright));
return false;
}
});