-
Notifications
You must be signed in to change notification settings - Fork 0
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
23 changed files
with
1,459 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# neostore | ||
|
||
## Synopsis | ||
|
||
This introductory course provides trainee with the opportunity to practice and expereince designing and publishing an android app. | ||
|
||
## Design Reference | ||
|
||
http://design.neosofttech.in/35/NeoSoft/NeoSTORE/Guideline_1.html | ||
|
||
## API Reference | ||
|
||
http://180.149.245.182:8844/trainingapp/webroot/apidoc/index.html#api-A_User | ||
|
||
## License | ||
|
||
A short snippet describing the license (MIT, Apache, etc.) |
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
63 changes: 63 additions & 0 deletions
63
app/src/main/java/com/neosoft/neostore/activity/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,63 @@ | ||
package com.neosoft.neostore.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
|
||
import com.google.gson.Gson; | ||
import com.neosoft.neostore.R; | ||
import com.neosoft.neostore.serviceapi.GetServices; | ||
import com.neosoft.neostore.serviceapi.Services; | ||
import com.neosoft.neostore.validate.Validate; | ||
|
||
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, Services.ApiResponse { | ||
|
||
Button btnLogin, btnRegister; | ||
EditText editEmail, editPass; | ||
String email, pass; | ||
Validate valid = new Validate(); | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_login); | ||
|
||
editEmail = (EditText) findViewById(R.id.edtEmail); | ||
editPass = (EditText) findViewById(R.id.edtPass); | ||
btnLogin = (Button) findViewById(R.id.btn_login); | ||
btnRegister = (Button) findViewById(R.id.btn_login_signup); | ||
|
||
btnLogin.setOnClickListener(this); | ||
btnRegister.setOnClickListener(this); | ||
} | ||
|
||
@Override | ||
public void onClick(View view) { | ||
switch (view.getId()) { | ||
case R.id.btn_login: | ||
if (valid.loginValidate(editEmail,editPass)) { | ||
email = String.valueOf(editEmail.getText()); | ||
pass = String.valueOf(editPass.getText()); | ||
|
||
GetServices getServices = new GetServices(); | ||
getServices.login(email,pass); | ||
} | ||
break; | ||
|
||
case R.id.btn_login_signup: | ||
Intent intent = new Intent(getApplicationContext(), RegisterActivity.class); | ||
startActivity(intent); | ||
} | ||
} | ||
|
||
@Override | ||
public void onSuccess(String response) { | ||
Log.e(LoginActivity.class.getSimpleName(), "onSuccess response " + response); | ||
|
||
new Gson().toJson(response); | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
app/src/main/java/com/neosoft/neostore/activity/RegisterActivity.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,90 @@ | ||
package com.neosoft.neostore.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.RadioButton; | ||
import android.widget.RadioGroup; | ||
import android.widget.TextView; | ||
|
||
import com.neosoft.neostore.R; | ||
import com.neosoft.neostore.serviceapi.GetServices; | ||
import com.neosoft.neostore.serviceapi.Services; | ||
import com.neosoft.neostore.validate.Validate; | ||
|
||
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener,Services.ApiResponse{ | ||
|
||
Button register; | ||
Toolbar toolbar; | ||
EditText editFname, editLname, editEmail, editPass, editConfirmPass, editPhone; | ||
String fname, lname, email, pass, cpass, phone, gender; | ||
RadioGroup rdGrpGender; | ||
RadioButton rdbtnGender; | ||
TextView txtGengerErr; | ||
Validate valid = new Validate(); | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_register); | ||
|
||
editFname = (EditText) findViewById(R.id.etFirstname); | ||
editLname = (EditText) findViewById(R.id.etLastname); | ||
editEmail = (EditText) findViewById(R.id.etEmail); | ||
editPass = (EditText) findViewById(R.id.etPassword); | ||
editConfirmPass = (EditText) findViewById(R.id.etConfirmPassword); | ||
editPhone = (EditText) findViewById(R.id.etPhone); | ||
register = (Button) findViewById(R.id.btnRegister); | ||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
rdGrpGender = (RadioGroup) findViewById(R.id.radioGender); | ||
txtGengerErr = (TextView) findViewById(R.id.txtGenderValidate); | ||
txtGengerErr.setVisibility(View.VISIBLE); | ||
setSupportActionBar(toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
getSupportActionBar().setDisplayShowHomeEnabled(true); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
register.setOnClickListener(this); | ||
} | ||
|
||
@Override | ||
public void onClick(View view) { | ||
switch (view.getId()) { | ||
case R.id.btnRegister : | ||
|
||
if(valid.registerValidate(editFname,editLname,editEmail,editPass,editConfirmPass,rdGrpGender,txtGengerErr,editPhone)) { | ||
int genderId = rdGrpGender.getCheckedRadioButtonId(); | ||
rdbtnGender = (RadioButton) findViewById(genderId); | ||
fname = String.valueOf(editFname.getText()); | ||
lname = String.valueOf(editLname.getText()); | ||
email = String.valueOf(editEmail.getText()); | ||
pass = String.valueOf(editPass.getText()); | ||
cpass = String.valueOf(editConfirmPass.getText()); | ||
phone = String.valueOf(editPhone.getText()); | ||
if(rdbtnGender.getText().equals("Male")) | ||
gender = "M"; | ||
else | ||
gender = "F"; | ||
|
||
GetServices services = new GetServices(); | ||
services.register(fname,lname,email,pass,cpass,gender,phone); | ||
} | ||
break; | ||
} | ||
} | ||
|
||
@Override | ||
public void onSuccess(String response) { | ||
Log.e(RegisterActivity.class.getSimpleName(),"onSuccess response "+response); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/neosoft/neostore/fragment/HomepageFragment.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,34 @@ | ||
package com.neosoft.neostore.fragment; | ||
|
||
import android.os.Bundle; | ||
import android.support.v4.app.Fragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
|
||
import com.neosoft.neostore.R; | ||
|
||
public class HomepageFragment extends Fragment { | ||
public static final String EXTRA_MESSAGE = "EXTRA_MESSAGE"; | ||
private View v; | ||
private boolean imageloaded; | ||
public static final HomepageFragment newInstance(int message) { | ||
HomepageFragment f = new HomepageFragment(); | ||
Bundle bdl = new Bundle(); | ||
bdl.putString(EXTRA_MESSAGE, String.valueOf(message)); | ||
f.setArguments(bdl); | ||
return f; | ||
} | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
String message = getArguments().getString(EXTRA_MESSAGE); | ||
if (!imageloaded) { | ||
v = inflater.inflate(R.layout.homepage_layout, container, false); | ||
ImageView imageView = (ImageView) v.findViewById(R.id.home_imageView); | ||
imageView.setImageResource(Integer.parseInt(message)); | ||
imageloaded = true; | ||
} | ||
return v; | ||
} | ||
} |
Oops, something went wrong.