Comments (7)
大神就坐我旁边!
from weibo.
其实你看到的并不是背景变半透明了,而是盖在上面的那张ImageView是半透明的背景。对那张半透明的ImageView做透明度动画就可以了。
from weibo.
就是整个popwindow背景的透明度吗?
from weibo.
http://stackoverflow.com/questions/6839683/windowmanager-with-animation
尝试使用这个来给windowmanager加入渐变动画
mParams.windowAnimations = android.R.style.Animation_Toast;
我在后期会抽空加入这个渐变动画,你也可以到我的源码中查阅
from weibo.
恩好,谢谢啦
from weibo.
@xiangflight 这位大神已经把背景阴影动画加上啦。主要在这个ImageDetailsActivity类里面,代码不到20行
我贴上关键代码供你参考哦。请Update一下项目代码到最新,看下效果
/**
* 调整窗口的透明度
*
* @param from
* @param to
*/
private void setOutBackground(float from, float to) {
final WindowManager.LayoutParams lp = getWindow().getAttributes();
ValueAnimator valueAnimator = ValueAnimator.ofFloat(from, to);
valueAnimator.setDuration(600);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
lp.alpha = (float) animation.getAnimatedValue();
getWindow().setAttributes(lp);
}
});
valueAnimator.start();
}
from weibo.
太好啦,学习了
from weibo.
Related Issues (20)
- 微博详情页转发评论悬浮 HOT 2
- 评论失败
- 大神怎么不继续维护这个项目了? HOT 2
- 关于下拉刷新与上拉加载更多 HOT 1
- 大神,关于recyclerview置顶以及取消置顶有没有好的方案,百度谷歌找遍了,自己实现的时候问题颇多 HOT 2
- 运行一直卡住在 gradle:resolve dependencies ':multiwindow:_debugPublish' HOT 1
- 关于微博图片浏览器区别加载普通图片、长图、gif HOT 1
- 无法登陆 HOT 1
- 这个客户端的微博授权过期了,大佬,无法登陆了 HOT 1
- Saving image error.
- 强烈建议加入抢沙发功能
- 点击图片 程序退出
- 点击登录的时候Weico授权失效了
- 啊
- 无法登陆? HOT 1
- 无法登陆?
- 无法登陆:对第三方应用授权时出现错误
- 用我自己的微博授权点击登录后显示是空白
- 在网盘下载的无法注册账号
- 网盘链接炸了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weibo.