Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not resolve method getText() #21

Closed
Sanjar1 opened this issue Nov 4, 2014 · 6 comments
Closed

can not resolve method getText() #21

Sanjar1 opened this issue Nov 4, 2014 · 6 comments

Comments

@Sanjar1
Copy link

Sanjar1 commented Nov 4, 2014

public void onClick(View v) {

    String buttonPressed = ((ButtonRectangle) v).getText().toString();
@manishandroid
Copy link

Add below method in ButtonRectangle.java file.

    public String getText(){
        return textButton.getText().toString();
 }

@navasmdc
Copy link
Owner

navasmdc commented Nov 4, 2014

To access text of button you have getTextView function, with this function you can access to textview of Button to get text or change Typeface. But if you want his function i will implement it.

@navasmdc navasmdc closed this as completed Nov 4, 2014
@Sanjar1
Copy link
Author

Sanjar1 commented Nov 4, 2014

thanks it worked for me manishandroid.
how to decrease anime time of ButtonRectangle
I am implementing ButtonRectangle to calculator. it take too long time

@navasmdc
Copy link
Owner

navasmdc commented Nov 4, 2014

You can use setRippleSpeed function of Buttons to set speed of ripple sppeed

@Sanjar1
Copy link
Author

Sanjar1 commented Nov 4, 2014

I am new in android development))
that is why
can you please write me some line of code
and say me where i should paste it))
to do it))

@navasmdc
Copy link
Owner

navasmdc commented Nov 4, 2014

Don't worry, it isn`t a problem, for example if you have a RectangleButton in XML file with id button1
you can access to this button in an activity with

RectangleButton button1 = (RectangleButton) findViewById(R.id.button1);

and now you can set ripple speed

button1.setRippleSpeed(20);

if you have other question it is my mail i.navas.mdc@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants