Skip to content
Browse files

make arrow buttons only clickable when estimate view is visible, fixes

  • Loading branch information...
1 parent 5a52913 commit cc742ed86c0f0fd4575ba39a944471ffc2fb7dab @swanson swanson committed
Showing with 27 additions and 14 deletions.
  1. +13 −13 res/layout/estimate.xml
  2. +14 −1 src/com/sep/planningpoker/activities/MainActivity.java
View
26 res/layout/estimate.xml
@@ -17,12 +17,9 @@
android:layout_height="match_parent"
android:orientation="vertical" >
- <RelativeLayout
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_gravity="top"
- android:layout_weight="10"
- android:onClick="onUpArrowClicked"
+ android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
@@ -32,7 +29,7 @@
android:layout_marginLeft="5dip"
android:layout_marginTop="5dip"
android:src="@drawable/card_logo" />
- </RelativeLayout>
+ </LinearLayout>
<RelativeLayout
android:id="@+id/digit_container"
@@ -46,8 +43,10 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
+ android:clickable="false"
android:gravity="top"
android:onClick="onUpArrowClicked"
+ android:padding="40dip"
android:src="@drawable/up_arrow" />
<com.sep.planningpoker.customcontrols.CustomFontTextView
@@ -65,27 +64,28 @@
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/up_arrow"
android:layout_alignParentBottom="true"
+ android:clickable="false"
android:gravity="bottom"
android:onClick="onDownArrowClicked"
+ android:padding="40dip"
android:src="@drawable/down_arrow" />
</RelativeLayout>
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="10"
- android:onClick="onDownArrowClicked"
- android:orientation="horizontal" >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
+ android:layout_gravity="right"
android:layout_marginBottom="5dip"
android:layout_marginRight="5dip"
android:src="@drawable/card_logo" />
- </RelativeLayout>
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
View
15 src/com/sep/planningpoker/activities/MainActivity.java
@@ -25,6 +25,9 @@
private View mDownArrowView;
private TextView mEstimateTextView;
+ private View mUpArrow;
+ private View mDownArrow;
+
private int mCardPosition = 0;
private DeckFactory mDeckFactory;
@@ -44,6 +47,8 @@ public void onCreate(Bundle savedInstanceState) {
instructionView.setId(INSTRUCTION_VIEW);
View estimateView = getLayoutInflater().inflate(R.layout.estimate, null);
+ mUpArrow = estimateView.findViewById(R.id.up_arrow);
+ mDownArrow = estimateView.findViewById(R.id.down_arrow);
estimateView.setId(ESTIMATE_VIEW);
mFlipper.addView(instructionView);
@@ -55,7 +60,7 @@ public void onCreate(Bundle savedInstanceState) {
mDownArrowView = findViewById(R.id.down_arrow);
mEstimateTextView = (TextView) findViewById(R.id.estimate_display);
-
+
Toast tapToStart = Toast.makeText(this, getResources().getString(R.string.tap_to_start), Toast.LENGTH_LONG);
tapToStart.setGravity(Gravity.BOTTOM, 0, 0);
tapToStart.show();
@@ -96,6 +101,14 @@ private boolean estimateViewIsShowing() {
private void flipCardOver() {
AnimationFactory.flipTransition(mFlipper, FlipDirection.LEFT_RIGHT);
+
+ if (estimateViewIsShowing()) {
+ mUpArrow.setClickable(true);
+ mDownArrow.setClickable(true);
+ } else {
+ mUpArrow.setClickable(false);
+ mDownArrow.setClickable(false);
+ }
}
private Deck getCurrentDeck() {

0 comments on commit cc742ed

Please sign in to comment.
Something went wrong with that request. Please try again.