日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全I(xiàn)T社區(qū)平臺(tái) 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > php開源 > 綜合技術(shù) > 用最簡單的方法去實(shí)現(xiàn)android中的一些提示

用最簡單的方法去實(shí)現(xiàn)android中的一些提示

來源:程序員人生   發(fā)布時(shí)間:2014-12-14 08:18:16 閱讀次數(shù):2896次

看個(gè)效果

1,加載框代碼

2,對(duì)話框代碼

3,提示框代碼













+1列表動(dòng)畫和側(cè)邊唆使條



===============1

package com.idonoo.frame.widget; import android.app.ProgressDialog; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.TextView; import com.idonoo.frame.R; /** * 對(duì)照1下,使用黑色背景的還是蠻多的. * @author intbird * */ public class ProgressDialogBar extends ProgressDialog { private String message; public ProgressDialogBar(Context context) { super(context, R.style.CustomDialog); } public ProgressDialogBar(Context context, String message) { super(context, R.style.CustomDialog); this.message = message; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.custom_progress_dialog); } @Override public void show() { show(message); } public void show(String message) { super.show(); if (!TextUtils.isEmpty(message)) { TextView text = (TextView) findViewById(R.id.tv_message); text.setVisibility(View.VISIBLE); text.setText(message); } } }
<?xml version="1.0" encoding="utf⑻"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linear_root" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/dialog_bg" android:gravity="center" android:minHeight="98dp" android:minWidth="98dp" android:orientation="horizontal" > <ProgressBar android:id="@+id/progress" android:layout_width="56dp" android:layout_height="56dp" android:layout_gravity="center" android:layout_margin="15dp" android:indeterminateDrawable="@drawable/progress_dialog" android:indeterminateDuration="1" android:max="100" android:progress="0" /> <TextView android:id="@+id/tv_message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="30dp" android:text="" android:textColor="#FFFFFF" android:textSize="18sp" android:visibility="gone" /> </LinearLayout>
============2

package com.idonoo.shareCar.widget; import com.idonoo.shareCar.R; import android.app.Dialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; /** * 對(duì)話框的樣式params需要注意; * @author intbird * */ public class MyAlertDialog extends Dialog { private View view; private TextView tvTitle,tvContent; private EditText edContent; private Button btnYes,btnCacel; public enum AlertStyle{ styleSingle,styleNoTitle,styleInput,styleTwoButton}; private Context context; public MyAlertDialog(Context context) { super(context,android.R.style.Theme_Translucent_NoTitleBar); this.context = context; initView(R.layout.layout_alert_dialog); } private void initView(int layoutId){ view= LayoutInflater.from(getContext()).inflate(layoutId, null); tvTitle=((TextView)view.findViewById(R.id.title)); tvContent=((TextView)view.findViewById(R.id.content)); edContent=(EditText)view.findViewById(R.id.ed_content); btnYes=(Button) view.findViewById(R.id.btn_yes); btnCacel=(Button) view.findViewById(R.id.btn_no); } public void initText(String title,String content) { tvTitle.setText(title); tvContent.setText(content); show(); } public MyAlertDialog(Context context,AlertStyle style){ this(context); switch (style) { case styleSingle: initView(R.layout.layout_alert_dialog_single); break; case styleNoTitle: initView(R.layout.layout_alert_dialog_notitle); break; case styleInput: initView(R.layout.layout_alert_dialog_input); break; case styleTwoButton: initView(R.layout.layout_alert_dialog); break; } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(view); } public void setTextYes(String text){ btnYes.setText(text); } public void setTextNo(String text){ btnCacel.setText(text); } public EditText getEditText(){ return edContent; } public void setEditText(EditText edContent){ this.edContent=edContent; } @Override public void show() { super.show(); } public void show(String title,String content,View.OnClickListener yes){ initText(title, content); btnYes.setOnClickListener(yes); } public void show(String title,String content,View.OnClickListener yes,View.OnClickListener cacel){ initText(title, content); btnYes.setOnClickListener(yes); btnCacel.setOnClickListener(cacel); } public void show(String title,View.OnClickListener yes,View.OnClickListener cacel){ tvTitle.setText(title); btnYes.setOnClickListener(yes); btnCacel.setOnClickListener(cacel); show(); } @Override public void dismiss() { super.dismiss(); } @Override public void cancel() { super.cancel(); } public interface InputCallBack{ public void inputCallBack(EditText edit); } }

=======3

    protected void showToast(int res){ //all fragments should be initUI();     <span style="white-space:pre"> </span>String s=getResources().getString(res);     <span style="white-space:pre"> </span>showToast(s);     }     protected void showToast(CharSequence s){         if (!TextUtils.isEmpty(s.toString())){         <span style="white-space:pre"> </span>try{         <span style="white-space:pre"> </span>if(toast!=null)         <span style="white-space:pre"> </span>toast.cancel();         <span style="white-space:pre"> </span>toast=new Toast(getActivity());         <span style="white-space:pre"> </span>}catch(Exception ex){         <span style="white-space:pre"> </span>toast=null;         <span style="white-space:pre"> </span>}         <span style="white-space:pre"> </span>         <span style="white-space:pre"> </span>if(toast==null)         <span style="white-space:pre"> </span>return ;         <span style="white-space:pre"> </span>View view=getActivity().getLayoutInflater().inflate(R.layout.toasts, null);         <span style="white-space:pre"> </span>TextView text=(TextView) view.findViewById(R.id.tv_toast);         <span style="white-space:pre"> </span>text.setText(s.toString());         <span style="white-space:pre"> </span>         <span style="white-space:pre"> </span>toast.setView(view);         <span style="white-space:pre"> </span>toast.setDuration(Toast.LENGTH_SHORT);         <span style="white-space:pre"> </span>toast.show();         }     }




生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 久久久久久久久网站 | 免费国产网站 | 五月婷婷综合色 | 国产自产视频 | 日韩欧美国产一区二区三区 | 日韩成人在线观看 | 亚洲三级不卡 | 欧美电影一区 | 久久久久国产美女免费网站 | 亚洲人成人一区二区在线观看 | 99精品视频在线观看免费播放 | 欧美日韩中文在线观看 | 狠狠干成人 | 久久精品视频在线观看 | 99精品视频在线观看 | 精品视频在线免费看 | 成人免费激情视频 | 久久久久久久久久国产精品 | 欧美日韩第一区 | 99久久免费看精品国产 | 日产精品久久久一区二区开放时间 | 91在线精品秘密一区二区 | 欧美不卡一区二区三区 | 国产亚洲一区二区三区 | 香港a毛片免费全部播放 | 中文一区 | 精品久久一区 | 免费成人看片 | 欧美hdfree性xxxx | 国产一区二区三区视频在线 | 欧美日韩伊人 | 久久这里只有精品首页 | 特黄网站 | 亚洲一区在线免费观看 | 亚洲专区 变态 另类 | 99久久精品一区字幕狠狠婷婷 | 成人精品在线 | 欧美日韩激情在线 | 欧洲亚洲一区二区三区四区五区 | 亚洲成人综合视频 | 一区二区三区中文 |