日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > Android >内容正文

Android

c语言获取安卓弹窗,Android实现信息弹出框

發(fā)布時(shí)間:2024/10/6 Android 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言获取安卓弹窗,Android实现信息弹出框 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

本文實(shí)例為大家分享了Android實(shí)現(xiàn)信息彈出框的具體代碼,供大家參考,具體內(nèi)容如下

layout下的dialog_common_layout.xml

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@drawable/bg_round_white"

android:focusable="true"

android:focusableInTouchMode="true"

android:orientation="vertical">

android:id="@+id/title"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@drawable/bg_top_round_left_right_blue"

android:focusable="true"

android:focusableInTouchMode="true"

android:gravity="center_horizontal"

android:padding="12dp"

android:text="@string/tip"

android:textColor="@color/white"

android:textSize="16sp" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_margin="2dp"

android:baselineAligned="false"

android:orientation="vertical"

android:paddingStart="10dp"

android:paddingEnd="10dp">

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1"

android:orientation="horizontal">

android:id="@+id/ZCMC2"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/ZCMC"

android:textColor="#A2A2A8" />

android:id="@+id/ZCMC1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/ZCMC" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1"

android:orientation="horizontal">

android:id="@+id/FLMC2"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/FLMC"

android:textColor="#A2A2A8" />

android:id="@+id/FLMC1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/FLMC" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_margin="2dp"

android:baselineAligned="false"

android:orientation="vertical"

android:paddingStart="10dp"

android:paddingEnd="10dp">

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="0.5"

android:orientation="horizontal">

android:id="@+id/SBPP2"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/SBPP"

android:textColor="#A2A2A8" />

android:id="@+id/SBPP1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/SBPP" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="0.5"

android:orientation="horizontal">

android:id="@+id/XH2"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/XH"

android:textColor="#A2A2A8" />

android:id="@+id/XH1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/XH" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_margin="2dp"

android:baselineAligned="false"

android:orientation="vertical"

android:paddingStart="10dp"

android:paddingEnd="10dp">

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1"

android:orientation="horizontal">

android:id="@+id/DJ3"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/DJ"

android:textColor="#A2A2A8" />

android:id="@+id/DJ1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/DJ" />

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1"

android:orientation="horizontal">

android:id="@+id/GZRQ2"

style="@style/DialogView"

android:layout_width="150dp"

android:layout_height="wrap_content"

android:layout_marginStart="@dimen/re_2_half_gap"

android:text="@string/GZRQ"

android:textColor="#A2A2A8" />

android:id="@+id/GZRQ1"

style="@style/DialogView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/GZRQ" />

android:layout_width="match_parent"

android:layout_height="1dp"

android:layout_marginTop="2dp"

android:background="@color/blue_touch_user" />

android:id="@+id/buttonLine"

android:layout_width="match_parent"

android:layout_height="50dp"

android:orientation="horizontal">

android:id="@+id/cancel"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1.0"

android:background="@drawable/bg_round_left_white"

android:gravity="center"

android:selectAllOnFocus="false"

android:text="@string/cancel"

android:textColor="@color/blue_touch_user"

android:textSize="14sp" />

android:layout_width="1dp"

android:layout_height="match_parent"

android:background="@color/blue_touch_user" />

android:id="@+id/submit"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1.0"

android:background="@drawable/bg_round_right_white"

android:gravity="center"

android:text="@string/ruku"

android:textColor="@color/blue_user"

android:textSize="14sp" />

android:id="@+id/buttonLine2"

android:layout_width="match_parent"

android:layout_height="50dp"

android:orientation="horizontal">

android:id="@+id/cancel2"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@drawable/bg_round_left_right_white"

android:gravity="center"

android:selectAllOnFocus="false"

android:text="@string/close"

android:textColor="@color/blue_touch_user"

android:textSize="14sp" />

CommomDialog.java

public class CommomDialog extends Dialog implements View.OnClickListener{

private Context mContext;

private PageData content;

private OnCloseListener listener;

private String positiveName;

private String negativeName;

private String title;

public CommomDialog(Context context) {

super(context);

this.mContext = context;

}

public CommomDialog(Context context, int themeResId, PageData content) {

super(context, themeResId);

this.mContext = context;

this.content = content;

}

public CommomDialog(Context context, int themeResId, PageData content, OnCloseListener listener) {

super(context, themeResId);

this.mContext = context;

this.content = content;

this.listener = listener;

}

protected CommomDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {

super(context, cancelable, cancelListener);

this.mContext = context;

}

public CommomDialog setTitle(String title){

this.title = title;

return this;

}

public CommomDialog setPositiveButton(String name){

this.positiveName = name;

return this;

}

public CommomDialog setNegativeButton(String name){

this.negativeName = name;

return this;

}

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.dialog_common_layout);

setCanceledOnTouchOutside(false);

initView();

}

private void initView(){

TextView ZCMC = (TextView) findViewById(R.id.ZCMC1);

TextView GZRQ = (TextView) findViewById(R.id.GZRQ1);

TextView DJ = (TextView) findViewById(R.id.DJ1);

TextView XH = (TextView) findViewById(R.id.XH1);

TextView SBPP = (TextView) findViewById(R.id.SBPP1);

TextView FLMC = (TextView) findViewById(R.id.FLMC1);

LinearLayout buttonLine=(LinearLayout) findViewById(R.id.buttonLine);

LinearLayout buttonLine2=(LinearLayout) findViewById(R.id.buttonLine2);

TextView titleTxt = (TextView) findViewById(R.id.title);

TextView submitTxt = (TextView) findViewById(R.id.submit);

submitTxt.setOnClickListener(this);

TextView cancelTxt = (TextView) findViewById(R.id.cancel);

cancelTxt.setOnClickListener(this);

TextView cancelTxt2 = (TextView) findViewById(R.id.cancel2);

cancelTxt2.setOnClickListener(this);

ZCMC.setText(content.getString("ZCMC").trim());

GZRQ.setText(content.getString("GZRQ").trim());

DJ.setText(content.getString("DJ").trim());

XH.setText(content.getString("XH").trim());

SBPP.setText(content.getString("SBPP").trim());

FLMC.setText(content.getString("FLMC").trim());

if(!TextUtils.isEmpty(positiveName)){

submitTxt.setText(positiveName);

}

if(!TextUtils.isEmpty(negativeName)){

cancelTxt.setText(negativeName);

}

if(!TextUtils.isEmpty(negativeName)){

cancelTxt2.setText(negativeName);

}

if(!TextUtils.isEmpty(title)){

titleTxt.setText(title);

}

System.out.println(content.getString("JYZT"));

if(!TextUtils.isEmpty(positiveName)&&positiveName.equals("出庫(kù)")){

if(!content.getString("JYZT").equals("1.0")){

buttonLine2.setVisibility(View.GONE);

buttonLine.setVisibility(View.VISIBLE);

}else{

buttonLine.setVisibility(View.GONE);

buttonLine2.setVisibility(View.VISIBLE);

}

}else if(!TextUtils.isEmpty(positiveName)&&positiveName.equals("入庫(kù)")){

//歸還資產(chǎn)入庫(kù)

if(!content.getString("JYZT").equals("1.0")){

buttonLine.setVisibility(View.GONE);

buttonLine2.setVisibility(View.VISIBLE);

}else{

buttonLine2.setVisibility(View.GONE);

buttonLine.setVisibility(View.VISIBLE);

}

}else{

//新增資產(chǎn)入庫(kù)

buttonLine.setVisibility(View.VISIBLE);

buttonLine2.setVisibility(View.GONE);

}

}

@Override

public void onClick(View v) {

switch (v.getId()){

case R.id.cancel2:

if(listener != null){

listener.onClick(this, false);

}

this.dismiss();

break;

case R.id.cancel:

if(listener != null){

listener.onClick(this, false);

}

this.dismiss();

break;

case R.id.submit:

if(listener != null){

listener.onClick(this, true);

}

break;

}

}

public interface OnCloseListener{

void onClick(Dialog dialog, boolean confirm);

}

}

drawable下bg_top_round_left_right_blue.xml

bg_round_left_white.xml

bg_round_right_white.xml

bg_round_left_right_white.xml

styles.xml

@null

true

false

true

@android:color/transparent

true

使用

//彈出框 確認(rèn)按鈕

CommomDialog commomDialog = new CommomDialog(HjtzActivity.this, R.style.dialog, gwcInfo, new CommomDialog.OnCloseListener() {

@Override

public void onClick(Dialog dialog, boolean confirm) {

dialogClose=true;

if(confirm){

PageData rkParam=new PageData();

rkParam.put("HJH",hjbh.getText().toString());

rkParam.put("DAH",DAH);

rkParam.put("CFDD",CFDD);

rkParam.put("WAREID",gwcInfo.getString("WAREID"));

mDialog2 = LoadDialogUtils.createLoadingDialog(HjtzActivity.this, "loading...");

addSubscription(httpApi.updateHjhInfo(rkParam),new SubscriberCallBack(new ApiCallBack() {

@Override

public void onSuccess(ResponseWrapper resp) {

if(resp.getCode()!=0){

showMsg("請(qǐng)求失敗");

}else{

showMsg("調(diào)整成功!");

}

}

@Override

public void onFailure(int code, String msg) {

showMsg(msg);

System.out.println(msg);

}

@Override

public void onCompoleted() {

LoadDialogUtils.closeDialog(mDialog2);

}

}));

}

dialog.dismiss();

}

});

dialogClose=false;

commomDialog.setTitle("貨架調(diào)整").setPositiveButton("調(diào)整").show();

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

總結(jié)

以上是生活随笔為你收集整理的c语言获取安卓弹窗,Android实现信息弹出框的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 97精品视频在线观看 | 国产一二三在线观看 | 蜜桃av噜噜一区二区三区麻豆 | 色在线综合 | 日韩精品一区二区三区久久 | 无码精品一区二区三区在线播放 | 99色在线| 国产野外作爱视频播放 | 99精品视频一区二区三区 | 一道本在线播放 | 国产精品久久久久久久久绿色 | 狠狠躁18三区二区一区视频 | 国产亚洲精品久久久久久无几年桃 | 91一区二区 | 在线视频一区二区三区四区 | 色男天堂 | 男同激情视频 | 黄色av网站免费 | 男男gay同性三级 | 精品国产大片大片大片 | 日韩专区中文字幕 | 亚洲精品久久久久久动漫器材一区 | 国产精品一区二区三区不卡 | 成人人伦一区二区三区 | 国产精品 欧美精品 | 美国少妇在线观看免费 | 在线观看欧美成人 | 麻豆免费观看视频 | 在线少妇 | 少妇精品 | 成人看片 | 91黄免费| 91黄色短视频 | 色多多在线看 | 三级全黄做爰在线观看 | 国产成人无码精品久久久久 | 欧美日韩大片在线观看 | 99国产精品视频免费观看一公开 | 91视频最新地址 | 色视频免费在线观看 | 日朝毛片| 成人免费视频网站在线看 | www黄色片网站 | 米奇av| 妖精视频一区二区三区 | 天天色影院 | 亚洲天堂免费在线 | 午夜国产在线视频 | 日韩黄色在线观看 | 麻豆视频免费看 | 亚洲AV无码国产精品午夜字幕 | 在线看福利影 | 国产精品入口免费 | 五月丁香久久婷婷 | 亚洲一区二区在线电影 | 中文字幕日日夜夜 | 欧美激情一区二区三区免费观看 | 伊人午夜 | 国产精品夜夜夜爽张柏芝 | 久久无码人妻丰满熟妇区毛片 | 三级男人添奶爽爽爽视频 | 国产在线观看免费网站 | 99久久久无码国产精品性波多 | 熟妇高潮一区二区三区在线播放 | 国产乱码精品一区二三赶尸艳谈 | 一级作爱视频 | 国产av电影一区二区三区 | 夜夜爽日日澡人人添 | 黄色国产视频网站 | 国产睡熟迷奷系列精品视频 | 欧美成人久久 | 国产成人无码精品久久二区三 | 久久亚洲a v | 香蕉视频性 | 清纯唯美亚洲色图 | 国内一区二区视频 | 中文在线a∨在线 | 巨茎大战刘亦菲 | 91在线小视频| 免费一区二区三区视频在线 | 亚洲爆乳无码精品aaa片蜜桃 | 国产成人精品国内自产拍免费看 | 一区二区三区四区在线视频 | 特黄特色特刺激免费播放 | 怡红院久久 | 69av片 | 亚洲av区无码字幕中文色 | 冲田杏梨一区二区三区 | 毛片网站网址 | 婷婷色综合网 | 绿帽h啪肉np辣文 | 久久婷婷影院 | 69欧美视频 | 黄色网页在线 | 91精品小视频 | 蜜臀久久99精品久久一区二区 | 超碰人人在线观看 | 日批视频免费在线观看 | 亚洲天堂精品一区 |