I have been trying to figure out a way to apply padding-bottom (Custom CSS) to a webpage fetched from RemoteConfig (URL provided). Unfortunately, I do not have direct access to the webpage's source files for editing.
Below is the code snippet in question:
public class PlayoffsFragment extends BaseFragment {
private WebView webView;
public static PlayoffsFragment newInstance(Bundle args) {
PlayoffsFragment fragment = new PlayoffsFragment();
fragment.setArguments(args);
return fragment;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_playoffs, container, false);
setActionBar();
setViews();
setViewContents();
return rootView;
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
hideCalendarMenuItem();
}
@Override
protected void setActionBar() {
showActionBar();
setContentMarginOff();
changeToolbarBackground(R.color.transparent);
changeToolbarIconsColor(ContextCompat.getColor(getContext(), R.color.white));
}
@Override
protected void setViews() {
webView = rootView.findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setMinimumFontSize(1);
webView.getSettings().setMinimumLogicalFontSize(1);
}
@Override
protected void setViewContents() {
webView.loadUrl(BuildConfig.WEB_URL);
}
}