9 Replies - 407 Views - Last Post: 21 June 2017 - 03:38 AM

#1 BigJoe5054  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-June 17

can some one please help me

Posted 20 June 2017 - 11:13 AM

i have a login button the needs to change color from gray to green when the user type the username and password in

loginbtn.setonclickListener(new View.onclickListener() {

            @Override
            public void onclick(View view){

               if (editText1_id.length() >= 4 && editText1_passcode.getText().length() >= 4) {
                    loginbtn.setEnabled(true);
                    loginbtn.setBackgroundResource(R.drawable.events_day_selected);
                }
            }

        });


Is This A Good Question/Topic? 0
  • +

Replies To: can some one please help me

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,478
  • Joined: 12-June 08

Re: can some one please help me

Posted 20 June 2017 - 11:17 AM

Which mobile platform?
Unclear on your problem; what is your question?
Was This Post Helpful? 0
  • +
  • -

#3 BigJoe5054  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-June 17

Re: can some one please help me

Posted 20 June 2017 - 11:43 AM

View Postmodi123_1, on 20 June 2017 - 11:17 AM, said:

Which mobile platform?
Unclear on your problem; what is your question?


its Android studio java the button is now gray and need the change to green when the user log in (username and password )
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,478
  • Joined: 12-June 08

Re: can some one please help me

Posted 20 June 2017 - 11:45 AM

Are you saying the button needs to be enabled from a disabled state?
Was This Post Helpful? 0
  • +
  • -

#5 BigJoe5054  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-June 17

Re: can some one please help me

Posted 20 June 2017 - 11:50 AM

View Postmodi123_1, on 20 June 2017 - 11:45 AM, said:

Are you saying the button needs to be enabled from a disabled state?

yes its disabled (gray) and when you type in your username and password it needs to enabled and be green so you can login
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,478
  • Joined: 12-June 08

Re: can some one please help me

Posted 20 June 2017 - 11:55 AM

Okay.. so hook into some key press events.. probably for both text boxes.. as they type check the contents of both.. if either have content, and the button is disabled, enable it.

Though just by pass all of that and have a 'do these textboxes have content' condition in the login button press. If not then then exit the event..
Was This Post Helpful? 1
  • +
  • -

#7 BigJoe5054  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-June 17

Re: can some one please help me

Posted 20 June 2017 - 12:10 PM

View Postmodi123_1, on 20 June 2017 - 11:55 AM, said:

Okay.. so hook into some key press events.. probably for both text boxes.. as they type check the contents of both.. if either have content, and the button is disabled, enable it.

Though just by pass all of that and have a 'do these textboxes have content' condition in the login button press. If not then then exit the event..

yes

View PostBigJoe5054, on 20 June 2017 - 12:06 PM, said:

View Postmodi123_1, on 20 June 2017 - 11:55 AM, said:

Okay.. so hook into some key press events.. probably for both text boxes.. as they type check the contents of both.. if either have content, and the button is disabled, enable it.

Though just by pass all of that and have a 'do these textboxes have content' condition in the login button press. If not then then exit the event..

yes

can you please help me with the code
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,478
  • Joined: 12-June 08

Re: can some one please help me

Posted 20 June 2017 - 12:14 PM

I don't know what you were 'yes'ing to. There were two suggestions there.
Was This Post Helpful? 0
  • +
  • -

#9 wseng92  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 279
  • Joined: 23-September 15

Re: can some one please help me

Posted 21 June 2017 - 02:46 AM

TextWatcher is probably what you need.
Was This Post Helpful? 0
  • +
  • -

#10 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6505
  • View blog
  • Posts: 14,362
  • Joined: 02-June 10

Re: can some one please help me

Posted 21 June 2017 - 03:38 AM

Quote

can you please help me with the code

'Help' on this site means:
You make an effort to implement the suggestion made. If you run into trouble, make another attempt maybe with a slightly different approach. But you make the effort. If you are still having trouble then you post your new code with your efforts and describe the problem you're running into. Then someone will help you to understand the concepts of what you're doing wrong and the direction you should take. Then you make a true effort to use that new guidance to fix your code. {repeat as needed}

'Help' here is about helping you to learn your craft and skillset as a developer. 'Help' here is not someone just giving you code.

This post has been edited by tlhIn`toq: 21 June 2017 - 03:38 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1