@Test public void testRefresh() { LocalBroadcastManager.getInstance(activity) .sendBroadcast(new Intent(WebFragment.ACTION_FULLSCREEN) .putExtra(WebFragment.EXTRA_FULLSCREEN, true)); ShadowWebView.lastGlobalLoadedUrl = null; ShadowWebView shadowWebView = Shadow.extract(activity.findViewById(R.id.web_view)); shadowWebView.setProgress(20); activity.findViewById(R.id.button_refresh).performClick(); assertThat(ShadowWebView.getLastGlobalLoadedUrl()).isNullOrEmpty(); shadowWebView.setProgress(100); activity.findViewById(R.id.button_refresh).performClick(); assertThat(ShadowWebView.getLastGlobalLoadedUrl()).isEqualTo(ShadowWebView.RELOADED); }
private void setProgress(int progress) { mProgressBar.setProgress(progress); mProgressBar.setVisibility(progress == 100 ? GONE : VISIBLE); mButtonRefresh.setImageResource(progress == 100 ? R.drawable.ic_refresh_white_24dp : R.drawable.ic_clear_white_24dp); }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { private void setProgress(int progress) { mProgressBar.setProgress(progress); mProgressBar.setVisibility(progress == 100 ? GONE : VISIBLE); mButtonRefresh.setImageResource(progress == 100 ? R.drawable.ic_refresh_white_24dp : R.drawable.ic_clear_white_24dp); } }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { private void setProgress(int progress) { mProgressBar.setProgress(progress); mProgressBar.setVisibility(progress == 100 ? GONE : VISIBLE); mButtonRefresh.setImageResource(progress == 100 ? R.drawable.ic_refresh_white_24dp : R.drawable.ic_clear_white_24dp); }  }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { private void setProgress(int progress) { mProgressBar.setProgress(progress); mProgressBar.setVisibility(progress == 100 ? GONE : VISIBLE); mButtonRefresh.setImageResource(progress == 100 ? R.drawable.ic_refresh_white_24dp : R.drawable.ic_clear_white_24dp); }  @Override void onAttach(Context context); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState); @Override void onViewCreated(View view, @Nullable Bundle savedInstanceState); @Override boolean onOptionsItemSelected(MenuItem item); @Override void onResume(); @Override void onStop(); @Override void onSaveInstanceState(Bundle outState); @Override void onDestroy(); @Override void onDetach(); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); @Override boolean onBackPressed(); }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { private void setProgress(int progress) { mProgressBar.setProgress(progress); mProgressBar.setVisibility(progress == 100 ? GONE : VISIBLE); mButtonRefresh.setImageResource(progress == 100 ? R.drawable.ic_refresh_white_24dp : R.drawable.ic_clear_white_24dp); }  @Override void onAttach(Context context); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState); @Override void onViewCreated(View view, @Nullable Bundle savedInstanceState); @Override boolean onOptionsItemSelected(MenuItem item); @Override void onResume(); @Override void onStop(); @Override void onSaveInstanceState(Bundle outState); @Override void onDestroy(); @Override void onDetach(); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); @Override boolean onBackPressed(); static final String EXTRA_ITEM; static final String PDF_LOADER_URL; }