本文整理汇总了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;
}
示例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();
}
示例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());
}
示例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;
}
示例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();
}
示例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;
}
示例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));
}
}
示例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;
}
示例9: onDestroy
import com.mattprecious.telescope.TelescopeLayout; //导入依赖的package包/类
@Override protected void onDestroy() {
super.onDestroy();
TelescopeLayout.cleanUp(this);
}
示例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;
}