@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView wv=new WebView(getContext()); wv.loadUrl("https://commonsware.com"); setContentView(wv); } }
public void setDisplay(Context ctxt, Display display) { if (display == null) { preso=null; } else { preso=new Presentation(ctxt, display, getTheme()); } this.display=display; }
@Override public Context getContext() { if (preso != null) { return(preso.getContext()); } return(getActivity()); } }
@Override public void showPreso(Display display) { preso=new SimplerPresentation(this, display); preso.show(); }
@Override public void clearPreso(boolean showInline) { if (preso != null) { preso.dismiss(); preso=null; } }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private void showPreso(RouteInfo route) { preso=new SimplePresentation(this, route.getPresentationDisplay()); preso.show(); }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private void clearPreso() { if (preso != null) { preso.dismiss(); preso=null; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView wv=new WebView(getContext()); wv.loadUrl("https://commonsware.com"); setContentView(wv); } }
public void setDisplay(Context ctxt, Display display) { if (display == null) { preso=null; } else { preso=new Presentation(ctxt, display, getTheme()); } this.display=display; }
public Context getContext() { if (preso != null) { return(preso.getContext()); } return(getActivity()); } }
@Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // Inflate the layout. setContentView(R.layout.sample_media_router_presentation); // Set up the surface view. mPresentationSurfaceView = (SurfaceView)findViewById(R.id.surface_view); SurfaceHolder holder = mPresentationSurfaceView.getHolder(); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); holder.addCallback(SurfaceViewPlayer.this); Log.i(TAG, "Presentation created"); }
/** * Call this to provide the Display for the Presentation and to actually * set up the Presentation. Otherwise, this fragment will behave like * an ordinary DialogFragment. * * @param ctxt a Context associated with this Display * @param display the Display on which to show the Presentation */ public void setDisplay(Context ctxt, Display display) { if (display == null) { preso=null; } else { preso=new Presentation(ctxt, display, getTheme()); } this.display=display; }
/** * @return the Context associated with the Presentation (via setDisplay()) * where available */ public Context getContext() { if (preso != null) { return(preso.getContext()); } return(getActivity()); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.presentation_main_layout); mPdfPresenRootView = (ViewGroup) findViewById(R.id.main_presentation_layout_root); }
@Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // Get the resources for the context of the presentation. // Notice that we are getting the resources from the context of the presentation. Resources r = getContext().getResources(); // Inflate the layout. setContentView(R.layout.presentation_with_media_router_content); // Set up the surface view for visual interest. mSurfaceView = (GLSurfaceView)findViewById(R.id.surface_view); mSurfaceView.setRenderer(new CubeRenderer(false)); }
@Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // Get the resources for the context of the presentation. // Notice that we are getting the resources from the context of the presentation. Resources r = getContext().getResources(); // Inflate the layout. setContentView(R.layout.presentation_with_media_router_content); // Set up the surface view for visual interest. mSurfaceView = (GLSurfaceView)findViewById(R.id.surface_view); mSurfaceView.setRenderer(new CubeRenderer(false)); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(TAG); w = getWindow(); startRefreshTask(); w.setType(WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the content view to the custom layout setContentView(R.layout.display); // Get the Views mLayout = (LinearLayout) findViewById(R.id.display_layout); mText = (TextView) findViewById(R.id.display_text); /* * Show the name of the display this presentation was embedded in. */ TextView smallText = (TextView) findViewById(R.id.display_smalltext); final String name = getDisplay().getName(); smallText.setText(getResources().getString(R.string.display_name, name)); }
@Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // Get the resources for the context of the presentation. // Notice that we are getting the resources from the context of the presentation. Resources r = getContext().getResources(); // Inflate the layout. setContentView(R.layout.presentation_content); final Display display = getDisplay(); final int displayId = display.getDisplayId(); final int photo = mContents.photo; // Show a caption to describe what's going on. TextView text = (TextView)findViewById(R.id.text); text.setText(r.getString(R.string.presentation_photo_text, photo, displayId, display.getName())); // Show a n image for visual interest. ImageView image = (ImageView)findViewById(R.id.image); image.setImageDrawable(r.getDrawable(PHOTOS[photo])); GradientDrawable drawable = new GradientDrawable(); drawable.setShape(GradientDrawable.RECTANGLE); drawable.setGradientType(GradientDrawable.RADIAL_GRADIENT); // Set the background to a random gradient. Point p = new Point(); getDisplay().getSize(p); drawable.setGradientRadius(Math.max(p.x, p.y) / 2); drawable.setColors(mContents.colors); findViewById(android.R.id.content).setBackground(drawable); } }
@Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // Get the resources for the context of the presentation. // Notice that we are getting the resources from the context of the presentation. Resources r = getContext().getResources(); // Inflate the layout. setContentView(R.layout.presentation_content); final Display display = getDisplay(); final int displayId = display.getDisplayId(); final int photo = mContents.photo; // Show a caption to describe what's going on. TextView text = (TextView)findViewById(R.id.text); text.setText(r.getString(R.string.presentation_photo_text, photo, displayId, display.getName())); // Show a n image for visual interest. ImageView image = (ImageView)findViewById(R.id.image); image.setImageDrawable(r.getDrawable(PHOTOS[photo])); GradientDrawable drawable = new GradientDrawable(); drawable.setShape(GradientDrawable.RECTANGLE); drawable.setGradientType(GradientDrawable.RADIAL_GRADIENT); // Set the background to a random gradient. Point p = new Point(); getDisplay().getSize(p); drawable.setGradientRadius(Math.max(p.x, p.y) / 2); drawable.setColors(mContents.colors); findViewById(android.R.id.content).setBackground(drawable); } }