Android Open Source - DroidUPnP Device Info Dialog






From Project

Back to project page DroidUPnP.

License

The source code is released under:

GNU General Public License

If you think the Android project DroidUPnP listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.droidupnp.view;
//from   w w  w .  ja  v a  2  s .  c  om
import org.droidupnp.R;

import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

public class DeviceInfoDialog extends DialogFragment {

  private String title;
  private String manufacturer;
  private String manufacturer_url;
  private String model_name;
  private String model_url;
  private String model_number;
  private String model_desc;
  private String presentation_url;
  private String desc_xml;

  /**
   * Create a new instance of MyDialogFragment, providing "num" as an argument.
   */
  static DeviceInfoDialog newInstance(DeviceDisplay d)
  {
    DeviceInfoDialog f = new DeviceInfoDialog();

    Bundle args = new Bundle();
    args.putString("title", d.toString());

    args.putString("manufacturer", d.getDevice().getManufacturer());
    args.putString("manufacturer_url", d.getDevice().getManufacturerURL());
    args.putString("model_name", d.getDevice().getModelName());
    args.putString("model_url", d.getDevice().getModelURL());
    args.putString("model_number", d.getDevice().getModelNumber());
    args.putString("model_desc", d.getDevice().getModelDesc());
    args.putString("presentation_url", d.getDevice().getPresentationURL());
    args.putString("desc_xml", d.getDevice().getXMLURL());

    f.setArguments(args);

    return f;
  }

  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    title = getArguments().getString("title");
    manufacturer = getArguments().getString("manufacturer");
    manufacturer_url = getArguments().getString("manufacturer_url");
    model_name = getArguments().getString("model_name");
    model_url = getArguments().getString("model_url");
    model_number = getArguments().getString("model_number");
    model_desc = getArguments().getString("model_desc");
    presentation_url = getArguments().getString("presentation_url");
    desc_xml = getArguments().getString("desc_xml");
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
  {
    View v = inflater.inflate(R.layout.popup_info, container, false);
    ((TextView) v.findViewById(R.id.manufacturer)).setText(manufacturer);
    ((TextView) v.findViewById(R.id.manufacturer_url)).setText(manufacturer_url);
    ((TextView) v.findViewById(R.id.model_name)).setText(model_name);
    ((TextView) v.findViewById(R.id.model_url)).setText(model_url);
    ((TextView) v.findViewById(R.id.model_number)).setText(model_number);
    ((TextView) v.findViewById(R.id.model_desc)).setText(model_desc);
    ((TextView) v.findViewById(R.id.presentation_url)).setText(presentation_url);
    ((TextView) v.findViewById(R.id.desc_xml)).setText(desc_xml);

    final DeviceInfoDialog deviceInfoDialog = this;

    this.getDialog().setTitle(title);

    // Watch for button clicks.
    Button button = (Button) v.findViewById(R.id.button);
    button.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v)
      {
        deviceInfoDialog.dismiss();
      }
    });

    return v;
  }
}




Java Source Code List

fi.iki.elonen.NanoHTTPD.java
fi.iki.elonen.ServerRunner.java
fi.iki.elonen.SimpleWebServer.java
org.droidupnp.DrawerFragment.java
org.droidupnp.Main.java
org.droidupnp.controller.cling.ContentDirectoryCommand.java
org.droidupnp.controller.cling.Factory.java
org.droidupnp.controller.cling.RendererCommand.java
org.droidupnp.controller.cling.ServiceController.java
org.droidupnp.controller.cling.ServiceListener.java
org.droidupnp.controller.upnp.IUpnpServiceController.java
org.droidupnp.controller.upnp.UpnpDebugListener.java
org.droidupnp.model.CObservable.java
org.droidupnp.model.cling.CDevice.java
org.droidupnp.model.cling.CRegistryListener.java
org.droidupnp.model.cling.RendererState.java
org.droidupnp.model.cling.TrackMetadata.java
org.droidupnp.model.cling.UpnpRegistry.java
org.droidupnp.model.cling.UpnpServiceController.java
org.droidupnp.model.cling.UpnpService.java
org.droidupnp.model.cling.didl.ClingAudioItem.java
org.droidupnp.model.cling.didl.ClingDIDLContainer.java
org.droidupnp.model.cling.didl.ClingDIDLItem.java
org.droidupnp.model.cling.didl.ClingDIDLObject.java
org.droidupnp.model.cling.didl.ClingDIDLParentContainer.java
org.droidupnp.model.cling.didl.ClingImageItem.java
org.droidupnp.model.cling.didl.ClingVideoItem.java
org.droidupnp.model.cling.localContent.AlbumContainer.java
org.droidupnp.model.cling.localContent.ArtistContainer.java
org.droidupnp.model.cling.localContent.AudioContainer.java
org.droidupnp.model.cling.localContent.CustomContainer.java
org.droidupnp.model.cling.localContent.DynamicContainer.java
org.droidupnp.model.cling.localContent.ImageContainer.java
org.droidupnp.model.cling.localContent.VideoContainer.java
org.droidupnp.model.mediaserver.ContentDirectoryService.java
org.droidupnp.model.mediaserver.MediaServer.java
org.droidupnp.model.upnp.ARendererState.java
org.droidupnp.model.upnp.CallableContentDirectoryFilter.java
org.droidupnp.model.upnp.CallableRendererFilter.java
org.droidupnp.model.upnp.ContentDirectoryDiscovery.java
org.droidupnp.model.upnp.DeviceDiscovery.java
org.droidupnp.model.upnp.DeviceListener.java
org.droidupnp.model.upnp.ICallableFilter.java
org.droidupnp.model.upnp.IContentDirectoryCommand.java
org.droidupnp.model.upnp.IDeviceDiscoveryObserver.java
org.droidupnp.model.upnp.IFactory.java
org.droidupnp.model.upnp.IRegistryListener.java
org.droidupnp.model.upnp.IRendererCommand.java
org.droidupnp.model.upnp.IRendererState.java
org.droidupnp.model.upnp.IServiceListener.java
org.droidupnp.model.upnp.IUpnpDevice.java
org.droidupnp.model.upnp.IUpnpRegistry.java
org.droidupnp.model.upnp.PeeringConnectionManager.java
org.droidupnp.model.upnp.RendererDiscovery.java
org.droidupnp.model.upnp.didl.DIDLDevice.java
org.droidupnp.model.upnp.didl.IDIDLContainer.java
org.droidupnp.model.upnp.didl.IDIDLItem.java
org.droidupnp.model.upnp.didl.IDIDLObject.java
org.droidupnp.model.upnp.didl.IDIDLParentContainer.java
org.droidupnp.view.ContentDirectoryDeviceFragment.java
org.droidupnp.view.ContentDirectoryDialog.java
org.droidupnp.view.ContentDirectoryEnabler.java
org.droidupnp.view.ContentDirectoryFragment.java
org.droidupnp.view.Content.java
org.droidupnp.view.DIDLObjectDisplay.java
org.droidupnp.view.DeviceDisplay.java
org.droidupnp.view.DeviceFragment.java
org.droidupnp.view.DeviceInfoDialog.java
org.droidupnp.view.PlaylistFragment.java
org.droidupnp.view.RendererDeviceFragment.java
org.droidupnp.view.RendererDialog.java
org.droidupnp.view.RendererFragment.java
org.droidupnp.view.ServiceDiscoveryFragment.java
org.droidupnp.view.SettingsActivity.java
org.droidupnp.view.UpnpDeviceListFragment.java