package cn.edu.nju.software.jksc.symys.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TableLayout;

import cn.edu.nju.software.jksc.symys.GamePanelController;
import cn.edu.nju.software.jksc.symys.R;
import cn.edu.nju.software.jksc.symys.algorithm.MapGenerator;
import cn.edu.nju.software.jksc.symys.common.Bobble;


public class GamePanel extends Activity {



    GamePanelController gc;

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

        FrameLayout frameLayout = (FrameLayout)findViewById(R.id.main_panel);
        Bundle extras = getIntent().getExtras();
        int size = (Integer) extras.get("boardSize");
        int axises = (Integer) extras.get("axisSum");
        int colorSum = (Integer) extras.get("colorSum");
        Bobble[][] colors = MapGenerator.generate(size,axises,0,40);


        gc = new GamePanelController(colors,frameLayout,this);
        gc.init();

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
//        getMenuInflater().inflate(R.menu.menu_game_panel, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@@ -850,221 +850,175 @@
    B
-undle extras = getIntent().getExtras();%0A        int size = (Integer) extras.get(%22boardSize%22);%0A        int axises = (Integer) extras.get(%22axisSum%22);%0A        int colorSum = (Integer) extras.get(%22colorSum%22
+obble%5B%5D%5B%5D colors = MapGenerator.generate(6,1,0,40);%0A        RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams(
 );%0A
+%0A
         
 Bobb
@@ -1017,66 +1017,49 @@
     
-Bobble%5B%5D%5B%5D colors = MapGenerator.generate(size,axises,0,40
+frameLayout.setMinimumHeight(params.width
 );%0A%0A

Revert "start from new activty"