|
|
|
|
@ -140,7 +140,14 @@ public class UserFragment extends BaseLazyFragment implements View.OnClickListen |
|
|
|
|
if (ApiConfig.get().getSourceBeanList().isEmpty()) |
|
|
|
|
return; |
|
|
|
|
Movie.Video vod = ((Movie.Video) adapter.getItem(position)); |
|
|
|
|
if (vod.id != null && !vod.id.isEmpty()) { |
|
|
|
|
|
|
|
|
|
// takagen99: CHeck if in Delete Mode
|
|
|
|
|
if ((vod.id != null && !vod.id.isEmpty()) && (Hawk.get(HawkConfig.HOME_REC, 0) == 2) && HawkConfig.hotVodDelete) { |
|
|
|
|
homeHotVodAdapter.remove(position); |
|
|
|
|
VodInfo vodInfo = RoomDataManger.getVodInfo(vod.sourceKey, vod.id); |
|
|
|
|
RoomDataManger.deleteVodRecord(vod.sourceKey, vodInfo); |
|
|
|
|
Toast.makeText(mContext, "已删除当前记录", Toast.LENGTH_SHORT).show(); |
|
|
|
|
} else if (vod.id != null && !vod.id.isEmpty()) { |
|
|
|
|
Bundle bundle = new Bundle(); |
|
|
|
|
bundle.putString("id", vod.id); |
|
|
|
|
bundle.putString("sourceKey", vod.sourceKey); |
|
|
|
|
@ -158,12 +165,18 @@ public class UserFragment extends BaseLazyFragment implements View.OnClickListen |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// takagen99 : Long press to trigger Delete Mode for VOD History on Home Page
|
|
|
|
|
homeHotVodAdapter.setOnItemLongClickListener(new BaseQuickAdapter.OnItemLongClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) { |
|
|
|
|
if (ApiConfig.get().getSourceBeanList().isEmpty()) return true; |
|
|
|
|
Movie.Video vod = ((Movie.Video) adapter.getItem(position)); |
|
|
|
|
// Additional Check if : Home Rec 0=豆瓣, 1=推荐, 2=历史
|
|
|
|
|
if ((vod.id != null && !vod.id.isEmpty()) && (Hawk.get(HawkConfig.HOME_REC, 0) == 2)) { |
|
|
|
|
HawkConfig.hotVodDelete = !HawkConfig.hotVodDelete; |
|
|
|
|
homeHotVodAdapter.notifyDataSetChanged(); |
|
|
|
|
} else { |
|
|
|
|
Bundle bundle = new Bundle(); |
|
|
|
|
bundle.putString("title", vod.name); |
|
|
|
|
jumpActivity(FastSearchActivity.class, bundle); |
|
|
|
|
@ -298,6 +311,10 @@ public class UserFragment extends BaseLazyFragment implements View.OnClickListen |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onClick(View v) { |
|
|
|
|
|
|
|
|
|
// takagen99: Remove Delete Mode
|
|
|
|
|
HawkConfig.hotVodDelete = false; |
|
|
|
|
|
|
|
|
|
FastClickCheckUtil.check(v); |
|
|
|
|
if (v.getId() == R.id.tvLive) { |
|
|
|
|
jumpActivity(LivePlayActivity.class); |
|
|
|
|
|