Skip to content

Commit

Permalink
#29 Fix
Browse files Browse the repository at this point in the history
#29 Fix
  • Loading branch information
sharish committed Jan 17, 2017
1 parent 30d555a commit 009095d
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 84 deletions.
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 creditcarddesign/src/main/res/layout/activity_card_edit.xml
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>
30 changes: 15 additions & 15 deletions creditcarddesign/src/main/res/layout/lyt_card_cvv.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding_small">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding_small">

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:orientation="vertical"
android:padding="@dimen/margin_small"
app:cardCornerRadius="@dimen/card_radius"
app:cardElevation="@dimen/cardview_default_elevation"
app:cardBackgroundColor="@android:color/white"
app:cardPreventCornerOverlap="false">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:orientation="vertical"
android:padding="@dimen/margin_small"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="@dimen/card_radius"
app:cardElevation="@dimen/cardview_default_elevation"
app:cardPreventCornerOverlap="false">

<LinearLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit 009095d

Please sign in to comment.