Giter Site home page Giter Site logo

wdybase's Introduction

WDYBase

代码远程仓库 maven { url "https://raw.githubusercontent.com/wangdongyi/WDYBaseMeaven/master" } implementation 'com.wdy.base.module:WDYBase:1.2.5' 我的基础包

权限调用

 PMUtil(AppCompatActivity activity, List<String> permissions, OnPermissionBack onPermissionBack)//构造函数
List<String> pList = new ArrayList<>();
        pList.add(Manifest.permission.READ_PHONE_STATE);
        pList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
        pList.add(Manifest.permission.ACCESS_FINE_LOCATION);
        new PMUtil(this, pList, new PMUtil.OnPermissionBack() {
            @Override
            public void permissionBack(boolean grant) {
                if (!grant) {
                    DialogMUtil.getInstance().with(MainActivity.this, "提示", "应用缺少必要的权限!是否前去设置,打开所需要的权限。", new NoDoubleClickListener() {
                        @Override
                        protected void onNoDoubleClick(View v) {
                            DialogMUtil.Dismiss();
                            Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                            intent.setData(Uri.parse("package:" + getPackageName()));
                            startActivity(intent);
                        }
                    });
                }
            }
        });

常用提示框

 DialogSinge.getInstance().with(this, "这是一个单独的提示");
 //
 DialogMUtil.getInstance().with(this, "提示", "这是一个Material风格的提示框", new NoDoubleClickListener() {
            @Override
            protected void onNoDoubleClick(View v) {
                DialogMUtil.Dismiss();
            }
        });
 //
 DialogSuccess.getInstance().with(this, "成功\n这是一个Material风格的提示框");
 //
 DialogFailed.getInstance().with(this, "失败\n这是一个Material风格的提示框");
 //
 DialogAddress.getInstance().with(this, new AddressPickerView.OnAddressPickerSureListener() {
            @Override
            public void onSureClick(String address, String provinceCode, String cityCode, String districtCode) {
                DialogAddress.Dismiss();
                DialogMUtil.getInstance().with(MainActivity.this, "提示", address + "\n" + provinceCode + "\n" + cityCode, new NoDoubleClickListener() {
                    @Override
                    protected void onNoDoubleClick(View v) {
                        DialogMUtil.Dismiss();
                    }
                });
            }
        });

下载apk并安装

  Intent intentDownload = new Intent(MainActivity.this, WDYDownloadService.class);
  intentDownload.putExtra("downloadUrl", url);
  intentDownload.putExtra("downloadAppName", "zhitou_all_release_3_4_0.apk");
  startService(intentDownload);

wdybase's People

Contributors

zadmeng avatar wangdongyi avatar

Stargazers

王东一 avatar

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.