dialog

dialog的应用

雨燕双飞 提交于 2020-02-27 09:45:12
第一步:重写dialog: ①代码: public static Dialog creatRequestDialog(final Context context, String tip) { final Dialog dialog = new Dialog(context, R.style.dialog); // dialog.setCancelable(false); // dialog.setCanceledOnTouchOutside(false); dialog.setContentView(R.layout.dialog_layout); Window window = dialog.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); int width = Utils.getScreenWidth(context); lp.width = (int) (0.5 * width); TextView titleTxtv = (TextView) dialog.findViewById(R.id.tvLoad); titleTxtv.setText(tip); return dialog; } ②dialog的style设置: <style name="dialog" parent="

用JQuery UI dialog实现Alert和Confirm功能

半城伤御伤魂 提交于 2020-02-27 04:17:17
JQuery UI dialog 虽然可以实现 Alert 和 Confirm 功能,但每次都要定义相关 dialog 内容是比较麻烦的。如果只需要简单的调用 ShowMsg ( ’ 内容 ’ )这样就会省上很多事情,其实只要在 JQuery UI dialog 的基础上做些简单的工作就可以了。 把功能封装到一个用户控件中,有需要直接引用就可以了。 <% @ Control Language ="C#" AutoEventWireup ="true" %> < div id ="AlertMessage" title =" 信息确认 "> < p id ="AlertMessageBody" class ="msgbody"></ p > </ div > < div id ="ConfirmMessage" title =" 信息提问 "> < p id ="ConfirmMessageBody" class ="msgbody""></ p > </ div > < script > $(document).ready( function () { $( '#AlertMessage' ).dialog({ autoOpen: false , width: 300, modal: true , buttons: { " 取消 " : function () { $( this

Set width of “Dialog” widget to a percentage of the page in Vaadin 14

佐手、 提交于 2020-02-25 22:35:29
问题 In Vaadin 14, the Dialog widget opens properly when specifying width and height by px (CSS virtual "pixels"). Dialog dialog = new Dialog(); dialog.setCloseOnEsc( true ); dialog.setCloseOnOutsideClick( true ); dialog.add( new Label( "whatever" ) ); dialog.setWidth( "500px" ); // 🡸 width dialog.setHeight( "700px" ); // 🡸 height Unfortunately, changing that 500px to 80% : dialog.setWidth( "80%" ); // 🡸 width as percentage (%) dialog.setHeight( "700px" ); // 🡸 height I expect the dialog to now

Cannot read property 'afterClosed' of undefined when unit testing MatDialog in Jasmine

血红的双手。 提交于 2020-02-24 12:38:32
问题 I get the following error from Karma Jasmine: TypeError: Cannot read property 'afterClosed' of undefined I searched sincerely, but I could not find a solution in Stack Overflow or in other sources. This is how I open the MatDialog in my component: (Like documented) constructor(public dialog: MatDialog) {} public openDialog(): void { const dialogReference: MatDialogRef<any, any> = this.dialog.open(myDialogComponent, { width: '1728px' }); dialogReference.afterClosed().subscribe((result) => { })

Cannot read property 'afterClosed' of undefined when unit testing MatDialog in Jasmine

余生长醉 提交于 2020-02-24 12:38:09
问题 I get the following error from Karma Jasmine: TypeError: Cannot read property 'afterClosed' of undefined I searched sincerely, but I could not find a solution in Stack Overflow or in other sources. This is how I open the MatDialog in my component: (Like documented) constructor(public dialog: MatDialog) {} public openDialog(): void { const dialogReference: MatDialogRef<any, any> = this.dialog.open(myDialogComponent, { width: '1728px' }); dialogReference.afterClosed().subscribe((result) => { })

How would I suppress the print dialog in this example?

馋奶兔 提交于 2020-02-23 06:46:46
问题 private void printCard() { PrinterJob printjob = PrinterJob.getPrinterJob(); printjob.setJobName("Label"); Printable printable = new Printable() { public int print(Graphics pg, PageFormat pf, int pageNum) { if (pageNum > 0) { return Printable.NO_SUCH_PAGE; } Dimension size = jLayeredPane2.getSize(); BufferedImage bufferedImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB); jLayeredPane2.print(bufferedImage.getGraphics()); Graphics2D g2 = (Graphics2D) pg; g2

Bring Bluetooth pairing request notification dialog on front to ask for PIN

爱⌒轻易说出口 提交于 2020-02-20 06:07:11
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

Bring Bluetooth pairing request notification dialog on front to ask for PIN

社会主义新天地 提交于 2020-02-20 06:05:06
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

Android自定义的弹窗

放肆的年华 提交于 2020-02-19 03:49:56
package com.microduino.qoobot.view; import android.app.Activity; import android.app.Dialog; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import com.microduino.qoobot.R; /* * :Created by z on 2019/1/16 */ public abstract class BaseDialog { private Dialog dialog; private Activity activity; public BaseDialog(Activity activity,int res){ dialog = new Dialog(activity, R.style.BuildDialog); LayoutInflater inflater = LayoutInflater.from(activity); View view = inflater.inflate(res, null);

《Semantically Conditioned Dialog Response Generation via Hierarchical Disentangled Self-Attention》

江枫思渺然 提交于 2020-02-17 05:40:20
来源:ACL 2019 代码:https://github.com/wenhuchen/HDSA-Dialog 一、摘要 基于pipeline的任务型对话系统可以拆解成以下四个部分,其中NLU为意图槽位理解,DST为对话历史并能根据当前用户query更新状态,Policy learning为根据用户需求判断下一步action(也就是论文中提到的dialog act),NLG为对话生成。本论文目标是提高后两步的性能。 示例如下: 创新点:将dialog act表示成图结构,并使用了独立多头self-attention(Disentangled Self-Attention,DSA)。 二、Dialog Act表示 定义:dialog act是一个语言序列的语义状态,包括action、意图、槽位名、槽位值。 论文将dialog act表示成(domain, action, slot)三元组,比如hotel-inform-location、hotel-inform-name等。表示dialog act的结构有两种方式,分别为树结构和图结构。假设domain数n1,action数n2,slot数n3。 树结构 如上图左为树结构。表示一个dialog act需要三部分:第1部分列举所有domain,那么产生一个n1纬的one-hot向量;第2部分列举所有domain-action的组合