mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Merge pull request #67 from joshsoftware/remove_deprecation
Remove Deprecated methods
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Christian Schabesberger
					Christian Schabesberger