Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate view in the bottom of the page if full page is't filled up. #16

Closed
devnizamuddin opened this issue Feb 19, 2021 · 3 comments
Labels
good first issue Good for newcomers not-generated-further Not generated in newer versions

Comments

@devnizamuddin
Copy link

I am generating an invoice with that pdf, but the problem is the signature part of the invoice gets up if the full paper isn't filled up.
I tried with a different layout but the result is the same.

@Gkemon
Copy link
Owner

Gkemon commented Feb 20, 2021

Can you share the following XML,please?

@devnizamuddin
Copy link
Author

`

<LinearLayout
    android:orientation="vertical"
    android:id="@+id/invoice_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="48dp">

    <!-- Our Store Name-->
    <TextView
        android:layout_gravity="center"
        android:id="@+id/shop_name_invoice_tv"
        style="@style/InvoiceLargeTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:text="@string/our_shop_name" />

    <!--Our Address-->

    <!--Invoice Text-->
    <RelativeLayout
        android:id="@+id/invoice_text_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/shop_name_invoice_tv">

        <TextView
            style="@style/InvoiceMediumTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="24dp"
            android:text="INVOICE" />

        <TextView
            style="@style/InvoiceMediumTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="24dp"
            android:text="Customer Copy"
            android:textSize="14sp" />
        <!--24-->
    </RelativeLayout>

    <!-- Order Info-->
    <LinearLayout
        android:id="@+id/order_info_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/invoice_text_layout"
        android:layout_marginBottom="32dp"
        android:orientation="horizontal"
        android:weightSum="2">

        <!--user information-->
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:weightSum="3">

            <TextView
                android:id="@+id/customer_shop_name_tv"
                style="@style/InvoiceNormalTextStyle"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:text="@string/customer_shop_name" />

            <TextView
                android:id="@+id/customer_address_tv"
                style="@style/InvoiceNormalTextStyle"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="4dp"
                android:layout_weight="1"
                android:text="@string/customer_address" />

            <TextView
                android:id="@+id/customer_phone_tv"
                style="@style/InvoiceNormalTextStyle"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="4dp"
                android:layout_weight="1"
                android:text="@string/customer_phone" />

        </LinearLayout>

        <!--Date Time-->
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:weightSum="2">

            <TextView
                android:id="@+id/customer_order_date_tv"
                style="@style/InvoiceNormalTextStyle"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="end"
                android:text="@string/customer_order_date" />

            <TextView
                android:id="@+id/our_delivery_date_tv"
                style="@style/InvoiceNormalTextStyle"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="4dp"
                android:layout_weight="1"
                android:gravity="end"
                android:text="@string/our_delivery_date" />

        </LinearLayout>

    </LinearLayout>

    <!--Product List-->
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/invoice_rv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/order_info_layout"
        android:background="@drawable/invoice_item_background"
        android:padding="1dp" />

    <!-- Signature Layout-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom"
        android:gravity="bottom"
        android:layout_marginTop="48dp"
        android:orientation="horizontal"
        android:weightSum="3">

        <TextView
            style="@style/InvoiceMediumTextStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Customer Signature" />

        <TextView
            style="@style/InvoiceMediumTextStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:text="Prepared By" />

        <TextView
            style="@style/InvoiceMediumTextStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="end"
            android:text="Authorized Signature" />
    </LinearLayout>

</LinearLayout>

<Button
    android:id="@+id/generate_invoice_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:text="Generate Invoice" />

`

Gkemon pushed a commit that referenced this issue Mar 1, 2021
#16
-- Fix crash if any user insert a view ids for print and which is not belonging to the current host activity
-- Change provider name to fix the conflict if any other app currently installed in the phone which is also using the same library. So it needs to be unique.
@Gkemon
Copy link
Owner

Gkemon commented Mar 1, 2021

I rearranged the mentioned XML here and you will get more insight here

@Gkemon Gkemon closed this as completed Mar 1, 2021
@Gkemon Gkemon added documentation Improvements or additions to documentation good first issue Good for newcomers not-generated-further Not generated in newer versions and removed documentation Improvements or additions to documentation labels Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers not-generated-further Not generated in newer versions
Projects
None yet
Development

No branches or pull requests

2 participants