Android开发:自定义界面的Dialog,并且实现按钮的监听回调

上传者: weidongjian | 上传时间: 2021-03-31 19:41:27 | 文件大小: 802KB | 文件类型: RAR
很多这种类型的dialog,界面千变万化,于是我建立了一个通用自定义dialog,可以实现以下功能: 1、界面的自定义,全部自己用xml定义界面; 2、不管是在Fragment,还是Activity都可以实例化该dialog,并且实现dialog按钮的监听回调; 3、在dialog按钮点击后,自动消失。

文件下载

资源详情

[{"title":"( 97 个子文件 802KB ) Android开发:自定义界面的Dialog,并且实现按钮的监听回调","children":[{"title":"ViewPageIndicator","children":[{"title":"bin","children":[{"title":"classes.dex <span style='color:#111;'> 346.90KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-ldpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.12KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"base_tabpager_indicator_selected.9.png <span style='color:#111;'> 167B </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 6.15KB </span>","children":null,"spread":false},{"title":"vpi__tab_selected_holo.9.png <span style='color:#111;'> 149B </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_focused_holo.9.png <span style='color:#111;'> 153B </span>","children":null,"spread":false},{"title":"vpi__tab_selected_focused_holo.9.png <span style='color:#111;'> 156B </span>","children":null,"spread":false},{"title":"icon.png <span style='color:#111;'> 5.32KB </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_pressed_holo.9.png <span style='color:#111;'> 153B </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_holo.9.png <span style='color:#111;'> 147B </span>","children":null,"spread":false},{"title":"vpi__tab_selected_pressed_holo.9.png <span style='color:#111;'> 155B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.85KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"ViewPageIndicator.apk <span style='color:#111;'> 167.05KB </span>","children":null,"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-649801054d78b73c10a41dcf2cb05856.jar <span style='color:#111;'> 109.17KB </span>","children":null,"spread":false}],"spread":true},{"title":"classes","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpageindicator","children":[{"title":"ItemFragment.class <span style='color:#111;'> 3.15KB </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 2.05KB </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 367B </span>","children":null,"spread":false},{"title":"MainActivity$1.class <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"MyDialogFragment$2.class <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"R$layout.class <span style='color:#111;'> 512B </span>","children":null,"spread":false},{"title":"R$bool.class <span style='color:#111;'> 676B </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 796B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 999B </span>","children":null,"spread":false},{"title":"MainActivity$TabPageIndicatorAdapter.class <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"ItemFragment$1.class <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false},{"title":"MyDialogFragment$1.class <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'> 430B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 1.00KB </span>","children":null,"spread":false},{"title":"R$styleable.class <span style='color:#111;'> 3.43KB </span>","children":null,"spread":false},{"title":"MyDialogFragment$OnDialogButtonClickListener.class <span style='color:#111;'> 342B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 503B </span>","children":null,"spread":false},{"title":"ItemFragment$2.class <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"R$integer.class <span style='color:#111;'> 718B </span>","children":null,"spread":false},{"title":"R$color.class <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'> 832B </span>","children":null,"spread":false},{"title":"MyDialogFragment.class <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"viewpagerindicator","children":[{"title":"PageIndicator.class <span style='color:#111;'> 564B </span>","children":null,"spread":false},{"title":"TabPageIndicator$2.class <span style='color:#111;'> 1.00KB </span>","children":null,"spread":false},{"title":"TabPageIndicator$OnTabReselectedListener.class <span style='color:#111;'> 295B </span>","children":null,"spread":false},{"title":"TabPageIndicator$1.class <span style='color:#111;'> 1.54KB </span>","children":null,"spread":false},{"title":"IconPagerAdapter.class <span style='color:#111;'> 191B </span>","children":null,"spread":false},{"title":"TabPageIndicator.class <span style='color:#111;'> 7.55KB </span>","children":null,"spread":false},{"title":"IcsLinearLayout.class <span style='color:#111;'> 4.93KB </span>","children":null,"spread":false},{"title":"TabPageIndicator$TabView.class <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"resources.ap_ <span style='color:#111;'> 44.69KB </span>","children":null,"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 907B </span>","children":null,"spread":false}],"spread":true},{"title":"res","children":[{"title":"drawable-ldpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'> 332B </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"activity_main.xml <span style='color:#111;'> 257B </span>","children":null,"spread":false}],"spread":true},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'> 389B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"base_tabpager_indicator_selected.9.png <span style='color:#111;'> 95B </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 8.02KB </span>","children":null,"spread":false},{"title":"vpi__tab_selected_holo.9.png <span style='color:#111;'> 148B </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_focused_holo.9.png <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"vpi__tab_selected_focused_holo.9.png <span style='color:#111;'> 147B </span>","children":null,"spread":false},{"title":"icon.png <span style='color:#111;'> 5.32KB </span>","children":null,"spread":false},{"title":"base_action_bar_bg.9.png <span style='color:#111;'> 218B </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_pressed_holo.9.png <span style='color:#111;'> 145B </span>","children":null,"spread":false},{"title":"vpi__tab_unselected_holo.9.png <span style='color:#111;'> 153B </span>","children":null,"spread":false},{"title":"vpi__tab_selected_pressed_holo.9.png <span style='color:#111;'> 147B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 13.25KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable","children":[{"title":"tab_indicator.xml <span style='color:#111;'> 603B </span>","children":null,"spread":false},{"title":"selector_tabtext.xml <span style='color:#111;'> 375B </span>","children":null,"spread":false},{"title":"vpi__tab_indicator.xml <span style='color:#111;'> 2.15KB </span>","children":null,"spread":false}],"spread":true},{"title":"color","children":[{"title":"vpi__light_theme.xml <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false},{"title":"vpi__dark_theme.xml <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 230B </span>","children":null,"spread":false},{"title":"vpi__colors.xml <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false},{"title":"vpi__attrs.xml <span style='color:#111;'> 5.90KB </span>","children":null,"spread":false},{"title":"vpi__defaults.xml <span style='color:#111;'> 2.86KB </span>","children":null,"spread":false},{"title":"vpi__styles.xml <span style='color:#111;'> 1.92KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.97KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"fragment_dialog.xml <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 661B </span>","children":null,"spread":false},{"title":"fragment_item.xml <span style='color:#111;'> 655B </span>","children":null,"spread":false}],"spread":true}],"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 54.44KB </span>","children":null,"spread":false},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpageindicator","children":[{"title":"BuildConfig.java <span style='color:#111;'> 171B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 61.96KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpageindicator","children":[{"title":"ItemFragment.java <span style='color:#111;'> 2.34KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 2.67KB </span>","children":null,"spread":false},{"title":"MyDialogFragment.java <span style='color:#111;'> 2.85KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"viewpagerindicator","children":[{"title":"IcsLinearLayout.java <span style='color:#111;'> 6.70KB </span>","children":null,"spread":false},{"title":"IconPagerAdapter.java <span style='color:#111;'> 237B </span>","children":null,"spread":false},{"title":"PageIndicator.java <span style='color:#111;'> 1.79KB </span>","children":null,"spread":false},{"title":"TabPageIndicator.java <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 853B </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 475B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 907B </span>","children":null,"spread":false},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 265.38KB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • jlhaoran :
    参考参考 多谢分享
    2020-10-18
  • 935039168 :
    感谢,很有帮助,描述准确
    2019-03-12
  • m1104 :
    谢谢楼主分享,不错不错
    2018-03-26
  • Adam_Santiago :
    谢谢楼主分享
    2017-09-03
  • shiwentao666 :
    有不少例子可以参考,目前正需要.
    2016-08-17
  • baidu_21787335 :
    可以.值得推荐的资源
    2015-12-14
  • liys106 :
    感谢分享,还是很有价值的
    2015-09-17
  • mal_wolf :
    学习了,解决了我的问题了
    2015-08-07
  • haibb :
    很好,解决了我的问题了,不过最后还是采用activity设置主题做dialog了
    2015-04-23

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明