Change black color when scale first activity during transition
I want to change the black color (outside activity) when scale activity during transition (eg: I want to make change it to white). You can see the black color in the image below
Here is my code
slide_up.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/activity_transition_time"
>
<translate
android:fromYDelta="100%p"
android:toYDelta="0"/>
<alpha
android:fromAlpha="0.5"
android:toAlpha="1"/>
</set>
scale_down.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
>
<scale
android:duration="@integer/activity_transition_time"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.8"
android:pivotX="50%p"
android:pivotY="50%p"
android:toYScale="0.8" />
<alpha
android:fromAlpha="1"
android:toAlpha="0.6"
/>
</set>
FirstActivity.java
startActivity(new Intent(this, SecondActivity.class));
overridePendingTransition(R.anim.slide_up, R.anim.anim_scale_down);
style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Can I do it or is there any other approach? Any help or suggestion would be great appreciated.
android android-animation
|
show 5 more comments
I want to change the black color (outside activity) when scale activity during transition (eg: I want to make change it to white). You can see the black color in the image below
Here is my code
slide_up.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/activity_transition_time"
>
<translate
android:fromYDelta="100%p"
android:toYDelta="0"/>
<alpha
android:fromAlpha="0.5"
android:toAlpha="1"/>
</set>
scale_down.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
>
<scale
android:duration="@integer/activity_transition_time"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.8"
android:pivotX="50%p"
android:pivotY="50%p"
android:toYScale="0.8" />
<alpha
android:fromAlpha="1"
android:toAlpha="0.6"
/>
</set>
FirstActivity.java
startActivity(new Intent(this, SecondActivity.class));
overridePendingTransition(R.anim.slide_up, R.anim.anim_scale_down);
style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Can I do it or is there any other approach? Any help or suggestion would be great appreciated.
android android-animation
try adding<item name="android:windowIsTranslucent">true</item>
to your theme.
– Karan Mer
Nov 15 '18 at 6:43
@KaranMer when addingandroid:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)
– Linh
Nov 15 '18 at 6:45
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
not sure but please try this line<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
inscale_down.xml
file but first comment your code.
– Ali
Nov 15 '18 at 6:58
|
show 5 more comments
I want to change the black color (outside activity) when scale activity during transition (eg: I want to make change it to white). You can see the black color in the image below
Here is my code
slide_up.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/activity_transition_time"
>
<translate
android:fromYDelta="100%p"
android:toYDelta="0"/>
<alpha
android:fromAlpha="0.5"
android:toAlpha="1"/>
</set>
scale_down.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
>
<scale
android:duration="@integer/activity_transition_time"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.8"
android:pivotX="50%p"
android:pivotY="50%p"
android:toYScale="0.8" />
<alpha
android:fromAlpha="1"
android:toAlpha="0.6"
/>
</set>
FirstActivity.java
startActivity(new Intent(this, SecondActivity.class));
overridePendingTransition(R.anim.slide_up, R.anim.anim_scale_down);
style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Can I do it or is there any other approach? Any help or suggestion would be great appreciated.
android android-animation
I want to change the black color (outside activity) when scale activity during transition (eg: I want to make change it to white). You can see the black color in the image below
Here is my code
slide_up.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/activity_transition_time"
>
<translate
android:fromYDelta="100%p"
android:toYDelta="0"/>
<alpha
android:fromAlpha="0.5"
android:toAlpha="1"/>
</set>
scale_down.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
>
<scale
android:duration="@integer/activity_transition_time"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.8"
android:pivotX="50%p"
android:pivotY="50%p"
android:toYScale="0.8" />
<alpha
android:fromAlpha="1"
android:toAlpha="0.6"
/>
</set>
FirstActivity.java
startActivity(new Intent(this, SecondActivity.class));
overridePendingTransition(R.anim.slide_up, R.anim.anim_scale_down);
style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Can I do it or is there any other approach? Any help or suggestion would be great appreciated.
android android-animation
android android-animation
edited Nov 15 '18 at 8:16
Linh
asked Nov 15 '18 at 6:37
LinhLinh
21.4k11113141
21.4k11113141
try adding<item name="android:windowIsTranslucent">true</item>
to your theme.
– Karan Mer
Nov 15 '18 at 6:43
@KaranMer when addingandroid:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)
– Linh
Nov 15 '18 at 6:45
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
not sure but please try this line<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
inscale_down.xml
file but first comment your code.
– Ali
Nov 15 '18 at 6:58
|
show 5 more comments
try adding<item name="android:windowIsTranslucent">true</item>
to your theme.
– Karan Mer
Nov 15 '18 at 6:43
@KaranMer when addingandroid:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)
– Linh
Nov 15 '18 at 6:45
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
not sure but please try this line<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
inscale_down.xml
file but first comment your code.
– Ali
Nov 15 '18 at 6:58
try adding
<item name="android:windowIsTranslucent">true</item>
to your theme.– Karan Mer
Nov 15 '18 at 6:43
try adding
<item name="android:windowIsTranslucent">true</item>
to your theme.– Karan Mer
Nov 15 '18 at 6:43
@KaranMer when adding
android:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)– Linh
Nov 15 '18 at 6:45
@KaranMer when adding
android:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)– Linh
Nov 15 '18 at 6:45
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
not sure but please try this line
<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
in scale_down.xml
file but first comment your code.– Ali
Nov 15 '18 at 6:58
not sure but please try this line
<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
in scale_down.xml
file but first comment your code.– Ali
Nov 15 '18 at 6:58
|
show 5 more comments
1 Answer
1
active
oldest
votes
You need to use a normal animation instead for the overridePendingTransition and then you can control the animation and do what you need.
Set animation listener to Activity animations
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f53313741%2fchange-black-color-when-scale-first-activity-during-transition%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to use a normal animation instead for the overridePendingTransition and then you can control the animation and do what you need.
Set animation listener to Activity animations
add a comment |
You need to use a normal animation instead for the overridePendingTransition and then you can control the animation and do what you need.
Set animation listener to Activity animations
add a comment |
You need to use a normal animation instead for the overridePendingTransition and then you can control the animation and do what you need.
Set animation listener to Activity animations
You need to use a normal animation instead for the overridePendingTransition and then you can control the animation and do what you need.
Set animation listener to Activity animations
answered Nov 15 '18 at 6:46
EugeneEugene
465
465
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f53313741%2fchange-black-color-when-scale-first-activity-during-transition%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
try adding
<item name="android:windowIsTranslucent">true</item>
to your theme.– Karan Mer
Nov 15 '18 at 6:43
@KaranMer when adding
android:windowIsTranslucent
the black become transparent (and I still don't know how to change it to another color)– Linh
Nov 15 '18 at 6:45
i implement one example but in this example new activity come bottom to up and current activity show as it is if you want example i can provide you @PhanVanLinh
– Ali
Nov 15 '18 at 6:49
@MohammadAli do you scale down the first activity?
– Linh
Nov 15 '18 at 6:50
not sure but please try this line
<translate android:fromYDelta="0%p" android:toYDelta="0" android:duration="400"/>
inscale_down.xml
file but first comment your code.– Ali
Nov 15 '18 at 6:58