-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from ibm-cloud-security/development
Development
- Loading branch information
Showing
29 changed files
with
2,544 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/ibm/mobilefirstplatform/appid/SignInActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.ibm.mobilefirstplatform.appid; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.AutoCompleteTextView; | ||
import android.widget.EditText; | ||
|
||
import static com.ibm.mobilefirstplatform.appid.MainActivity.LOGIN_CANCEL; | ||
import static com.ibm.mobilefirstplatform.appid.MainActivity.LOGIN_SUBMITTED; | ||
|
||
/** | ||
* A login screen that offers login via userName/password. | ||
*/ | ||
|
||
public class SignInActivity extends Activity { | ||
// UI references. | ||
private AutoCompleteTextView muserNameView; | ||
private EditText mPasswordView; | ||
private View mLoginFormView; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.sign_in); | ||
// Set up the login form. | ||
muserNameView = (AutoCompleteTextView) findViewById(R.id.userName); | ||
mPasswordView = (EditText) findViewById(R.id.password); | ||
mLoginFormView = findViewById(R.id.login_form); | ||
} | ||
|
||
public void attemptLogin(View v) { | ||
String userName = muserNameView.getText().toString(); | ||
String password = mPasswordView.getText().toString(); | ||
Intent inent = new Intent(); | ||
inent.putExtra("username",userName); | ||
inent.putExtra("password", password); | ||
setResult(LOGIN_SUBMITTED, inent); | ||
finish(); | ||
} | ||
|
||
public void cancelLogin(View v){ | ||
Intent inent = new Intent(); | ||
setResult(LOGIN_CANCEL, inent); | ||
finish(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright 2015 IBM Corp. | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | ||
android:layout_height="match_parent" android:gravity="center_horizontal" | ||
android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" | ||
android:paddingLeft="@dimen/activity_horizontal_margin" | ||
android:paddingRight="@dimen/activity_horizontal_margin" | ||
android:paddingTop="@dimen/activity_vertical_margin"> | ||
|
||
<!-- Login progress --> | ||
<ProgressBar android:id="@+id/login_progress" style="?android:attr/progressBarStyleLarge" | ||
android:layout_width="wrap_content" android:layout_height="wrap_content" | ||
android:layout_marginBottom="8dp" android:visibility="gone" /> | ||
|
||
<ScrollView android:id="@+id/login_form" android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fillViewport="false"> | ||
|
||
<LinearLayout android:id="@+id/email_login_form" android:layout_width="match_parent" | ||
android:layout_height="wrap_content" android:orientation="vertical"> | ||
|
||
<AutoCompleteTextView android:id="@+id/userName" android:layout_width="match_parent" | ||
android:layout_height="wrap_content" android:hint="@string/prompt_email" | ||
android:inputType="textEmailAddress" android:maxLines="1" /> | ||
|
||
<EditText android:id="@+id/password" android:layout_width="match_parent" | ||
android:layout_height="wrap_content" android:hint="@string/prompt_password" | ||
android:imeActionId="@+id/login" | ||
android:imeActionLabel="@string/action_sign_in_short" | ||
android:imeOptions="actionUnspecified" android:inputType="textPassword" | ||
android:maxLines="1" android:singleLine="true" /> | ||
|
||
<Button android:id="@+id/email_sign_in_button" style="?android:textAppearanceSmall" | ||
android:layout_width="match_parent" android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" android:text="@string/action_sign_in" | ||
android:textStyle="bold" | ||
android:onClick="attemptLogin" /> | ||
|
||
<Button | ||
style="?android:textAppearanceSmall" | ||
android:id="@+id/cancelButton" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:text="cancel" | ||
android:textStyle="bold" | ||
android:onClick="cancelLogin" | ||
android:layout_gravity="center_horizontal" /> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</LinearLayout> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<string name="title_activity_login">Sign in</string> | ||
<!-- Strings related to login --> | ||
<string name="prompt_email">User Name</string> | ||
<string name="prompt_password">Password</string> | ||
<string name="action_sign_in">Sign in</string> | ||
<string name="action_sign_in_short">Sign in</string> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.