Android 匹配点击FindViewById和点击事件

[a-zA-Z]
签到
http://wechat.poso2o.com/wxshop/sign_in/sign_in.jsp?shop_id=XXX&preview=1
http://wechat.poso2o.com/wxshop/goods/goods20181218.jsp?shop_id=XXX

[a-zA-Z]

1.匹配变量
[a-zA-Z]* =

2.匹配括号里面的强转类型
[(][a-zA-Z]*[)]

匹配Android 里面的点击事件:

1.匹配findViewById(普通的findViewById)
[a-zA-Z]* = [(][a-zA-Z][)] findViewById[(]R.id.[a-zA-Z_][)];
例如:
mTvBrokeage = (TextView) findViewById(R.id.tv_brokeage_hhfd);

2.第二种findViewById(没有指定类型):
[a-zA-Z]* = findViewById[(]R.id.[a-zA-Z_]*[)];
mTvRightNowEarn = findViewById(R.id.tv_right_now_earn);

3.匹配view.findViewById
[a-zA-Z]* = [(][a-zA-Z][)] [a-zA-z].findViewById[(]R.id.[a-zA-Z_]*[)];
mVpContent = (ViewPager) view.findViewById(R.id.vp_content);
mLlyParentContent = view.findViewById(R.id.lly_parent_content);
mTvCommissionRate = view.findViewById(R.id.tv_commission_rate);
mTvCommissionDiscount = view.findViewById(R.id.tv_commission_discount);

4.匹配没有实例的点击事件
findViewById[(]R.id.[a-zA-z_][)].setOnClickListener[(][a-zA-Z][)];
findViewById(R.id.ty_share_earn).setOnClickListener(this);
findViewById(R.id.item_na_goods_detail_second_more_comment).setOnClickListener(this);

5.匹配点击事件:
[a-zA-Z].setOnClickListener[(][a-zA-Z][)];
mTvClickAll.setOnClickListener(this);

String rawCodeBlock = mPsiCodeBlock.getText();
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = [(][a-zA-Z][)] findViewById[(]R.id.[a-zA-Z_][)];","");

String rawCodeBlock = mPsiCodeBlock.getText();
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = [(][a-zA-Z]*[)] findViewById[(]R.id.[a-zA-Z_]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = findViewById[(]R.id.[a-zA-Z_]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = findViewById[(]R.id.[a-zA-Z_]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = [(][a-zA-Z]*[)] [a-zA-z]*.findViewById[(]R.id.[a-zA-Z_]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]* = findViewById[(]R.id.[a-zA-Z_]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("findViewById[(]R.id.[a-zA-z_]*[)].setOnClickListener[(][a-zA-Z]*[)];\n","");
rawCodeBlock=rawCodeBlock.replaceAll("[a-zA-Z]*.setOnClickListener[(][a-zA-Z]*[)];\n","");
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值