Navigation Menu

Skip to content

Commit

Permalink
did some shit
Browse files Browse the repository at this point in the history
  • Loading branch information
kylelobo committed Mar 19, 2018
1 parent 9f1f17f commit d5b1de4
Show file tree
Hide file tree
Showing 67 changed files with 743 additions and 91 deletions.
26 changes: 0 additions & 26 deletions cahatapp/app/src/main/AndroidManifest.xml

This file was deleted.

10 changes: 0 additions & 10 deletions cahatapp/app/src/main/res/menu/menu_main.xml

This file was deleted.

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.
6 changes: 0 additions & 6 deletions cahatapp/app/src/main/res/values/colors.xml

This file was deleted.

3 changes: 0 additions & 3 deletions cahatapp/app/src/main/res/values/dimens.xml

This file was deleted.

6 changes: 0 additions & 6 deletions cahatapp/app/src/main/res/values/strings.xml

This file was deleted.

20 changes: 0 additions & 20 deletions cahatapp/app/src/main/res/values/styles.xml

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cahatapp/.idea/misc.xml → maybefinal/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions cahatapp/app/build.gradle → maybefinal/app/build.gradle
Expand Up @@ -3,12 +3,17 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.kodery.calden.cahatapp"
applicationId "com.kodery.kyle.maybefinal"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
buildTypes {
release {
Expand All @@ -21,8 +26,10 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.jakewharton:butterknife:6.1.0'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
package com.kodery.calden.cahatapp;
package com.kodery.kyle.maybefinal;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand All @@ -21,6 +21,6 @@ public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.kodery.calden.cahatapp", appContext.getPackageName());
assertEquals("com.kodery.kyle.maybefinal", appContext.getPackageName());
}
}
28 changes: 28 additions & 0 deletions maybefinal/app/src/main/AndroidManifest.xml
@@ -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>
@@ -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);
}
}
@@ -1,4 +1,4 @@
package com.kodery.calden.cahatapp;
package com.kodery.kyle.maybefinal;

import android.content.Context;
import android.content.Intent;
Expand All @@ -10,7 +10,7 @@
import android.widget.Toast;

/**
* Created by calden on 18/3/18.
* Created by kyle on 18/3/18.
*/

public class CustomizedListView extends BaseAdapter{
Expand Down
@@ -1,4 +1,4 @@
package com.kodery.calden.cahatapp;
package com.kodery.kyle.maybefinal;

import android.content.Context;
import android.content.Intent;
Expand All @@ -15,7 +15,7 @@
import java.util.List;

/**
* Created by calden on 18/3/18.
* Created by kyle on 18/3/18.
*/

public class CustomizedListViewnew extends BaseAdapter{
Expand Down
@@ -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;
}
}
@@ -1,4 +1,4 @@
package com.kodery.calden.cahatapp;
package com.kodery.kyle.maybefinal;

import android.content.Intent;
import android.os.Bundle;
Expand Down

0 comments on commit d5b1de4

Please sign in to comment.