forked from Doikki/DKVideoPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.整理Demo,将功能分门别类。 3.其他细节优化
- Loading branch information
Showing
30 changed files
with
610 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/dueeeke/dkplayer/activity/ApiActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.dueeeke.dkplayer.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.dueeeke.dkplayer.R; | ||
|
||
/** | ||
* 基础API相关Demo | ||
* Created by xinyu on 2018/1/3. | ||
*/ | ||
|
||
public class ApiActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_api); | ||
} | ||
|
||
public void skipToVodPlayer(View view) { | ||
startActivity(new Intent(this, VodPlayerActivity.class)); | ||
} | ||
|
||
public void skipToLivePlayer(View view) { | ||
startActivity(new Intent(this, LivePlayerActivity.class)); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/dueeeke/dkplayer/activity/ExtendActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.dueeeke.dkplayer.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.dueeeke.dkplayer.R; | ||
|
||
/** | ||
* 基于IjkVideoView扩展的功能 | ||
* Created by xinyu on 2018/1/3. | ||
*/ | ||
|
||
public class ExtendActivity extends AppCompatActivity{ | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.acitivity_extend); | ||
} | ||
|
||
public void startFullScreen(View view) { | ||
startActivity(new Intent(this, FullScreenActivity.class)); | ||
} | ||
|
||
public void danmaku(View view) { | ||
startActivity(new Intent(this, DanmakuActivity.class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/dueeeke/dkplayer/activity/ListActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.dueeeke.dkplayer.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.dueeeke.dkplayer.R; | ||
|
||
/** | ||
* List相关Demo | ||
* Created by xinyu on 2018/1/3. | ||
*/ | ||
|
||
public class ListActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_list); | ||
} | ||
|
||
public void list(View view) { | ||
startActivity(new Intent(this, ListViewActivity.class)); | ||
} | ||
|
||
public void recyclerAutoPlay(View view) { | ||
startActivity(new Intent(this, AutoPlayRecyclerViewActivity.class)); | ||
} | ||
|
||
public void listFragmentViewPager(View view) { | ||
startActivity(new Intent(this, ListFragmentViewPagerActivity.class)); | ||
} | ||
|
||
public void recycler(View view) { | ||
startActivity(new Intent(this, RecyclerViewActivity.class)); | ||
} | ||
|
||
} |
96 changes: 96 additions & 0 deletions
96
app/src/main/java/com/dueeeke/dkplayer/activity/ListFragmentViewPagerActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package com.dueeeke.dkplayer.activity; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.design.widget.TabLayout; | ||
import android.support.v4.view.ViewPager; | ||
import android.support.v7.app.ActionBar; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.MenuItem; | ||
|
||
import com.dueeeke.dkplayer.R; | ||
import com.dueeeke.dkplayer.adapter.MyPagerAdapter; | ||
import com.dueeeke.dkplayer.fragment.ListViewFragment; | ||
import com.dueeeke.videoplayer.player.VideoViewManager; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* 列表加ViewPager | ||
* Created by xinyu on 2018/1/3. | ||
*/ | ||
|
||
public class ListFragmentViewPagerActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener { | ||
|
||
private TabLayout mTabLayout; | ||
private ViewPager mViewPager; | ||
private List<String> titles = new ArrayList<>(); | ||
private List<ListViewFragment> mFragmentList = new ArrayList<>(); | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_list_fragment_view_pager); | ||
|
||
ActionBar actionBar = getSupportActionBar(); | ||
if (actionBar != null) { | ||
actionBar.setTitle("LIST FRAGMENT VIEWPAGER"); | ||
actionBar.setDisplayHomeAsUpEnabled(true); | ||
} | ||
initView(); | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
if (item.getItemId() == android.R.id.home) { | ||
finish(); | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
private void initView() { | ||
mTabLayout = findViewById(R.id.tl); | ||
mViewPager = findViewById(R.id.vp); | ||
mViewPager.addOnPageChangeListener(this); | ||
|
||
titles.add("List1"); | ||
titles.add("List2"); | ||
titles.add("List3"); | ||
|
||
for (int i = 0; i < titles.size(); i++) { | ||
mFragmentList.add(ListViewFragment.newInstance()); | ||
} | ||
|
||
mViewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), mFragmentList, titles)); | ||
mTabLayout.setupWithViewPager(mViewPager); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
VideoViewManager.instance().releaseVideoPlayer(); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
if (!VideoViewManager.instance().onBackPressed()){ | ||
super.onBackPressed(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPageSelected(int position) { | ||
VideoViewManager.instance().releaseVideoPlayer(); | ||
} | ||
|
||
@Override | ||
public void onPageScrollStateChanged(int state) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.