Source:
<code>protected View inflateDialogView(LayoutInflater inflater, ViewGroup container) { WikipediaApp app = WikipediaApp.getInstance(); boolean shouldLoadImages = app.isImageDownloadEnabled(); pageTitle = getArguments().getParcelable("title"); entrySource = getArguments().getInt("entrySource"); View rootView = inflater.inflate(R.layout.dialog_link_preview_b, container); progressBar = (ProgressBar) rootView.findViewById(R.id.link_preview_progress); leadImage = (ImageView) rootView.findViewById(R.id.link_preview_lead_image); View overlayRootView = addOverlay(inflater, R.layout.dialog_link_preview_overlay); Button goButton = (Button) overlayRootView.findViewById(R.id.link_preview_go_button); goButton.setOnClickListener(goToPageListener); goButton.setText(getStringForArticleLanguage(pageTitle, R.string.button_continue_to_article)); TextView titleText = (TextView) rootView.findViewById(R.id.link_preview_title); titleText.setOnClickListener(goToPageListener); titleText.setText(pageTitle.getDisplayText()); setConditionalLayoutDirection(rootView, pageTitle.getSite().getLanguageCode()); if (!ApiUtil.hasKitKat()) { titleText.setLineSpacing(0, 1.0f); } else if (!ApiUtil.hasLollipop()) { } onNavigateListener = new DefaultOnNavigateListener(); extractText = (TextView) rootView.findViewById(R.id.link_preview_extract); extractText.setMovementMethod(new ScrollingMovementMethod()); progressBar.setVisibility(View.VISIBLE); if (pageTitle.getSite().getLanguageCode().equalsIgnoreCase("en") <START> && RbSwitch.INSTANCE.isRestBaseEnabled()) { <END> loadContentWithRestBase(shouldLoadImages); } else { loadContentWithMwapi(); } funnel = new LinkPreviewFunnel(app); funnel.logLinkClick(); return rootView; }</code><technical_language>In Clean-Codian spirit, a couple of convenience methods for isRestBaseEnabled() (especially) getPageLanguage() improve readability here</technical_language>

Target:
protected View inflateDialogView(LayoutInflater inflater, ViewGroup container) { WikipediaApp app = WikipediaApp.getInstance(); boolean shouldLoadImages = app.isImageDownloadEnabled(); pageTitle = getArguments().getParcelable("title"); entrySource = getArguments().getInt("entrySource"); View rootView = inflater.inflate(R.layout.dialog_link_preview_b, container); progressBar = (ProgressBar) rootView.findViewById(R.id.link_preview_progress); leadImage = (ImageView) rootView.findViewById(R.id.link_preview_lead_image); View overlayRootView = addOverlay(inflater, R.layout.dialog_link_preview_overlay); Button goButton = (Button) overlayRootView.findViewById(R.id.link_preview_go_button); goButton.setOnClickListener(goToPageListener); goButton.setText(getStringForArticleLanguage(pageTitle, R.string.button_continue_to_article)); TextView titleText = (TextView) rootView.findViewById(R.id.link_preview_title); titleText.setOnClickListener(goToPageListener); titleText.setText(pageTitle.getDisplayText()); setConditionalLayoutDirection(rootView, pageTitle.getSite().getLanguageCode()); if (!ApiUtil.hasKitKat()) { titleText.setLineSpacing(0, 1.0f); } onNavigateListener = new DefaultOnNavigateListener(); extractText = (TextView) rootView.findViewById(R.id.link_preview_extract); extractText.setMovementMethod(new ScrollingMovementMethod()); progressBar.setVisibility(View.VISIBLE); if (pageTitle.getSite().getLanguageCode().equalsIgnoreCase("en") && RbSwitch.INSTANCE.isRestBaseEnabled()) { loadContentWithRestBase(shouldLoadImages); } else { loadContentWithMwapi(); } funnel = new LinkPreviewFunnel(app); funnel.logLinkClick(); return rootView; }