|
23 | 23 | import com.fox2code.mmm.MainApplication; |
24 | 24 | import com.fox2code.mmm.R; |
25 | 25 | import com.fox2code.mmm.XHooks; |
| 26 | +import com.fox2code.mmm.utils.BlurUtils; |
26 | 27 | import com.fox2code.mmm.utils.Http; |
27 | 28 | import com.fox2code.mmm.utils.IntentHelper; |
28 | 29 | import com.google.android.material.chip.Chip; |
@@ -131,7 +132,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { |
131 | 132 | this.header = findViewById(R.id.markdownHeader); |
132 | 133 | this.footer = findViewById(R.id.markdownFooter); |
133 | 134 | this.actionBarBlur.setBackground(this.actionBarBackground); |
134 | | - this.setupBlurView(this.actionBarBlur, markdownBackground); |
| 135 | + BlurUtils.setupBlur(this.actionBarBlur, this, markdownBackground); |
| 136 | + this.updateBlurState(); |
135 | 137 | UiThreadHandler.handler.post(() -> // Fix header/footer height |
136 | 138 | this.updateScreenInsets(this.getResources().getConfiguration())); |
137 | 139 |
|
@@ -171,15 +173,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { |
171 | 173 | }, "Markdown load thread").start(); |
172 | 174 | } |
173 | 175 |
|
174 | | - private void setupBlurView(BlurView view, ViewGroup setupWith) { |
175 | | - view.setupWith(setupWith).setFrameClearDrawable( |
176 | | - this.getWindow().getDecorView().getBackground()) |
177 | | - .setBlurAlgorithm(new RenderScriptBlur(this)) |
178 | | - .setBlurRadius(4F).setBlurAutoUpdate(true) |
179 | | - .setHasFixedTransformationMatrix(true); |
180 | | - this.updateBlurState(); |
181 | | - } |
182 | | - |
183 | 176 | private void updateBlurState() { |
184 | 177 | boolean isLightMode = this.isLightTheme(); |
185 | 178 | int colorBackground; |
|
0 commit comments