-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Live TV popups #3733
Refactor Live TV popups #3733
Conversation
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
View layout = inflater.inflate(R.layout.program_detail_popup, null); | ||
int popupHeight = Utils.convertDpToPixel(activity, 400); | ||
View layout = LayoutInflater.from(context).inflate(R.layout.program_detail_popup, null); |
Check warning
Code scanning / Android Lint
Layout Inflation without a Parent Warning
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
View layout = inflater.inflate(R.layout.new_program_record_popup, null); | ||
int popupHeight = Utils.convertDpToPixel(activity, 330); | ||
View layout = LayoutInflater.from(context).inflate(R.layout.new_program_record_popup, null); |
Check warning
Code scanning / Android Lint
Layout Inflation without a Parent Warning
TextView datetime = new TextView(mActivity); | ||
datetime.setText(TimeUtils.getFriendlyDate(context, local)+ " @ "+android.text.format.DateFormat.getTimeFormat(mActivity).format(local)+ " ("+ DateUtils.getRelativeTimeSpanString(local.getTime())+")"); | ||
TextView datetime = new TextView(mContext); | ||
datetime.setText(TimeUtils.getFriendlyDate(context, local)+ " @ "+android.text.format.DateFormat.getTimeFormat(mContext).format(local)+ " ("+ DateUtils.getRelativeTimeSpanString(local.getTime())+")"); |
Check warning
Code scanning / Android Lint
TextView Internationalization Warning
TextView datetime = new TextView(activity); | ||
datetime.setText(TimeUtils.getFriendlyDate(activity, local)+ " @ "+android.text.format.DateFormat.getTimeFormat(activity).format(local)+ " ("+ DateUtils.getRelativeTimeSpanString(local.getTime())+")"); | ||
TextView datetime = new TextView(context); | ||
datetime.setText(TimeUtils.getFriendlyDate(context, local)+ " @ "+android.text.format.DateFormat.getTimeFormat(context).format(local)+ " ("+ DateUtils.getRelativeTimeSpanString(local.getTime())+")"); |
Check warning
Code scanning / Android Lint
TextView Internationalization Warning
public LiveProgramDetailPopup(Activity activity, Lifecycle lifecycle, LiveTvGuide tvGuide, int width, EmptyLifecycleAwareResponse tuneAction) { | ||
mActivity = activity; | ||
this.lifecycle = lifecycle; | ||
public LiveProgramDetailPopup(Context context, LifecycleOwner lifecycleOwner, LiveTvGuide tvGuide, int width, EmptyLifecycleAwareResponse tuneAction) { |
Check warning
Code scanning / Android Lint
Lambda Parameters Last Warning
@@ -68,36 +67,35 @@ | |||
|
|||
private Lazy<CustomMessageRepository> customMessageRepository = inject(CustomMessageRepository.class); | |||
|
|||
public RecordPopup(Activity activity, Lifecycle lifecycle, View anchorView, int left, int top, int width) { | |||
mActivity = activity; | |||
public RecordPopup(Context context, Lifecycle lifecycle, View anchorView, int left, int top, int width) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
@@ -68,36 +67,35 @@ | |||
|
|||
private Lazy<CustomMessageRepository> customMessageRepository = inject(CustomMessageRepository.class); | |||
|
|||
public RecordPopup(Activity activity, Lifecycle lifecycle, View anchorView, int left, int top, int width) { | |||
mActivity = activity; | |||
public RecordPopup(Context context, Lifecycle lifecycle, View anchorView, int left, int top, int width) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
@@ -186,19 +185,19 @@ | |||
return !mProgramsDict.containsKey(channelId) ? new ArrayList<BaseItemDto>() : mProgramsDict.get(channelId); | |||
} | |||
|
|||
public static void setTimelineRow(Activity activity, LinearLayout timelineRow, BaseItemDto program) { | |||
public static void setTimelineRow(Context context, LinearLayout timelineRow, BaseItemDto program) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
@@ -186,19 +185,19 @@ | |||
return !mProgramsDict.containsKey(channelId) ? new ArrayList<BaseItemDto>() : mProgramsDict.get(channelId); | |||
} | |||
|
|||
public static void setTimelineRow(Activity activity, LinearLayout timelineRow, BaseItemDto program) { | |||
public static void setTimelineRow(Context context, LinearLayout timelineRow, BaseItemDto program) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
@@ -186,19 +185,19 @@ | |||
return !mProgramsDict.containsKey(channelId) ? new ArrayList<BaseItemDto>() : mProgramsDict.get(channelId); | |||
} | |||
|
|||
public static void setTimelineRow(Activity activity, LinearLayout timelineRow, BaseItemDto program) { | |||
public static void setTimelineRow(Context context, LinearLayout timelineRow, BaseItemDto program) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
Changes
Issues
Partially addresses #3732. Need to figure out a way to get actual guide data to test further....