Replace deprecated APIs.

The min SDK target is now 21 because of getDrawable change,
so this app will not install on KitKat.

Also, MediaCodecView is obsolete, so there is no need to change
getInput/OutputBiffers and INFO_OUTPUT_BUFFERS_CHANGED, which requires
additional refactoring effort.

bug: 26185358
Change-Id: If83a5fa0eefebb4932fcd4c03162ba2dd94a755e
This commit is contained in:
Edwin Wong
2015-12-16 17:43:26 -08:00
parent 8e4ad69cf0
commit d173791ccc
4 changed files with 21 additions and 21 deletions

View File

@@ -167,7 +167,8 @@ public class VideoPlayerView extends Activity {
FrameLayout.LayoutParams.MATCH_PARENT));
bgImage = new ClipImageView(this);
bgImage.setBackgroundDrawable(getResources().getDrawable(R.drawable.play_shield));
bgImage.setBackground(getResources().getDrawable(R.drawable.play_shield,
context.getTheme()));
bgImage.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -215,10 +216,10 @@ public class VideoPlayerView extends Activity {
main = new LinearLayout(this);
main.addView(playerFrame, new LinearLayout.LayoutParams((int)(width * 0.65),
LinearLayout.LayoutParams.FILL_PARENT, 1));
LinearLayout.LayoutParams.MATCH_PARENT, 1));
main.addView(sidePanel, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.FILL_PARENT, 3));
LinearLayout.LayoutParams.MATCH_PARENT, 3));
return main;
}
@@ -442,7 +443,7 @@ public class VideoPlayerView extends Activity {
});
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
params.setMargins(0, 0, 0, 5);
@@ -459,7 +460,7 @@ public class VideoPlayerView extends Activity {
buttonsRight.addView(removeButton, params);
LinearLayout.LayoutParams paramsSides = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
paramsSides.gravity = Gravity.BOTTOM;