All Projects → t-kurimura → flickabledialog

t-kurimura / flickabledialog

Licence: MIT license
This dialog can flick and make it easy to dismiss sensuously.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to flickabledialog

dynamic-dialogs
Display improved dialogs and dialog fragments on Android.
Stars: ✭ 33 (-60.71%)
Mutual labels:  dialog
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (-64.29%)
Mutual labels:  dialog
whatisnewdialog
An Android library for displaying a dialog where it presents new features in the app.
Stars: ✭ 22 (-73.81%)
Mutual labels:  dialog
CompatAlertDialog
No description or website provided.
Stars: ✭ 27 (-67.86%)
Mutual labels:  dialog
UIFramework
A powerful UI framework for the game Onset (https://playonset.com/)
Stars: ✭ 13 (-84.52%)
Mutual labels:  dialog
vaadin-dialog
High quality web component for modal dialogs. Part of the Vaadin platform.
Stars: ✭ 15 (-82.14%)
Mutual labels:  dialog
AttributionPresenter
An Android library to easily display attribution information of open source libraries.
Stars: ✭ 47 (-44.05%)
Mutual labels:  dialog
babi tools
Augmentation scripts for the bAbI Dialog Tasks dataset
Stars: ✭ 14 (-83.33%)
Mutual labels:  dialog
vscode-color
Helper with GUI to generate color codes such as CSS color notations.
Stars: ✭ 88 (+4.76%)
Mutual labels:  dialog
android-suspend-dialogs
A helper library for Android to display Dialogs by suspending the coroutine till finish of the dialog.
Stars: ✭ 32 (-61.9%)
Mutual labels:  dialog
SimpleDialogs
💬 A simple framework to help displaying dialogs on a WPF app
Stars: ✭ 24 (-71.43%)
Mutual labels:  dialog
TipDialog
flutter tip dialog
Stars: ✭ 78 (-7.14%)
Mutual labels:  dialog
vue2-dialog
A mobile Vue plugin for VueDialog
Stars: ✭ 21 (-75%)
Mutual labels:  dialog
ngx-simple-modal
A simple unopinionated framework to implement simple modal based behaviour in angular (v2+) projects.
Stars: ✭ 50 (-40.48%)
Mutual labels:  dialog
blurdialog
A dialog providing a blur effect as background, a title and an icon
Stars: ✭ 72 (-14.29%)
Mutual labels:  dialog
vue-dialog
A drag-able dialog for Vue.js
Stars: ✭ 21 (-75%)
Mutual labels:  dialog
Toaster-Library
🎫 Android library, Custom toast and dialog (2018)
Stars: ✭ 14 (-83.33%)
Mutual labels:  dialog
angular-custom-modal
Angular2+ Modal / Dialog (with inner component support).
Stars: ✭ 30 (-64.29%)
Mutual labels:  dialog
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-83.33%)
Mutual labels:  dialog
probabilistic nlg
Tensorflow Implementation of Stochastic Wasserstein Autoencoder for Probabilistic Sentence Generation (NAACL 2019).
Stars: ✭ 28 (-66.67%)
Mutual labels:  dialog

FlickableDialog

This dialog can flick and make it easy to dismiss sensuously. You can show your infromation to users with minimum stress. And, users can swipe dialog to select options extremley easy!

Download

Gradle :

compile 'com.tkurimura:flickabledialog:0.9.0'

Require

Java7 and Android minimum API level(SDK) 11 (Andorid 3.0)

Usecase demo

AlertDialog Premium appeal Review popup
AlertDialog Premium Review

Usage

Show

  • Call from Activity

Attention to use getSupportFragmentManager() as argument in dialog.show(,);

// simple way to call
FlickableDialog dialog = FlickableDialog.newInstance(R.layout.your_dialog_layout);
dialog.show(getSupportFragmentManager(),dialog.getClass().getSimpleName());
// you can define detail flicking settings 
FlickableDialog dialog = FlickableDialog.newInstance(
	R.layout.your_dialog_layout, // dialog content layout resource Id
	800f, // the area raidus dialog will come back to original position (default : 700f)
	50f, // slope when you flick dialog to side direction (default : 30f)
	R.color.colorAccent); // background color of the area where dialog dismiss if you touch

dialog.show(getSupportFragmentManager(),dialog.getClass().getSimpleName()); 
  • Call from Fragment

Attention to use getChildFragmentManager() as argument in dialog.show(,);

// simple way to call
FlickableDialog dialog = FlickableDialog.newInstance(R.layout.your_dialog_layout);
dialog.show(getChildFragmentManager(),dialog.getClass().getSimpleName());
// you can define detail flicking settings 
FlickableDialog dialog = FlickableDialog.newInstance(
	R.layout.your_dialog_layout, // dialog content layout resource Id
	800f, // the area raidus dialog will come back to original position (default : 700f)
	50f, // slope when you flick dialog to side direction (default : 30f)
	R.color.colorAccent); // background color of the area where dialog dismiss if you touch

dialog.show(getChildFragmentManager(),dialog.getClass().getSimpleName());

Callback

you implement FlickableDialogListener.OnFlickedXDirection in Activity or Fragment.

  • On flicked
HogeActivity extend Activity implement FlickableDialogListener.OnFlickedXDirection{

	@Override 
	public void onFlickableDialogFlicked(FlickableDialogListener.X_DIRECTION xDirection) {
		// do something according to flicked direction
		if(xDirection.equals(LEFT_BOTTOM)){
			doSomething();
		}
	}
}
  • On Cancel

onCancel is callbacked when user touched outside or

FugaFragment extend Fragment implement FlickableDialogListener.OnCanceled{

	@Override 
	public void onFlickableDialogCanceled() {
		getActivity().finish();
	}
}

Custom

You can extend FlickableDialog to your custom dialog.

public class FlickableHogeDialog extends FlickableDialog {

  public static FlickableHogeDialog newInstance(Fragment fragment){

    FlickableHogeDialog flickableHogeDialog = new FlickableHogeDialog();
    Bundle bundle = new Bundle();
    bundle.putInt(LAYOUT_RESOURCE_KEY,R.layout.your_custom_layout);
    flickableHogeDialog.setTargetFragment(fragment,0);
    flickableHogeDialog.setArguments(bundle);

    return flickableHogeDialog;
  }

  @Override 
  public Dialog onCreateDialog(Bundle savedInstanceState) {
  Dialog dialog = super.onCreateDialog(savedInstanceState);
  
  Button button = (Button) dialog.findViewById(R.id.your_custom_complete_button);
  button.setOnClickListener(new View.OnClickListener() {
    @Override 
    public void onClick(View v) {
      Toast.makeText(getContext(),"You tapped Complete button!",Toast.LENGTH_SHORT).show();
      dismiss();
    }
  });
  
    return dialog;
  }

  @Override
  public void onFlicking(float verticalPercentage, float horizontalPercentage) {
  	// callback when dialog moves according to flicks
  	changeStatus();
  }

  @Override
  public void onOriginBack() {
  	// when dialog position came back to default position
  }

License

The MIT License (MIT)
Copyright (c) 2016 Takahisa Kurimura

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].