├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── quick-action-dialog-fragment ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── kingfisherphuoc │ │ └── quickactiondialog │ │ ├── AlignmentFlag.java │ │ └── QuickActionDialogFragment.java │ └── res │ └── values │ └── strings.xml ├── sample ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── kingfisherphuoc │ │ └── sample │ │ └── MainActivity.java │ └── res │ ├── drawable │ ├── header.png │ └── ic_up_arrow.png │ ├── layout │ ├── activity_main.xml │ └── dialog_sample_view.xml │ ├── menu │ └── menu_main.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | QuickActionDialogFragment -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | Android API 8 Platform 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QuickActionDialogFragment [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-QuickActionDialogFragment-green.svg?style=true)](https://android-arsenal.com/details/1/2927) 2 | After longtime searching in GG to find a way to show Quick Action Dialog with up Arrow in the top of dialog, I failed!! Therefore, I create This Library to help lazy devs as me to show quick action view in a dialog fragment. Therefore, you can custom your quick action view easily even with: viewpager inside your quick action. 3 | 4 | ![alt sample](https://cloud.githubusercontent.com/assets/962484/11528816/a62c3ce6-991b-11e5-862b-fee09e89cb12.png) 5 | ![alt sample](https://cloud.githubusercontent.com/assets/962484/11551602/61918946-99ad-11e5-97ea-249d832d4208.png) 6 | ## Gradle dependency 7 | 8 | `compile 'com.kingfisherphuoc:quick-action-dialog-fragment:1.1'` 9 | 10 | ## Usage 11 | 1. You need to create your own `DialogFragment` class which `extends QuickActionDialogFragment` and `override` some abstract methods 12 | 2. `setAnchorView(View)` before showing it. 13 | 3. You can change Alignment of Dialog based on position of AnchorView (like RealativeLayout) with methods: `setAligmentFlags(AlignmentFlag.ALIGN_ANCHOR_VIEW_LEFT | AlignmentFlag.ALIGN_ANCHOR_VIEW_BOTTOM);` 14 | ``` 15 | // Sample class 16 | public static class MySampleDialogFragment extends QuickActionDialogFragment { 17 | 18 | @Override 19 | protected int getArrowImageViewId() { 20 | return R.id.ivArrow; //return 0; that mean you do not have an up arrow icon 21 | } 22 | @Override 23 | protected int getLayout() { 24 | return R.layout.dialog_sample_view; 25 | } 26 | @Override 27 | protected boolean isStatusBarVisible() { 28 | return true; //optional: if status bar is visible in your app 29 | } 30 | @Override 31 | protected boolean isCanceledOnTouchOutside() { 32 | return true; //optional 33 | } 34 | @Override 35 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 36 | View view = super.onCreateView(inflater, container, savedInstanceState); 37 | // Set listener, view, data for your dialog fragment 38 | view.findViewById(R.id.btnSample).setOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View view) { 41 | Toast.makeText(getContext(), "Button inside Dialog!!", Toast.LENGTH_SHORT).show(); 42 | } 43 | }); 44 | return view; 45 | } 46 | } 47 | // Sample XML: 48 | 52 | 56 | 61 | 68 | 74 |