Ejemplo n.º 1
0
    @Override
    public View getView(int arg0, View arg1, ViewGroup arg2) {
      // TODO Auto-generated method stub

      LayoutInflater inflater =
          (LayoutInflater) LogView.this.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);

      ViewHolder holder = null;

      if (arg1 == null) {

        arg1 = inflater.inflate(R.layout.loglistobject, null);

        holder = new ViewHolder();

        holder.CountsTv = (TextView) arg1.findViewById(R.id.counttv);

        holder.DateTv = (TextView) arg1.findViewById(R.id.datetV);

        holder.ExcerciseName = (TextView) arg1.findViewById(R.id.enametV);

        holder.Repetition = (TextView) arg1.findViewById(R.id.reptV);

        arg1.setTag(holder);
      } else {

        holder = (ViewHolder) arg1.getTag();
      }
      try {
        date = fromUser.parse(Log_Date.get(arg0));
      } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      String outputDateStr = myFormat.format(date);

      holder.CountsTv.setText(String.valueOf(arg0 + 1));

      holder.ExcerciseName.setText(Exc_Namel.get(arg0));

      holder.DateTv.setText(outputDateStr);

      holder.Repetition.setText(Log_reps.get(arg0) + " Reps");

      return arg1;
    }
Ejemplo n.º 2
0
    @Override
    protected void onPostExecute(String result) {
      // TODO Auto-generated method stub
      super.onPostExecute(result);

      Ed1.setText("");

      Ed2.setText("");

      Ed3.setText("");

      Ed4.setText("");

      if (done_is == true) {

        ConditionClas.Toastmethod(LogView.this, " " + MessageDisplay_Submit);
      }
      if (Methodcall.equalsIgnoreCase("submit")) {

        ConditionClas.Toastmethod(LogView.this, " " + MessageDisplay);

      } else if (Methodcall.equalsIgnoreCase("show")) {

        System.out.println("inside showLog_reps " + SiteList.Log_reps);
        System.out.println("inside show Exc_Namel " + SiteList.Exc_Name);
        System.out.println("inside showLog_Date " + SiteList.Log_Date);
        System.out.println("inside show Log_Ints " + SiteList.Log_Ints);
        System.out.println("inside show Log_Sets " + SiteList.Log_Sets);
        System.out.println("inside show exc_Name " + method(exc_Name));
        Log_reps.clear();

        Exc_Namel.clear();

        Log_Date.clear();

        Log_Ints.clear();

        Log_Sets.clear();

        for (int i = 0; i < SiteList.Exc_Name.size(); i++) {

          //					if(SiteList.Exc_Name.get(i).toLowerCase().
          //							contains(method(exc_Name).toLowerCase()))
          if (SiteList.Exces_Id.get(i).toLowerCase().contains(Id.toLowerCase())) {

            Log_reps.add(SiteList.Log_reps.get(i));

            Exc_Namel.add(SiteList.Exc_Name.get(i));

            Log_Date.add(SiteList.Log_Date.get(i));

            Log_Ints.add(SiteList.Log_Ints.get(i));

            Log_Sets.add(SiteList.Log_Sets.get(i));
          }
        }
        System.out.println("inside show");

        System.out.println("inside showLog_reps " + Log_reps);
        System.out.println("inside show Exc_Namel " + Exc_Namel);
        System.out.println("inside showLog_Date " + Log_Date);
        System.out.println("inside show Log_Ints " + Log_Ints);
        System.out.println("inside show Log_Sets " + Log_Sets);

        System.out.println("StatusStatusStatus " + Status);
        System.out.println("MessageDisplay    " + MessageDisplay);
        //				if (Status.equalsIgnoreCase("success"))
        //
        //				{
        System.out.println("inside if  ");
        System.out.println("MessageDisplay    " + MessageDisplay);

        Excercise.setAdapter(new CustomListExcercise());

        //					VideoList.setAdapter()
        VideoList.setAdapter(new CustomListVideo());

        //				}
        //
        //				else
        //
        //				{
        //					System.out.println(" in side elese " +
        //							"MessageDisplay    "+MessageDisplay);
        //
        //					twoValue[0] = " Error";
        //					VideoList.setAdapter(new ArrayAdapter<String>(LogView.this,
        //							android.R.layout.simple_list_item_1 ,
        //							android.R.id.text1 ,twoValue ));
        //					ConditionClas.Toastmethod(LogView.this, MessageDisplay);
        //
        //					Excercise.setAdapter(new ArrayAdapter<String>(LogView.this,
        //							android.R.layout.simple_list_item_1 ,
        //							android.R.id.text1 ,twoValue ));
        //					ConditionClas.Toastmethod(LogView.this, MessageDisplay);
        //
        //
        //				}

        /* This part checks is the log link hit was successful
         *  so on basis of that it shall set an adapter */

        if (StatusLog.equalsIgnoreCase("success")) {
          System.out.println("inside if StatusLog   ");
          if (MesageList.length() > 0) {

            //						SelectList.setAdapter(new CustomList());
            updateTable();

          } else {

            //						SelectList.setAdapter(new ArrayAdapter<String>(LogView.this,
            //								android.R.layout.simple_list_item_1 ,
            //								android.R.id.text1 ,SiteList.Error ));
          }
        }
      }
      dialog.dismiss();
    }