Skip to content

Commit

Permalink
Ugly fix for broken text colors in dark mode (#12035)
Browse files Browse the repository at this point in the history
* Ugly fix for broken text colors in dark mode

* Add comment for clarification

* Added error prevention

* Update app/src/main/java/org/schabi/newpipe/MainActivity.java

---------

Co-authored-by: Stypox <[email protected]>
  • Loading branch information
Thompson3142 and Stypox authored Feb 21, 2025
1 parent 1d12874 commit c9ec257
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/org/schabi/newpipe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
Expand Down Expand Up @@ -140,6 +141,19 @@ protected void onCreate(final Bundle savedInstanceState) {
ThemeHelper.setDayNightMode(this);
ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this));

// Fixes text color turning black in dark/black mode:
// https://github.com/TeamNewPipe/NewPipe/issues/12016
// For further reference see: https://issuetracker.google.com/issues/37124582
if (DeviceUtils.supportsWebView()) {
try {
new WebView(this);
} catch (final Throwable e) {
if (DEBUG) {
Log.e(TAG, "Failed to create WebView", e);
}
}
}

assureCorrectAppLanguage(this);
super.onCreate(savedInstanceState);

Expand Down

0 comments on commit c9ec257

Please sign in to comment.