Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Dialog with multi show ( TOP, CENTER, BOTTOM )

Notifications You must be signed in to change notification settings

CASH-IT-Developer/cashitDialog

Repository files navigation

cashitDialog

Dialog with multi view ( Top , Center , Bottom )

Top Dialog Center Dialog Bottom Dialog
alt text alt text alt text

How To Use

 implementation "com.github.CASH-IT-Developer:cashitDialog:VERSION"
 ...
 ...

and

 allprojects {
     repositories {
         google()
         maven { url "https://maven.google.com" }
         ...
         ...
     }
 }

Implementation in Programatically

Setup Top Dialog

        FloatingActionButton fab3 = findViewById(R.id.fab3);
        fab3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new Dlg.Builder(MainActivity.this)
                        .setTitle("Im Title Top Dialog")
                        .setDlgPosition(Dlg.Position.TOP)
                        .setContentImage(R.mipmap.ic_launcher)
                        .setDescription("I'm description Top Dialog")
                        .addButtonHoriz("Style 1 (Horizontal)",  Dlg.Style.STYLE1, new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.dismiss();

                            }
                        }).addButtonHoriz("Style 2 (Horizontal)",  Dlg.Style.STYLE2, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).addButtonVert("Style 3 (Vertical)",  Dlg.Style.STYLE3, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();

                    }
                }).addButtonVert("Style 4 (Vertical)",  Dlg.Style.STYLE4, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).show();
            }
        });

Setup Center Dialog

FloatingActionButton fab = findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new Dlg.Builder(MainActivity.this)
                        .setTitle("Im Title Center Dialog")
                        .setDlgPosition(Dlg.Position.CENTER)
                        .setDescription("I'm description Center Dialog")
                        .addButtonHoriz("Style 1 (Horizontal)",  Dlg.Style.STYLE1, new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.dismiss();

                            }
                        }).addButtonHoriz("Style 2 (Horizontal)",  Dlg.Style.STYLE2, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).addButtonVert("Style 3 (Vertical)",  Dlg.Style.STYLE3, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();

                    }
                }).addButtonVert("Style 4 (Vertical)",  Dlg.Style.STYLE4, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).show();
            }
        });

Setup Bottom Dialog

        FloatingActionButton fab2 = findViewById(R.id.fab2);
        fab2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new Dlg.Builder(MainActivity.this)
                        .setTitle("Im Title Bottom Dialog")
                        .setDlgPosition(Dlg.Position.BOTTOM)
                        .setDescription("I'm description Bottom Dialog")
                        .addButtonHoriz("Style 1 (Horizontal)",  Dlg.Style.STYLE1, new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.dismiss();

                            }
                        }).addButtonHoriz("Style 2 (Horizontal)",  Dlg.Style.STYLE2, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).addButtonVert("Style 3 (Vertical)",  Dlg.Style.STYLE3, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();

                    }
                }).addButtonVert("Style 4 (Vertical)",  Dlg.Style.STYLE4, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {


                    }
                }).show();
            }
        });

License

Copyright 2020 PT. Kreigan Sentral Teknologi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
      
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.