android-simple-tooltip icon indicating copy to clipboard operation
android-simple-tooltip copied to clipboard

Display tooltip when pressing on the button

Open jt4000 opened this issue 6 years ago • 1 comments

Goal: When you press the button, the tooltip shall display.

Problem: What syntax code do I need to add?

Thank you!

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        View yourView = findViewById(R.id.btn_data);

        new SimpleTooltip.Builder(this)
                .anchorView(yourView)
                .text("Texto do Tooltip")
                .gravity(Gravity.END)
                .modal(true)
                .dismissOnOutsideTouch(true)
                .dismissOnInsideTouch(false)
                .showArrow(true)
                .build()
                .show();
    }
}

jt4000 avatar Sep 24 '18 19:09 jt4000

Please, take a look at the Sample Project. All examples are made with a button click.

douglasjunior avatar Sep 26 '18 22:09 douglasjunior