How to apply same behaviors on java objects?
up vote
0
down vote
favorite
How can I apply the same behavior of multiple class objects in java(android)? For example, in jquery it's easy because you can select all/or a specific DOM object(s)
$('.div').on("mousedown",function()
$(this).css("transform":"scale(0.8)");
);
$('.div').on("mouseup",function()
$(this).css("transform":"scale(0.9)");
);
I want to make this similar in Android , i make an XML animation and when i press a card view(i have 9) ,that view animate.I succeeded making one to animate but I don't want to apply this 9 times to all views.
java android
add a comment |
up vote
0
down vote
favorite
How can I apply the same behavior of multiple class objects in java(android)? For example, in jquery it's easy because you can select all/or a specific DOM object(s)
$('.div').on("mousedown",function()
$(this).css("transform":"scale(0.8)");
);
$('.div').on("mouseup",function()
$(this).css("transform":"scale(0.9)");
);
I want to make this similar in Android , i make an XML animation and when i press a card view(i have 9) ,that view animate.I succeeded making one to animate but I don't want to apply this 9 times to all views.
java android
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How can I apply the same behavior of multiple class objects in java(android)? For example, in jquery it's easy because you can select all/or a specific DOM object(s)
$('.div').on("mousedown",function()
$(this).css("transform":"scale(0.8)");
);
$('.div').on("mouseup",function()
$(this).css("transform":"scale(0.9)");
);
I want to make this similar in Android , i make an XML animation and when i press a card view(i have 9) ,that view animate.I succeeded making one to animate but I don't want to apply this 9 times to all views.
java android
How can I apply the same behavior of multiple class objects in java(android)? For example, in jquery it's easy because you can select all/or a specific DOM object(s)
$('.div').on("mousedown",function()
$(this).css("transform":"scale(0.8)");
);
$('.div').on("mouseup",function()
$(this).css("transform":"scale(0.9)");
);
I want to make this similar in Android , i make an XML animation and when i press a card view(i have 9) ,that view animate.I succeeded making one to animate but I don't want to apply this 9 times to all views.
java android
java android
edited Nov 10 at 15:28
Mostafa Aryannejad
304213
304213
asked Nov 10 at 15:10
Valentin
89
89
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can do that using state list animators.
After creating the animation you want, just apply it to the cardview XML
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can do that using state list animators.
After creating the animation you want, just apply it to the cardview XML
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
add a comment |
up vote
0
down vote
You can do that using state list animators.
After creating the animation you want, just apply it to the cardview XML
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
add a comment |
up vote
0
down vote
up vote
0
down vote
You can do that using state list animators.
After creating the animation you want, just apply it to the cardview XML
You can do that using state list animators.
After creating the animation you want, just apply it to the cardview XML
answered Nov 10 at 15:18
João Paulo Sena
1
1
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
add a comment |
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
Thanks , it works. I used the information from here developer.android.com/guide/topics/graphics/…
– Valentin
Nov 10 at 15:46
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240265%2fhow-to-apply-same-behaviors-on-java-objects%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown