Back to project page NotATop.
The source code is released under:
GNU General Public License
If you think the Android project NotATop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.gg.view; /* w ww . j ava 2s .com*/ import android.app.Activity; import android.content.Context; import android.view.SurfaceView; import android.view.View; /* ?????????????????????????????????????????????????????? */ public class SurfaceViewFactory { public final static int WELCOME = 0; // ?????????????? public final static int MAIN_MENU = 1; // ???????????????? public final static int CLASSIC_GAME = 2; // ???????????????? public final static int SELECT = 3; // ????????????? public final static int SCORE = 4; // ?????????????? public final static int HELP = 5; // ??????????????? public final static int END = 6; public final static int FIRST_TIME = 7; public final static int GAME_MODE = 8; public final static int TIME_GAME = 9; private static SurfaceView surfaceView; // ???????????????????????????????????? private SurfaceViewFactory(){ // ???????????????? } public static SurfaceView getView(MainActivity mainActivity, int index){ // ??????????????????????????????????? switch(index){ case WELCOME: surfaceView = new WelcomeSurfaceView(mainActivity); break; case MAIN_MENU: surfaceView = new MainMenuSurfaceView(mainActivity); break; case CLASSIC_GAME: surfaceView = new ClassicGameSurfaceView(mainActivity); break; case SELECT: surfaceView = new SelectSurfaceView(mainActivity); break; case SCORE: surfaceView = new ScoreSurfaceView(mainActivity); break; case HELP: surfaceView = new HelpSurfaceView(mainActivity); break; case END: surfaceView = new EndSurfaceView(mainActivity); break; case FIRST_TIME: surfaceView = new FirstTimeSurfaceView(mainActivity); break; case GAME_MODE: surfaceView = new GameModeSurfaceView(mainActivity); break; case TIME_GAME: surfaceView = new TimeGameSurfaceView(mainActivity); break; default: break; } return surfaceView; } }