use of com.mattprecious.telescope.TelescopeLayout in project sbt-android by scala-android.
the class TelescopeAppContainer method showTelescopeDialog.
public void showTelescopeDialog(final Activity activity) {
LayoutInflater inflater = LayoutInflater.from(activity);
TelescopeLayout content = (TelescopeLayout) inflater.inflate(R.layout.telescope_tutorial_dialog, null);
final AlertDialog dialog = new AlertDialog.Builder(activity).setView(content).setCancelable(false).create();
content.setLens(new Lens() {
@Override
public void onCapture(File file) {
dialog.dismiss();
Context toastContext = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Dialog);
LayoutInflater toastInflater = LayoutInflater.from(toastContext);
Toast toast = Toast.makeText(toastContext, "", Toast.LENGTH_SHORT);
View toastView = toastInflater.inflate(R.layout.telescope_tutorial_toast, null);
toast.setView(toastView);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
});
dialog.show();
}
use of com.mattprecious.telescope.TelescopeLayout in project u2020 by JakeWharton.
the class TelescopeViewContainer method showTelescopeDialog.
public void showTelescopeDialog(final Activity activity) {
LayoutInflater inflater = LayoutInflater.from(activity);
TelescopeLayout content = (TelescopeLayout) inflater.inflate(R.layout.telescope_tutorial_dialog, null);
final AlertDialog dialog = new AlertDialog.Builder(activity).setView(content).setCancelable(false).create();
content.setLens(new Lens() {
@Override
public void onCapture(File file) {
dialog.dismiss();
Context toastContext = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Dialog);
LayoutInflater toastInflater = LayoutInflater.from(toastContext);
Toast toast = Toast.makeText(toastContext, "", Toast.LENGTH_SHORT);
View toastView = toastInflater.inflate(R.layout.telescope_tutorial_toast, null);
toast.setView(toastView);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
});
dialog.show();
}
Aggregations