Skip to content

Commit

Permalink
Merge pull request #447 from Countly/fix_action_bar
Browse files Browse the repository at this point in the history
fix: action bar overlapping
  • Loading branch information
turtledreams authored Jan 13, 2025
2 parents 8e7bd6f + 864cf61 commit 1df53f1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.WebSettings;
Expand Down Expand Up @@ -45,7 +46,8 @@ protected void onCreate(Bundle savedInstanceState) {
// there is a stripe at the top of the screen for contents
// we eliminate it with no action bar full screen and this adds more smoothness
// the stripe is because of our transparency
setTheme(android.R.style.Theme_DeviceDefault_NoActionBar_Fullscreen);
//setTheme(android.R.style.Theme_DeviceDefault_NoActionBar_Fullscreen);
hideSystemUI();
super.onCreate(savedInstanceState);
overridePendingTransition(0, 0);

Expand Down Expand Up @@ -114,6 +116,18 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(relativeLayout);
}

private void hideSystemUI() {
// Enables regular immersive mode
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
);
}

private TransparentActivityConfig setupConfig(@Nullable TransparentActivityConfig config) {
final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
final Display display = wm.getDefaultDisplay();
Expand Down

0 comments on commit 1df53f1

Please sign in to comment.