Example #1
1
  public boolean onOptionsItemSelected(MenuItem item) {
    super.onOptionsItemSelected(item);
    switch (item.getItemId()) {
      case R.id.Edit_Contact:
        Button b = (Button) findViewById(R.id.button1);
        b.setVisibility(View.VISIBLE);
        name.setEnabled(true);
        name.setFocusableInTouchMode(true);
        name.setClickable(true);

        phone.setEnabled(true);
        phone.setFocusableInTouchMode(true);
        phone.setClickable(true);

        email.setEnabled(true);
        email.setFocusableInTouchMode(true);
        email.setClickable(true);

        street.setEnabled(true);
        street.setFocusableInTouchMode(true);
        street.setClickable(true);

        place.setEnabled(true);
        place.setFocusableInTouchMode(true);
        place.setClickable(true);

        return true;
      case R.id.Delete_Contact:
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder
            .setMessage(R.string.deleteContact)
            .setPositiveButton(
                R.string.yes,
                new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int id) {
                    mydb.deleteContact(id_To_Update);
                    Toast.makeText(
                            getApplicationContext(), "Deleted Successfully", Toast.LENGTH_SHORT)
                        .show();
                    Intent intent =
                        new Intent(getApplicationContext(), com.example.myapp.MainActivity.class);
                    startActivity(intent);
                  }
                })
            .setNegativeButton(
                R.string.no,
                new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int id) {
                    // User cancelled the dialog
                  }
                });
        AlertDialog d = builder.create();
        d.setTitle("Are you sure");
        d.show();

        return true;
      default:
        return super.onOptionsItemSelected(item);
    }
  }
Example #2
0
    void update(final Task item) {
      task = item;
      int position = getPosition(item);
      Optional<?> thisHeader = groupFunction.apply(task);
      if (position >= 0 && thisHeader.isPresent()) {
        if (position == 0 || !thisHeader.equals(groupFunction.apply(getItem(position - 1)))) {
          header.setVisibility(View.VISIBLE);
          headerUnderline.setVisibility(View.VISIBLE);
          header.setText(thisHeader.get().toString());
        } else {
          header.setVisibility(View.GONE);
          headerUnderline.setVisibility(View.GONE);
        }
      } else {
        header.setVisibility(View.GONE);
        headerUnderline.setVisibility(View.GONE);
      }

      configureText(item);
      configureTimeText(item);
      configureStatus();
      textTitle.setClickable(isEditMode());
      textTime.setClickable(isEditMode());
      if (isSelected()) {
        this.convertView.setBackgroundColor(Color.rgb(50, 50, 50));
      } else {
        this.convertView.setBackgroundColor(
            getContext().getResources().getColor(android.R.color.background_dark));
      }
      if (canShowLevel()) {
        doneStatus.setPadding(task.getMasterTasks().size() * 32 + 5, 0, 5, 0);
      }
    }
 private void enableAll() {
   mDueDateLayout.setClickable(true);
   mDueHourLayout.setClickable(true);
   mStartDateLayout.setClickable(true);
   mStartHourLayout.setClickable(true);
   mSlaveTitle.setClickable(true);
   mSelectedSlaveView.setClickable(true);
   mPermissionTypeLayout.setClickable(true);
 }
 private void refreshRegButtonStatus() {
   if (!isNameEmpty && !isPswEmpty && !isEmailEmpty && !isCodeEmpty) {
     mRegisterBtn.setTextColor(getContext().getResources().getColor(R.color.teal500));
     mRegisterBtn.setClickable(true);
   } else {
     mRegisterBtn.setTextColor(getContext().getResources().getColor(R.color.teal100));
     mRegisterBtn.setClickable(false);
   }
 }
Example #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_display_contact);
    name = (TextView) findViewById(R.id.editTextName);
    phone = (TextView) findViewById(R.id.editTextPhone);
    email = (TextView) findViewById(R.id.editTextStreet);
    street = (TextView) findViewById(R.id.editTextEmail);
    place = (TextView) findViewById(R.id.editTextCity);

    mydb = new DBHelper(this);

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
      int Value = extras.getInt("id");

      if (Value > 0) {
        // means this is the view part not the add contact part.
        Cursor rs = mydb.getData(Value);
        id_To_Update = Value;
        rs.moveToFirst();

        String nam = rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_NAME));
        String phon = rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_PHONE));
        String emai = rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_EMAIL));
        String stree = rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_STREET));
        String plac = rs.getString(rs.getColumnIndex(DBHelper.CONTACTS_COLUMN_CITY));

        if (!rs.isClosed()) {
          rs.close();
        }
        Button b = (Button) findViewById(R.id.button1);
        b.setVisibility(View.INVISIBLE);

        name.setText((CharSequence) nam);
        name.setFocusable(false);
        name.setClickable(false);

        phone.setText((CharSequence) phon);
        phone.setFocusable(false);
        phone.setClickable(false);

        email.setText((CharSequence) emai);
        email.setFocusable(false);
        email.setClickable(false);

        street.setText((CharSequence) stree);
        street.setFocusable(false);
        street.setClickable(false);

        place.setText((CharSequence) plac);
        place.setFocusable(false);
        place.setClickable(false);
      }
    }
  }
 private void deleteCount() {
   if (orderProduct.getBuyCount() > 1) {
     orderProduct.setBuyCount(orderProduct.getBuyCount() - 1);
   }
   if (orderProduct.getBuyCount() == 1) {
     countDeleteButton.setClickable(false);
   }
   countAddButton.setClickable(true);
   countTextView.setText(orderProduct.getBuyCount() + "");
   totalPriceTextView.setText(Parameters.CONSTANT_RMB + decimalFormat.format(countTotalPrice()));
 }
        public void handleMessage(android.os.Message msg) {

          if (msg.what == STSTE) {
            quxioaTextView.setEnabled(false);
            quxioaTextView.setClickable(false);
            quxioaTextView.setBackgroundResource(R.drawable.focus_n_btn);
            quxioaTextView.setTextColor(getResources().getColor(R.color.gr_color_03));

            kefuTextView.setEnabled(false);
            kefuTextView.setClickable(false);
            kefuTextView.setBackgroundResource(R.drawable.focus_n_btn);
            kefuTextView.setTextColor(getResources().getColor(R.color.gr_color_03));
          }
        };
Example #8
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.nfcard);

    final Resources res = getResources();
    this.res = res;

    final View decor = getWindow().getDecorView();
    final TextView board = (TextView) decor.findViewById(R.id.board);
    this.board = board;

    decor.findViewById(R.id.btnCopy).setOnClickListener(this);
    decor.findViewById(R.id.btnNfc).setOnClickListener(this);
    decor.findViewById(R.id.btnExit).setOnClickListener(this);

    board.setMovementMethod(LinkMovementMethod.getInstance());
    board.setFocusable(false);
    board.setClickable(false);
    board.setLongClickable(false);

    nfcAdapter = NfcAdapter.getDefaultAdapter(this);
    pendingIntent =
        PendingIntent.getActivity(
            this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);

    onNewIntent(getIntent());
  }
Example #9
0
  public static void SetFileExplorerLink(
      TextView txtFilename, Spanned htmlString, final String pathToLinkTo, final Context context) {

    final Intent intent = new Intent();
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setDataAndType(Uri.parse("file://" + pathToLinkTo), "resource/folder");
    intent.setAction(Intent.ACTION_VIEW);

    if (intent.resolveActivity(context.getPackageManager()) != null) {
      txtFilename.setLinksClickable(true);
      txtFilename.setClickable(true);
      txtFilename.setMovementMethod(LinkMovementMethod.getInstance());
      txtFilename.setSelectAllOnFocus(false);
      txtFilename.setTextIsSelectable(false);
      txtFilename.setText(htmlString);

      txtFilename.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              context.startActivity(intent);
            }
          });
    }
  }
  private void startGame(int start_score) {
    setState(STATE_RUNNING);
    // Set allowed time
    m_allowedTime = m_initial_allowedTime;
    m_allowedTime_millis = m_allowedTime * 1000;
    m_score = start_score;
    m_answers.clear();
    m_Handler.removeCallbacks(mUpdateTimeTask);
    m_Handler.removeCallbacks(mBlinkTimeTask);
    if (mGameMode.equals("demo")) {
      mDemoState = 0;
      m_demo_word_i = 0;
      mBoardGameLogic.startGame("SABONETE");
      m_playboard.setClickable(false);
      m_Handler.postDelayed(mDemoPlayTask, 1000);
    } else {
      mBoardGameLogic.startGame(getRandomWord());
      m_Handler.postDelayed(mUpdateTimeTask, 1000);
      m_playboard.setClickable(true);
      m_word.setClickable(true);
    }

    mScoreText.setText(new Integer(m_score).toString());

    m_text_status.setVisibility(View.INVISIBLE);
    m_start_button.setVisibility(View.INVISIBLE);
    m_word.setText("");
    m_word.setEnabled(false);
    mPlayTime.setVisibility(View.VISIBLE);

    m_playboard.setKeepScreenOn(true);

    mStartTime = System.currentTimeMillis();
  }
Example #11
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.sms_code_view:
       String phoneNumb = ret_phone_view.getText().toString().trim();
       if (TextUtils.isEmpty(phoneNumb)) {
         Toast.makeText(
                 getActivity(), getResources().getString(R.string.login_msg1), Toast.LENGTH_SHORT)
             .show();
         return;
       }
       if (!IDoGooUtils.isMobileNo(phoneNumb)) {
         Toast.makeText(
                 getActivity(), getResources().getString(R.string.login_msg2), Toast.LENGTH_SHORT)
             .show();
         return;
       }
       if (smsCodeView.isClickable()) {
         smsTime = 59;
         handler.sendEmptyMessage(2);
         smsCodeView.setClickable(false);
         smsCodeView.setBackgroundResource(R.drawable.bg_gray_corners);
         smsCodeView.setTextColor(getResources().getColor(R.color.gray));
         getSmsCode(phoneNumb);
       }
       break;
     case R.id.register_sms_view:
       break;
     case R.id.ret_phone_view:
       break;
     case R.id.btn_next:
       JumpUtils.startLogin(getActivity());
       break;
   }
 }
  @Override
  protected void onFinishInflate() {
    final int childCount = getChildCount();
    if (childCount > 2) {
      throw new IllegalStateException("PtrFrameLayout only can host 2 elements");
    } else if (childCount == 2) {
      if (mHeaderId != 0 && mHeaderView == null) {
        mHeaderView = findViewById(mHeaderId);
      }
      if (mContainerId != 0 && mContent == null) {
        mContent = findViewById(mContainerId);
      }

      // not specify header or content
      if (mContent == null || mHeaderView == null) {

        View child1 = getChildAt(0);
        View child2 = getChildAt(1);
        if (child1 instanceof PtrUIHandler) {
          mHeaderView = child1;
          mContent = child2;
        } else if (child2 instanceof PtrUIHandler) {
          mHeaderView = child2;
          mContent = child1;
        } else {
          // both are not specified
          if (mContent == null && mHeaderView == null) {
            mHeaderView = child1;
            mContent = child2;
          }
          // only one is specified
          else {
            if (mHeaderView == null) {
              mHeaderView = mContent == child1 ? child2 : child1;
            } else {
              mContent = mHeaderView == child1 ? child2 : child1;
            }
          }
        }
      }
    } else if (childCount == 1) {
      mContent = getChildAt(0);
    } else {
      TextView errorView = new TextView(getContext());
      errorView.setClickable(true);
      errorView.setTextColor(0xffff6600);
      errorView.setGravity(Gravity.CENTER);
      errorView.setTextSize(20);
      errorView.setText(
          "The content view in PtrFrameLayout is empty. Do you forget to specify its id in xml layout file?");
      mContent = errorView;
      addView(mContent);
    }
    // 检测mContent 是否是ILoadMoreView 也就是可以添加加载更多
    onContentViewFinishInflate(mContent);
    if (mHeaderView != null) {
      mHeaderView.bringToFront();
    }
    super.onFinishInflate();
  }
 private void setTitleLeftDrawable() {
   mView_Title.setClickable(true);
   Drawable title_drawable = getResources().getDrawable(R.drawable.btn_titile_back);
   title_drawable.setBounds(
       0, 0, title_drawable.getIntrinsicWidth(), title_drawable.getIntrinsicHeight());
   mView_Title.setCompoundDrawables(title_drawable, null, null, null);
   mView_Title.setBackgroundResource(R.drawable.button_backround_light);
 }
Example #14
0
 public void ClickEnable(int time) {
   if (time == 0) {
     getCode_tv.setText(mContext.getString(R.string.mymagic_um_register_phone_tip));
     getCode_tv.setClickable(true);
   } else {
     getCode_tv.setText(time + "秒");
   }
 }
 private void setSlaves() {
   if (mSelectedMaster == null) return;
   mSlaves = new ArrayList<>();
   mSlaves.add(getAllSlavesRepresentative());
   mSlaves.addAll(mSelectedMaster.getSlaves());
   mSelectedSlaveView.setClickable(true);
   mSelectedSlave = mSlaves.get(0);
   mSelectedSlaveView.setText(mSelectedSlave.getName());
 }
    @Override
    public View newView(Context arg0, Cursor arg1, ViewGroup arg2) {

      View res = View.inflate(TaskListActivity.this, R.layout.single_item, null);
      TextView nameTv = (TextView) res.findViewById(R.id.lab_name);

      nameTv.setClickable(true);
      nameTv.setOnClickListener(this);

      return res;
    }
  /**
   * Initialize the buttons declared in the xml. In this case just the MAIN button. Main button: add
   * a touch listener, when clicked should take you back to the main conversation
   */
  public void initializeButtons() {
    // set listener to main button
    // Button mainButton = (Button) findViewById(R.id.main_button);
    /*
     * mainButton.setOnTouchListener(new View.OnTouchListener() {
     *
     * @Override public boolean onTouch(View view, MotionEvent evt) { switch
     * (evt.getAction()) { case MotionEvent.ACTION_DOWN: break; case
     * MotionEvent.ACTION_MOVE: break; case MotionEvent.ACTION_UP:
     * if(!(screen.getSpace()==Space.getMainSpace())){
     * MainApplication.screen
     * .getSpaceViewController().changeSpace(Space.getMainSpace()); } break;
     * } return false; } });
     */
    try {
      // sidechat 1
      // Log.v("C", "Problem on adding space");
      Space newSpace = SpaceController.addSpace(Space.getMainSpace().getContext());

      side1 = new PrivateSpaceIconView(Space.getMainSpace().getContext(), newSpace);
      newSpace.getSpaceController().setPSIV(side1);
      // main chat
      PrivateSpaceIconView main =
          new PrivateSpaceIconView(Space.getMainSpace().getContext(), Space.getMainSpace());
      Space.getMainSpace().getSpaceController().setPSIV(main);
      // sidechat 2
      Space newSpace2 = SpaceController.addSpace(Space.getMainSpace().getContext());
      side2 = new PrivateSpaceIconView(Space.getMainSpace().getContext(), newSpace2);
      newSpace2.getSpaceController().setPSIV(side2);
    } catch (XMPPException e) {
      // TODO Auto-generated catch block

      e.printStackTrace();
    }

    TextView logo = (TextView) findViewById(R.id.logo);
    logo.setClickable(true);
    logo.setOnClickListener(this.logoOnClickListener());

    // ImageView soundButton = (ImageView) findViewById(R.id.sound_button);
    // soundButton.setClickable(true);
    // soundButton.setOnClickListener(this.getSoundButtonOnClickListener());
    /*
     * Log.v(TAG, "Clicked on MENU key"); LayoutInflater inflater =
     * (LayoutInflater) MainApplication.this
     * .getSystemService(Context.LAYOUT_INFLATER_SERVICE); MenuView menuView
     * = new MenuView(inflater); menuView.launch();
     */

    ImageView spatializationButton = (ImageView) findViewById(R.id.auto_spatialization);
    spatializationButton.setClickable(true);
    spatializationButton.setOnClickListener(this.getSpatializationListener());
  }
 /**
  * @param context The aplication context.
  * @param resTitle Thew resoure string of the title.
  * @param resMessage The resource string of the message. Could be HTML.
  * @return Instance of a alert dialog with title and meesage.
  */
 public static AlertDialog create(Context context, int resTitle, int resMessage) {
   TextView message = new TextView(context);
   message.setText(Html.fromHtml(context.getString(resMessage)));
   message.setTextColor(Color.WHITE);
   message.setTextSize(context.getResources().getDimension(R.dimen.text_small));
   message.setPadding(16, 16, 16, 16);
   message.setClickable(true);
   message.setMovementMethod(LinkMovementMethod.getInstance());
   AlertDialog alertDialog = new AlertDialog.Builder(context).create();
   alertDialog.setTitle(resTitle);
   alertDialog.setView(message);
   return alertDialog;
 }
 @Override
 public void run() {
   handler.removeCallbacks(timeTask);
   if (oneMinute <= 0) {
     oneMinute = 60;
     tvVerifyAgain.setText(R.string.verify_send_again);
     tvVerifyAgain.setClickable(true);
     tvVerifyAgain.setTextColor(getResources().getColor(R.color.light_blue));
   } else {
     --oneMinute;
     tvVerifyAgain.setText(getString(R.string.verify_send_again_count, oneMinute));
     handler.postDelayed(timeTask, 1000);
   }
 }
    public ViewHolder(View itemView) {

      super(itemView);
      mTextView_headlines =
          (TextView) itemView.findViewById(R.id.savedNewsFeedItem_headlines_textView);
      mTextView_trailText =
          (TextView) itemView.findViewById(R.id.savedNewsFeedItem_trailText_textView);
      mImageView_deleteButton =
          (ImageView) itemView.findViewById(R.id.savedNewsFeedItem_deleteButton);
      mCardView = (CardView) itemView.findViewById(R.id.savedNewsFeed_cardView);
      mImageView_shareButton =
          (ImageView) itemView.findViewById(R.id.savedNewsFeedItem_shareButton);
      mTextView_author = (TextView) itemView.findViewById(R.id.savedNewsFeedItem_author);
      mTextView_sectionID = (TextView) itemView.findViewById(R.id.savedNewsFeedItem_sectionID);

      mTextView_headlines.setClickable(true);
      mTextView_headlines.setOnClickListener(this);
      mTextView_trailText.setClickable(true);
      mTextView_trailText.setOnClickListener(this);
      mImageView_deleteButton.setClickable(true);
      mImageView_deleteButton.setOnClickListener(this);
      mImageView_shareButton.setClickable(true);
      mImageView_shareButton.setOnClickListener(this);
    }
  @Override
  public void setupInnerViewElements(ViewGroup parent, View view) {
    TextView title = (TextView) view.findViewById(R.id.vitals_inner_txt_title);
    TextView mButton = (TextView) view.findViewById(R.id.vitals_inner_txt_btn);

    title.setText(mTitle);
    //        subTitle.setText(mSubTitle);
    mButton.setText(mBtnTitle);
    mButton.setClickable(true);
    mButton.setOnClickListener(mBtnClickListener);

    ViewToClickToExpand viewToClickToExpand =
        ViewToClickToExpand.builder().setupView(getCardView());
    setViewToClickToExpand(viewToClickToExpand); // click anywhere on the card to expand
  }
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_RIGHT_ICON);
    SessionController.titleBar(this, " - Samtal", true);

    contacts = SessionController.getOnlineContacts();
    SessionController.getSessionController().addObserver(this);
    Collections.sort(
        contacts,
        new Comparator<Contact>() {
          public int compare(Contact object1, Contact object2) {
            return object1.getUserName().compareToIgnoreCase(object2.getUserName());
          }
        });
    ia = new ContactAdapter(this, R.layout.call_contact_list, contacts);
    ListView lv = getListView();
    lv.setTextFilterEnabled(true);

    lv.setOnItemClickListener(
        new OnItemClickListener() {

          /** lv �r satt som en onItemClickListener Snabbt klick p� en kontakt, ringer direkt */
          public void onItemClick(AdapterView<?> a, View v, int position, long id) {
            if (contacts.size() == 0) return;
            Intent nextIntent = new Intent(CallContactListView.this, CallView.class);
            nextIntent.putExtra(
                "sip", "sip:" + contacts.get(position).getUserName() + "@ekiga.net");
            nextIntent.putExtra("dstUser", contacts.get(position).getUserName());
            startActivityForResult(nextIntent, 9);
          }
        });
    footer =
        ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
            .inflate(R.layout.contact_footer_text, null, false);
    foot = (TextView) footer.findViewById(R.id.text_foot);
    foot.setClickable(false);
    foot.setTextSize(20);
    if (SessionController.getConnectionStatus().equals(ConnectionStatus.CONNECTED)) {
      foot.setText("Ingen är online för tillfället");
    } else {
      foot.setText("Ingen kontakt med servern");
    }

    if (contacts.size() == 0) {
      lv.addFooterView(footer);
    }
    setListAdapter(ia);
  }
Example #23
0
  private void getEmailCode() {
    email = email_editText.getText().toString();
    if (TextUtils.isEmpty(email) || !email.contains("@")) {
      showWarning("Email格式错误");
    }

    ClearWindows.clearInput(getActivity(), email_editText);
    final BaseParams baseParams = new BaseParams("api/sendemail");
    baseParams.addParams("email", email);
    baseParams.addSign();
    getCode.setClickable(false);
    x.http()
        .post(
            baseParams.getRequestParams(),
            new Callback.CommonCallback<String>() {
              @Override
              public void onSuccess(String result) {
                MyLog.i("sendEmail==" + result);
                try {
                  JSONObject js = new JSONObject(result);
                  boolean su = js.getBoolean("success");
                  int code = js.getInt("code");
                  if (su && code == 200) {
                    codeChange();

                    JSONObject js1 = js.getJSONObject("data");
                    pa = js1.getString("pa");
                    CusToast.showToast(getActivity(), "发送邮件成功", Toast.LENGTH_SHORT);
                  } else {
                    String mes = js.getString("msg");
                    showWarning(mes);
                    getCode.setClickable(true);
                  }
                } catch (JSONException e) {
                  e.printStackTrace();
                }
              }

              @Override
              public void onError(Throwable ex, boolean isOnCallback) {}

              @Override
              public void onCancelled(CancelledException cex) {}

              @Override
              public void onFinished() {}
            });
  }
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode != Activity.RESULT_OK) return;

    if (requestCode == REQUEST_DATE) {
      Date date = (Date) data.getSerializableExtra(DatePickerFragment.EXTRA_DATE);
      // Update for Upload
      mRegisterData.setBirthday(DateUtils.date2StringForUpload(date));

      // Update for Display
      mTvDate.setText(DateUtils.date2StringForDisplay(date));

      mTvDate.setClickable(true);
    }
  }
 public MMImageButton(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
   super(paramContext, paramAttributeSet, paramInt);
   paramAttributeSet = new FrameLayout.LayoutParams(-2, -2);
   gravity = 17;
   aAF = new ImageView(paramContext);
   aAF.setLayoutParams(paramAttributeSet);
   addView(aAF);
   paramAttributeSet = new FrameLayout.LayoutParams(-2, -2);
   gravity = 17;
   ftN = new TextView(paramContext);
   ftN.setLayoutParams(paramAttributeSet);
   ftN.setClickable(false);
   ftN.setFocusable(false);
   ftN.setFocusableInTouchMode(false);
   ftN.setTextColor(a.x(paramContext, 2131231259));
   addView(ftN);
 }
Example #26
0
        @Override
        public void handleMessage(Message msg) {
          switch (msg.what) {
            case 0:
              time--;
              getCode.setText(time + "s");
              break;
            case 1:
              getCode.setBackgroundResource(R.drawable.border_getcode_orange);
              getCode.setText("重新获取");
              getCode.setClickable(true);
              time = 59;

              break;
          }
          super.handleMessage(msg);
        }
  public void clickTextView(final TextView textView, final int skillId) {
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setEms(13);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setClickable(true);
    textView.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            skillPageFlag = true;
            sellerSkillId = skillId;
            new regTask().execute("SellerMarket profile");
          }
        });
  }
  @Override
  public void onAnimationEnd(Animation animation) {
    // TODO Auto-generated method stub

    /*
    mButtonStartOver = (ImageButton) findViewById(R.id.button_refresh);
    mButtonStartOver.setVisibility(View.VISIBLE);
    mButtonStartOver.setOnClickListener(new OnClickListener() {

    	@Override
    	public void onClick(View v) {
    		// TODO Auto-generated method stub
    		InitializeArrays();
    		mButtonStartOver.setVisibility(View.INVISIBLE);
    		mTextViewWord.setVisibility(View.INVISIBLE);
    	}
    });*/
    if (mWordArray.isEmpty()) {
      mIsOver = true;
      mTextViewWord.setClickable(true);
      mTextViewWord.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_action_refresh, 0, 0);
      mTextViewWord.setTextSize((float) 16);
      mTextViewWord.setText(R.string.str_flash_card_retry_button_decs);
      mTextViewWord.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              //
              finish();
              startActivity(getIntent());
            }
          });
    }
    if (!mWordArray.isEmpty() && mIsWordShowing == false) {
      Random random = new Random();
      int index = random.nextInt(mWordArray.size());
      Word word = mWordArray.get(index);
      mWordArray.remove(index);
      mWordIdArray.add(word.getId());
      changeText(word);
    }

    mIsWordShowing = !mIsWordShowing;
  }
 private void setTopList(CustomLinearLayout layout, JSONArray array) throws JSONException {
   layout.removeAllViews();
   TextView textView = new TextView(this);
   textView.setText("标签:");
   layout.addView(textView);
   for (int i = 0; i < array.length(); i++) {
     JSONObject jsonObject = array.getJSONObject(i);
     int domain = jsonObject.optInt("domain", 0);
     String title = jsonObject.optString("title");
     textView = new TextView(this);
     textView.setClickable(true);
     if (domain != 0 && !TextUtils.isEmpty(title))
       textView.setOnClickListener(new TopOnClickListener(domain, title));
     textView.setTextColor(Color.parseColor("#1CBE9D"));
     textView.setBackgroundResource(R.drawable.textclick_background);
     textView.setText(title);
     layout.addView(textView);
   }
 }
  private void enableSkippingFromSkipText() {
    if (_skipTextView == null) {
      _skipTextView = (TextView) _layout.findViewById(R.id.unityAdsVideoSkipText);
    }

    if (_skipTextView != null) {
      _skipTextView.setText(R.string.unityads_skip_video_text);
    }

    if (_skipTextView != null) {
      _skipTextView.setClickable(true);
      _skipTextView.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              _listener.onVideoSkip();
            }
          });
    }
  }