Android Open Source - OneSearch Results Activity






From Project

Back to project page OneSearch.

License

The source code is released under:

MIT License

If you think the Android project OneSearch 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 chrisjluc.funsearch.ui;
/*from  w  w w .j av  a  2 s . co  m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import chrisjluc.funsearch.R;
import chrisjluc.funsearch.WordSearchManager;
import chrisjluc.funsearch.base.BaseActivity;
import chrisjluc.funsearch.models.GameMode;
import chrisjluc.funsearch.ui.gameplay.WordSearchActivity;

public class ResultsActivity extends BaseActivity implements View.OnClickListener {

    public final static int RESULT_REPLAY_GAME = 0;
    public final static int RESULT_EXIT_TO_MENU = 1;
    public final static String ACTION_IDENTIFIER = "action_identifier";

    private GameMode mGameMode;
    private int mScore;
    private int mSkipped;

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

        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            mScore = extras.getInt("score");
            mSkipped = extras.getInt("skipped");
            mGameMode = WordSearchManager.getInstance().getGameMode();
        }
        TextView scoreTextView = (TextView) findViewById(R.id.tvScoreResult);
        scoreTextView.setText(Integer.toString(mScore));
        Button replayButton = (Button) findViewById(R.id.bReplay);
        Button returnMenuButton = (Button) findViewById(R.id.bReturnMenu);
        replayButton.setOnClickListener(this);
        returnMenuButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent resultIntent = new Intent(getApplicationContext(), WordSearchActivity.class);
        switch (view.getId()) {
            case R.id.bReplay:
                resultIntent.putExtra(ACTION_IDENTIFIER, RESULT_REPLAY_GAME);
                break;
            case R.id.bReturnMenu:
                resultIntent.putExtra(ACTION_IDENTIFIER, RESULT_EXIT_TO_MENU);
                break;
        }
        setResult(Activity.RESULT_OK, resultIntent);
        finish();
    }
}




Java Source Code List

chrisjluc.funsearch.ApplicationTest.java
chrisjluc.funsearch.WordSearchManager.java
chrisjluc.funsearch.adapters.WordSearchGridAdapter.java
chrisjluc.funsearch.adapters.WordSearchPagerAdapter.java
chrisjluc.funsearch.base.BaseActivity.java
chrisjluc.funsearch.models.GameDifficulty.java
chrisjluc.funsearch.models.GameMode.java
chrisjluc.funsearch.models.GameType.java
chrisjluc.funsearch.ui.MenuActivity.java
chrisjluc.funsearch.ui.ResultsActivity.java
chrisjluc.funsearch.ui.components.GameButton.java
chrisjluc.funsearch.ui.components.GameTextView.java
chrisjluc.funsearch.ui.gameplay.PauseDialogFragment.java
chrisjluc.funsearch.ui.gameplay.WordSearchActivity.java
chrisjluc.funsearch.ui.gameplay.WordSearchFragment.java
chrisjluc.funsearch.ui.gameplay.WordSearchGridView.java
chrisjluc.funsearch.ui.gameplay.WordSearchViewPager.java
chrisjluc.funsearch.wordSearchGenerator.generators.DistinctRandomGenerator.java
chrisjluc.funsearch.wordSearchGenerator.generators.WordSearchGenerator.java
chrisjluc.funsearch.wordSearchGenerator.models.Node.java
chrisjluc.funsearch.wordSearchGenerator.models.Point.java
chrisjluc.funsearch.wordSearchGenerator.models.PossibleInstance.java