Exemplo n.º 1
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.config_product_done:
        Util.setChannelAreaCode(getActivity(), selectedAreaCode);
        Util.setChannelAreaName(getActivity(), selectedAreaName);

        if (isNoSelect) {
          selectedProductCode = adapter.getItem(0).getProductCode();
          selectedProductName = adapter.getItem(0).getProductName();
        }

        Util.setChannelProductCode(getActivity(), selectedProductCode);
        Util.setChannelProductName(getActivity(), selectedProductName);

        // 지역, 상품정보를 refresh
        Fragment fg = ((MainActivity) getActivity()).getFragmentConfig();
        if (fg != null) {
          ((ConfigMain) fg).refreshAreaProduct();
        }

        getActivity().onBackPressed();
        break;
    }
  }
Exemplo n.º 2
0
 private void showSearchProgram() {
   // check network and data loading
   if (Util.GetNetworkInfo(getActivity()) == 99) {
     Util.AlertShow(getActivity());
   } else {
     search = getArguments().getString("search");
     new SearchProgramAsyncTask().execute(search);
   }
 }
Exemplo n.º 3
0
 private void showProduct() {
   // check network and data loading
   if (Util.GetNetworkInfo(getActivity()) == 99) {
     Util.AlertShow(getActivity());
   } else {
     String url = UrlAddress.Channel.getGetChannelProduct(selectedAreaCode);
     new ProductAsyncTask().execute(url);
   }
 }
Exemplo n.º 4
0
    protected ArrayList<SearchProgram> doInBackground(String... params) {
      String areaCode = Util.getChannelAreaCode(getActivity());
      String productCode = Util.getChannelProductCode(getActivity());
      String requestURL =
          UrlAddress.Search.getSearchProgram(params[0], "0", "0", areaCode, productCode);
      SearchProgramParser parser = new SearchProgramParser(requestURL);

      elapsedTime = System.currentTimeMillis();
      parser.start();
      Log.i("hwang", "elapsedTime of search vod : " + (System.currentTimeMillis() - elapsedTime));

      list = parser.getList();
      return parser.getList().getList();
    }
Exemplo n.º 5
0
 public boolean isSameAreaCode() {
   if (selectedAreaCode != null) {
     if (Util.getChannelAreaCode(getActivity()).equals(selectedAreaCode)) return true;
     else return false;
   }
   return true;
 }
Exemplo n.º 6
0
 public int getPosition() {
   String productText;
   int pos = 0;
   for (int i = 0; i < adapter.getCount(); i++) {
     productText = adapter.getItem(i).getProductName();
     if (Util.getChannelProductName(getActivity())
         .replace(" ", "")
         .equals(productText.replace(" ", ""))) {
       pos = i;
       break;
     }
   }
   return pos;
 }
Exemplo n.º 7
0
    // onPostExecute displays the results of the AsyncTask.
    @Override
    protected void onPostExecute(ArrayList<SearchVod> result) {
      mResult = result;

      if (mResult == null) onCancelled();
      else {
        Log.i("hwang", "search vod result count : " + list.getTotalCount());

        if (!list.getResultCode().equals("100")) {
          String desc = Util.getErrorCodeDesc(list.getResultCode());
          Toast.makeText(getActivity(), desc, Toast.LENGTH_LONG).show();
        } else {
          adapter =
              new VodSemiDetailAdapter(getActivity(), R.layout.list_item_vod_semidetail, mResult);
          listView.setAdapter(adapter);
        }

        ((MainActivity) getActivity()).getMyProgressBar().dismiss();
      }
    }
Exemplo n.º 8
0
    @Override
    protected void onCancelled() {
      Util.onCancelled(getActivity());

      super.onCancelled();
    }