Code Monkey home page Code Monkey logo

Comments (3)

tuhin10 avatar tuhin10 commented on July 24, 2024

I want to remove the white space between lower buttons and crop view, by center aligning the cropview.

from croppernocropper.

jayrambhia avatar jayrambhia commented on July 24, 2024

You're right. It does calculate height based on the width to make it square. Maybe it wouldn't work properly in Landscape mode. You can solve your problem by changing your layout.

If you want to keep the cropper in center, use layout_gravity="center" and since it is a square, you would want your FrameLayout height to wrap_content.

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom_frame"
android:layout_alignParentTop="true" >
<com.fenchtose.nocropper.CropperView
    android:background="#ff282828"
    android:id="@+id/imageview"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_gravity="center"
    app:grid_opacity="0.8"
    app:grid_thickness="1.1dp"
    app:grid_color="@color/colorAccent"/>
<ImageView
    android:id="@+id/snap_button"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_margin="16dp"
    android:padding="8dp"
    android:layout_gravity="left|bottom"
    android:background="@drawable/black_transp_circ_ripple"
    android:scaleType="center"
    android:src="@mipmap/ic_crop_free_white_24dp"/>
<ImageView
    android:id="@+id/rotate_button"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:padding="8dp"
    android:layout_margin="16dp"
    android:layout_gravity="right|bottom"
    android:background="@drawable/black_transp_circ_ripple"
    android:scaleType="center"
    android:src="@mipmap/ic_rotate_right_white_24dp"/>
</FrameLayout>

from croppernocropper.

jayrambhia avatar jayrambhia commented on July 24, 2024

Closed in favor of #3

from croppernocropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.