use of com.manan.dev.ec2018app.Models.UserDetails in project EC2018App by Manan-YMCA.
the class EventRegister method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_event_register);
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
eventName = getIntent().getStringExtra("eventName");
eventId = getIntent().getStringExtra("eventId");
eventType = getIntent().getStringExtra("eventType");
userDetails = new UserDetails();
// barLoader = (ProgressBar) findViewById(R.id.pb_register);
// barLoader.setVisibility(View.VISIBLE);
pd = new ProgressDialog(EventRegister.this);
pd.setMessage("Making your Ticket...");
pd.setCancelable(false);
pd.setCanceledOnTouchOutside(false);
pd1 = new ProgressDialog(EventRegister.this);
pd1.setMessage("Loading your details...");
pd1.setCancelable(true);
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
Button Add = (Button) findViewById(R.id.add_mem_button);
personNo = (TextView) findViewById(R.id.current_team_mem);
layPar = personNo.getLayoutParams();
memberno = new ArrayList<>();
nameText = new ArrayList<>();
collegeText = new ArrayList<>();
databaseController = new DatabaseController(EventRegister.this);
eventTypeView = (TextView) findViewById(R.id.max_team_mem);
eventTypeView.setText(eventType);
eventNameView = (TextView) findViewById(R.id.tv_event_name);
eventNameView.setText(eventName);
mainName = (EditText) findViewById(R.id.ld_reg_name);
mainClg = (EditText) findViewById(R.id.ld_reg_clg);
mainPhone = (EditText) findViewById(R.id.ld_mobile);
mainmail = (EditText) findViewById(R.id.ld_email);
nameText.add(mainName);
collegeText.add(mainClg);
final LinearLayout layout = findViewById(R.id.layout_infater);
text = new TextView(this);
if (eventType.equals("solo"))
Add.setVisibility(View.GONE);
if (eventType.equals("solo"))
Add.setVisibility(View.GONE);
SharedPreferences prefs = getSharedPreferences(getResources().getString(R.string.sharedPrefName), MODE_PRIVATE);
final String phoneNumber = prefs.getString("Phone", null);
if (phoneNumber == null) {
}
if (isNetworkAvailable()) {
pd1.show();
getDetails(phoneNumber);
}
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
personNo.setVisibility(View.VISIBLE);
final View v = LayoutInflater.from(EventRegister.this).inflate(R.layout.register_inflater, layout, false);
name = (EditText) v.findViewById(R.id.inflate_reg_name);
college = (EditText) v.findViewById(R.id.inflate_reg_clg);
final ImageView remove = (ImageView) v.findViewById(R.id.bt_remove);
final TextView tv_2 = (TextView) v.findViewById(R.id.member_no_count);
remove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewGroup p1 = (ViewGroup) v.getParent();
ViewGroup p2 = (ViewGroup) p1.getParent();
ViewGroup p3 = (ViewGroup) p2.getParent();
Integer remove_member = Integer.parseInt(tv_2.getText().toString());
nameText.remove(remove_member - 1);
collegeText.remove(remove_member - 1);
memberno.remove(tv_2);
update();
p3.removeView(p2);
count--;
personNo.setText(String.valueOf(count));
}
});
count++;
personNo.setText(String.valueOf(count));
tv_2.setText(String.valueOf(count));
memberno.add(tv_2);
nameText.add(name);
collegeText.add(college);
layout.addView(v);
}
});
Button bt = (Button) findViewById(R.id.register_button);
bt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intentName = "";
intentClg = "";
intentMail = "";
intentPhone = "";
intentPhone += mainPhone.getText().toString();
intentMail += mainmail.getText().toString();
for (int i = 0; i < nameText.size(); i++) {
intentName += nameText.get(i).getText().toString() + ",";
}
intentName = intentName.substring(0, intentName.length() - 1);
for (int i = 0; i < collegeText.size(); i++) {
intentClg += collegeText.get(i).getText().toString() + ",";
}
intentClg = intentClg.substring(0, intentClg.length() - 1);
//
Boolean checker = validateCredentials();
if (checker) {
pd.show();
registerEvent();
}
}
});
}
use of com.manan.dev.ec2018app.Models.UserDetails in project EC2018App by Manan-YMCA.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
parent = "default";
setContentView(R.layout.activity_login);
parent = getIntent().getStringExtra("parent");
userTickets = new ArrayList<>();
userDetails = new UserDetails();
pbLogin = (ProgressBar) findViewById(R.id.pb_login);
mobileNum = (EditText) findViewById(R.id.mobileNum);
loginMobileNum = (Button) findViewById(R.id.login_mobileNum);
RelativeView = (RelativeLayout) findViewById(R.id.rl_main_view);
NeedHelp = (TextView) findViewById(R.id.need_help);
registerView = (TextView) findViewById(R.id.tv_register_option);
databaseController = new DatabaseController(LoginActivity.this);
String first = "Haven't completed the details? ";
String next = "<font color='#f55246'>Click Here!</font>";
registerView.setText(Html.fromHtml(first + next));
NeedHelp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String to = "manantechnosurge@gmail.com";
String subject = "Need Help";
String messg = "I am facing a problem regarding...\n";
sendEmailBug(to, subject, messg);
}
});
registerView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (parent.equals("xunbao") || parent.equals("ct")) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class).putExtra("parent", "xunbao"));
finish();
} else {
finish();
}
}
});
loginMobileNum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Boolean checker = validateCredentials();
if (checker) {
pbLogin.setVisibility(View.VISIBLE);
userDetails.setmPhone(mobileNum.getText().toString());
checkOTP(mobileNum.getText().toString());
}
}
});
}
use of com.manan.dev.ec2018app.Models.UserDetails in project EC2018App by Manan-YMCA.
the class ProfileActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
callbackManager = CallbackManager.Factory.create();
userDetails = new UserDetails();
userDetails.setmFbId("null");
tvName = (TextView) findViewById(R.id.tv_name);
tvMail = (TextView) findViewById(R.id.tv_email);
tvCollege = (TextView) findViewById(R.id.tv_college);
tvPhone = (TextView) findViewById(R.id.tv_phone);
final String EMAIL = "email";
backbutton = findViewById(R.id.pr_back_button);
SharedPreferences prefs = getSharedPreferences(getResources().getString(R.string.sharedPrefName), MODE_PRIVATE);
phoneNumber = prefs.getString("Phone", null);
if (phoneNumber == null) {
}
ivBar = (ProgressBar) findViewById(R.id.pb_profile_image);
detailsBar = (ProgressBar) findViewById(R.id.pb_user_profile);
ivBar.setVisibility(View.VISIBLE);
detailsBar.setVisibility(View.VISIBLE);
mAuth = FirebaseAuth.getInstance();
textView1 = (TextView) findViewById(R.id.tv6);
loginButton = (LoginButton) findViewById(R.id.login_button);
profilePictureFrame = (RelativeLayout) findViewById(R.id.profile_picture_layout);
profilePicture = (ImageView) findViewById(R.id.profile_pic);
loginButton.setReadPermissions(Arrays.asList(EMAIL));
// If you are using in a fragment, call loginButton.setFragment(this);
// Callback registration
backbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
ivBar.setVisibility(View.VISIBLE);
if (Profile.getCurrentProfile() == null) {
mProfileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
mProfileTracker.stopTracking();
}
};
} else {
Profile profile = Profile.getCurrentProfile();
}
userDetails.setmFbId(loginResult.getAccessToken().getUserId());
registerUser(userDetails);
profilePicture.setImageBitmap(null);
checkStatus();
handleFirebaseLogin(loginResult.getAccessToken());
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException exception) {
}
});
// Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.dashboard_image);
// Bitmap resized = Bitmap.createScaledBitmap(largeIcon, 100, 100, true);
// GetRoundedImage getRoundedImage = new GetRoundedImage();
// Bitmap conv_bm = getRoundedImage.getRoundedShape(resized);
// BitmapDrawable background = new BitmapDrawable(conv_bm);
// profilePicture.setBackground(background);
final LayoutInflater factory = LayoutInflater.from(this);
ImageView editButton = (ImageView) findViewById(R.id.edit_button);
editButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
input1 = new EditText(ProfileActivity.this);
input2 = new EditText(ProfileActivity.this);
input3 = new EditText(ProfileActivity.this);
flag = false;
final AlertDialog.Builder alert = new AlertDialog.Builder(ProfileActivity.this);
final LinearLayout layout = new LinearLayout(ProfileActivity.this);
layout.setOrientation(LinearLayout.VERTICAL);
layout.removeAllViews();
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(30, 0, 30, 0);
final TextView tv_name = new TextView(ProfileActivity.this);
tv_name.setLayoutParams(layoutParams);
tv_name.setText("Name");
input1.setLayoutParams(layoutParams);
final TextView tv_email = new TextView(ProfileActivity.this);
tv_email.setText("Email");
tv_email.setLayoutParams(layoutParams);
input2.setLayoutParams(layoutParams);
final TextView tv_college = new TextView(ProfileActivity.this);
tv_college.setText("College Name");
input1.setText(userDetails.getmName());
input3.setText(userDetails.getmCollege());
input2.setText(userDetails.getEmail());
tv_college.setLayoutParams(layoutParams);
input3.setLayoutParams(layoutParams);
layout.addView(tv_name);
layout.addView(input1);
layout.addView(tv_email);
layout.addView(input2);
layout.addView(tv_college);
layout.addView(input3);
alert.setIcon(R.drawable.vector_pencil_black).setTitle("Edit Profile").setView(layout).setPositiveButton("Save", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
/* User clicked OK so do some stuff */
boolean checker = checkDetails();
if (checker) {
detailsBar.setVisibility(View.VISIBLE);
userDetails.setmName(input1.getText().toString());
userDetails.setEmail(input2.getText().toString());
userDetails.setmCollege(input3.getText().toString());
tvName.setText("");
tvCollege.setText("");
tvMail.setText("");
tvPhone.setText("");
registerUser(userDetails);
layout.removeAllViews();
} else {
MDToast.makeText(ProfileActivity.this, "Invalid Credentials", Toast.LENGTH_SHORT, MDToast.TYPE_ERROR).show();
}
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
/*
* User clicked cancel so do some stuff
*/
layout.removeAllViews();
}
});
alert.show();
}
});
}
use of com.manan.dev.ec2018app.Models.UserDetails in project EC2018App by Manan-YMCA.
the class RegisterActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
parent = "default";
setContentView(R.layout.activity_register);
parent = getIntent().getStringExtra("parent");
userName = (EditText) findViewById(R.id.et_reg_name);
userEmail = (EditText) findViewById(R.id.et_reg_email);
userCollege = (EditText) findViewById(R.id.et_reg_clg);
userPhone = (EditText) findViewById(R.id.et_reg_mob);
view = (RelativeLayout) findViewById(R.id.rl_main_view);
LoginText = (TextView) this.findViewById(R.id.tv_log_in);
mProgress = new ProgressDialog(this);
mProgress.setMessage("Registering You");
mProgress.setTitle("Please Wait");
mProgress.setCanceledOnTouchOutside(false);
userDetails = new UserDetails();
userDetails.setmFbId("null");
String first = "Already a User? ";
String next = "<font color='#f55246'>Just Login!</font>";
LoginText.setText(Html.fromHtml(first + next));
TextView submit = (TextView) findViewById(R.id.tv_reg_submit);
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Boolean checker = validateCredentials();
if (checker) {
mProgress.show();
userDetails.setEmail(userEmail.getText().toString());
userDetails.setmName(userName.getText().toString());
userDetails.setmCollege(userCollege.getText().toString());
userDetails.setmPhone(userPhone.getText().toString());
// MDToast.makeText(RegisterActivity.this, "Done!", MDToast.LENGTH_SHORT, MDToast.TYPE_SUCCESS).show();
checkOTP(userDetails);
}
}
});
LoginText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (parent.equals("xunbao") || parent.equals("ct")) {
startActivity(new Intent(RegisterActivity.this, LoginActivity.class).putExtra("parent", "xunbao"));
} else {
startActivity(new Intent(RegisterActivity.this, LoginActivity.class).putExtra("parent", "normal"));
}
}
});
}
Aggregations