GithubHelp home page GithubHelp logo

Comments (7)

pandulapeter avatar pandulapeter commented on September 26, 2024

Hi!

The library should be working fine on top of Compose apps, I know about full Compose projects that use it without issues.

There is no difference in setup whatsoever: you just have to initialize it in your custom Application class.

Do let me know if you encounter any issues as right now I'm not aware of any Compose related problems.

from beagle.

RyeGordo avatar RyeGordo commented on September 26, 2024

Hello again:

Yes, I do have an issue on Compose.
My implementation works when testing in regular views, but not in Compose -- for any UI type.

compileSdk 32
minSdk 23
targetSdk 32
beagleVersion = "2.6.6"
beagleUiType = "ui-drawer"
debugImplementation "com.github.pandulapeter.beagle:$beagleUiType:$beagleVersion"
override fun onCreate() {
    super.onCreate()

    Beagle.initialize(this)

    Beagle.set(
        HeaderModule(
            title = getString(R.string.app_name),
            subtitle = BuildConfig.APPLICATION_ID,
            text = BuildConfig.VERSION_NAME
        ),
        PaddingModule(),
        TextModule("Rendering", TextModule.Type.SECTION_HEADER),
        KeylineOverlaySwitchModule(),
        AnimationDurationSwitchModule(),
        ScreenCaptureToolboxModule(),
        DividerModule(),
        ForceCrashButtonModule()
    )
}

from beagle.

pandulapeter avatar pandulapeter commented on September 26, 2024

@RyeGordo That's weird...

Check out this small project here.

It's basically a blank canvas with Jetpack Compase + Beagle. This last commit added the debug menu, it's working fine on my devices. Maybe check it out but I suspect the problem lies somwhere else.

What exactly is the problem you see? The debug menu simply doesn't appear...? Are you sure that the custom Application class is registered in the Manifest? I can't think of any other issues right now.

from beagle.

RyeGordo avatar RyeGordo commented on September 26, 2024

The problem I have is the Debug Drawer not appearing. This is with swipe gesture or device shake.
My Application class is registered in the manifest.

I made an attempt to re-implement with an Empty Compose project from Android Studio which still does not work.
The sample project you provided works. Aside from "dependency catalogs" and "kotlin DSL", I am trying to pick through the differences. I looked at pretty much everything from Themes to the gradle dependencies.

I am unable to figure out what I'm doing wrong despite synchronizing the differences in both directions.

from beagle.

pandulapeter avatar pandulapeter commented on September 26, 2024

I think I found the issue!

Bealge only injects itself into Activities that extend the FragmentActivity (AppCompatActivity is one such example).

If you create an "Empty Compose Activity", that's only going to extend ComponentActivity (which is one of the parent classes of FragmentActivity).

To fix your issue, simply make your Activity extend AppCompatActivity. Let me know if this works!

Sorry, I should have caught this earlier.

from beagle.

RyeGordo avatar RyeGordo commented on September 26, 2024

Yes, it looks like AppCompatActivity was the missing part in all of this.
I have Beagle finally working.

And no worries about missing this. This is something I should have also suspected given that Beagle is still driven by Fragments/Activities.

Thanks, for your help.

from beagle.

pandulapeter avatar pandulapeter commented on September 26, 2024

Glad we figured it out. You're right, Beagle uses an overlay Fragment to do its thing, so it needs the supportFragmentManager getter from FragmentActivity. I'll update the readme to highlight this fact.

from beagle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.