コード例 #1
0
  @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(true);
    getSupportActionBar().setDisplayUseLogoEnabled(false);
    getSupportActionBar().setTitle("AutoTinyNormal");
    setContentView(R.layout.activity_listview_content);

    listView = (ListView) findViewById(R.id.listview);
    headerLayout =
        (LinearLayout) getLayoutInflater().inflate(R.layout.header_auto_tiny_normal, null);
    listView.addHeaderView(headerLayout);

    JCVideoPlayerStandard jcVideoPlayerStandard =
        (JCVideoPlayerStandard) headerLayout.findViewById(R.id.jc_video);
    jcVideoPlayerStandard.setUp(
        "http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4",
        JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,
        "嫂子坐这");
    Picasso.with(this)
        .load(
            "http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg")
        .into(jcVideoPlayerStandard.thumbImageView);

    Map<String, String> keyValuePair = new HashMap<>();
    keyValuePair.put("key", "list item");
    List<Map<String, String>> list = new ArrayList<>();
    for (int i = 0; i < 50; i++) {
      list.add(keyValuePair);
    }

    ListAdapter adapter =
        new SimpleAdapter(
            this,
            list,
            android.R.layout.simple_list_item_1,
            new String[] {"key"},
            new int[] {android.R.id.text1});

    listView.setAdapter(adapter);
    listView.setOnScrollListener(this);
  }
コード例 #2
0
  private void Setheardview() {
    TextView name = (TextView) heardview1.findViewById(R.id.heard_vediodetailname_tv);
    TextView title = (TextView) heardview1.findViewById(R.id.heard_vediodetailtitle_tv);
    TextView time = (TextView) heardview1.findViewById(R.id.heard_vediodetailtime_tv);
    TextView texted = (TextView) heardview1.findViewById(R.id.heard_vediodetailtexted_tv);
    JCVideoPlayerStandard vedioplay =
        (JCVideoPlayerStandard) heardview1.findViewById(R.id.heard_vediodetai_jc);

    if (infoBean.getCat() != null) {
      name.setText(infoBean.getCat().getName());
      title.setText(infoBean.getTitle());
      time.setText(infoBean.getPublish_time());
      texted.setText(infoBean.getTxtlead());
      vedioplay.setUp(infoBean.getVideo().getUrl(), "");
      ImageView imageView = vedioplay.thumbImageView;
      imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
      Picasso.with(this).load(infoBean.getImg()).into(imageView);
    }
  }