Android Open Source - polygons Level Activity






From Project

Back to project page polygons.

License

The source code is released under:

GNU General Public License

If you think the Android project polygons listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.polygons;
/* w  w  w .  j  a  v a 2 s.  co  m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.github.polygons.logic.Keeper;

import com.nobcatz.android.polygons.R;

public class LevelActivity extends Activity {

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


    }

    private void startAnimations() {
        Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
        anim.reset();
        LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
        l.clearAnimation();
        l.startAnimation(anim);

        anim = AnimationUtils.loadAnimation(this, R.anim.translate);
        anim.reset();
        anim.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

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

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        TextView tv = (TextView) findViewById(R.id.logo);
        String level = getResources().getString(R.string.level) +"\n" + Keeper.getInstance().getLevel();
        tv.setText(level);
        tv.clearAnimation();
        tv.startAnimation(anim);


    }

    private void createNewActivity(){
        Intent intent = new Intent(this, FigureListActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivity(intent);
        this.finish();
    }

    @Override
    public void onBackPressed() {/*Do nothing*/}

}




Java Source Code List

com.github.polygons.FigureListActivity.java
com.github.polygons.GameActivity.java
com.github.polygons.LevelActivity.java
com.github.polygons.LostActivity.java
com.github.polygons.MainActivity.java
com.github.polygons.figures.Figure.java
com.github.polygons.figures.Oval.java
com.github.polygons.figures.Square.java
com.github.polygons.figures.Triangle.java
com.github.polygons.logic.CustomAudioManager.java
com.github.polygons.logic.FigureGenerator.java
com.github.polygons.logic.Keeper.java
com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelper.java