Android Open Source - HNdroid Login Dialog






From Project

Back to project page HNdroid.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project HNdroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.gluegadget.hndroid;
/*from w  w w  . j a v a2s  .c  o m*/
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginDialog extends Dialog {
  
  Button loginButton;
  String name;
    private ReadyListener readyListener;
    EditText username;
    EditText password;
  
  public interface ReadyListener {
        public void ready(String username, String password);
    }
  
  public LoginDialog(Context context, String name, ReadyListener readyListener) {
    super(context);
    this.readyListener = readyListener;
    this.name = name;

  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        setTitle("Sign In");
    loginButton = (Button)findViewById(R.id.login_button);
    loginButton.setOnClickListener(new loginListener());
    username = (EditText)findViewById(R.id.username);
    password = (EditText)findViewById(R.id.password);
    }
  
  private class loginListener implements android.view.View.OnClickListener {
     @Override
       public void onClick(View v) {
       readyListener.ready(String.valueOf(username.getText()), String.valueOf(password.getText()));
       dismiss();
     }
  }
  
  public void onClick(View v) {
    if (v == loginButton) {
      dismiss();
    }
  }

}




Java Source Code List

com.gluegadget.hndroid.CommentDialog.java
com.gluegadget.hndroid.Comment.java
com.gluegadget.hndroid.CommentsAdapter.java
com.gluegadget.hndroid.Comments.java
com.gluegadget.hndroid.KarmaWidgetConfigurationActivity.java
com.gluegadget.hndroid.KarmaWidget.java
com.gluegadget.hndroid.LoginDialog.java
com.gluegadget.hndroid.Main.java
com.gluegadget.hndroid.NewsAdapter.java
com.gluegadget.hndroid.News.java
com.gluegadget.hndroid.Preferences.java
com.gluegadget.hndroid.Submissions.java