本文整理汇总了Java中com.mattprecious.telescope.TelescopeLayout.setLens方法的典型用法代码示例。如果您正苦于以下问题:Java TelescopeLayout.setLens方法的具体用法?Java TelescopeLayout.setLens怎么用?Java TelescopeLayout.setLens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mattprecious.telescope.TelescopeLayout
的用法示例。
在下文中一共展示了TelescopeLayout.setLens方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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());
}
示例3: 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();
}
示例4: 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));
}
}