Skip to content

Commit

Permalink
Correction of quick fix for #477 \"Rendering under status bar in Andr…
Browse files Browse the repository at this point in the history
…oid 15\": disable edge-to-ege display for now
  • Loading branch information
nilsbraden committed Nov 12, 2024
1 parent dcb3057 commit c5ec60e
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@
package org.ttrssreader.gui;


import android.os.Bundle;
import org.ttrssreader.R;

import androidx.appcompat.app.AppCompatActivity;

/**
* This class is empty since we don't want to use the play services library here!
*/
public abstract class MenuFlavorActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle instance) {
// Call before the DecorView is accessed in setContentView, see https://medium.com/androiddevelopers/insets-handling-tips-for-android-15s-edge-to-edge-enforcement-872774e8839b
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);

super.onCreate(instance);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import static org.ttrssreader.R.id.AboutActivity_ThanksText;

public class AboutActivity extends Activity {
public class AboutActivity extends MenuFlavorActivity {

// private static final String TAG = AboutActivity.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ public final class EditPluginActivity extends AbstractPluginActivity {

@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(Controller.getInstance().getThemeResource());

// Call before the DecorView is accessed in setContentView, see https://medium.com/androiddevelopers/insets-handling-tips-for-android-15s-edge-to-edge-enforcement-872774e8839b
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);

super.onCreate(savedInstanceState);
Controller.getInstance().initializeThemeMode();
mDamageReport.initialize();
setContentView(R.layout.localeplugin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.ttrssreader.controllers.Controller;
import org.ttrssreader.utils.PostMortemReportExceptionHandler;

public class MediaPlayerActivity extends Activity {
public class MediaPlayerActivity extends MenuFlavorActivity {

// private static final String TAG = MediaPlayerActivity.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.ttrssreader.R;
import org.ttrssreader.controllers.Controller;
import org.ttrssreader.gui.MenuFlavorActivity;
import org.ttrssreader.preferences.fragments.PreferencesFragment;
import org.ttrssreader.utils.AsyncTask;
import org.ttrssreader.utils.PostMortemReportExceptionHandler;
Expand All @@ -38,7 +39,7 @@
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;

public class PreferencesActivity extends AppCompatActivity implements PreferenceFragmentCompat.OnPreferenceStartFragmentCallback {
public class PreferencesActivity extends MenuFlavorActivity implements PreferenceFragmentCompat.OnPreferenceStartFragmentCallback {

// private static final String TAG = PreferencesActivity.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!-- TODO: Remove once activities handle insets. -->
<style name="OptOutEdgeToEdgeEnforcement">
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
Expand Down
2 changes: 2 additions & 0 deletions ttrssreader/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
<item name="android:windowBackground">@drawable/splash</item>
</style>

<style name="OptOutEdgeToEdgeEnforcement">
</style>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public abstract class MenuFlavorActivity extends AppCompatActivity implements Pr

@Override
protected void onCreate(Bundle instance) {
// Call before the DecorView is accessed in setContentView, see https://medium.com/androiddevelopers/insets-handling-tips-for-android-15s-edge-to-edge-enforcement-872774e8839b
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);

super.onCreate(instance);
if (Controller.getInstance().useProviderInstaller())
ProviderInstaller.installIfNeededAsync(this, this);
Expand Down

0 comments on commit c5ec60e

Please sign in to comment.