- NimChallenge_src.zip
- NimChallenge
- .classpath
- .project
- .settings
- AndroidManifest.xml
- assets
- libs
- proguard.cfg
- project.properties
- res
- drawable
- drawable-el
- logo.png
- drawable-hdpi
- clock1.png
- clock2.png
- clock2_gray.png
- clock3.png
- clock3_gray.png
- icon.png
- presence_offline.png
- drawable-ldpi
- icon.png
- drawable-mdpi
- clock1.png
- clock2.png
- clock2_gray.png
- clock3.png
- clock3_gray.png
- glass.png
- glass_selected.png
- ic_menu_emoticons.png
- icon.png
- logo.png
- nim1.png
- nim2.png
- paper.png
- paper_bg.png
- presence_offline.png
- selected1.png
- selected2.png
- wood.png
- drawable-xhdpi
- clock1.png
- clock2.png
- clock2_gray.png
- clock3.png
- clock3_gray.png
- layout
- layout-land
- menu
- values
- values-de
- values-el
- values-large
- values-small
- xml
- src
- gr
- sullenart
|
package gr.sullenart.games.nimchallenge;
import gr.sullenart.games.nimchallenge.ads.AdsManager;
import gr.sullenart.games.nimchallengeplus.GameFeatures;
import android.app.Activity;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class NimGameSelect extends Activity {
private AdsManager adsManager = new AdsManager();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.game_select);
Button classicButton = (Button) findViewById(R.id.classicButton);
classicButton.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
Button customButton = (Button) findViewById(R.id.customButton);
customButton.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
Button variationsButton = (Button) findViewById(R.id.variationsButton);
variationsButton.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
Button challenge1Button = (Button) findViewById(R.id.challenge1Button);
challenge1Button.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
Button challenge2Button = (Button) findViewById(R.id.challenge2Button);
challenge2Button.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
Button challenge3Button = (Button) findViewById(R.id.challenge3Button);
challenge3Button.getBackground().setColorFilter(0xF00000FF, PorterDuff.Mode.MULTIPLY);
classicButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.GAME");
intent.putExtra("game", "classic");
startActivity(intent);
}
});
customButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.NIM_EDIT_BOARDS");
startActivity(intent);
}
});
variationsButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.GAME");
intent.putExtra("game", "variations");
startActivity(intent);
}
});
challenge1Button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.GAME");
intent.putExtra("game", "challenge1");
startActivity(intent);
}
});
challenge2Button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.GAME");
intent.putExtra("game", "challenge2");
startActivity(intent);
}
});
challenge3Button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("gr.sullenart.games.nimchallenge.GAME");
intent.putExtra("game", "challenge3");
startActivity(intent);
}
});
if (!GameFeatures.getExtendedGamesEnabled()) {
challenge2Button.setEnabled(false);
challenge2Button.setTextColor(0xFFCCCCCC);
challenge2Button.getBackground().setColorFilter(0xFF000000, PorterDuff.Mode.MULTIPLY);
challenge2Button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.clock2_gray, 0, 0, 0);
challenge3Button.setEnabled(false);
challenge3Button.setTextColor(0xFFCCCCCC);
challenge3Button.getBackground().setColorFilter(0xFF000000, PorterDuff.Mode.MULTIPLY);
challenge3Button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.clock3_gray, 0, 0, 0);
}
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int height = metrics.heightPixels;
int width = metrics.widthPixels;
if (height > width && height <=400) {
((ImageView) findViewById(R.id.logo_header)).getLayoutParams().height = 0;
}
LinearLayout layout = (LinearLayout)findViewById(R.id.banner_layout);
adsManager.addAdsView(this, layout);
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.