Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
743 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.kodery.kyle.maybefinal"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme" > | ||
<activity | ||
android:name=".LoginActivity" android:theme="@style/AppTheme.Dark"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".SignupActivity" android:theme="@style/AppTheme.Dark" /> | ||
<activity android:name=".AndroidMaterialSpinner" android:theme="@style/AppTheme.NoActionBar" /> | ||
<activity android:name=".homepage" android:theme="@style/AppTheme.NoActionBar"/> | ||
<activity android:name=".tabtab" android:theme="@style/AppTheme.NoActionBar"/> | ||
<activity android:name=".CustomizedListView" android:theme="@style/AppTheme.NoActionBar"/> | ||
<activity android:name=".CustomizedListViewnew" android:theme="@style/AppTheme.NoActionBar"/> | ||
<activity android:name=".MainActivity" android:theme="@style/AppTheme.NoActionBar"/> | ||
|
||
</application> | ||
|
||
</manifest> |
29 changes: 29 additions & 0 deletions
29
maybefinal/app/src/main/java/com/kodery/kyle/maybefinal/AndroidMaterialSpinner.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,29 @@ | ||
package com.kodery.kyle.maybefinal; | ||
|
||
/** | ||
* Created by kyle on 18/3/18. | ||
*/ | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.widget.ArrayAdapter; | ||
|
||
import com.weiwangcn.betterspinner.library.material.MaterialBetterSpinner; | ||
|
||
public class AndroidMaterialSpinner extends AppCompatActivity { | ||
|
||
|
||
String[] SPINNERLIST = {"Department of Pinoys", "Department of Peruvians", "Deparment of Pros", "Some department"}; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.android_material_design_spinner); | ||
|
||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, | ||
android.R.layout.simple_dropdown_item_1line, SPINNERLIST); | ||
MaterialBetterSpinner materialDesignSpinner = (MaterialBetterSpinner) | ||
findViewById(R.id.android_material_design_spinner); | ||
materialDesignSpinner.setAdapter(arrayAdapter); | ||
} | ||
} |
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
142 changes: 142 additions & 0 deletions
142
maybefinal/app/src/main/java/com/kodery/kyle/maybefinal/LoginActivity.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,142 @@ | ||
package com.kodery.kyle.maybefinal; | ||
|
||
import android.app.ProgressDialog; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
|
||
import android.content.Intent; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.TextView; | ||
import android.widget.Toast; | ||
|
||
import butterknife.ButterKnife; | ||
import butterknife.InjectView; | ||
|
||
public class LoginActivity extends AppCompatActivity { | ||
private static final String TAG = "LoginActivity"; | ||
private static final int REQUEST_SIGNUP = 0; | ||
|
||
@InjectView(R.id.input_login_mobile) EditText _loginMobileText; | ||
@InjectView(R.id.input_login_userid) EditText _loginUseridText; | ||
@InjectView(R.id.btn_login) Button _loginButton; | ||
@InjectView(R.id.link_signup) TextView _signupLink; | ||
|
||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_login); | ||
ButterKnife.inject(this); | ||
|
||
_loginButton.setOnClickListener(new View.OnClickListener() { | ||
|
||
@Override | ||
public void onClick(View v) { | ||
//login(); | ||
final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this, R.style.AppTheme_Dark_Dialog); | ||
progressDialog.setIndeterminate(true); | ||
progressDialog.setMessage("Authenticating.."); | ||
progressDialog.show(); | ||
Intent intent_main = new Intent(LoginActivity.this, MainActivity.class); | ||
startActivity(intent_main); | ||
} | ||
}); | ||
|
||
_signupLink.setOnClickListener(new View.OnClickListener() { | ||
|
||
@Override | ||
public void onClick(View v) { | ||
// Start the Signup activity | ||
Intent intent = new Intent(getApplicationContext(), SignupActivity.class); | ||
startActivityForResult(intent, REQUEST_SIGNUP); | ||
} | ||
}); | ||
} | ||
|
||
public void login() { | ||
Log.d(TAG, "Login"); | ||
|
||
if (!validate()) { | ||
onLoginFailed(); | ||
return; | ||
} | ||
|
||
_loginButton.setEnabled(false); | ||
|
||
final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this, R.style.AppTheme_Dark_Dialog); | ||
progressDialog.setIndeterminate(true); | ||
progressDialog.setMessage("Authenticating.."); | ||
progressDialog.show(); | ||
|
||
String login_userid = _loginUseridText.getText().toString(); | ||
String login_mobile = _loginMobileText.getText().toString(); | ||
|
||
// TODO: Implement authentication logic here. | ||
|
||
/*new android.os.Handler().postDelayed( | ||
new Runnable() { | ||
public void run() { | ||
// On complete call either onLoginSuccess or onLoginFailed | ||
onLoginSuccess(); | ||
//onLoginFailed(); | ||
progressDialog.dismiss(); | ||
} | ||
}, 3000);*/ | ||
} | ||
|
||
|
||
@Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
if (requestCode == REQUEST_SIGNUP) { | ||
if (resultCode == RESULT_OK) { | ||
|
||
// TODO: Implement successful signup logic here | ||
// By default we just finish the Activity and log them in automatically | ||
this.finish(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
// disable going back to the MainActivity | ||
moveTaskToBack(true); | ||
} | ||
|
||
public void onLoginSuccess() { | ||
_loginButton.setEnabled(true); | ||
finish(); | ||
} | ||
|
||
public void onLoginFailed() { | ||
Toast.makeText(getBaseContext(), "Login failed", Toast.LENGTH_LONG).show(); | ||
|
||
_loginButton.setEnabled(true); | ||
} | ||
|
||
public boolean validate() { | ||
boolean valid = true; | ||
|
||
String login_userid = _loginUseridText.getText().toString(); | ||
String login_mobile = _loginMobileText.getText().toString(); | ||
|
||
if (login_userid.isEmpty()) { | ||
_loginUseridText.setError("Invalid User ID."); | ||
valid = false; | ||
} else { | ||
_loginUseridText.setError(null); | ||
} | ||
|
||
if (login_mobile.isEmpty() || login_mobile.length() != 10) { | ||
_loginMobileText.setError("Invalid Mobile Number."); | ||
valid = false; | ||
} else { | ||
_loginMobileText.setError(null); | ||
} | ||
|
||
return valid; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../kodery/calden/cahatapp/MainActivity.java → .../kodery/kyle/maybefinal/MainActivity.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
Oops, something went wrong.