• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TelescopeLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mattprecious.telescope.TelescopeLayout的典型用法代码示例。如果您正苦于以下问题:Java TelescopeLayout类的具体用法?Java TelescopeLayout怎么用?Java TelescopeLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TelescopeLayout类属于com.mattprecious.telescope包,在下文中一共展示了TelescopeLayout类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: forActivity

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override public ViewGroup forActivity(final Activity activity) {
  activity.setContentView(R.layout.internal_activity_frame);
  ButterKnife.bind(this, activity);

  TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.
  telescopeLayout.setLens(new BugReportLens(activity, lumberYard, intentManager));

  // If you have not seen the telescope dialog before, show it.
  if (!seenTelescopeDialog.get()) {
    telescopeLayout.postDelayed(() -> {
      if (activity.isFinishing()) {
        return;
      }

      seenTelescopeDialog.set(true);
      showTelescopeDialog(activity);
    }, 1000);
  }

  return telescopeLayout;
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:22,代码来源:TelescopeViewContainer.java


示例2: showTelescopeDialog

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
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();
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:24,代码来源:TelescopeViewContainer.java


示例3: onModuleAttached

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override
protected void onModuleAttached(Activity activity, DebugModule module) {
	super.onModuleAttached(activity,module);

	ViewGroup content = module.getContent();

	telescopeLayout = new TelescopeLayout(activity);

	ViewGroup parent = (ViewGroup) content.getParent();
	parent.removeView(content);
	parent.addView(telescopeLayout,0);
	telescopeLayout.addView(content);

	telescopeLayout.setLens(new BugReportLens(activity, LumberYard.getInstance(activity)));

	TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.

	// enable/disable based on saved preference
	onSwitch(isChecked());
}
 
开发者ID:williamwebb,项目名称:debugdrawer,代码行数:21,代码来源:TelescopeElement.java


示例4: forActivity

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override public ViewGroup forActivity(final Activity activity) {
    activity.setContentView(R.layout.internal_activity_frame);
    ButterKnife.bind(this, activity);

    TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.
    telescopeLayout.setLens(new BugReportLens(activity, lumberYard));

    // If you have not seen the telescope dialog before, show it.
    if (!seenTelescopeDialog.get()) {
        telescopeLayout.postDelayed(new Runnable() {
            @Override public void run() {
                if (activity.isFinishing()) {
                    return;
                }

                seenTelescopeDialog.set(true);
                showTelescopeDialog(activity);
            }
        }, 1000);
    }

    return telescopeLayout;
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:24,代码来源:TelescopeViewContainer.java


示例5: showTelescopeDialog

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
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();
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:24,代码来源:TelescopeViewContainer.java


示例6: forActivity

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override public ViewGroup forActivity(final Activity activity) {
  activity.setContentView(R.layout.internal_activity_frame);
  ButterKnife.bind(this, activity);

  TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.
  telescopeLayout.setLens(new BugReportLens(activity, lumberYard));

  // If you have not seen the telescope dialog before, show it.
  if (!seenTelescopeDialog.get()) {
    telescopeLayout.postDelayed(new Runnable() {
      @Override public void run() {
        if (activity.isFinishing()) {
          return;
        }

        seenTelescopeDialog.set(true);
        showTelescopeDialog(activity);
      }
    }, 1000);
  }

  return telescopeLayout;
}
 
开发者ID:JakeWharton,项目名称:u2020,代码行数:24,代码来源:TelescopeViewContainer.java


示例7: initBugReport

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
public void initBugReport()
{
    try
    {
        TelescopeLayout telescopeView = (TelescopeLayout) findViewById(telescopeId);
        telescopeView.setLens(new EmailDeviceInfoLens(this, getString(R.string.bug_report_title),
                getPackageManager().getPackageInfo(getPackageName(), 0).versionName,
                getPackageManager().getPackageInfo(getPackageName(), 0).versionCode,
                getResources().getStringArray(R.array.bugreport_email)));
    }
    catch (Exception e)
    {
        Log.w("Test", Log.getStackTraceString(e));
    }
}
 
开发者ID:Alfresco,项目名称:activiti-android-app,代码行数:16,代码来源:AlfrescoActivity.java


示例8: forActivity

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override public ViewGroup forActivity(final Activity activity) {
  activity.setContentView(R.layout.debug_activity_frame);

  final ViewHolder viewHolder = new ViewHolder();
  ButterKnife.bind(viewHolder, activity);

  final Context drawerContext = new ContextThemeWrapper(activity, R.style.Theme_SuperGlue_Debug);
  final DebugView debugView = new DebugView(drawerContext);
  viewHolder.debugDrawer.addView(debugView);

  viewHolder.drawerLayout.setDrawerShadow(R.drawable.debug_drawer_shadow, GravityCompat.END);
  viewHolder.drawerLayout.setDrawerListener(new DebugDrawerLayout.SimpleDrawerListener() {
    @Override public void onDrawerOpened(View drawerView) {
      debugView.onDrawerOpened();
    }
  });

  TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.
  viewHolder.telescopeLayout.setLens(new BugReportLens(activity, lumberYard, intentManager));

  // If you have not seen the debug drawer before, show it with a message
  if (!seenDebugDrawer.get()) {
    viewHolder.drawerLayout.postDelayed(() -> {
      viewHolder.drawerLayout.openDrawer(GravityCompat.END);
      Toast.makeText(drawerContext, R.string.debug_drawer_welcome, Toast.LENGTH_LONG).show();
    }, SECONDS.toMillis(1));
    seenDebugDrawer.set(true);
  }

  final CompositeSubscription subscriptions = new CompositeSubscription();
  setupMadge(viewHolder, subscriptions);
  setupScalpel(viewHolder, subscriptions);

  final Application app = activity.getApplication();
  app.registerActivityLifecycleCallbacks(new EmptyActivityLifecycleCallbacks() {
    @Override public void onActivityDestroyed(Activity lifecycleActivity) {
      if (lifecycleActivity == activity) {
        subscriptions.unsubscribe();
        app.unregisterActivityLifecycleCallbacks(this);
      }
    }
  });

  riseAndShine(activity);
  return viewHolder.content;
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:47,代码来源:DebugViewContainer.java


示例9: onDestroy

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override protected void onDestroy() {
  super.onDestroy();
  TelescopeLayout.cleanUp(this);
}
 
开发者ID:mattprecious,项目名称:telescope,代码行数:5,代码来源:SampleActivity.java


示例10: forActivity

import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override public ViewGroup forActivity(final Activity activity) {
  activity.setContentView(R.layout.debug_activity_frame);

  final ViewHolder viewHolder = new ViewHolder();
  ButterKnife.bind(viewHolder, activity);

  final Context drawerContext = new ContextThemeWrapper(activity, R.style.Theme_U2020_Debug);
  final DebugView debugView = new DebugView(drawerContext);
  viewHolder.debugDrawer.addView(debugView);

  // Set up the contextual actions to watch views coming in and out of the content area.
  ContextualDebugActions contextualActions = debugView.getContextualDebugActions();
  contextualActions.setActionClickListener(v -> viewHolder.drawerLayout.closeDrawers());
  viewHolder.content.setOnHierarchyChangeListener(
      HierarchyTreeChangeListener.wrap(contextualActions));

  viewHolder.drawerLayout.setDrawerShadow(R.drawable.debug_drawer_shadow, GravityCompat.END);
  viewHolder.drawerLayout.setDrawerListener(new DebugDrawerLayout.SimpleDrawerListener() {
    @Override public void onDrawerOpened(View drawerView) {
      debugView.onDrawerOpened();
    }
  });

  TelescopeLayout.cleanUp(activity); // Clean up any old screenshots.
  viewHolder.telescopeLayout.setLens(new BugReportLens(activity, lumberYard));

  // If you have not seen the debug drawer before, show it with a message
  if (!seenDebugDrawer.get()) {
    viewHolder.drawerLayout.postDelayed(() -> {
      viewHolder.drawerLayout.openDrawer(GravityCompat.END);
      Toast.makeText(drawerContext, R.string.debug_drawer_welcome, Toast.LENGTH_LONG).show();
    }, 1000);
    seenDebugDrawer.set(true);
  }

  final CompositeSubscription subscriptions = new CompositeSubscription();
  setupMadge(viewHolder, subscriptions);
  setupScalpel(viewHolder, subscriptions);

  final Application app = activity.getApplication();
  app.registerActivityLifecycleCallbacks(new EmptyActivityLifecycleCallbacks() {
    @Override public void onActivityDestroyed(Activity lifecycleActivity) {
      if (lifecycleActivity == activity) {
        subscriptions.unsubscribe();
        app.unregisterActivityLifecycleCallbacks(this);
      }
    }
  });

  riseAndShine(activity);
  return viewHolder.content;
}
 
开发者ID:JakeWharton,项目名称:u2020,代码行数:53,代码来源:DebugViewContainer.java



注:本文中的com.mattprecious.telescope.TelescopeLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Timer类代码示例发布时间:2022-05-22
下一篇:
Java HtmlData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap