Ejemplo n.º 1
0
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
      case R.id.detect_start_localize_button:
        ConnectivityManager cm =
            (ConnectivityManager)
                this.getApplicationContext().getSystemService(CONNECTIVITY_SERVICE);
        NetworkInfo networkInfo = cm.getActiveNetworkInfo();
        if (networkInfo == null || !networkInfo.isConnected()) {
          myHandler.post(new FailConnectInternet());
          return;
        }

        if (((String) listTypeSpinner.getSelectedItem()).equals("GPS")) {
          LocationManager locationManager =
              (LocationManager) getSystemService(Context.LOCATION_SERVICE);
          if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
            Toast.makeText(getApplicationContext(), "Gps Disabled", Toast.LENGTH_SHORT).show();

            return;
          }
        }

        startLocalizeButton.setEnabled(false);
        startLocalizeButton.setFocusable(false);
        stopLocalizeButton.setEnabled(true);
        stopLocalizeButton.setFocusable(true);
        listTypeSpinner.setEnabled(false);
        listTypeSpinner.setFocusable(false);

        countInt = 0;

        if (((String) listTypeSpinner.getSelectedItem()).equals("WIFI")) {
          wifiDetector.setConvert(convertCheckbox.isChecked());
          wifiDetector.startDetectLocation();
        } else {
          gpsDetector.startDetectLocation();
        }
        break;

      case R.id.detect_stop_localize_button:
        startLocalizeButton.setEnabled(true);
        startLocalizeButton.setFocusable(true);
        stopLocalizeButton.setEnabled(false);
        stopLocalizeButton.setFocusable(false);
        listTypeSpinner.setEnabled(true);
        listTypeSpinner.setFocusable(true);

        if (((String) listTypeSpinner.getSelectedItem()).equals("WIFI")) {
          wifiDetector.stopDectectLocation();
        } else {
          gpsDetector.stopDectectLocation();
        }
        break;

      default:
        break;
    }
  }
Ejemplo n.º 2
0
  public void installcomplete()
      throws IOException, InterruptedException, TimeoutException, RootDeniedException {
    recovery();
    File file = new File("/system/etc/dreamnarae.sh");
    if (file.length() > 0) {
      RootTools.remount("/system/", "RW");
      CommandCapture command =
          new CommandCapture(
              0,
              "busybox touch /system/98banner_dreamnarae_prev",
              "echo check > /system/98banner_dreamnarae_prev",
              "chmod 755 /system/98banner_dreamnarae_prev");
      RootTools.getShell(true).add(command).waitForFinish();
      Log.d("Install", "Install Success!");
      success_dn();
      if (new File("/system/98banner_dreamnarae_prev").exists()) {
        apply.setEnabled(false);
        apply.setFocusable(false);
        imageview.setImageResource(R.drawable.apply);
      } else {
      }

    } else {
      fail_dn();
    }
  }
Ejemplo n.º 3
0
 @Override
 protected void onBindView(View view) {
   super.onBindView(view);
   mButton = (Button) view.findViewById(R.id.preference_button);
   mButton.setText(mText);
   mButton.setFocusable(false);
   mButton.setOnClickListener(this);
 }
Ejemplo n.º 4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.subject);

    filter_tab = (LinearLayout) findViewById(R.id.filter_tab);
    LogUtil.d("&&&&&&&&&", filter_tab.getWidth() + "--------width---" + filter_tab.getHeight());

    mFilter = (Button) findViewById(R.id.subject_search);
    mFilter.setFocusable(true);
    mFilter.setClickable(true);
    mFilter.setOnClickListener(this);

    mSearchIB = (ImageButton) findViewById(R.id.subject_search_value);
    mSearchIB.setOnClickListener(this);
    home = (ImageButton) findViewById(R.id.menu_control_level1_but);
    home.setOnClickListener(this);
    initNav();
    lv = (LoadingView) findViewById(R.id.data_loading);
    prlistView = (PullToRefreshListView) findViewById(R.id.obj_list);
    prlistView.setOnRefreshListener(
        new OnRefreshListener() {
          @Override
          public void onRefresh() {
            new GetDataTask().execute();
          }

          @Override
          public void onLoadMore() {
            // TODO Auto-generated method stub
            new GetDataTask().execute();
          }
        });

    data = new ArrayList<SubjectVo>();
    prlistView.setOnItemClickListener(this);

    filterContent = (LinearLayout) findViewById(R.id.filter_content);
    mFilterExpand = (FilterExpand) findViewById(R.id.filter_expand);

    mFilterLatest = (Button) findViewById(R.id.filter_latest);
    mFilterPopularity = (Button) findViewById(R.id.filter_popularity);
    mFilterStar = (Button) findViewById(R.id.filter_price);
    mFilterLatest.setOnClickListener(this);
    mFilterPopularity.setOnClickListener(this);
    mFilterStar.setOnClickListener(this);
    loadAnim(filterContent);
  }
Ejemplo n.º 5
0
  private void showQRCodeAndAddress() {
    try {
      // set qr image
      ImageView imageQR = (ImageView) rootView.findViewById(R.id.qr_code);
      // get qr image

      Bitmap bitmapQR =
          generateBitmap(
              user_address_wallet,
              width,
              height,
              GeneratorQR.MARGIN_AUTOMATIC,
              colorQR,
              colorBackQR);

      imageQR.setImageBitmap(bitmapQR);
      // show qr image
      imageQR.setVisibility(View.VISIBLE);

      // set string_address
      TextView string_address = (TextView) rootView.findViewById(R.id.string_address);
      string_address.setText(user_address_wallet);
      // show string_address
      string_address.setVisibility(View.VISIBLE);

      // show share_btn
      Button share_btn = (Button) rootView.findViewById(R.id.share_btn);
      share_btn.setEnabled(true);
      share_btn.setFocusable(true);
      share_btn.setTextColor(Color.parseColor("#72af9c"));
    } catch (WriterException writerException) {
      referenceWalletSession
          .getErrorManager()
          .reportUnexpectedUIException(
              UISource.ACTIVITY,
              UnexpectedUIExceptionSeverity.CRASH,
              FermatException.wrapException(writerException));
      Toast.makeText(
              getActivity().getApplicationContext(),
              "Oooops! recovering from system error",
              Toast.LENGTH_SHORT)
          .show();
    }
  }
Ejemplo n.º 6
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.prev);
    apply = (Button) findViewById(R.id.apply);
    imageview = (ImageView) findViewById(R.id.imageview);
    apply.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            apply.setEnabled(false);
            apply.setFocusable(false);
            startDownload(v);
            Handler mHandler = new Handler();
            mHandler.postDelayed(
                new Runnable() {
                  @Override
                  public void run() {
                    if (RootTools.isAccessGiven()) {
                      try {
                        Install_Prev();
                      } catch (InterruptedException e) {
                      } catch (IOException e) {
                      } catch (TimeoutException e) {

                      } catch (RootDeniedException e) {
                      }
                    } else {
                      Toast.makeText(Prev.this, R.string.noroottoast, Toast.LENGTH_LONG).show();
                    }
                  }
                },
                2000);
          }
        });
    if (new File("/system/98banner_dreamnarae_prev").exists()) {
      apply.setEnabled(false);
      apply.setFocusable(false);
      imageview.setImageResource(R.drawable.apply);
    } else {
    }
  }
Ejemplo n.º 7
0
  @Override
  protected void onBindDialogView(@NonNull View view) {
    super.onBindDialogView(view);

    Button resetButton = (Button) view.findViewById(R.id.key_combo_preference_reset_button);
    if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
      resetButton.setFocusable(false);
    }
    resetButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            mKeyCombos.clear();
            updateKeyListAdapter();
          }
        });
    ListView listView = (ListView) view.findViewById(R.id.key_combo_preference_key_list);
    mKeyCombos = getKeyCodesForPreference(getContext(), getKey());
    updateKeyListAdapter();
    listView.setAdapter(mKeyListAdapter);
  }
Ejemplo n.º 8
0
 private void b() {
   Utils.a(
       Utils.getResourceId(Utils.jdField_a_of_type_JavaLangString, "id", "tv_header"),
       getResources()
           .getString(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "string", "upomp_bypay_editpass")));
   jdField_a_of_type_AndroidWidgetButton =
       (Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_userpass_old_editpass"));
   jdField_a_of_type_AndroidWidgetButton.setFocusable(true);
   jdField_a_of_type_AndroidWidgetButton.setFocusableInTouchMode(true);
   jdField_a_of_type_AndroidWidgetButton.setOnFocusChangeListener(
       this.jdField_a_of_type_AndroidViewView$OnFocusChangeListener);
   jdField_a_of_type_AndroidWidgetButton.setOnClickListener(this);
   jdField_b_of_type_AndroidWidgetButton =
       (Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_userpass_new_editpass"));
   jdField_b_of_type_AndroidWidgetButton.setFocusable(true);
   jdField_b_of_type_AndroidWidgetButton.setFocusableInTouchMode(true);
   jdField_b_of_type_AndroidWidgetButton.setOnFocusChangeListener(
       this.jdField_a_of_type_AndroidViewView$OnFocusChangeListener);
   jdField_b_of_type_AndroidWidgetButton.setOnClickListener(this);
   jdField_c_of_type_AndroidWidgetButton =
       (Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_userpass_re_editpass"));
   jdField_c_of_type_AndroidWidgetButton.setFocusable(true);
   jdField_c_of_type_AndroidWidgetButton.setFocusableInTouchMode(true);
   jdField_c_of_type_AndroidWidgetButton.setOnFocusChangeListener(
       this.jdField_a_of_type_AndroidViewView$OnFocusChangeListener);
   jdField_c_of_type_AndroidWidgetButton.setOnClickListener(this);
   this.jdField_a_of_type_AndroidWidgetTextView =
       ((TextView)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "tv_tel_content_editpass")));
   this.jdField_a_of_type_AndroidWidgetTextView.setText(Utils.a(eh.R, 3, 3));
   jdField_a_of_type_AndroidWidgetEditText =
       (EditText)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "et_validcode_editpass"));
   jdField_a_of_type_AndroidWidgetEditText.setFocusable(true);
   jdField_a_of_type_AndroidWidgetEditText.setFocusableInTouchMode(true);
   jdField_a_of_type_AndroidWidgetEditText.setOnFocusChangeListener(
       this.jdField_a_of_type_AndroidViewView$OnFocusChangeListener);
   this.e =
       ((Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_validcode_editpass")));
   this.e.setFocusable(true);
   this.e.setFocusableInTouchMode(true);
   this.e.setOnFocusChangeListener(this.jdField_a_of_type_AndroidViewView$OnFocusChangeListener);
   this.e.setOnClickListener(this);
   this.jdField_d_of_type_AndroidWidgetButton =
       ((Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_button_editpass")));
   this.jdField_d_of_type_AndroidWidgetButton.setOnClickListener(this);
   this.f =
       ((Button)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "btn_return_editpass")));
   this.f.setOnClickListener(this);
   ((TextView)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "tv_welcome_editpass")))
       .setText(
           getResources()
                   .getString(
                       Utils.getResourceId(
                           Utils.jdField_a_of_type_JavaLangString,
                           "string",
                           "upomp_bypay_welcome"))
               + eh.X);
   this.jdField_a_of_type_AndroidWidgetRelativeLayout =
       ((RelativeLayout)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "rl_userpass_old_editpass")));
   this.jdField_b_of_type_AndroidWidgetRelativeLayout =
       ((RelativeLayout)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "rl_userpass_new_editpass")));
   this.jdField_c_of_type_AndroidWidgetRelativeLayout =
       ((RelativeLayout)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "rl_userpass_re_editpass")));
   this.jdField_d_of_type_AndroidWidgetRelativeLayout =
       ((RelativeLayout)
           findViewById(
               Utils.getResourceId(
                   Utils.jdField_a_of_type_JavaLangString, "id", "rl_validcode_editpass")));
 }
Ejemplo n.º 9
0
  public View_FriendList_item(
      Context context,
      Handler handler,
      boolean isMoreitem,
      Parser_ListItem_OnlyText parserListItemOnlyText,
      int index,
      Handler mHandler) {
    super(context, handler, null);
    // TODO Auto-generated constructor stub
    this.isMoreItem = isMoreitem;
    this.parserListItemOnlyText = parserListItemOnlyText;
    this.mHandler = mHandler;
    String url = null;
    if (isMoreitem) {
      l =
          (LinearLayout)
              ((Activity) context).getLayoutInflater().inflate(R.layout.listitem_friend_more, null);
      l.setGravity(Gravity.CENTER_HORIZONTAL);
      listItem_more = (TextView) l.findViewById(R.id.listItem_c_comment);
      listItem_more.setGravity(Gravity.CENTER_HORIZONTAL);
    } else {
      if (parserListItemOnlyText.getPageId() == PageID.PAGEID_PUSH_FRIEDN) {
        l =
            (LinearLayout)
                ((Activity) context)
                    .getLayoutInflater()
                    .inflate(R.layout.listitem_pushfriend, null);
      } else {
        l =
            (LinearLayout)
                ((Activity) context).getLayoutInflater().inflate(R.layout.listitem_onlytext, null);
        llistitem_friend_state = (LinearLayout) l.findViewById(R.id.llistitem_friend_state);
        llistitem_friend_state.setFocusable(false);
        listitem_friend_state = (Button) l.findViewById(R.id.listitem_friend_state);
        listitem_friend_state.setFocusable(false); // 这里需要设置一下,否则list中将无法响应onitemclick事件
        //				listitem_friend_state.setClickable(false);
        listitem_friend_state.setClickable(true);
      }
      listitem_friend_icon = (ImageView) l.findViewById(R.id.listitem_friend_icon);
      listitem_friend_name = (TextView) l.findViewById(R.id.listitem_friend_name);
      switch (parserListItemOnlyText.getPageId()) {
        case PageID.PAGEID_PUSH_FRIEDN:
          break;
        case PageID.PAGEID_FRIEND_SEARCH:
          break;
        default:
          //				listitem_friend_state.setOnClickListener(childcListener);
          listitem_friend_state.setOnTouchListener(
              new View.OnTouchListener() {

                @Override
                public boolean onTouch(View v, MotionEvent event) {
                  if (event.getAction() == MotionEvent.ACTION_UP) {
                    childEvent();
                  }
                  return false;
                }
              });
          break;
      }

      if (parserListItemOnlyText.getImage().getSrc() == null
          || parserListItemOnlyText.getImage().getSrc().equalsIgnoreCase("null")
          || parserListItemOnlyText.getImage().getSrc().equalsIgnoreCase("")) {
        url = null;
      } else {
        url = parserListItemOnlyText.getImage().getSrc();
      }
      // 压入下载队列
      DownImageItem downImageItem =
          new DownImageItem(
              Parser_Layout_AbsLayout.MODELTYPE_LISTITEM,
              index,
              url,
              parserListItemOnlyText.getPageId(),
              0);
      DownImageManager.add(downImageItem);
    }

    addView(l);
  }