1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

Merge pull request #67 from joshsoftware/remove_deprecation

Remove Deprecated methods
This commit is contained in:
Christian Schabesberger 2015-11-02 15:37:17 +01:00
commit 1850dee93a
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
package org.schabi.newpipe;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
@ -308,15 +308,15 @@ public class VideoItemListFragment extends ListFragment {
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
public void onAttach(Context context) {
super.onAttach(context);
// 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.");
}
mCallbacks = (Callbacks) activity;
mCallbacks = (Callbacks) context;
}
@Override

View File

@ -2,6 +2,7 @@ package org.schabi.newpipe;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -99,7 +100,7 @@ public class VideoListAdapter extends BaseAdapter {
convertView = viewCreator.getViewByVideoInfoItem(convertView, parent, videoList.get(position));
if(listView.isItemChecked(position)) {
convertView.setBackgroundColor(context.getResources().getColor(R.color.primaryColorYoutube));
convertView.setBackgroundColor(ContextCompat.getColor(context,R.color.primaryColorYoutube));
} else {
convertView.setBackgroundColor(0);
}