-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29 Fix
- Loading branch information
Showing
3 changed files
with
99 additions
and
84 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...esign/src/main/java/com/cooltechworks/creditcarddesign/views/HeightWrappingViewPager.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.cooltechworks.creditcarddesign.views; | ||
|
||
import android.content.Context; | ||
import android.support.v4.view.ViewPager; | ||
import android.util.AttributeSet; | ||
import android.view.View; | ||
|
||
public class HeightWrappingViewPager extends ViewPager { | ||
|
||
public HeightWrappingViewPager(Context context) { | ||
super(context); | ||
} | ||
|
||
public HeightWrappingViewPager(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
@Override | ||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | ||
View firstChild = getChildAt(0); | ||
firstChild.measure(widthMeasureSpec, heightMeasureSpec); | ||
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(firstChild.getMeasuredHeight(), MeasureSpec.EXACTLY)); | ||
} | ||
} |
128 changes: 59 additions & 69 deletions
128
creditcarddesign/src/main/res/layout/activity_card_edit.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,72 @@ | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".CardEditActivity"> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/parent" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
tools:context=".CardEditActivity"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/parent" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
tools:context=".CardEditActivity"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<com.cooltechworks.creditcarddesign.CreditCardView | ||
android:id="@+id/credit_card_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<com.cooltechworks.creditcarddesign.CreditCardView | ||
android:id="@+id/credit_card_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
|
||
/> | ||
|
||
<android.support.v4.view.ViewPager | ||
android:id="@+id/card_field_container_pager" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:minHeight="120dp" | ||
android:orientation="horizontal" | ||
> | ||
android:layout_gravity="center" | ||
|
||
</android.support.v4.view.ViewPager> | ||
/> | ||
|
||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
<com.cooltechworks.creditcarddesign.views.HeightWrappingViewPager | ||
android:id="@+id/card_field_container_pager" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom" | ||
android:layout_marginTop="@dimen/margin_small" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/previous" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:background="@color/green_continue" | ||
android:gravity="center" | ||
android:padding="@dimen/padding_normal" | ||
android:text="@string/previous" | ||
android:textColor="@android:color/white" | ||
android:textSize="@dimen/text_size_small" | ||
android:minHeight="120dp" | ||
android:orientation="horizontal" | ||
> | ||
|
||
/> | ||
</com.cooltechworks.creditcarddesign.views.HeightWrappingViewPager> | ||
|
||
<TextView | ||
android:id="@+id/next" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:background="@color/green_continue" | ||
android:gravity="center" | ||
android:padding="@dimen/padding_normal" | ||
android:text="@string/next" | ||
android:textColor="@android:color/white" | ||
android:textSize="@dimen/text_size_small" | ||
|
||
/> | ||
</LinearLayout> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom" | ||
android:layout_marginTop="@dimen/margin_small" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/previous" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:background="@color/green_continue" | ||
android:gravity="center" | ||
android:padding="@dimen/padding_normal" | ||
android:text="@string/previous" | ||
android:textColor="@android:color/white" | ||
android:textSize="@dimen/text_size_small" | ||
|
||
/> | ||
|
||
<TextView | ||
android:id="@+id/next" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:background="@color/green_continue" | ||
android:gravity="center" | ||
android:padding="@dimen/padding_normal" | ||
android:text="@string/next" | ||
android:textColor="@android:color/white" | ||
android:textSize="@dimen/text_size_small" | ||
|
||
/> | ||
</LinearLayout> | ||
|
||
|
||
</RelativeLayout> | ||
</LinearLayout> |
This file contains 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