Move crop button (#197)

* Moved the crop button so that it doesn't take space in the activity

* Semi transparent in the middle, same position than the image

Co-authored-by: Joachim Dunant <joachim.dunant@epfl.ch>
This commit is contained in:
Sanimys 2020-05-21 21:40:27 +02:00 committed by GitHub
parent 66e6bd66dd
commit 4a79c862fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,46 +1,76 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".PhotoEditActivity" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:showIn="@layout/activity_photo_edit" xmlns:android="http://schemas.android.com/apk/res/android"
> xmlns:tools="http://schemas.android.com/tools">
<ImageView <LinearLayout
android:id="@+id/image_preview" android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight=".70" tools:context=".PhotoEditActivity"
android:scaleType="centerInside" /> tools:showIn="@layout/activity_photo_edit"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<ImageView
android:id="@+id/image_preview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".70"
android:scaleType="centerInside" />
<com.h.pixeldroid.utils.NonSwipeableViewPager
android:id="@+id/viewPager"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".22" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
app:tabGravity="fill"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".08"/>
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/left_guideline"
app:layout_constraintGuide_percent=".15"
android:orientation="vertical"/>
<androidx.constraintlayout.widget.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/right_guideline"
app:layout_constraintGuide_percent=".85"
android:orientation="vertical"/>
<androidx.constraintlayout.widget.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bottom_guideline"
app:layout_constraintGuide_percent=".7"
android:orientation="horizontal"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/cropImageButton" android:id="@+id/cropImageButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginTop="411dp"
android:src="@drawable/ic_crop_black_24dp" /> android:backgroundTint="#FFFFFFFF"
android:src="@drawable/ic_crop_black_24dp"
<com.h.pixeldroid.utils.NonSwipeableViewPager app:layout_constraintLeft_toLeftOf="@+id/left_guideline"
android:id="@+id/viewPager" app:layout_constraintRight_toRightOf="@+id/right_guideline"
android:layout_above="@+id/tabs" app:layout_constraintBottom_toBottomOf="@+id/bottom_guideline" />
app:layout_behavior="@string/appbar_scrolling_view_behavior" </androidx.constraintlayout.widget.ConstraintLayout>
android:layout_below="@+id/image_preview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".22" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
app:tabGravity="fill"
app:tabMode="fixed"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".08"/>
</LinearLayout>