Tabnine Logo
PresentationActivity$DemoPresentation.setContentView
Code IndexAdd Tabnine to your IDE (free)

How to use
setContentView
method
in
com.example.android.apis.app.PresentationActivity$DemoPresentation

Best Java code snippets using com.example.android.apis.app.PresentationActivity$DemoPresentation.setContentView (Showing top 2 results out of 315)

origin: qiubiteme/android_api_demos

  @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);
  }
}
origin: li2/learning-android-open-source

  @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);
  }
}
com.example.android.apis.appPresentationActivity$DemoPresentationsetContentView

Popular methods of PresentationActivity$DemoPresentation

  • <init>
  • dismiss
  • findViewById
  • getContext
  • getDisplay
  • setOnDismissListener
  • show
  • getWindow
  • setPreferredDisplayMode
    Sets the preferred display mode id for the presentation.

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now