日韩性视频-久久久蜜桃-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ò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 禁欲天堂 | 国产麻豆91 | 日本国产亚洲 | 欧美三根一起进三p | 男人用嘴添女人下身免费视频 | 理伦毛片 | 97人妻精品一区二区三区软件 | 破处视频在线观看 | 国产精品久久久久久久妇 | 51妺嘿嘿午夜福利 | 永久免费成人代码 | 中文字幕av一区二区三区 | 疯狂揉花蒂控制高潮h | 久久伊人色 | 色桃av | 精品国产三级片在线观看 | 午夜xxx| 欧美高清免费 | 日韩久久久久 | 欧美青青草| 国产乱子轮xxx农村 岛国久久久 | 91亚洲国产精品 | 欧美日韩国产在线观看 | 久久综合亚洲精品 | 成人永久免费视频 | 成人午夜av | 粉嫩av网| 免播放器在线视频 | 九色porny自拍视频在线播放 | 国产精品丝袜视频无码一区69 | 国产精品一线二线三线 | 伦理一级片 | 成人午夜精品一区二区三区 | 午夜精品一区二区三区在线观看 | 伊人中文字幕在线观看 | 亚洲免费二区 | 国产在线观 | 尤物在线视频观看 | 91在线视频网址 | 国产绿帽一区二区三区 | 中文字幕在线视频免费观看 | 日本成人在线不卡 | 欧美人妻日韩精品 | 国产伦精品一区二区三区四区免费 | 天天干天| 青青草在线视频免费观看 | 96国产在线| 波多野结衣在线视频播放 | 女人下面无遮挡 | 国产乱真实合集 | 中文字幕在线观看视频一区二区 | 99精品视频免费 | 91亚瑟| 国产亚洲精品成人无码精品网站 | 亚洲高清av在线 | 91精品国产高清一区二区三区蜜臀 | 精品无码人妻一区二区免费蜜桃 | 亚洲高清在线看 | 性xxxx欧美老肥妇牲乱 | 美女黄色一级 | 天天射夜夜爽 | 高潮无码精品色欲av午夜福利 | 黄色av电影在线观看 | 一级黄色片网址 | 日韩一级免费片 | 久久福利精品 | 在线黄色免费网站 | 777奇米视频| 天天干天天操天天操 | 韩国美女福利视频 | 国产精品国产三级国产a | 精品在线91| 亚洲一区 在线播放 | 精品久久成人 | 护士的小嫩嫩好紧好爽 | 五月天国产 | 精品国产日本 | 国内精品久久99人妻无码 | 亚洲欧美一区在线 | 欧美中文视频 | 亚洲国产精品久久久久久 | 亚洲视频免费 | 天堂视频在线 | 99久热在线精品996热是什么 | 一区二区三区www污污污网站 | 成人免费做受小说 | 91视频插插插 | 黄色网av | 丁香花电影免费播放在线观看 | 欧美一区二区性久久久 | 亚洲精品自拍偷拍 | 91视频精品 | av在线不卡网 | 亚洲成人av在线 | 扒开美女内裤狂揉下部 | 乱子伦一区 | 欧美精品不卡 | 四虎国产成人永久精品免费 | 亚洲无限码 |