翻译动画不起作用

时间:2013-12-27 16:10:45

标签: android

我在布局上为项目翻译动画。当第一项有动画结束时开始第二项等。它不适用于索尼爱立信Xperia Arc S LT18i,我不知道为什么。 这是我的代码

public class LoginActivity extends FragmentActivity {

private static final String TAG = LoginActivity.class.getSimpleName();

private EditText mUsername;
private EditText mPassword;
private CheckBox mSaveUserNameCheckbox;
private View contentHolder;
private ImageView logoImage;
private LinearLayout logLay, passLay, rememberLay, buttonLay;
private String key_link = "";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    Uri data = getIntent().getData();
    Log.i("URI issue", "uri="+data);
    if (data != null) {
        String scheme = data.getScheme(); 
        List<String> params = data.getPathSegments();
        if (params.get(0) != null && params.get(1) != null) {
            Log.i("PARSING", "data=" + data + " shame=" + scheme + " host="
                    + data.getHost() + " ::: param 0=" + params.get(0)
                    + "   param 1=" + params.get(1));

            if (scheme.equalsIgnoreCase("https")) {
                String host = data.getHost();
                if (host.equalsIgnoreCase("jira.hiqo-solutions.us")) {
                    if (params.get(0).equalsIgnoreCase("browse"))
                        key_link = params.get(1);
                } else {
                    Toast.makeText(this, "Incorrect link!",
                            Toast.LENGTH_LONG).show();
                }
            }
        }
    }

    contentHolder = findViewById(R.id.content_holder);
    logoImage = (ImageView) findViewById(R.id.imageLogo);
    logoImage.setVisibility(View.GONE);

    logLay = (LinearLayout) findViewById(R.id.usernameLay);
    logLay.setVisibility(View.GONE);
    passLay = (LinearLayout) findViewById(R.id.passLay);
    passLay.setVisibility(View.GONE);
    rememberLay = (LinearLayout) findViewById(R.id.rememberLay);
    rememberLay.setVisibility(View.GONE);
    buttonLay = (LinearLayout) findViewById(R.id.buttonLay);
    buttonLay.setVisibility(View.GONE);

    contentHolder.setVisibility(View.GONE);

    if (CredentialsPrefs.mRememberMe.get() && checkConnection()) {
        setMode();
        doLogin(CredentialsPrefs.mLogin.get(),
                CredentialsPrefs.mPassword.get());
    } else {
        if (!checkConnection()) {
            Toast.makeText(this, "No Internet Connections!",
                    Toast.LENGTH_LONG).show();
        }
        contentHolder.setVisibility(View.VISIBLE);
        CredentialsPrefs.mLogined.put(false);
        final Animation logoAnim = AnimationUtils.loadAnimation(this,
                R.anim.logo_animation);
        final Animation loginAnim = AnimationUtils.loadAnimation(this,
                R.anim.items_animation);
        final Animation passAnim = AnimationUtils.loadAnimation(this,
                R.anim.items_animation);
        final Animation rememberAnim = AnimationUtils.loadAnimation(this,
                R.anim.items_animation);
        final Animation buttonAnim = AnimationUtils.loadAnimation(this,
                R.anim.items_animation);
        loginAnim.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                passLay.setVisibility(View.VISIBLE);
                passLay.startAnimation(passAnim);
            }
        });
        passAnim.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                rememberLay.setVisibility(View.VISIBLE);
                rememberLay.startAnimation(rememberAnim);
            }
        });
        rememberAnim.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {
                buttonLay.setVisibility(View.VISIBLE);
                buttonLay.startAnimation(buttonAnim);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {

            }
        });
        buttonAnim.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                initializateControls();

            }
        });

        logoAnim.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                logLay.setVisibility(View.VISIBLE);
                logLay.startAnimation(loginAnim);
            }
        });
        logoImage.setVisibility(View.VISIBLE);
        logoImage.startAnimation(logoAnim);

    }

它可以是什么?

0 个答案:

没有答案