{"id":25244773,"url":"https://github.com/tientham/sweet-dialog","last_synced_at":"2026-05-08T01:47:51.063Z","repository":{"id":180658666,"uuid":"115270355","full_name":"tientham/sweet-dialog","owner":"tientham","description":"Lovely and especially simple library","archived":false,"fork":false,"pushed_at":"2019-08-15T20:11:24.000Z","size":376,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T01:41:01.249Z","etag":null,"topics":["android","java","kotlin","library"],"latest_commit_sha":null,"homepage":"https://jitpack.io/#tientham/sweet-dialog/v1.1.1","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tientham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-24T15:05:29.000Z","updated_at":"2019-08-15T20:10:57.000Z","dependencies_parsed_at":"2023-07-27T02:32:39.386Z","dependency_job_id":null,"html_url":"https://github.com/tientham/sweet-dialog","commit_stats":null,"previous_names":["tientham/sweet-dialog"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tientham%2Fsweet-dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tientham%2Fsweet-dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tientham%2Fsweet-dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tientham%2Fsweet-dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tientham","download_url":"https://codeload.github.com/tientham/sweet-dialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399888,"owners_count":20932880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","java","kotlin","library"],"created_at":"2025-02-12T01:36:11.704Z","updated_at":"2026-05-08T01:47:46.022Z","avatar_url":"https://github.com/tientham.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sweet-dialog\n![](https://img.shields.io/badge/v1.1.2-pass-blue.svg)\n![Release](https://img.shields.io/badge/build-pass-green.svg)\n![](https://img.shields.io/badge/dialog-lovely-orange.svg)\n## Setup\n\nIn order to use this lib, you need to:\n\nStep 1. Add it in your root build.gradle at the end of repositories:\n\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n  \nStep 2. Add the dependency\n\n\tdependencies {\n\t        implementation 'com.github.tientham:sweet-dialog:v1.1.2'\n\t}\n\n## How to\n\n- Showing sweet-dialog with 2 buttons, animation and title with icon\n\n\t\tfinal SweetDialog dialog = new SweetDialog(v.getContext(), SweetDialog.CUSTOM_IMAGE_TYPE);\n\t\tdialog.setTitleText(getResources().getString(R.string.app_name))\n\t\t\t.setContentText(R.string.dialog_exit_app_title)\n\t\t\t.setCancelText(R.string.dialog_exit_app_btn_cancel)\n\t\t\t.setConfirmText(R.string.dialog_exit_app_btn_yes)\n\t\t\t.showCancelButton(true)\n\t\t\t.setCustomImage(R.drawable.img_girl_1)\n\t\t\t.setCancelClickListener(null)\n\t\t\t.setConfirmClickListener(new SweetDialog.OnSweetClickListener() {\n\t\t\t    @Override\n\t\t\t    public void onClick(SweetDialog sweetDialog) {\n\t\t\t\tdialog.dismiss();\n\t\t\t\tMainActivity.this.finish();\n\t\t\t    }\n\t\t\t})\n\t\t\t.show();\n\n- Showing list dialog fragment with icon and text title\n\nYour main activity need to implement SimpleDialog.OnItemClickListener\n\t\t\n\t\tpublic class MainActivity extends AppCompatActivity implements View.OnClickListener, SimpleDialog.OnItemClickListener \n\t\t{\n\t\t\t// Your code\n\t\t}\n\nTo create dialog:\n\n                new SimpleDialogSupportFragment.Builder()\n                        .setTitle(R.string.app_language)\n                        .setItems(R.array.icon_languages, getIconLanguages())\n                        .setRequestCode(REQUEST_CODE_LANGUAGE_ICON_ITEMS)\n                        .create().show(getSupportFragmentManager(), \"dialog\");\n\n\t\tprotected int[] getIcons()\n\t\t{\n\t\t\treturn new int[] { R.drawable.\u003cyour_img\u003e,\n\t\t\t\tR.drawable.\u003cyour_img\u003e,\n\t\t\t\tR.drawable.\u003cyour_img\u003e,\n\t\t\t\tR.drawable.\u003cyour_img\u003e,\n\t\t};\n\t\t}\n\n\t\tprotected int[] getIconLanguages()\n\t\t{\n\t\t\treturn new int[] { R.drawable.lan_uk,\n\t\t\t\tR.drawable.lan_it,\n\t\t\t\tR.drawable.lan_vn,\n\t\t};\n\t\t\n\t\t@Override\n\t\tpublic void onItemClick(SimpleDialog dialog, int requestCode, int which)\n\t\t{\n\t\t\tif (requestCode == REQUEST_CODE_LANGUAGE_ICON_ITEMS) {\n\t\t\t    switch (which)\n\t\t\t    {\n\t\t\t\tcase 0:\n\t\t\t\t    //Doing something here;\n\t\t\t\t    break;\n\t\t\t\tcase 1:\t\n\t\t\t\t    // Doing something here\n\t\t\t\t    break;\n\t\t\t\tdefault:\n\t\t\t\t    break;\n\n\t\t\t    }\n\t\t\t}\n\t\t}\n\t\t\n\n## Roadmap\n\n- Convert this lib to 100% Kotlin\n\n## Who is using us?\n\n- [#App4Autism](https://play.google.com/store/apps/details?id=vn.tientham.visualsupportforautism)\n- [#App4Timer](https://play.google.com/store/apps/details?id=tientham.androidtimer)\n- [#BluChat](https://play.google.com/store/apps/details?id=tientham.bluetoothdemo)\n- [#MovieWiki](https://play.google.com/store/apps/details?id=tientham.movie_wiki)\n\n## Credit\n\n- Badge images are taken from: https://shields.io/#/\n- Reference for this project is: https://github.com/pedant/sweet-alert-dialog\n\n## License\n\tCopyright (c) 2018. Minh Tien TO.\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t   http://www.apache.org/licenses/LICENSE-2.0\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftientham%2Fsweet-dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftientham%2Fsweet-dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftientham%2Fsweet-dialog/lists"}