示例#1
0
  public static ProgressDialog createProgressDialogWithMessage(Context mContext, String msg) {
    ProgressDialog dialog = new ProgressDialog(mContext);
    try {
      dialog.show();
    } catch (WindowManager.BadTokenException e) {

    }
    dialog.setCancelable(false);
    dialog.setContentView(R.layout.progressdialog);

    CustomTextView lblLoadingMessage = (CustomTextView) dialog.findViewById(R.id.lblLoadingMessage);
    lblLoadingMessage.setVisibility(View.VISIBLE);

    lblLoadingMessage.setText(msg);

    Window window = dialog.getWindow();
    WindowManager.LayoutParams windowParams = window.getAttributes();

    windowParams.dimAmount = 0.90f;
    windowParams.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND;
    window.setAttributes(windowParams);
    // dialog.setMessage(Message);
    return dialog;
  }
示例#2
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup myFragmentView =
        (ViewGroup) inflater.inflate(R.layout.fragment_patient_information, container, false);

    CustomTextView lblAllergyRiskNotes =
        (CustomTextView) myFragmentView.findViewById(R.id.lblAllergyRiskNotes);
    lblAllergyRiskNotes.setText(Html.fromHtml(getString(R.string.lblAllergyRiskNotes)));
    Linkify.addLinks(lblAllergyRiskNotes, Linkify.WEB_URLS);

    imgPatientPhoto = (ImageView) myFragmentView.findViewById(R.id.patient_photo);
    etPatientsFName = (CustomEditTextView) myFragmentView.findViewById(R.id.etPatientsFName);
    etPatientsMName = (CustomEditTextView) myFragmentView.findViewById(R.id.etPatientsMName);
    etPatientsLName = (CustomEditTextView) myFragmentView.findViewById(R.id.etPatientsLName);
    etIWasBornDate = (CustomEditTextView) myFragmentView.findViewById(R.id.etIWasBornDate);
    etBornAt = (CustomEditTextView) myFragmentView.findViewById(R.id.etBornAt);
    etIWasDeliveredBy = (CustomEditTextView) myFragmentView.findViewById(R.id.etIWasDeliveredBy);
    etWhenIWasBornIWeighed =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etWhenIWasBornIWeighed);
    etAndIMeasured = (CustomEditTextView) myFragmentView.findViewById(R.id.etAndIMeasured);
    etGrowthTrackerHead =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etGrowthTrackerHead);
    etGrowthTrackerChest =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etGrowthTrackerChest);
    etGrowthTrackerAbdomen =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etGrowthTrackerAbdomen);
    etCircumcisedOn = (CustomEditTextView) myFragmentView.findViewById(R.id.etCircumcisedOn);
    etEarsPiercedOn = (CustomEditTextView) myFragmentView.findViewById(R.id.etEarsPiercedOn);
    etDistinguishingMarks =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etDistinguishingMarks);
    etNewBornScreening = (CustomEditTextView) myFragmentView.findViewById(R.id.etNewBornScreening);
    etVaccinationsGiven =
        (CustomEditTextView) myFragmentView.findViewById(R.id.etVaccinationsGiven);
    etMomFName = (CustomEditTextView) myFragmentView.findViewById(R.id.etMomFName);
    etMomMName = (CustomEditTextView) myFragmentView.findViewById(R.id.etMomMName);
    etMomLName = (CustomEditTextView) myFragmentView.findViewById(R.id.etMomLName);
    etSheWorksAt = (CustomEditTextView) myFragmentView.findViewById(R.id.etSheWorksAt);
    etSheWorksAtAs = (CustomEditTextView) myFragmentView.findViewById(R.id.etSheWorksAtAs);
    etHerHMOIs = (CustomEditTextView) myFragmentView.findViewById(R.id.etHerHMOIs);
    etDadFName = (CustomEditTextView) myFragmentView.findViewById(R.id.etDadFName);
    etDadMName = (CustomEditTextView) myFragmentView.findViewById(R.id.etDadMName);
    etDadLName = (CustomEditTextView) myFragmentView.findViewById(R.id.etDadLName);
    etHeWorksAt = (CustomEditTextView) myFragmentView.findViewById(R.id.etHeWorksAt);
    etHeWorksAtAs = (CustomEditTextView) myFragmentView.findViewById(R.id.etHeWorksAtAs);
    etHisHMOIs = (CustomEditTextView) myFragmentView.findViewById(R.id.etHisHMOIs);
    etILiveAtAddress1 = (CustomEditTextView) myFragmentView.findViewById(R.id.etILiveAtAddress1);
    etILiveAtAddress2 = (CustomEditTextView) myFragmentView.findViewById(R.id.etILiveAtAddress2);

    spinnerMyMomGaveBirthToMeThrough =
        (Spinner) myFragmentView.findViewById(R.id.spinnerMyMomGaveBirthToMeThrough);
    CustomAdapter adapterMyMomGaveBirthToMeThrough =
        new CustomAdapter(
            getActivity(),
            android.R.layout.simple_spinner_item,
            ICareApplication.populateTypeOfDelivery());
    spinnerMyMomGaveBirthToMeThrough.setAdapter(adapterMyMomGaveBirthToMeThrough);

    spinnerAllergyRisk = (Spinner) myFragmentView.findViewById(R.id.spinnerAllergyRisk);
    CustomAdapter adapterAllergyRisk =
        new CustomAdapter(
            getActivity(),
            android.R.layout.simple_spinner_item,
            ICareApplication.populateAllergyRisk());
    spinnerAllergyRisk.setAdapter(adapterAllergyRisk);
    //         Log.d("mParamPatientData.getPatientphoto().length",
    // ""+mParamPatientData.getPatientphoto().length);
    if (mParamMyPicture != null) {
      Bitmap bMap = BitmapFactory.decodeByteArray(mParamMyPicture, 0, mParamMyPicture.length);
      imgPatientPhoto.setBackground(Utils.resizedBitmapDisplay(getActivity(), bMap));
    }

    etPatientsFName.setText(mParamPatientData.getFirtname());
    etPatientsMName.setText(mParamPatientData.getMiddlename());
    etPatientsLName.setText(mParamPatientData.getLastname());

    etIWasBornDate.setText(mParamPatientData.getbDate());
    etBornAt.setText(mParamPatientData.getbPlace());
    etIWasDeliveredBy.setText(mParamPatientData.getDrName());

    // Set Selection Delivery Type
    int spinnerPosition =
        adapterMyMomGaveBirthToMeThrough.getPosition(mParamPatientData.getDeliveryType());
    spinnerMyMomGaveBirthToMeThrough.setSelection(spinnerPosition);

    etWhenIWasBornIWeighed.setText(mParamPatientData.getpWeight());
    etAndIMeasured.setText(mParamPatientData.getpHeight());
    etGrowthTrackerHead.setText(mParamPatientData.getpHead());
    etGrowthTrackerChest.setText(mParamPatientData.getpChest());
    etGrowthTrackerAbdomen.setText(mParamPatientData.getpAbdomen());

    // Set Selection Delivery Type
    int spinnerPositionAllergy = adapterAllergyRisk.getPosition(mParamPatientData.getAllergyRisk());
    spinnerAllergyRisk.setSelection(spinnerPositionAllergy);

    etCircumcisedOn.setText(mParamPatientData.getpCircumcisedOn());
    etEarsPiercedOn.setText(mParamPatientData.getpEarPiercedOn());
    etDistinguishingMarks.setText(mParamPatientData.getpDistinguishingMarks());

    etNewBornScreening.setText(mParamPatientData.getpNewbornScreening());
    etVaccinationsGiven.setText(mParamPatientData.getpVaccinationsGiven());

    etMomFName.setText(mParamPatientData.getpMomsFname());
    etMomMName.setText(mParamPatientData.getpMomsMname());
    etMomLName.setText(mParamPatientData.getpMomsLname());
    etSheWorksAt.setText(mParamPatientData.getpMomsWorkPlace());
    etSheWorksAtAs.setText(mParamPatientData.getpMomsWorkAs());
    etHerHMOIs.setText(mParamPatientData.getpMomsHMO());

    etDadFName.setText(mParamPatientData.getpDadsFname());
    etDadMName.setText(mParamPatientData.getpDadsMname());
    etDadLName.setText(mParamPatientData.getpDadsLname());
    etHeWorksAt.setText(mParamPatientData.getpDadsWorkPlace());
    etHeWorksAtAs.setText(mParamPatientData.getpDadsWorkAs());
    etHisHMOIs.setText(mParamPatientData.getpDadsHMO());

    etILiveAtAddress1.setText(mParamPatientData.getpAddress1());
    etILiveAtAddress2.setText(mParamPatientData.getpAddress2());

    return myFragmentView;
  }