Search in sources :

Example 1 with TelescopeLayout

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();
}
Also used : TelescopeLayout(com.mattprecious.telescope.TelescopeLayout) AlertDialog(android.support.v7.app.AlertDialog) Context(android.content.Context) ContextThemeWrapper(android.view.ContextThemeWrapper) Toast(android.widget.Toast) LayoutInflater(android.view.LayoutInflater) Lens(com.mattprecious.telescope.Lens) BugReportLens(com.jakewharton.u2020.ui.bugreport.BugReportLens) File(java.io.File) View(android.view.View)

Example 2 with TelescopeLayout

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();
}
Also used : TelescopeLayout(com.mattprecious.telescope.TelescopeLayout) AlertDialog(android.support.v7.app.AlertDialog) Context(android.content.Context) ContextThemeWrapper(android.view.ContextThemeWrapper) Toast(android.widget.Toast) LayoutInflater(android.view.LayoutInflater) Lens(com.mattprecious.telescope.Lens) BugReportLens(com.jakewharton.u2020.ui.bugreport.BugReportLens) File(java.io.File) BindView(butterknife.BindView) View(android.view.View)

Aggregations

Context (android.content.Context)2 AlertDialog (android.support.v7.app.AlertDialog)2 ContextThemeWrapper (android.view.ContextThemeWrapper)2 LayoutInflater (android.view.LayoutInflater)2 View (android.view.View)2 Toast (android.widget.Toast)2 BugReportLens (com.jakewharton.u2020.ui.bugreport.BugReportLens)2 Lens (com.mattprecious.telescope.Lens)2 TelescopeLayout (com.mattprecious.telescope.TelescopeLayout)2 File (java.io.File)2 BindView (butterknife.BindView)1