Komal Sorathiya
Komal Sorathiya

Reputation: 228

implementing custom view style in actionbar

I want to implement this kind of functionality in android, for example, when i click on Pinterest the arrow sign will be automatically moved to piterest (Like you can see in image) now if i press twitter then arrow will be moved to there like that..., arrow will move with animation, if anybody knows how to implement then please let me know

enter image description here

Like in above image there is three button (Facebook, Pinterest, Twitter), you can see piterest is selected so arrow is below the pinterest now if i press facebook the arrow will move below facebook image with animation

Upvotes: 1

Views: 75

Answers (1)

Ahmed Ekri
Ahmed Ekri

Reputation: 4651

I think the easiest way is to make three different images.

1st:

enter image description here

2nd:

enter image description here

3rd:

enter image description here

So you do,

if(images[1] was clicked){
imageView.setdrawable(image1);
} else if(images[2] was clicked){
imageView.setdrawable(image2);
} else if(images[3] was clicked){
imageView.setdrawable(image3);
}

Upvotes: 1

Related Questions