| 65 | import java.util.List; |
| 66 | |
| 67 | public class ActivityCode extends ActivityBase { |
| 68 | private WebView wvCode; |
| 69 | private ContentLoadingProgressBar pbWait; |
| 70 | private Group grpReady; |
| 71 | |
| 72 | private boolean force_light = false; |
| 73 | private boolean sanitize = false; |
| 74 | private boolean lines = false; |
| 75 | private boolean links = false; |
| 76 | private boolean pretty = true; |
| 77 | private String searching = null; |
| 78 | |
| 79 | private static final int REQUEST_SAVE = 1; |
| 80 | |
| 81 | @Override |
| 82 | protected void onCreate(Bundle savedInstanceState) { |
| 83 | super.onCreate(savedInstanceState); |
| 84 | |
| 85 | if (savedInstanceState != null) { |
| 86 | force_light = savedInstanceState.getBoolean("fair:force_light"); |
| 87 | sanitize = savedInstanceState.getBoolean("fair:sanitize"); |
| 88 | lines = savedInstanceState.getBoolean("fair:lines"); |
| 89 | links = savedInstanceState.getBoolean("fair:links"); |
| 90 | pretty = savedInstanceState.getBoolean("fair:pretty"); |
| 91 | searching = savedInstanceState.getString("fair:searching"); |
| 92 | } |
| 93 | |
| 94 | getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { |
| 95 | @Override |
| 96 | public void handleOnBackPressed() { |
| 97 | finishAndRemoveTask(); |
| 98 | } |
| 99 | }); |
| 100 | |
| 101 | View view = LayoutInflater.from(this).inflate(R.layout.activity_code, null); |
| 102 | setContentView(view); |
| 103 | |
| 104 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
| 105 | |
| 106 | wvCode = findViewById(R.id.wvCode); |
| 107 | pbWait = findViewById(R.id.pbWait); |
| 108 | grpReady = findViewById(R.id.grpReady); |
| 109 | |
| 110 | wvCode.clearCache(true); |
| 111 | |
| 112 | WebSettings settings = wvCode.getSettings(); |
| 113 | |
| 114 | settings.setBuiltInZoomControls(true); |
| 115 | settings.setDisplayZoomControls(false); |
| 116 | |
| 117 | settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY); |
| 118 | settings.setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW); |
| 119 | |
| 120 | if (WebViewEx.isFeatureSupported(this, WebViewFeature.ATTRIBUTION_REGISTRATION_BEHAVIOR)) |
| 121 | WebSettingsCompat.setAttributionRegistrationBehavior(settings, WebSettingsCompat.ATTRIBUTION_BEHAVIOR_DISABLED); |
| 122 | |
| 123 | settings.setLoadsImagesAutomatically(false); |
| 124 | settings.setBlockNetworkLoads(true); |
nothing calls this directly
no outgoing calls
no test coverage detected