团队冲刺08

团队冲刺08

今天完成:

数据库的连接

成果展示:

package com.example.animator.knowledge_circle;

import android.app.Activity;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;

public class EditEssayActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_essay);
    }
}
package com.example.animator.knowledge_circle;

import android.animation.Animator;
import android.app.Activity;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import ui.NbButton;
import utils.CircularAnim;

public class LoginActivity extends Activity {

    private NbButton button;
    private RelativeLayout rlContent;
    private Handler handler;
    private Animator animator;
    private ImageView logo_show;
    private LinearLayout form;
    private TextView label;
    private LinearLayout btn_group;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        button= (NbButton) findViewById(R.id.login_btn);
        rlContent= (RelativeLayout) findViewById(R.id.r1_content);
        logo_show = (ImageView) findViewById(R.id.logo_show);
        form = (LinearLayout) findViewById(R.id.log_l1);
        label = (TextView) findViewById(R.id.label_log);
        btn_group = (LinearLayout) findViewById(R.id.btn_group);
        rlContent.getBackground().setAlpha(0);
        handler=new Handler();

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                button.startAnim();
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        //跳转
                        gotoNew();
                    }
                }, 2000);

            }
        });
    }

    private void gotoNew() {
        button.gotoNew();

        final Intent intent=new Intent(this,MainActivity.class);

        int xc=(button.getLeft()+button.getRight())/2;
        int yc=(button.getTop()+button.getBottom())/2;
        animator= ViewAnimationUtils.createCircularReveal(rlContent,xc,yc,0,1111);
        animator.setDuration(100);
        animator.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        startActivity(intent);
                        overridePendingTransition(R.anim.anim_in, R.anim.anim_out);
                    }
                }, 80);
            }

            @Override
            public void onAnimationEnd(Animator animation) {

            }

            @Override
            public void onAnimationCancel(Animator animation) {

            }

            @Override
            public void onAnimationRepeat(Animator animation) {

            }
        });

        animator.start();
        form.setVisibility(View.INVISIBLE);
        logo_show.setVisibility(View.INVISIBLE);
        label.setVisibility(View.INVISIBLE);
        btn_group.setVisibility(View.INVISIBLE);
        rlContent.getBackground().setAlpha(255);
    }

    @Override
    protected void onStop() {
        super.onStop();
        animator.cancel();
        rlContent.getBackground().setAlpha(0);
        form.setVisibility(View.VISIBLE);
        logo_show.setVisibility(View.VISIBLE);
        label.setVisibility(View.VISIBLE);
        btn_group.setVisibility(View.VISIBLE);
        button.regainBackground();
    }
}

 

posted @ 2020-04-23 21:12  城南漠北  阅读(90)  评论(0编辑  收藏  举报