Removed toast message
This commit is contained in:
parent
3808f3daf0
commit
f390ceac2b
@ -445,7 +445,7 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
// Do something with the latitude and longitude
|
||||
String message = "Latitude: " + latitude + "\nLongitude: " + longitude;
|
||||
System.out.println("My current location: "+ message);
|
||||
Toast.makeText(CheckInActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
Location target = new Location("");
|
||||
target.setLatitude(latitude);
|
||||
target.setLongitude(longitude);
|
||||
@ -457,18 +457,18 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
float distance = current.distanceTo(target);
|
||||
System.out.println("Distance: "+distance);
|
||||
if(distance<500){
|
||||
Toast.makeText(CheckInActivity.this, "You are out of range!Please get back to location", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "You are out of range!Please get back to location", Toast.LENGTH_SHORT).show();
|
||||
//showFailedDialog();
|
||||
}
|
||||
else{
|
||||
//showSuccessDialog();
|
||||
Toast.makeText(CheckInActivity.this, "Attendance ready to be captured", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Attendance ready to be captured", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(CheckInActivity.this, RegisterActivity.class);
|
||||
intent.putExtra("FromLoginPage",true);
|
||||
startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(CheckInActivity.this, "Location not available", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Location not available", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -616,7 +616,7 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Toast.makeText(CheckInActivity.this, valueFromApiCheckIn, Toast.LENGTH_LONG).show();
|
||||
// Toast.makeText(CheckInActivity.this, valueFromApiCheckIn, Toast.LENGTH_LONG).show();
|
||||
|
||||
Intent intent = new Intent(CheckInActivity.this, RegisterActivity.class);
|
||||
intent.putExtra("FromLoginPage",true);
|
||||
@ -632,7 +632,7 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
// Log.d("error-=>",error.getMessage());
|
||||
Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
System.out.println("Error message: "+ error.getMessage());
|
||||
|
||||
|
||||
@ -681,11 +681,12 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
Log.d("data-=>",response);
|
||||
Toast.makeText(CheckInActivity.this, valueFromApiCheckIn, Toast.LENGTH_SHORT).show();
|
||||
//Toast.makeText(CheckInActivity.this, valueFromApiCheckIn, Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(CheckInActivity.this, RegisterActivity.class);
|
||||
intent.putExtra("FromLoginPage",true);
|
||||
intent.putExtra("valueFromApiCheckIn",valueFromApiCheckIn);
|
||||
startActivity(intent);
|
||||
|
||||
/*new SweetAlertDialog(CheckInActivity.this, SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("You have successfully checked out.")
|
||||
.setConfirmText("Face recognition")
|
||||
@ -697,13 +698,14 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
}
|
||||
})
|
||||
.setContentText("Thank you.").show();*/
|
||||
|
||||
loading.dismiss();
|
||||
}
|
||||
}, new com.android.volley.Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
// Log.d("error-=>",error.getMessage());
|
||||
Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
loading.dismiss();
|
||||
System.out.println("Error message: "+ error.getMessage());
|
||||
|
||||
@ -777,14 +779,14 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
if(distance <= Float.valueOf(Limit)){
|
||||
Toast.makeText(CheckInActivity.this, "Attendance ready to be captured", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Attendance ready to be captured", Toast.LENGTH_SHORT).show();
|
||||
checkIn();
|
||||
break;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Toast.makeText(CheckInActivity.this, "You are out of range!Please get back to location", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "You are out of range!Please get back to location", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
@ -884,7 +886,7 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
// Log.d("error-=>",error.getMessage());
|
||||
Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(CheckInActivity.this, "Fail to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
System.out.println("Error message: "+ error.getMessage());
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@ package ru.visionlab.femdemo;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@ -77,7 +78,9 @@ public class LeaveRequestDetailsActivity extends AppCompatActivity {
|
||||
String _statusMessage3 = jsonObject.getString("_statusMessage");
|
||||
System.out.println("_statusMessage "+_statusMessage3);
|
||||
if(_statusMessage3.equals("Saved Successfully")){
|
||||
Toast.makeText(LeaveRequestDetailsActivity.this, "Current Status :A", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(LeaveRequestDetailsActivity.this, ApprovalListActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
|
@ -2,6 +2,7 @@ package ru.visionlab.femdemo;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Intent;
|
||||
@ -13,6 +14,7 @@ import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
@ -38,8 +40,11 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
import ru.visionlab.femdemo.R;
|
||||
import ru.visionlab.femdemo.login.LoginActivity;
|
||||
import ru.visionlab.femdemo.login.LoginActivityNew;
|
||||
import ru.visionlab.femdemo.register.RegisterActivity;
|
||||
|
||||
public class PermissionRequestActivity extends AppCompatActivity {
|
||||
|
||||
@ -50,13 +55,14 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
String remarks="";
|
||||
LinearLayout timePickerFrom,timePickerTo;
|
||||
private int mDayFrom,mMonthFrom,mMonthTo,mYearFrom,mYearTo,mDayTo, mHour, mMinute;
|
||||
TextView textTimeFrom,textTimeTo;
|
||||
TextView textTimeFrom,textTimeTo,txt_p_date,txt_from_date,txt_to_date;
|
||||
|
||||
LinearLayout linearLayout1;
|
||||
|
||||
Spinner spinner;
|
||||
|
||||
String permission_type,permission_code;
|
||||
String permission_type,permission_code,Employeeid;
|
||||
String toDate,fromTime,fromDate,currentDateandTime;
|
||||
|
||||
ArrayList<PermissionModel> permission_type_list=new ArrayList<>();
|
||||
ArrayList<String> spinner_array=new ArrayList<>();
|
||||
@ -64,7 +70,11 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
// code for Niladri
|
||||
|
||||
RelativeLayout private_date,official_from_date,official_to_date;
|
||||
String permission_code;
|
||||
String timeset, timeSetFrom,RegisterUser;
|
||||
EditText txtDate, txtTime;
|
||||
private int mYear, mMonth, mDay;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -75,10 +85,15 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
SharedPreferences shared = getSharedPreferences("MyPrefs", MODE_PRIVATE);
|
||||
|
||||
Employeeid = shared.getString("Employeeid", "");
|
||||
RegisterUser = shared.getString("RegisterUser", "");
|
||||
|
||||
private_date=findViewById(R.id.private_date);
|
||||
official_from_date=findViewById(R.id.official_from_date);
|
||||
official_to_date=findViewById(R.id.official_to_date);
|
||||
txt_p_date = findViewById(R.id.txtPDate);
|
||||
txt_from_date = findViewById(R.id.txt_from_date);
|
||||
txt_to_date = findViewById(R.id.txt_to_date);
|
||||
|
||||
|
||||
IsELeaveApprover();
|
||||
//PermissionInsert();
|
||||
@ -128,10 +143,71 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
// private_date.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// open_date();
|
||||
// }
|
||||
// });
|
||||
|
||||
private_date.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
mYear = c.get(Calendar.YEAR);
|
||||
mMonth = c.get(Calendar.MONTH);
|
||||
mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(PermissionRequestActivity.this,
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
txt_p_date.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year);
|
||||
}
|
||||
}, mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
}
|
||||
});
|
||||
official_from_date.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
mYear = c.get(Calendar.YEAR);
|
||||
mMonth = c.get(Calendar.MONTH);
|
||||
mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(PermissionRequestActivity.this,
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
txt_from_date.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year);
|
||||
}
|
||||
}, mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
}
|
||||
});
|
||||
official_to_date.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
mYear = c.get(Calendar.YEAR);
|
||||
mMonth = c.get(Calendar.MONTH);
|
||||
mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(PermissionRequestActivity.this,
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
txt_to_date.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year);
|
||||
}
|
||||
}, mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
}
|
||||
});
|
||||
|
||||
@ -200,9 +276,20 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
public void onTimeSet(TimePicker view, int hourOfDay,
|
||||
int minute) {
|
||||
|
||||
timeset="";
|
||||
if(hourOfDay>12)
|
||||
{
|
||||
hourOfDay-=12;
|
||||
timeSetFrom="PM";
|
||||
}
|
||||
else if(hourOfDay==0)
|
||||
{
|
||||
hourOfDay+=12;
|
||||
timeSetFrom="AM";
|
||||
}
|
||||
|
||||
|
||||
textTimeFrom.setText(hourOfDay + ":" + minute);
|
||||
textTimeFrom.setText(hourOfDay + ":" + minute + " " + timeSetFrom);
|
||||
}
|
||||
}, mHour, mMinute, false);
|
||||
timePickerDialog.show();
|
||||
@ -232,8 +319,19 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
int minute) {
|
||||
|
||||
|
||||
timeset="";
|
||||
if(hourOfDay>12)
|
||||
{
|
||||
hourOfDay-=12;
|
||||
timeset="PM";
|
||||
}
|
||||
else if(hourOfDay==0)
|
||||
{
|
||||
hourOfDay+=12;
|
||||
timeset="AM";
|
||||
}
|
||||
|
||||
textTimeTo.setText(hourOfDay + ":" + minute);
|
||||
textTimeTo.setText(hourOfDay + ":" + minute+" "+timeset);
|
||||
}
|
||||
}, mHour, mMinute, false);
|
||||
timePickerDialog.show();
|
||||
@ -249,6 +347,10 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void open_date() {
|
||||
|
||||
}
|
||||
|
||||
public void getPermission(){
|
||||
@ -266,12 +368,19 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
}
|
||||
try {
|
||||
_statusMessage = jsonObject.getString("_statusMessage");
|
||||
System.out.println("Status message: "+_statusMessage);
|
||||
loading.dismiss();
|
||||
new SweetAlertDialog(PermissionRequestActivity.this, SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("Permission successful")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sDialog) {
|
||||
sDialog.dismissWithAnimation();
|
||||
}
|
||||
}).show();
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Toast.makeText(PermissionRequestActivity.this, _statusMessage, Toast.LENGTH_SHORT).show();
|
||||
loading.dismiss();
|
||||
|
||||
}
|
||||
|
||||
}, new com.android.volley.Response.ErrorListener() {
|
||||
@ -297,7 +406,7 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
params.put("totime", textTimeTo.getText().toString());
|
||||
params.put("reason", edtRemarks.getText().toString());
|
||||
params.put("attachment", "");
|
||||
params.put("userid", "a");
|
||||
params.put("userid", RegisterUser);
|
||||
if(permission_code.equals("O")){
|
||||
params.put("startdate", fromDate);
|
||||
params.put("enddate", toDate);
|
||||
@ -451,7 +560,37 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
|
||||
Toast.makeText(PermissionRequestActivity.this, "Response successful2", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(PermissionRequestActivity.this, "Response successful2", Toast.LENGTH_SHORT).show();
|
||||
|
||||
try {
|
||||
JSONArray jsonArray=new JSONArray(response);
|
||||
for(int i=0;i<jsonArray.length();i++)
|
||||
{
|
||||
JSONObject jb1=jsonArray.getJSONObject(i);
|
||||
permission_code=jb1.getString("Permission_code");
|
||||
permission_type=jb1.getString("Permission_NameEN");
|
||||
|
||||
|
||||
// spinner_array.add(permission_type);
|
||||
// spinner_array.add
|
||||
|
||||
PermissionModel permissionModel=new PermissionModel();
|
||||
permissionModel.setPermission_NameEN(permission_type);
|
||||
permissionModel.setPermission_code(permission_code);
|
||||
permission_type_list.add(permissionModel);
|
||||
}
|
||||
|
||||
ArrayAdapter spinnerArrayAdapter = new ArrayAdapter
|
||||
(getApplicationContext(), android.R.layout.simple_spinner_item,
|
||||
permission_type_list); //selected item will look like a spinner set from XML
|
||||
spinnerArrayAdapter.setDropDownViewResource(android.R.layout
|
||||
.simple_spinner_dropdown_item);
|
||||
spinner.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
loading.dismiss();
|
||||
|
||||
|
||||
@ -463,14 +602,10 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
||||
// Log.d("error-=>",error.getMessage());
|
||||
Toast.makeText(PermissionRequestActivity.this, "Failed to get response = " + error.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
loading.dismiss();
|
||||
System.out.println("Error message: "+ error.getMessage());
|
||||
|
||||
|
||||
}
|
||||
System.out.println("Error message: "+ error.getMessage()); }
|
||||
})
|
||||
{
|
||||
|
||||
};
|
||||
Volley.newRequestQueue(PermissionRequestActivity.this).add(stringRequest);
|
||||
}
|
||||
}
|
||||
}}
|
@ -641,16 +641,9 @@ public class LoginActivityNew extends AppCompatActivity {
|
||||
editor.putString("Employeeid",_employeeid);
|
||||
editor.commit();
|
||||
|
||||
new SweetAlertDialog(LoginActivityNew.this, SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("Login successful")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sDialog) {
|
||||
Intent intent=new Intent(LoginActivityNew.this,RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}).show();
|
||||
Intent intent=new Intent(LoginActivityNew.this,RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -198,15 +198,8 @@ public class RegisterFragment extends BaseFragment {
|
||||
editor.putString("Employeeid",_employeeid);
|
||||
editor.commit();
|
||||
|
||||
new SweetAlertDialog(getContext(), SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("Success Registration")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sDialog) {
|
||||
Intent intent=new Intent(getContext(),RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}).show();
|
||||
Intent intent=new Intent(getContext(),RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -159,7 +159,7 @@
|
||||
android:layout_marginTop="25dp">
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/txtPDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Date"
|
||||
@ -183,6 +183,7 @@
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/txt_from_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="From Date"
|
||||
@ -205,6 +206,7 @@
|
||||
android:layout_marginTop="25dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_to_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="To Date"
|
||||
|
Loading…
x
Reference in New Issue
Block a user