正在查看: St.John's v1.0.9 应用的 ParentConcernsDetailsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: St.John's v1.0.9 应用的 ParentConcernsDetailsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mcb.stjohnsemschool.activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.net.ConnectivityManager;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.mcb.stjohnsemschool.adapter.DetailAnnouncementAdapter;
import com.mcb.stjohnsemschool.model.FilePathModelClass;
import com.mcb.stjohnsemschool.model.NotSatisfactoryReasonsModelClass;
import com.mcb.stjohnsemschool.model.ParentConcernsDetailsModelClass;
import com.mcb.stjohnsemschool.services.ApiClient;
import com.mcb.stjohnsemschool.services.ApiInterface;
import com.mcb.stjohnsemschool.utils.ExpandedListViewCustom;
import com.mcb.stjohnsemschool.utils.TransparentProgressDialog;
import com.mcb.stjohnsemschool.utils.Utility;
import java.util.ArrayList;
import java.util.HashMap;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class ParentConcernsDetailsActivity extends BaseActivity implements View.OnClickListener {
public static ArrayList<FilePathModelClass> mFilepthList = new ArrayList<>();
public static AppCompatActivity myActivity;
private String academicYearId;
private String branchId;
private ConnectivityManager conMgr;
private String date;
private String enteredRemarks;
private String filepath;
private boolean isSatisfied;
private boolean isZonal;
private ImageView mAttendantImg;
private TextView mAttendantPickup;
private LinearLayout mChangeMonthlyFeePlanLL;
private LinearLayout mChangeRouteLL;
private Button mCloseConcern;
private TextView mCompanyAddress;
private TextView mConcernCategory;
private TextView mConcernDetails;
private TextView mConcernStatusTv;
private TextView mContactNo;
private DetailAnnouncementAdapter mDetailAdapterFilePath;
private TextView mDistance;
private TextView mDropPoint;
private TextView mDropTime;
private TextView mExistingBusNo;
private TextView mExistingDropPoint;
private TextView mExistingPickupPoint;
private TextView mExistingRoute;
private LinearLayout mExistingRouteDetailsLL;
private TextView mFatherBasicSalary;
private TextView mFatherDeductions;
private TextView mFatherGrossSalary;
private TextView mFatherHRA;
private TextView mFatherOccupation;
private TextView mFatherOtherAllowances;
private TextView mFeePlanDocumentsHeader;
private LinearLayout mFeePlanDocumentsLL;
private Typeface mLatoFont;
private ExpandedListViewCustom mListViewFilePath;
private TextView mMotherBasicSalary;
private TextView mMotherDeductions;
private TextView mMotherGrossSalary;
private TextView mMotherHRA;
private TextView mMotherOccupation;
private TextView mMotherOtherAllowances;
private TextView mNameOfTheCompany;
private TextView mNearestLandmark;
private RadioButton mNo;
private TextView mOfficialMail;
private TextView mPickUpByOthers;
private TextView mPickupPoint;
private TextView mPickupTime;
private TextView mPreferredDropPoint;
private TextView mPreferredPickupPoint;
private TextView mPreferredRoute;
private TextView mPreferredRouteAvailDate;
private LinearLayout mPreferredRouteDetailsLL;
private TransparentProgressDialog mProgressbar;
private TextView mReason;
private Spinner mReasonSpn;
private TextView mRemarks;
private EditText mRemarksEdt;
private TextView mRemarksHeader;
private LinearLayout mRequestForTransportLL;
private TextView mResidentialAddress;
private TextView mRoute;
private LinearLayout mSatisfactoryLL;
private TextView mSatisfiedMsg;
private SharedPreferences mSharedPref;
private Button mSubmit;
private TextView mTransportAvailDate;
private RadioButton mYes;
private RadioGroup mYesNo;
private String organisationId;
private String reason;
private ArrayList<NotSatisfactoryReasonsModelClass> reasons = new ArrayList<>();
private String referenceNo;
private int satisfied;
private int serviceRequestTicketId;
private String status;
private String studentEnrollmentId;
private int type;
private String userId;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_parent_concern_details);
myActivity = this;
this.mLatoFont = Typeface.createFromAsset(getAssets(), "Roboto-Regular.ttf");
SharedPreferences sharedPreferences = getSharedPreferences("", 0);
this.mSharedPref = sharedPreferences;
this.userId = sharedPreferences.getString("UseridKey", this.userId);
this.studentEnrollmentId = this.mSharedPref.getString("studentEnrollmentIdKey", this.studentEnrollmentId);
this.organisationId = this.mSharedPref.getString("orgnizationIdKey", this.organisationId);
this.branchId = this.mSharedPref.getString("BranchIdKey", this.branchId);
this.academicYearId = this.mSharedPref.getString("academicyearIdKey", this.academicYearId);
this.mProgressbar = new TransparentProgressDialog(myActivity, R.drawable.spinner_loading_imag);
Bundle extras = getIntent().getExtras();
this.date = extras.getString("CreatedDate");
this.referenceNo = extras.getString("TicketNumber");
this.filepath = extras.getString("FileName");
this.isSatisfied = extras.getBoolean("IsSatisfied");
this.isZonal = extras.getBoolean("IsZonal");
this.status = extras.getString("Status");
this.serviceRequestTicketId = extras.getInt("ServiceRequestTicketId");
this.type = extras.getInt("Type");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setTitle(this.date);
getSupportActionBar().setSubtitle(this.referenceNo);
setUpIds();
getFileDetails();
if (Build.VERSION.SDK_INT >= 23) {
getMultiplePermissions();
}
}
private void setUpIds() {
this.mListViewFilePath = findViewById(R.id.listview_event_filepath);
this.mRequestForTransportLL = (LinearLayout) findViewById(R.id.ll_request_for_transport);
this.mChangeRouteLL = (LinearLayout) findViewById(R.id.ll_change_route);
this.mExistingRouteDetailsLL = (LinearLayout) findViewById(R.id.ll_existing_bus_route_details);
this.mPreferredRouteDetailsLL = (LinearLayout) findViewById(R.id.ll_preferred_bus_route_details);
this.mChangeMonthlyFeePlanLL = (LinearLayout) findViewById(R.id.ll_change_monthly_fee_plan);
this.mFeePlanDocumentsLL = (LinearLayout) findViewById(R.id.ll_fee_documents);
this.mSatisfactoryLL = (LinearLayout) findViewById(R.id.ll_satisfactory);
this.mFeePlanDocumentsHeader = (TextView) findViewById(R.id.txv_fee_documents);
this.mConcernCategory = (TextView) findViewById(R.id.txv_concern_category);
this.mConcernDetails = (TextView) findViewById(R.id.txv_details_of_concern);
this.mRemarks = (TextView) findViewById(R.id.txv_remarks);
this.mRemarksHeader = (TextView) findViewById(R.id.txv_remarks_header);
this.mSatisfiedMsg = (TextView) findViewById(R.id.txv_are_you_satisfied);
this.mReason = (TextView) findViewById(R.id.txv_reason);
this.mConcernStatusTv = (TextView) findViewById(R.id.txv_c_status);
this.mResidentialAddress = (TextView) findViewById(R.id.txv_residential_address);
this.mNearestLandmark = (TextView) findViewById(R.id.txv_nearest_landmark);
this.mRoute = (TextView) findViewById(R.id.txv_route);
this.mPickupPoint = (TextView) findViewById(R.id.txv_pickup_point);
this.mDropPoint = (TextView) findViewById(R.id.txv_drop_point);
this.mTransportAvailDate = (TextView) findViewById(R.id.txv_date);
this.mDistance = (TextView) findViewById(R.id.txv_distance);
this.mAttendantPickup = (TextView) findViewById(R.id.txv_attendant_pickup);
this.mPickUpByOthers = (TextView) findViewById(R.id.txv_pickup_by_others);
this.mExistingRoute = (TextView) findViewById(R.id.txv_existing_route);
this.mExistingBusNo = (TextView) findViewById(R.id.txv_existing_bus_no);
this.mExistingPickupPoint = (TextView) findViewById(R.id.txv_existing_pickup_point);
this.mExistingDropPoint = (TextView) findViewById(R.id.txv_existing_drop_point);
this.mPickupTime = (TextView) findViewById(R.id.txv_pickup_time);
this.mDropTime = (TextView) findViewById(R.id.txv_drop_time);
this.mPreferredRoute = (TextView) findViewById(R.id.txv_preferred_route);
this.mPreferredPickupPoint = (TextView) findViewById(R.id.txv_preferred_pickup_point);
this.mPreferredDropPoint = (TextView) findViewById(R.id.txv_preferred_drop_point);
this.mPreferredRouteAvailDate = (TextView) findViewById(R.id.txv_preferred_avail_date);
this.mFatherOccupation = (TextView) findViewById(R.id.txv_father_occupation);
this.mMotherOccupation = (TextView) findViewById(R.id.txv_mother_occupation);
this.mNameOfTheCompany = (TextView) findViewById(R.id.txv_name_of_the_company);
this.mContactNo = (TextView) findViewById(R.id.txv_contact_number);
this.mOfficialMail = (TextView) findViewById(R.id.txv_official_email);
this.mCompanyAddress = (TextView) findViewById(R.id.txv_company_address);
this.mFatherGrossSalary = (TextView) findViewById(R.id.txv_father_gross_salary);
this.mFatherBasicSalary = (TextView) findViewById(R.id.txv_father_basic_salary);
this.mFatherHRA = (TextView) findViewById(R.id.txv_father_hra);
this.mFatherOtherAllowances = (TextView) findViewById(R.id.txv_father_other_allowances);
this.mFatherDeductions = (TextView) findViewById(R.id.txv_father_deductions);
this.mMotherGrossSalary = (TextView) findViewById(R.id.txv_mother_gross_salary);
this.mMotherBasicSalary = (TextView) findViewById(R.id.txv_mother_basic_salary);
this.mMotherHRA = (TextView) findViewById(R.id.txv_mother_hra);
this.mMotherOtherAllowances = (TextView) findViewById(R.id.txv_mother_other_allowances);
this.mMotherDeductions = (TextView) findViewById(R.id.txv_mother_deductions);
this.mAttendantImg = (ImageView) findViewById(R.id.img_attendant);
this.mYesNo = (RadioGroup) findViewById(R.id.rgp_yes_no);
this.mYes = (RadioButton) findViewById(R.id.rbtn_yes);
this.mNo = (RadioButton) findViewById(R.id.rbtn_no);
this.mReasonSpn = (Spinner) findViewById(R.id.spn_reasons);
this.mRemarksEdt = (EditText) findViewById(R.id.edt_remarks);
this.mSubmit = (Button) findViewById(R.id.btn_submit);
this.mCloseConcern = (Button) findViewById(R.id.btn_close_concern);
this.mSatisfiedMsg.setTypeface(this.mLatoFont);
this.mReason.setTypeface(this.mLatoFont);
this.mRemarksEdt.setTypeface(this.mLatoFont);
this.mSubmit.setTypeface(this.mLatoFont);
this.mCloseConcern.setTypeface(this.mLatoFont);
this.mConcernStatusTv.setTypeface(this.mLatoFont, 1);
if (this.status.length() > 0) {
this.mConcernStatusTv.setVisibility(0);
if (this.status.equalsIgnoreCase("Closed")) {
this.mConcernStatusTv.setTextColor(getResources().getColor(R.color.green));
} else if (this.status.equalsIgnoreCase("Open")) {
this.mConcernStatusTv.setTextColor(getResources().getColor(R.color.red));
} else if (this.status.equalsIgnoreCase("Can Escalate")) {
this.mConcernStatusTv.setTextColor(getResources().getColor(R.color.blue));
} else {
this.mConcernStatusTv.setTextColor(getResources().getColor(R.color.mcb_yellow));
}
this.mConcernStatusTv.setText(this.status);
} else {
this.mConcernStatusTv.setVisibility(8);
}
this.mSubmit.setOnClickListener(this);
this.mCloseConcern.setOnClickListener(this);
this.mYesNo.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
ParentConcernsDetailsActivity.this.mRemarksEdt.setText("");
ParentConcernsDetailsActivity.this.mReasonSpn.setSelection(0);
if (ParentConcernsDetailsActivity.this.mYes.isChecked()) {
ParentConcernsDetailsActivity.this.satisfied = 1;
ParentConcernsDetailsActivity.this.mReason.setVisibility(8);
ParentConcernsDetailsActivity.this.mReasonSpn.setVisibility(8);
ParentConcernsDetailsActivity.this.mRemarksEdt.setVisibility(8);
ParentConcernsDetailsActivity.this.mSubmit.setVisibility(8);
ParentConcernsDetailsActivity.this.mCloseConcern.setVisibility(0);
return;
}
ParentConcernsDetailsActivity.this.satisfied = 0;
ParentConcernsDetailsActivity.this.mReason.setVisibility(0);
ParentConcernsDetailsActivity.this.mReasonSpn.setVisibility(0);
ParentConcernsDetailsActivity.this.mRemarksEdt.setVisibility(0);
ParentConcernsDetailsActivity.this.mSubmit.setVisibility(0);
ParentConcernsDetailsActivity.this.mCloseConcern.setVisibility(8);
}
});
this.mReasonSpn.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
ParentConcernsDetailsActivity parentConcernsDetailsActivity = ParentConcernsDetailsActivity.this;
parentConcernsDetailsActivity.reason = ((NotSatisfactoryReasonsModelClass) parentConcernsDetailsActivity.reasons.get(i)).getReason();
}
});
this.mYes.setChecked(true);
if (this.status.equalsIgnoreCase("Closed") && !this.isSatisfied && !this.isZonal) {
this.mSatisfactoryLL.setVisibility(0);
getServiceReasons();
} else {
this.mSatisfactoryLL.setVisibility(8);
}
this.mRequestForTransportLL.setVisibility(8);
this.mChangeRouteLL.setVisibility(8);
this.mChangeMonthlyFeePlanLL.setVisibility(8);
int i = this.type;
if (i == 1) {
this.mChangeMonthlyFeePlanLL.setVisibility(0);
} else if (i == 2) {
this.mRequestForTransportLL.setVisibility(0);
} else if (i == 3) {
this.mChangeRouteLL.setVisibility(0);
}
getServiceTicketsRaisingDetails();
}
public void getFileDetails() {
mFilepthList = null;
mFilepthList = new ArrayList<>();
if (this.filepath.length() > 0) {
String replace = this.filepath.replace("\\", "/");
this.filepath = replace;
String replace2 = replace.replace(" ", "%20");
this.filepath = replace2;
String substring = replace2.substring(replace2.lastIndexOf("/") + 1);
FilePathModelClass filePathModelClass = new FilePathModelClass();
filePathModelClass.setFileName(substring);
filePathModelClass.setFilePath(this.filepath);
mFilepthList.add(filePathModelClass);
}
if (mFilepthList.size() > 0) {
DetailAnnouncementAdapter detailAnnouncementAdapter = new DetailAnnouncementAdapter(this, mFilepthList);
this.mDetailAdapterFilePath = detailAnnouncementAdapter;
this.mListViewFilePath.setAdapter(detailAnnouncementAdapter);
}
}
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (keyEvent.getKeyCode() != 4 || keyEvent.getAction() != 0) {
return false;
}
setResult(565, new Intent());
finish();
overridePendingTransition(R.anim.left_in, R.anim.right_out);
return true;
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == 16908332) {
super.onBackPressed();
return true;
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onClick(View view) {
if (view == this.mSubmit) {
this.enteredRemarks = this.mRemarksEdt.getText().toString().trim();
if (this.reason.length() > 0) {
if (this.enteredRemarks.length() > 0) {
updateServiceReasons();
return;
} else {
Toast.makeText(getApplicationContext(), "Please enter remarks", 0).show();
return;
}
}
Toast.makeText(getApplicationContext(), "Please select reason", 0).show();
return;
}
if (view == this.mCloseConcern) {
this.reason = "";
this.enteredRemarks = "";
updateServiceReasons();
}
}
private void getServiceTicketsRaisingDetails() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService("connectivity");
this.conMgr = connectivityManager;
if (connectivityManager.getActiveNetworkInfo() != null && this.conMgr.getActiveNetworkInfo().isAvailable() && this.conMgr.getActiveNetworkInfo().isConnected()) {
int i = this.type;
if (i == 1) {
getServiceTicketsRaisingMonthlyFeePlanFullDetails();
return;
} else if (i == 2 || i == 3) {
getServiceTicketsRaisingTransportFullDetails();
return;
} else {
getServiceTicketsRaisingFullDetails();
return;
}
}
Toast.makeText(getApplicationContext(), "Check your Network Connection", 0).show();
}
private void getServiceTicketsRaisingTransportFullDetails() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && !transparentProgressDialog.isShowing()) {
this.mProgressbar.show();
}
((ApiInterface) ApiClient.getClient1(getApplicationContext()).create(ApiInterface.class)).GetServiceTicketsRaisingTransportFullDetails(this.studentEnrollmentId, this.branchId, this.organisationId, this.academicYearId, this.userId, this.serviceRequestTicketId, Utility.getSchoolApiKey(this)).enqueue(new Callback<ParentConcernsDetailsModelClass>() {
public void onResponse(Call<ParentConcernsDetailsModelClass> call, Response<ParentConcernsDetailsModelClass> response) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
if (response != null && response.body() != null) {
ParentConcernsDetailsActivity.this.setDataToUI((ParentConcernsDetailsModelClass) response.body());
} else {
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
}
public void onFailure(Call<ParentConcernsDetailsModelClass> call, Throwable th) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
});
}
private void getServiceTicketsRaisingMonthlyFeePlanFullDetails() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && !transparentProgressDialog.isShowing()) {
this.mProgressbar.show();
}
((ApiInterface) ApiClient.getClient1(getApplicationContext()).create(ApiInterface.class)).GetServiceTicketsRaisingMonthlyFeePlanFullDetails(this.studentEnrollmentId, this.branchId, this.organisationId, this.academicYearId, this.userId, this.serviceRequestTicketId, Utility.getSchoolApiKey(this)).enqueue(new Callback<ParentConcernsDetailsModelClass>() {
public void onResponse(Call<ParentConcernsDetailsModelClass> call, Response<ParentConcernsDetailsModelClass> response) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
if (response != null && response.body() != null) {
ParentConcernsDetailsActivity.this.setDataToUI((ParentConcernsDetailsModelClass) response.body());
} else {
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
}
public void onFailure(Call<ParentConcernsDetailsModelClass> call, Throwable th) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
});
}
private void getServiceTicketsRaisingFullDetails() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && !transparentProgressDialog.isShowing()) {
this.mProgressbar.show();
}
((ApiInterface) ApiClient.getClient1(getApplicationContext()).create(ApiInterface.class)).GetServiceTicketsRaisingFullDetails(this.studentEnrollmentId, this.branchId, this.organisationId, this.academicYearId, this.userId, this.serviceRequestTicketId, Utility.getSchoolApiKey(this)).enqueue(new Callback<ParentConcernsDetailsModelClass>() {
public void onResponse(Call<ParentConcernsDetailsModelClass> call, Response<ParentConcernsDetailsModelClass> response) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
if (response != null && response.body() != null) {
ParentConcernsDetailsActivity.this.setDataToUI((ParentConcernsDetailsModelClass) response.body());
} else {
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
}
public void onFailure(Call<ParentConcernsDetailsModelClass> call, Throwable th) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
});
}
public void setDataToUI(com.mcb.stjohnsemschool.model.ParentConcernsDetailsModelClass r24) {
throw new UnsupportedOperationException("Method not decompiled: com.mcb.stjohnsemschool.activity.ParentConcernsDetailsActivity.setDataToUI(com.mcb.stjohnsemschool.model.ParentConcernsDetailsModelClass):void");
}
private void getServiceReasons() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService("connectivity");
this.conMgr = connectivityManager;
if (connectivityManager.getActiveNetworkInfo() != null && this.conMgr.getActiveNetworkInfo().isAvailable() && this.conMgr.getActiveNetworkInfo().isConnected()) {
getServiceRequestReasons();
} else {
Toast.makeText(getApplicationContext(), "Check your Network Connection", 0).show();
}
}
private void getServiceRequestReasons() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && !transparentProgressDialog.isShowing()) {
this.mProgressbar.show();
}
((ApiInterface) ApiClient.getClient1(getApplicationContext()).create(ApiInterface.class)).GetServiceRequestReasons(Utility.getSchoolApiKey(this)).enqueue(new Callback<ArrayList<NotSatisfactoryReasonsModelClass>>() {
public void onResponse(Call<ArrayList<NotSatisfactoryReasonsModelClass>> call, Response<ArrayList<NotSatisfactoryReasonsModelClass>> response) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
if (response != null && response.body() != null) {
ParentConcernsDetailsActivity.this.reasons.clear();
ParentConcernsDetailsActivity.this.reasons = (ArrayList) response.body();
ParentConcernsDetailsActivity.this.mReasonSpn.setAdapter((SpinnerAdapter) new ArrayAdapter(ParentConcernsDetailsActivity.this.getApplicationContext(), R.layout.custom_textview, ParentConcernsDetailsActivity.this.reasons));
return;
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
public void onFailure(Call<ArrayList<NotSatisfactoryReasonsModelClass>> call, Throwable th) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
});
}
private void updateServiceReasons() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService("connectivity");
this.conMgr = connectivityManager;
if (connectivityManager.getActiveNetworkInfo() != null && this.conMgr.getActiveNetworkInfo().isAvailable() && this.conMgr.getActiveNetworkInfo().isConnected()) {
updateServiceTicket();
} else {
Toast.makeText(getApplicationContext(), "Check your Network Connection", 0).show();
}
}
private void updateServiceTicket() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && !transparentProgressDialog.isShowing()) {
this.mProgressbar.show();
}
HashMap hashMap = new HashMap();
hashMap.put("UserID", this.userId);
hashMap.put("ServiceRequestTicketID", String.valueOf(this.serviceRequestTicketId));
hashMap.put("IsSatisfied", String.valueOf(this.satisfied));
hashMap.put("NotSatisfiedReason", this.reason);
hashMap.put("Remarks", this.enteredRemarks);
hashMap.put("apikey", Utility.getSchoolApiKey(this));
((ApiInterface) ApiClient.getClient1(getApplicationContext()).create(ApiInterface.class)).UpdateServiceTicket(hashMap).enqueue(new Callback<String>() {
public void onResponse(Call<String> call, Response<String> response) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
if (response != null && response.body() != null) {
String str = (String) response.body();
AlertDialog.Builder builder = new AlertDialog.Builder(ParentConcernsDetailsActivity.this);
builder.setMessage(str).setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (ParentConcernRequestsActivity.myActivity != null) {
ParentConcernRequestsActivity.myActivity.finish();
}
ParentConcernsDetailsActivity.this.startActivity(new Intent(ParentConcernsDetailsActivity.this.getApplicationContext(), (Class<?>) ParentConcernRequestsActivity.class));
ParentConcernsDetailsActivity.this.finish();
}
}).setCancelable(false);
builder.create().show();
return;
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
public void onFailure(Call<String> call, Throwable th) {
if (ParentConcernsDetailsActivity.this.mProgressbar != null && ParentConcernsDetailsActivity.this.mProgressbar.isShowing()) {
ParentConcernsDetailsActivity.this.mProgressbar.dismiss();
}
Utility.showAlertDialog(ParentConcernsDetailsActivity.myActivity);
}
});
}
protected void onResume() {
super.onResume();
String string = this.mSharedPref.getString("usernamekey", "");
Bundle bundle = new Bundle();
bundle.putString("user_name", string);
FirebaseAnalytics.getInstance(this).logEvent("PAGE_PARENT_CONCERN_DETAILS", bundle);
}
protected void onStop() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && transparentProgressDialog.isShowing()) {
this.mProgressbar.dismiss();
}
super.onStop();
}
}