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:
@@ -57,9 +57,8 @@ public abstract class AssetActivity extends Activity {
|
||||
protected abstract boolean setUpAssetPages();
|
||||
|
||||
private View createView(Context ctxt) {
|
||||
|
||||
ImageView empty = new ImageView(this);
|
||||
empty.setBackgroundDrawable(getResources().getDrawable(R.drawable.empty));
|
||||
empty.setBackground(getResources().getDrawable(R.drawable.empty, context.getTheme()));
|
||||
|
||||
View[] clips = new View[6];
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
@@ -77,12 +76,12 @@ public abstract class AssetActivity extends Activity {
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.FILL_PARENT, 1);
|
||||
LinearLayout.LayoutParams.MATCH_PARENT, 1);
|
||||
params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;
|
||||
|
||||
LinearLayout.LayoutParams paramsMain = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.FILL_PARENT, 1);
|
||||
LinearLayout.LayoutParams.MATCH_PARENT, 1);
|
||||
paramsMain.gravity = Gravity.CENTER;
|
||||
|
||||
LinearLayout left = new LinearLayout(ctxt);
|
||||
@@ -167,7 +166,8 @@ public abstract class AssetActivity extends Activity {
|
||||
buttons.addView(prev, params);
|
||||
buttons.addView(next, params);
|
||||
|
||||
body.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.background3));
|
||||
body.setBackground(this.getResources().getDrawable(R.drawable.background3,
|
||||
context.getTheme()));
|
||||
|
||||
SwipeLinearLayout main = new SwipeLinearLayout(this);
|
||||
main.setNext(nextButtonListener);
|
||||
@@ -186,7 +186,7 @@ public abstract class AssetActivity extends Activity {
|
||||
|
||||
private View createEmptyView() {
|
||||
ImageView empty = new ImageView(this);
|
||||
empty.setBackgroundDrawable(getResources().getDrawable(R.drawable.empty));
|
||||
empty.setBackground(getResources().getDrawable(R.drawable.empty, context.getTheme()));
|
||||
|
||||
TextView emptyText = new TextView(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user