Created
August 14, 2012 13:08
-
-
Save panmari/3349104 to your computer and use it in GitHub Desktop.
setView ignores Layout other than StackLayout?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch.aplu.cardex12; | |
import android.graphics.Color; | |
import ch.aplu.jcardgame.*; | |
import ch.aplu.android.*; | |
public class CardEx12 extends CardGame | |
{ | |
public enum Suit { | |
KREUZ, HERZ, KARO, PIK | |
} | |
public enum Rank { | |
ASS, KOENIG, DAME, BAUER, ZEHN, NEUN, ACHT, SIEBEN, SECHS | |
} | |
private Deck deck; | |
private Hand talon; | |
private Hand pile; | |
public CardEx12() | |
{ | |
super(Color.rgb(20, 80, 0), Color.WHITE, BoardType.HORZ_SPLIT, | |
windowZoom(600)); | |
} | |
public void main() | |
{ | |
deck = new Deck(Suit.values(), Rank.values(), "cover"); | |
talon = deck.dealingOut(1, 9)[0]; | |
StackLayout talonLayout = new StackLayout(new Location(200, 300)); | |
talon.setView(this, talonLayout); | |
talon.draw(); | |
//Bug2: I expect this to be drawn as RowLayout, but it is drawn as StackLayout: | |
pile = new Hand(deck); | |
pile.setView(this, new RowLayout(new Location(400, 300), 300, 50)); | |
pile.draw(); | |
talon.addCardListener(new CardAdapter() { | |
public void pressed(Card card) { | |
card.transferNonBlocking(pile); } | |
}); | |
talon.setTouchEnabled(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment