Skip to content

Conversation

@MihaiCristianCondrea
Copy link
Owner

Summary

  • centralize up navigation in base activity
  • clean up settings and permissions activities
  • remove duplicate home indicator calls

Testing

  • ./gradlew test (fails: SDK location not found)

https://chatgpt.com/codex/tasks/task_e_68c5dd63e638832d9dcff9070d422214

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 1 to 8
package com.d4rk.androidtutorials.java.ui.components.navigation;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NavUtils;

public abstract class UpNavigationActivity extends AppCompatActivity {
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}

public abstract class UpNavigationActivity extends BaseActivity {
@Override
public boolean onSupportNavigateUp() {
NavUtils.navigateUpFromSameTask(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve custom edge-to-edge insets for bottom-nav activities

By switching UpNavigationActivity to extend BaseActivity, every subclass now runs BaseActivity.onPostCreate, which always calls EdgeToEdgeDelegate.apply(this, container) and installs a new window-insets listener. Activities like BottomNavigationActivity currently set up their own listener via EdgeToEdgeDelegate.applyBottomBar(...) in onCreate to pad the BottomNavigationView. The base class call happens afterward and overwrites that listener, so the bottom bar loses its padding and will overlap the system gesture/navigation bar on edge-to-edge devices. Consider letting subclasses opt out or have BaseActivity detect when insets are already handled before replacing the listener.

Useful? React with 👍 / 👎.

@MihaiCristianCondrea MihaiCristianCondrea merged commit 389feb8 into main Sep 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants