Java 类com.google.android.exoplayer.demo.Samples.Sample 实例源码

项目:ExoPlayerController    文件:SampleChooserActivity.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  View view = convertView;
  if (view == null) {
    int layoutId = getItemViewType(position) == 1 ? android.R.layout.simple_list_item_1
        : R.layout.sample_chooser_inline_header;
    view = LayoutInflater.from(getContext()).inflate(layoutId, null, false);
  }
  Object item = getItem(position);
  String name = null;
  if (item instanceof Sample) {
    name = ((Sample) item).name;
  } else if (item instanceof Header) {
    name = ((Header) item).name;
  }
  ((TextView) view).setText(name);
  return view;
}
项目:android-exoplayer    文件:SampleChooserActivity.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  View view = convertView;
  if (view == null) {
    int layoutId = getItemViewType(position) == 1 ? android.R.layout.simple_list_item_1
        : R.layout.sample_chooser_inline_header;
    view = LayoutInflater.from(getContext()).inflate(layoutId, null, false);
  }
  Object item = getItem(position);
  String name = null;
  if (item instanceof Sample) {
    name = ((Sample) item).name;
  } else if (item instanceof Header) {
    name = ((Header) item).name;
  }
  ((TextView) view).setText(name);
  return view;
}
项目:Exoplayer_VLC    文件:SampleChooserActivity.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  View view = convertView;
  if (view == null) {
    int layoutId = getItemViewType(position) == 1 ? android.R.layout.simple_list_item_1
        : R.layout.sample_chooser_inline_header;
    view = LayoutInflater.from(getContext()).inflate(layoutId, null, false);
  }
  Object item = getItem(position);
  String name = null;
  if (item instanceof Sample) {
    name = ((Sample) item).name;
  } else if (item instanceof Header) {
    name = ((Header) item).name;
  }
  ((TextView) view).setText(name);
  return view;
}
项目:ExoPlayer    文件:SampleChooserActivity.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  View view = convertView;
  if (view == null) {
    int layoutId = getItemViewType(position) == 1 ? android.R.layout.simple_list_item_1
        : R.layout.sample_chooser_inline_header;
    view = LayoutInflater.from(getContext()).inflate(layoutId, null, false);
  }
  Object item = getItem(position);
  String name = null;
  if (item instanceof Sample) {
    name = ((Sample) item).name;
  } else if (item instanceof Header) {
    name = ((Header) item).name;
  }
  ((TextView) view).setText(name);
  return view;
}
项目:ExoPlayerController    文件:SampleChooserActivity.java   
private void onSampleSelected(Sample sample) {
  Intent mpdIntent = new Intent(this, PlayerActivity.class)
      .setData(Uri.parse(sample.uri))
      .putExtra(PlayerActivity.CONTENT_ID_EXTRA, sample.contentId)
      .putExtra(PlayerActivity.CONTENT_TYPE_EXTRA, sample.type);
  startActivity(mpdIntent);
}
项目:android-exoplayer    文件:SampleChooserActivity.java   
private void onSampleSelected(Sample sample) {
  if (Util.SDK_INT < 18 && sample.isEncypted) {
    Toast.makeText(getApplicationContext(), R.string.drm_not_supported, Toast.LENGTH_SHORT)
        .show();
    return;
  }
  Class<?> playerActivityClass = sample.fullPlayer ? FullPlayerActivity.class
      : SimplePlayerActivity.class;
  Intent mpdIntent = new Intent(this, playerActivityClass)
      .setData(Uri.parse(sample.uri))
      .putExtra(DemoUtil.CONTENT_ID_EXTRA, sample.contentId)
      .putExtra(DemoUtil.CONTENT_TYPE_EXTRA, sample.type);
  startActivity(mpdIntent);
}
项目:Exoplayer_VLC    文件:SampleChooserActivity.java   
private void onSampleSelected(Sample sample) {
  Intent mpdIntent = new Intent(this, PlayerActivity.class)
      .setData(Uri.parse(sample.uri))
      .putExtra(PlayerActivity.CONTENT_ID_EXTRA, sample.contentId)
      .putExtra(PlayerActivity.CONTENT_TYPE_EXTRA, sample.type);
  startActivity(mpdIntent);
}
项目:ExoPlayer    文件:SampleChooserActivity.java   
private void onSampleSelected(Sample sample) {
  Intent mpdIntent = new Intent(this, PlayerActivity.class)
      .setData(Uri.parse(sample.uri))
      .putExtra(PlayerActivity.CONTENT_ID_EXTRA, sample.contentId)
      .putExtra(PlayerActivity.CONTENT_TYPE_EXTRA, sample.type);
  startActivity(mpdIntent);
}
项目:ExoPlayerController    文件:SampleChooserActivity.java   
@Override
public int getItemViewType(int position) {
  return (getItem(position) instanceof Sample) ? 1 : 0;
}
项目:android-exoplayer    文件:SampleChooserActivity.java   
@Override
public int getItemViewType(int position) {
  return (getItem(position) instanceof Sample) ? 1 : 0;
}
项目:Exoplayer_VLC    文件:SampleChooserActivity.java   
@Override
public int getItemViewType(int position) {
  return (getItem(position) instanceof Sample) ? 1 : 0;
}
项目:ExoPlayer    文件:SampleChooserActivity.java   
@Override
public int getItemViewType(int position) {
  return (getItem(position) instanceof Sample) ? 1 : 0;
}