GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — videoview add · AndroidLu/Coder@5a81867

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main
    • java/com/coder/guoy/recyclerview
      • HomeActivity.java
    • res/layout
      • activity_home.xml
      • item_home_banner.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/coder/guoy/recyclerview/HomeActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/coder/guoy/recyclerview/HomeActivity.java
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.coder.guoy.recyclerview;
22

33
import android.os.Bundle;
4+
import android.os.Environment;
45
import android.support.v4.view.GravityCompat;
56
import android.support.v4.widget.DrawerLayout;
67
import android.support.v7.app.AppCompatActivity;
78
import android.support.v7.widget.LinearLayoutManager;
89
import android.support.v7.widget.RecyclerView;
910
import android.view.View;
11+
import android.widget.MediaController;
12+
import android.widget.VideoView;
1013

1114
import com.coder.guoy.recyclerview.utils.CommonUtils;
1215
import com.coder.guoy.recyclerview.view.statusbar.StatusBarUtil;
@@ -21,6 +24,7 @@ public class HomeActivity extends AppCompatActivity implements View.OnClickListe
2124
"Design Pattern", "目标1", "目标2", "目标3", "目标4"};
2225
private String[] describe = {"材料设计", "", "卡片控件", "自定义", "动画",
2326
"设计模式", "", "", "", ""};
27+
private VideoView video;
2428

2529
@Override
2630
protected void onCreate(Bundle savedInstanceState) {
@@ -37,6 +41,10 @@ private void initView() {
3741
StatusBarUtil.setColorNoTranslucentForDrawerLayout(HomeActivity.this, drawerlayout,
3842
CommonUtils.getColor(R.color.colorTheme));
3943
findViewById(R.id.fl_title_menu).setOnClickListener(this);
44+
45+
video = (VideoView) findViewById(R.id.videoview);
46+
video.setVideoPath(Environment.getExternalStorageDirectory().getPath()+"/speed8.mp4");
47+
video.setMediaController(new MediaController(this));
4048
}
4149

4250
/**
@@ -49,6 +57,12 @@ private void initRecyclerView() {
4957
recyclerView.setAdapter(adapter);
5058
}
5159

60+
@Override
61+
public void onWindowFocusChanged(boolean hasFocus) {
62+
super.onWindowFocusChanged(hasFocus);
63+
video.start();
64+
}
65+
5266
@Override
5367
public void onClick(View v) {
5468
switch (v.getId()) {
Collapse file

‎app/src/main/res/layout/activity_home.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_home.xml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
android:textSize="18sp"/>
4646
</android.support.v7.widget.Toolbar>
4747

48+
<VideoView
49+
android:id="@+id/videoview"
50+
android:layout_width="match_parent"
51+
android:layout_height="200dp"/>
52+
4853
<android.support.v7.widget.RecyclerView
4954
android:id="@+id/home_recyclerview"
5055
android:layout_width="match_parent"
Collapse file

‎app/src/main/res/layout/item_home_banner.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/item_home_banner.xml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
app:cardPreventCornerOverlap="false"
1414
app:cardUseCompatPadding="true">
1515

16+
<VideoView
17+
android:id="@+id/videoview"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"/>
20+
1621

1722
</android.support.v7.widget.CardView>
1823

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.