1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-25 22:01:16 +00:00

Fix status bar text and icons color in light mode (fixes #1963) (#1965)

closes #1963

PS: This one has been kinda ugly to spot, ngl. I didn't expect that we
were modifying the welcome activity status bar color programmatically
instead of just with an XML theme ...
This commit is contained in:
Bnyro 2023-08-18 21:34:07 +02:00 committed by GitHub
parent a7bfd721bd
commit a088701d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 21 deletions

View file

@ -93,12 +93,6 @@ public class FirstStartActivity extends Activity {
return; return;
} }
// Make notification bar transparent (API level 21+)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
// Show first start welcome wizard UI. // Show first start welcome wizard UI.
setContentView(R.layout.activity_first_start); setContentView(R.layout.activity_first_start);
mViewPager = (ViewPager) findViewById(R.id.view_pager); mViewPager = (ViewPager) findViewById(R.id.view_pager);
@ -119,9 +113,6 @@ public class FirstStartActivity extends Activity {
addBottomDots(); addBottomDots();
setActiveBottomDot(0); setActiveBottomDot(0);
// Make notification bar transparent
changeStatusBarColor();
mViewPagerAdapter = new ViewPagerAdapter(); mViewPagerAdapter = new ViewPagerAdapter();
mViewPager.setAdapter(mViewPagerAdapter); mViewPager.setAdapter(mViewPagerAdapter);
mViewPager.addOnPageChangeListener(mViewPagerPageChangeListener); mViewPager.addOnPageChangeListener(mViewPagerPageChangeListener);
@ -288,17 +279,6 @@ public class FirstStartActivity extends Activity {
} }
}; };
/**
* Making notification bar transparent
*/
private void changeStatusBarColor() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
}
/** /**
* View pager adapter * View pager adapter
*/ */

View file

@ -2,6 +2,7 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Syncthing" parent="Theme.Syncthing.Base"> <style name="Theme.Syncthing" parent="Theme.Syncthing.Base">
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">false</item> <item name="android:windowLightNavigationBar" tools:ignore="NewApi">false</item>
</style> </style>

View file

@ -28,10 +28,13 @@
<item name="android:statusBarColor" tools:targetApi="m">@android:color/transparent</item> <item name="android:statusBarColor" tools:targetApi="m">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowIsTranslucent">false</item>
</style> </style>
<style name="Theme.Syncthing" parent="Theme.Syncthing.Base"> <style name="Theme.Syncthing" parent="Theme.Syncthing.Base">
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item> <item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item> <item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
</style> </style>