android 开发 制作弹出等待进度条
技术点:
dialog;ProgressBar;animated-rotate;
弹出框:
import com.carspeak.client.R; import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.TextView; /**
* 等待进度条
* @author huqiang
*
*/
public class WaitProgressDialog extends Dialog {
private Context context = null;
private static WaitProgressDialog wProgressDialog = null; public WaitProgressDialog(Context context){
super(context);
this.context = context;
} public WaitProgressDialog(Context context, int theme) {
super(context, theme);
} public static WaitProgressDialog createDialog(Context context){
wProgressDialog = new WaitProgressDialog(context,R.style.WaitProgressDialog);
wProgressDialog.setContentView(R.layout.waitprogressdialog);
wProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER; return wProgressDialog;
}
}
R.style.WaitProgressDialog:
<style name="WaitProgressDialog" parent="@style/TipsDialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
R.layout.waitprogressdialog:
<?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:orientation="horizontal">
<ProgressBar
android:id="@+id/pb_process"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
style="?android:attr/progressBarStyle"
android:indeterminate="false"
android:indeterminateDrawable="@anim/process_round"/>
</LinearLayout>
@anim/process_round:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_loading"
android:pivotX="50%"
android:pivotY="50%" />
android 开发 制作弹出等待进度条的更多相关文章
- Android开发-各种各样好看漂亮的进度条,指示器,加载提示汇总
导读:之前项目中用到一些进度条,找了不少,打算写个demo自己总结一下,留着以后用, 有些是自己写的,有些是github上找的别人的库,如果大家觉得好看可以用,直接下载复制代码到项目里就可以用,ok ...
- android开发学习 ------- 弹出框
这是一种方法,是我觉得简单易懂代码量较少的一种: /* 创建AlertDialog对象并显示 */ final AlertDialog alertDialog = new AlertDialog.Bu ...
- Android 开发笔记 “弹出框”
AlertDialog.Builder builder = new AlertDialog.Builder(Activity.this); builder.setMessage("Are y ...
- android 网络异步加载数据进度条
ProgressDialog progressDialog = null; public static final int MESSAGETYPE = 0; private void execute( ...
- android 自定义控件——(四)圆形进度条
----------------------------------↓↓圆形进度条(源代码下有属性解释)↓↓---------------------------------------------- ...
- [Swift通天遁地]一、超级工具-(2)制作美观大方的环形进度条
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- android标题栏上面弹出提示框(二) PopupWindow实现,带动画效果
需求:上次用TextView写了一个从标题栏下面弹出的提示框.android标题栏下面弹出提示框(一) TextView实现,带动画效果, 总在找事情做的产品经理又提出了奇葩的需求.之前在通知栏显示 ...
- android标题栏下面弹出提示框(一) TextView实现,带动画效果
产品经理用的是ios手机,于是android就走上了模仿的道路.做这个东西也走了一些弯路,写一篇博客放在这里,以后自己也可用参考,也方便别人学习. 弯路: 1.刚开始本来用PopupWindow去实现 ...
- jquery制作弹出层带遮罩效果,点击阴影部分层消失
jquery制作弹出层带遮罩效果,点击阴影部分层消失. 整体还是比较简单的. HTML代码很简单 <a href="#" class="big-link" ...
随机推荐
- android版猜拳游戏源码分享
android版猜拳游戏源码分享安卓版猜拳游戏源码,该文件中带有安装测试包的,这个游戏源码比较简单的,现在有两个代码,一个自定义VIEW的,一个就是普通的imageView图片,游戏非常适合一些新手的 ...
- 转 网络IO模型:同步IO和异步IO,阻塞IO和非阻塞IO
此文章为转载,如有侵权,请联系本人.转载出处,http://blog.chinaunix.net/uid-28458801-id-4464639.html 同步(synchronous) IO和异步( ...
- jquery 获取元素坐标
不错哦! 原文地址:http://jianzhong5137.blog.163.com/blog/static/9829049201182295833503/ 绝对X,Y坐标,可以用offset()方 ...
- Oracle中rownum的用法
rownum是Oracle对查询结果进行顺序编号,第一行分配1,第二行2,以此类推.rownum不能以任何表的名称作为前缀. rownum这个伪字段可以用于控制返回的记录行数. 例如表:student ...
- 日期转换(用DateTime的ParseExact方法解析特殊的日期时间)
今天遇到一个特别的需求,需要从下面的字符串中转换成一个DateTime对象: [07-13 15:50:42] 主要问题是这个时间不是标准的时间,而是自定义的格式,即开头是月-日,然后是时间. 使用最 ...
- Qt使用默认浏览器打开网页
#include <QDesktopServices> #include <QUrl> QDesktopServices::openUrl(QUrl("http:// ...
- js实现touch移动触屏滑动事件
在开始描述touch事件之前,需要先描述一下多触式系统中特有的touch对象(android和iOS乃至nokia最新的meego系统都模拟了类 似的对象).这个对象封装一次屏幕触摸,一般来自于手指. ...
- VS2012那点事儿
VS2012并不完美支持C99标准,这一点强烈的体现在如下的错误: 也就是是说你的变量定义必须在前面,一股脑儿全写完,然后才可以使用,如果你定义变量穿插在了其他地方,那么就会报上面的错误.略微有些遗憾 ...
- PIL不能关闭文件的解决方案
今天写了一个能指定图片尺寸,以及比例 来搜索分类图片的Python脚本.为了读取多个格式的文件的头,采用了Python PIL库. im = PIL.Image.open(imPath) if im的 ...
- python time 模块详解
Python中time模块详解 发表于2011年5月5日 12:58 a.m. 位于分类我爱Python 在平常的代码中,我们常常需要与时间打交道.在Python中,与时间处理有关的模块就包括: ...