Exemplo n.º 1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.repeat_dialog);
   setTitle(REPEAT);
   repeatRepEdit = (EditText) findViewById(R.id.repeatRepEdit);
   repeatUntilDate = (TextView) findViewById(R.id.repeatUntilDate);
   repeatRepEdit.setOnClickListener(this);
   repeatUntilDate.setOnClickListener(this);
   repeatRepRow = (TableRow) findViewById(R.id.repeatRepRow);
   repeatUntilRow = (TableRow) findViewById(R.id.repeatUntilRow);
   repeatRepRow.setOnClickListener(this);
   repeatUntilRow.setOnClickListener(this);
   repeatRepRadio = (RadioButton) findViewById(R.id.repeatRepRadio);
   repeatUntilRadio = (RadioButton) findViewById(R.id.repeatUntilRadio);
   repeatRepRadio.setOnClickListener(this);
   repeatUntilRadio.setOnClickListener(this);
   yes = (Button) findViewById(R.id.btn_yes);
   no = (Button) findViewById(R.id.btn_no);
   yes.setOnClickListener(this);
   no.setOnClickListener(this);
   if (null != rule && rule.getUntil() == null && rule.getCount() == null) {
     repeatRepEdit.performClick();
     repeatRepEdit.setText("1");
   }
 }
    @Override
    public View getView(final int position, View view, ViewGroup parent) {
      if (view == null) view = getLayoutInflater().inflate(R.layout.list_single, null, false);

      final ElementManager currentElement = elementsList.get(position);
      TableRow tableRow = (TableRow) view.findViewById(R.id.tablerow);
      tableRow.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              Bundle bundle = new Bundle();
              bundle.putInt("advertid", currentElement.getId());
              Intent detail = new Intent(IlanAraActivity.this, IlanActivity.class);
              detail.putExtras(bundle);
              startActivity(detail);
            }
          });
      TextView section = (TextView) view.findViewById(R.id.section);
      TextView location = (TextView) view.findViewById(R.id.location);
      TextView price = (TextView) view.findViewById(R.id.price);
      section.setText(currentElement.getBaslik());
      location.setText(currentElement.getKonum());
      price.setText(currentElement.getFiyat());
      ImageView img = (ImageView) view.findViewById(R.id.img);
      Basic b = new Basic();
      Bitmap map = b.decompressImage(currentElement.getResim());
      img.setScaleType(ImageView.ScaleType.FIT_XY);
      img.setImageBitmap(map);
      return view;
    }
Exemplo n.º 3
0
 public void addTableBody(TableLayout table) {
   Cursor cursor = mySQLiteHelper.executeQuery(this.buildTableQuery());
   int row = 0;
   if (cursor != null && cursor.moveToFirst()) {
     do {
       TableRow tr = new TableRow(getActivity());
       tr.setGravity(Gravity.CENTER);
       for (int i = 0; i < columnNames.length; i++) {
         String value = cursor.getString(cursor.getColumnIndex(columnNames[i]));
         TextView tv = getCellTextView(value, row);
         tr.addView(tv);
       }
       table.addView(tr);
       Long id = cursor.getLong(cursor.getColumnIndex("_id"));
       tr.setTag(id);
       tr.setOnClickListener(
           new View.OnClickListener() {
             @Override
             public void onClick(View v) {
               Long id = Long.valueOf(v.getTag().toString());
               String xml = formBuilder.buildFormSubmissionXMLString(form, id);
               ((FormDataActivity) getActivity()).switchToDisplayFormFragment(1, xml);
             }
           });
       row++;
     } while (cursor.moveToNext());
   }
 }
Exemplo n.º 4
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tabmore_list);

    livechat = (TableRow) findViewById(R.id.tbl_more_livechat);
    livechat.setOnClickListener(this);

    signin = (TableRow) findViewById(R.id.tbl_signin);
    signin.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent sign = new Intent(getApplicationContext(), FacebookLogin.class);
            startActivity(sign);
          }
        });
  }
  public void displayPopupControl() {
    log.debug("displayPopupControl");
    // popupControl_flag = true;

    LayoutInflater layoutInflater =
        (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    TableLayout viewGroup = (TableLayout) findViewById(R.id.popup_list_control_id);
    View layout = layoutInflater.inflate(R.layout.popup_control, viewGroup);

    int popControlWindowWidth = getWindowManager().getDefaultDisplay().getWidth() - 100;
    int popControlWindowHeight = LayoutParams.WRAP_CONTENT;

    popControlWindow = new PopupWindow(layout, popControlWindowWidth, popControlWindowHeight);
    popControlWindow.setBackgroundDrawable(new BitmapDrawable());
    popControlWindow.setOutsideTouchable(true);
    popControlWindow.setFocusable(true);
    popControlWindow.setTouchable(true);

    int y = getWindowManager().getDefaultDisplay().getHeight() / 5;
    int x = 50; // getWindowManager().getDefaultDisplay().getWidth()-150;

    log.debug("x[" + x + "]y[" + y + "]");
    popControlWindow.showAtLocation(layout, Gravity.NO_GRAVITY, x, y);

    TableRow tableRowHomeId = (TableRow) layout.findViewById(R.id.tableRowHomeId);

    // Show
    tableRowHomeId.setVisibility(View.VISIBLE);

    Button homeButton = (Button) layout.findViewById(R.id.controlHomeBtn);
    Button homeButtonImg = (Button) layout.findViewById(R.id.controlHomeBtn_Temp);

    tableRowHomeId.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            Intent intent = new Intent(FeedMainItemLocalActivity.this, MainActivity.class);
            intent.putExtra("APP_CONFIG_MAP", appConfig);
            startActivity(intent);
          }
        });
    homeButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            Intent intent = new Intent(FeedMainItemLocalActivity.this, MainActivity.class);
            intent.putExtra("APP_CONFIG_MAP", appConfig);
            startActivity(intent);
          }
        });

    popControlWindow.update();
  }
  public void dispControlOnLongTouchItemInListView() {
    log.debug("dispControlOnLongTouchItemInListView");

    LayoutInflater layoutInflater =
        (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    TableLayout viewGroup = (TableLayout) findViewById(R.id.popup_list_control_id);
    View layout = layoutInflater.inflate(R.layout.popup_control, viewGroup);

    popControlWindow2 =
        new PopupWindow(layout, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

    popControlWindow2.setBackgroundDrawable(new BitmapDrawable());
    popControlWindow2.setOutsideTouchable(true);
    popControlWindow2.setFocusable(true);
    popControlWindow2.setTouchable(true);

    int y = 150;
    int x = getWindowManager().getDefaultDisplay().getWidth() - 150;

    log.debug("x[" + x + "]y[" + y + "]");
    popControlWindow2.showAtLocation(layout, Gravity.CENTER_VERTICAL, 0, 0);

    TableRow tableRowSearchId = (TableRow) layout.findViewById(R.id.tableRowSearchId);
    TableRow tableRowSaveId = (TableRow) layout.findViewById(R.id.tableRowSaveId);
    TableRow tableRowBookmarkId = (TableRow) layout.findViewById(R.id.tableRowBookmarkId);
    TableRow tableRowDelId = (TableRow) layout.findViewById(R.id.tableRowDelId);
    TableRow tableRowRefreshId = (TableRow) layout.findViewById(R.id.tableRowRefreshId);
    TableRow tableRowHomeId = (TableRow) layout.findViewById(R.id.tableRowHomeId);
    TableRow tableRowTopId = (TableRow) layout.findViewById(R.id.tableRowTopId);
    TableRow tableRowBottomId = (TableRow) layout.findViewById(R.id.tableRowBottomId);
    TableRow tableRowAnnounceId = (TableRow) layout.findViewById(R.id.tableRowAnnounceId);

    // Hide
    tableRowSearchId.setVisibility(View.GONE);
    tableRowRefreshId.setVisibility(View.GONE);
    tableRowAnnounceId.setVisibility(View.GONE);
    tableRowSaveId.setVisibility(View.GONE);
    tableRowBookmarkId.setVisibility(View.GONE);
    tableRowHomeId.setVisibility(View.GONE);
    tableRowTopId.setVisibility(View.GONE);
    tableRowBottomId.setVisibility(View.GONE);

    Button delButton = (Button) layout.findViewById(R.id.controlDelBtn);

    if (Constants.FEED_TYPE_ARTICLE.equalsIgnoreCase(feedType)) {
      delButton.setText("ลบข้อมูล");
    } else {
      delButton.setText("ลบบุ็คมาร์ค");
    }

    tableRowDelId.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            removeTopic();
            popControlWindow2.dismiss();
          }
        });
    delButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            removeTopic();
            popControlWindow2.dismiss();
          }
        });

    popControlWindow2.update();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // requestWindowFeature(Window.F)
    setContentView(R.layout.grid_layout);

    trLocatMe = (TableRow) findViewById(R.id.trLocateMe);
    trDistrict = (TableRow) findViewById(R.id.trDistrict);
    trUniversity = (TableRow) findViewById(R.id.trUniversity);
    trHospital = (TableRow) findViewById(R.id.trHospital);
    trFireStation = (TableRow) findViewById(R.id.trFireStation);
    trSearchCategory = (TableRow) findViewById(R.id.trSearchCategory);
    trSearchName = (TableRow) findViewById(R.id.trSearchName);

    //		RequestThread thread = new RequestThread();
    //		thread.start();

    trLocatMe.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            CommonStatic.mapFlagForPOI = false;
            Intent intentToMap = new Intent(GridActivity.this, MapLocateMe.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
            /*View view=LocateMeGroup.group.getLocalActivityManager()
            		.startActivity("MapLocateMe",intentToMap.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
            		.getDecorView();
            LocateMeGroup.group.replaceView(view);*/
          }
        });
    trDistrict.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intentToMap = new Intent(GridActivity.this, DistrictActivity.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
          }
        });
    trUniversity.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intentToMap = new Intent(GridActivity.this, UniversityActivity.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
          }
        });
    trHospital.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intentToMap = new Intent(GridActivity.this, HospitalActivity.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
          }
        });
    trFireStation.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intentToMap = new Intent(GridActivity.this, FireStationActivity.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
          }
        });
    trSearchCategory.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intentToMap = new Intent(GridActivity.this, SearchGroup.class);
            intentToMap.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intentToMap);
          }
        });
    trSearchName.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent i = new Intent(GridActivity.this, MyActivityGroup.class);
            i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(i);
            // finish();
          }
        });
  }
Exemplo n.º 8
0
  private void TabloDoldur() {
    try {

      Integer count = 0;
      YeDatabase db = new YeDatabase(this);
      final ObDataBase yDb = new ObDataBase(this);
      db.open();
      final Cursor cursor = db.QueryTbDataBases();
      tlResults.removeAllViews();
      while (cursor.moveToNext()) {

        yDb.ID = cursor.getInt(0);
        yDb.Name = cursor.getString(1);
        yDb.Instance = cursor.getString(2);
        yDb.Ip = cursor.getString(3);
        yDb.Port = cursor.getString(4);
        yDb.User = cursor.getString(5);
        yDb.Pass = cursor.getString(6);
        yDb.InUse = cursor.getInt(7);
        yDb.Description = cursor.getString(8);

        LayoutInflater inflater =
            (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        TableRow tr = (TableRow) inflater.inflate(R.layout.satir, null);

        tr.setId(100 + count);
        tr.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

        TextView labelDesc = new TextView(this, null, R.style.BodyText);
        labelDesc.setId(200 + count);
        labelDesc.setText(yDb.Description);
        tr.addView(labelDesc);

        TextView labelIp = new TextView(this, null, R.style.BodyText);
        labelIp.setId(200 + count);
        labelIp.setText(yDb.Ip);
        tr.addView(labelIp);

        TextView labelName = new TextView(this);
        labelName.setId(200 + count);
        labelName.setText(yDb.Name);
        tr.addView(labelName);

        RadioButton labelInUse = new RadioButton(this);
        labelInUse.setId(200 + count);
        labelInUse.setTag(200 + "");
        labelInUse.setGravity(Gravity.CENTER_VERTICAL);
        labelInUse.setGravity(Gravity.CENTER_HORIZONTAL);
        labelInUse.setEnabled(false);

        // rdgActiveData.addView(labelInUse);
        if (yDb.InUse == 1) labelInUse.setChecked(true);
        else labelInUse.setChecked(false);

        tr.addView(labelInUse);

        tlResults.addView(
            tr, new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
        count++;

        tr.setOnClickListener(
            new OnClickListener() {
              @Override
              public void onClick(View view) {
                DetayDoldur((TableRow) view);
              }
            });
        tr.setOnLongClickListener(
            new OnLongClickListener() {

              @Override
              public boolean onLongClick(View v) {
                SetAktifVeriTabani((TableRow) v);
                return true;
              }
            });
      }
    } catch (Exception e) {
      Toast.makeText(this, "detay göster" + e.getMessage(), Toast.LENGTH_LONG).show();
    }
  }