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简单封装类似JQuery异步请求
在android开发中经常会使用异步请求数据,通常会使用handler或者AsyncTask去做,handler 配合message 使用起来比较麻烦,AsyncTask 线程池只允许128个线程工作 ...
- linux下快速删除大量文件
昨天遇到一个问题,在Linux中有一个文件夹里面含有大量的Cache文件(夹),数量级可能在百万级别,使用rm -rf ./* 删除时间慢到不可接受.Google了一下,查到了一种方法,试用了下确实比 ...
- ASP.NET中application对象
ASP.NET中application对象的使用. Application对象的应用 1.使用Application对象保存信息 (1).使用Application对象保存信息 Applicat ...
- Material Design:CollapsingToolbarLayout
activity_main.xml: <android.support.design.widget.CoordinatorLayout xmlns:android="http://sc ...
- keytool 获取证书信息
keytool -list -v -keystore E:\androidkestore 红色部分为证书地址 输入密码后得到md5及sha1 google地图和百度地图申请key可能用到
- ElasticSearch.js
ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticsearch是用Java开发的,并作为Apach ...
- Linux获取用户主目录
#!/usr/bin/python# -*- coding:utf-8 -*-import sysimport osclass get_home_path(object): def __init__( ...
- 记一个python+sqlalchemy+tornado的一个高并发下,产生重复记录的bug
场景:在用户通过支付通道支付完成返回时,发现我收到的处理数据记录中有两条同样的数据记录, 也就是同一笔钱,我数据库中记为了两条一样的记录. tornado端代码 from tornado import ...
- C,C++容易被忽略的问题
1.字符串数组,字符串指针可以直接输出 ]="I am a student"; cout<<s2<<endl; char *p="I am a s ...
- hdu 2645 find the nearest station
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2645 find the nearest station Description Since dande ...