皮棉和兼容性

时间:2020-02-02 12:57:27

标签: android-studio lint

我在android studio中写一个项目

现在我将用Lint分析我的项目

Lint可以发现有关兼容性的问题吗?

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cheat);
        mAsweristrue = getIntent().getBooleanExtra(Extra_Answer_Is_True, false);
        mAnswerTextView = findViewById(R.id.AnswerTextView);
        mShowAnswerButton = findViewById(R.id.ShowAnswerButton);
        mShowAnswerButton.setOnClickListener(new View.OnClickListener() {
            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onClick(View view) {
                if (mAsweristrue) {
                    mAnswerTextView.setText(R.string.Button_True);
                } else {
                    mAnswerTextView.setText(R.string.Button_False);
                }
                setAnswerShownResult(true);
                int cx = mShowAnswerButton.getWidth() / 2;
                int cy = mShowAnswerButton.getHeight() / 2;
                float radius = mShowAnswerButton.getWidth();
                Animator anim = ViewAnimationUtils.createCircularReveal(mShowAnswerButton, cx, cy, radius, 0);
                anim.addListener(new AnimatorListenerAdapter() {
                                     @Override
                                     public void onAnimationEnd(Animator animation) {
                                         super.onAnimationEnd(animation);
                                         mShowAnswerButton.setVisibility(View.INVISIBLE);
                                     }
                                 });
                        anim.start();
            }
        });

0 个答案:

没有答案