question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disabling buttons not working from Java

See original GitHub issue

AppIntro Version: 6.0.0

Device/Android Version: Fails on Samsung Galaxy s9, Pixel 3 Android 10

Issue details / Repro steps / Use case background: setButtonsEnabled(false) not working as expected as the buttons are not disabled.

buttons-not-disabled

Setting isButtonsEnabled = false works in Kotlin, additionally setSkipButtonEnabled(false) is working from Java. Source seems to step through updateButtonVisibility() correctly, but buttons visibility not changing.

Your Code:

public class SomeClass extends AppIntro2 {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    addSlide(Fragement.newInstance());
    addSlide(Fragement.newInstance());
    addSlide(Fragement.newInstance());

    setButtonsEnabled(false);
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
doneillcommented, Jul 30, 2020

Sure enough, creating a Java example in your example app works

public class CustomJavaIntro extends AppIntro2 {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        addSlide(AppIntroCustomLayoutFragment.newInstance(R.layout.intro_custom_layout1));
        addSlide(AppIntroCustomLayoutFragment.newInstance(R.layout.intro_custom_layout2));
        addSlide(AppIntroCustomLayoutFragment.newInstance(R.layout.intro_custom_layout3));
        addSlide(AppIntroCustomLayoutFragment.newInstance(R.layout.intro_custom_layout4));

        setButtonsEnabled(false);
    }

    @Override
    public void onDonePressed(Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        finish();
    }
}

Thanks for confirming, I’ll keep trying to figure it out.

0reactions
cortinicocommented, Oct 27, 2020

@cortinico any clue when will be up the new version?

We don’t have ETA, but definitely we want to wait for #878 #887 #863 to be merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Disable GUI Button in Java - Stack Overflow
You should put the statement btnConvertDocuments.setEnabled(false); in the actionPerformed(ActionEvent event) method.
Read more >
Disable Button Example - Java Program Sample Source Code
This java example shows how to disable a Button using setEnabled method.
Read more >
34 - Java Swing Basics - Enabling and Disabling of Buttons
Building on the topic of Java Swing, in this video will be explained how Buttons can be Enabled and Disabled in Java Swing....
Read more >
Enabling and Disabling Buttons - SWT - O'Reilly
Enabling and Disabling Buttons It is often useful to “disable” a button when it is not appropriate for the user to initiate the...
Read more >
Javascript button disabled is not working - Oracle Communities
Hi All,. onclick of button disable is not workin I am using below code. please check and suggest. var savebutton = document.createElement("div");.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found