mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-03 14:00:32 +00:00
Merge pull request #67 from joshsoftware/remove_deprecation
Remove Deprecated methods
This commit is contained in:
commit
1850dee93a
@ -1,6 +1,6 @@
|
|||||||
package org.schabi.newpipe;
|
package org.schabi.newpipe;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -308,15 +308,15 @@ public class VideoItemListFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(activity);
|
super.onAttach(context);
|
||||||
|
|
||||||
// Activities containing this fragment must implement its callbacks.
|
// Activities containing this fragment must implement its callbacks.
|
||||||
if (!(activity instanceof Callbacks)) {
|
if (!(context instanceof Callbacks)) {
|
||||||
throw new IllegalStateException("Activity must implement fragment's callbacks.");
|
throw new IllegalStateException("Activity must implement fragment's callbacks.");
|
||||||
}
|
}
|
||||||
|
|
||||||
mCallbacks = (Callbacks) activity;
|
mCallbacks = (Callbacks) context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,6 +2,7 @@ package org.schabi.newpipe;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -99,7 +100,7 @@ public class VideoListAdapter extends BaseAdapter {
|
|||||||
convertView = viewCreator.getViewByVideoInfoItem(convertView, parent, videoList.get(position));
|
convertView = viewCreator.getViewByVideoInfoItem(convertView, parent, videoList.get(position));
|
||||||
|
|
||||||
if(listView.isItemChecked(position)) {
|
if(listView.isItemChecked(position)) {
|
||||||
convertView.setBackgroundColor(context.getResources().getColor(R.color.primaryColorYoutube));
|
convertView.setBackgroundColor(ContextCompat.getColor(context,R.color.primaryColorYoutube));
|
||||||
} else {
|
} else {
|
||||||
convertView.setBackgroundColor(0);
|
convertView.setBackgroundColor(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user