android dialog加载中动画效果
- //显示动画
- dialog = new Dialog(context, R.style.loading);
- dialog.setContentView(R.layout.loadinglayout);//此处布局为一个progressbar
- dialog.setCancelable(true); // 可以取消
- dialog.show();
- WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
- params.height = -1;
- params.width = -1;
- params.format=1;
- params.flags = LayoutParams.FLAG_FULLSCREEN | LayoutParams.FLAG_LAYOUT_IN_SCREEN;
- dialog.getWindow().setAttributes(params);
- dialog.cancel(); //去掉dialog
//dialog中设置的布局progressbar
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="center"
- >
- <ProgressBar
- android:id="@+id/loadingbar"
- style="@style/loadingStyle"
- android:layout_width="fill_parent"
- android:layout_height="130dp"
- android:layout_gravity="center">
- </ProgressBar>
- </LinearLayout>
//dialog和progressbar分别用的style
- <!-- 使用frame动画制作的logo炫动效果 -->
- <style name="loadingStyle">
- <item name="android:indeterminateDrawable">@anim/loading</item>
- </style>
- <style name="loading">
- <item name="android:layout_width">fill_parent</item>
- <item name="android:layout_height">fill_parent</item>
- <item name="android:windowFullscreen">true</item>
- <item name="android:windowNoTitle">true</item>
- <item name="android:backgroundDimEnabled">false</item> <!-- 模糊 -->
- <item name="android:windowIsFloating">true</item><!-- 类似windows的弹出Dialog -->
- <item name="android:windowContentOverlay">@null</item><!-- 不要头部阴影 -->
- <item name="android:windowBackground">@color/transparent</item> <!-- 背景颜色设置透明-->
- </style>
progressbar中Style引用的动画
- <?xml version="1.0" encoding="UTF-8"?>
- <animation-list android:oneshot="false" xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:duration="150" android:drawable="@drawable/load1" />
- <item android:duration="150" android:drawable="@drawable/load2" />
- <item android:duration="150" android:drawable="@drawable/load3" />
- <item android:duration="150" android:drawable="@drawable/load4" />
- <item android:duration="150" android:drawable="@drawable/load5" />
- <item android:duration="150" android:drawable="@drawable/load6" />
- </animation-list>
android dialog加载中动画效果的更多相关文章
- 用纯CSS实现加载中动画效果
HTML <div class="pswp__preloader__icn"> <div class="pswp__preloader__cut&quo ...
- 漂亮的Android加载中动画:AVLoadingIndicatorView
AVLoadingIndicatorView 包含一组漂亮的Android加载中动画. IOS版本:here. 示例 Download Apk 用法 步骤1 Add dependencies in b ...
- css实现加载中的效果
那天闲着,学习了一下样式效果,自己实现了一个简单的加载中的效果 废话不多说,开始吧!! 一.实现一个圆环 要实现圆环,首先我们需要知道盒模型里面border的本质,先来看一个效果吧 从上面 ...
- [Swift通天遁地]五、高级扩展-(11)图像加载Loading动画效果的自定义和缓存
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- HTML5+javascript实现图片加载进度动画效果
在网上找资料的时候,看到网上有图片加载进度的效果,手痒就自己也写了一个. 图片加载完后,隐藏loading效果. 想看加载效果,请ctrel+F5强制刷新或者清理缓存. 效果预览: 0% // ...
- 微信小程序:添加全局的正在加载中图标效果
在发送请求的时候,显示一个正在加载中的小图标.在加载下一页的时候也显示正在加载中.同时数据请求回来了,把加载中进行关闭. 开发----API-----界面 在哪里添加这两段代码会比较方便呢?一个项目有 ...
- 用CSS实现加载的动画效果
用纯CSS实现加载的一些动态效果,可以把加载效果中的元素分成很多个小部分,每个部分都有动画,每个部分的动画再设置相应的延迟效果,这样,看起来就是连贯的加载动画效果.代码如下: 1.效果1 <di ...
- css 实现页面加载中等待效果
<!DOCTYPE html> <html> <head> <title>css实现页面加载中,请稍候效果</title> <meta ...
- 利用document的readyState去实现页面加载中的效果
打开新的网页时,为了增强友好性体验,告知用户网页正在加载数据需要呈现一个"页面加载中"之类的提示,只需要利用document就可以实现. 实现示例代码如下: <style&g ...
随机推荐
- 调用百度、高德地图App,百度地图网页版,App定位
https://www.jianshu.com/p/296a3995adc2 https://blog.csdn.net/qq_26598821/article/details/51087785 ht ...
- [PureScript] Break up Expressions into Cases in PureScript using Simple Pattern Matching
Pattern matching in functional programming languages is a way to break up expressions into individua ...
- jquery easyui tree异步加载子节点
easyui中的树可以从标记中建立,也可以通过指定一个URL属性读取数据建立.如果想建立一棵异步树,需要为每个节点指定一个id属性值,这样在加载数据时会自动向后台传递id参数. <ul id=& ...
- OpenGL ES 3.0顶点着色器(二)
#version es uniform mat4 u_mvpMatrix; in vec4 a_position; in vec4 a_color;out vec4 v_color;void main ...
- WampServer在win10系统下安装的坑
WampServer之前一直是好好的,最近换了Win10的系统,安装的不太顺利. 1.问题一 出现的第一个问题,就是安装时会报错.怎么解决的,具体的我已经忘记了,好像是要下载vc运行时包. 2.问题二 ...
- Android Studio 之 导入Eclipse项目常见问题及解决方案
在将Eclipse做的Android项目成功导入Android Studio 后,启动生成,遇到一些问题,现总结如下: 问题1:图片命名问题 AS对图片命名要求比eclipse严格,图片名称只能有&q ...
- MVC 之 缓存机制(二)
八.应用程序缓存 应用程序缓存提供了一种编程方式,可通过键/值对将任意数据存储在内存中. 使用应用程序缓存与使用应用程序状态类似. 但是,与应用程序状态不同的是,应用程序缓存中的数据是易失的, 即数据 ...
- uni/微信小程序 - 使用外部字体
字体图标/字体仅支持网络css路径(也就是不支持本地路径) 参考于:https://blog.csdn.net/u013451157/article/details/79825740
- Spring Cloud Zuul的一个坑
Spring Cloud 版本: Dalston.SR5 今天使用Zuul发现一个和动态刷新相关的问题,动态刷新使用的是 /bus/refresh,即我的Zuul连着一个Rabbitmq,我这里是使用 ...
- spark的外排:AppendOnlyMap与ExternalAppendOnlyMap
相信很多人和我一样, 在控制台中总是可以看到会打印出如下的语句: INFO ExternalAppendOnlyMap: Thread 94 spilling in-memory map of 63. ...