GithubHelp home page GithubHelp logo

androidsuperdialog's Introduction

AndroidSuperDialog

基于DialogFragment封装,支持自定义边框圆角、背景透明度、字体大小与色值等。 列表选择框可以接收ListArrays的数据源,详细见demo

#效果图

# 引入 ```xml compile 'com.mylhyl:superDialog:1.0.1' ``` #使用 简单的对话框 ```java new SuperDialog.Builder(this).setRadius(10) .setAlpha(0.5f) .setTitle("标题").setMessage("可以看到?") .setPositiveButton("确定", new SuperDialog.OnClickPositiveListener() { @Override public void onClick(View v) { Toast.makeText(v.getContext(), "点了确定", Toast.LENGTH_LONG).show(); } }).build(); ``` 选择对话框 ```java //final String[] strings = {"拍照", "从相册选择", "小视频"}; List list = new ArrayList<>(); list.add(new People(1,"拍照")); list.add(new People(2,"从相册选择")); list.add(new People(3,"小视频")); new SuperDialog.Builder(this) //.setAlpha(0.5f) //.setGravity(Gravity.CENTER) //.setTitle("上传头像", ColorRes.negativeButton) .setCanceledOnTouchOutside(false) .setItems(list, new SuperDialog.OnItemClickListener() { @Override public void onItemClick(int position) { Toast.makeText(MainActivity.this, strings[position], Toast.LENGTH_LONG).show(); } }) .setNegativeButton("取消", null) .build(); ``` #说明 此库自动将px转换百分比,由于 Dialog 布局一般只有微调,暂时只支持 * textSize,height,padding。 默认字体大小;Title、message、button、padding 的px在设计稿为 1080 * 1920 的尺寸 所以使用时设计稿尺寸一定是1080 * 1920 QQ交流群:435173211

#感谢 AutoLayout-Android

androidsuperdialog's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.