mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 10:39:25 +00:00
Image editor: added flip vertically
This commit is contained in:
parent
0ef6c0951d
commit
1553c2450f
4 changed files with 40 additions and 8 deletions
|
@ -50,7 +50,8 @@ public class FragmentDialogEditImage extends FragmentDialogBase {
|
|||
Context context = getContext();
|
||||
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_edit_image, null);
|
||||
ImageButton ibRotate = dview.findViewById(R.id.ibRotate);
|
||||
ImageButton ibFlip = dview.findViewById(R.id.ibFlip);
|
||||
ImageButton ibFlipHorizontally = dview.findViewById(R.id.ibFlipHorizontally);
|
||||
ImageButton ibFlipVertically = dview.findViewById(R.id.ibFlipVertically);
|
||||
ImageButton ibCancel = dview.findViewById(R.id.ibCancel);
|
||||
ImageButton ibSave = dview.findViewById(R.id.ibSave);
|
||||
CropImageView civ = dview.findViewById(R.id.civ);
|
||||
|
@ -67,13 +68,20 @@ public class FragmentDialogEditImage extends FragmentDialogBase {
|
|||
}
|
||||
});
|
||||
|
||||
ibFlip.setOnClickListener(new View.OnClickListener() {
|
||||
ibFlipHorizontally.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
civ.flipImageHorizontally();
|
||||
}
|
||||
});
|
||||
|
||||
ibFlipVertically.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
civ.flipImageVertically();
|
||||
}
|
||||
});
|
||||
|
||||
ibCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,7h2v2h-2zM19,21c1.1,0 2,-0.9 2,-2h-2v2zM19,15h2v2h-2zM19,11h2v2h-2zM9,5L9,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h4v-2L5,19L5,5h4zM19,3v2h2c0,-1.1 -0.9,-2 -2,-2zM11,1h2v22h-2zM15,3h2v2h-2zM15,19h2v2h-2z"/>
|
||||
android:pathData="M6.99,11L3,15l3.99,4v-3H14v-2H6.99v-3zM21,9l-3.99,-4v3H10v2h7.01v3L21,9z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/twotone_swap_vert_24.xml
Normal file
10
app/src/main/res/drawable/twotone_swap_vert_24.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M16,17.01V10h-2v7.01h-3L15,21l4,-3.99h-3zM9,3L5,6.99h3V14h2V6.99h3L9,3z"/>
|
||||
</vector>
|
|
@ -29,31 +29,45 @@
|
|||
app:tint="?attr/colorAccent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibFlip"
|
||||
android:id="@+id/ibFlipHorizontally"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ibRotate"
|
||||
app:layout_constraintTop_toBottomOf="@id/civ"
|
||||
app:srcCompat="@drawable/twotone_flip_24"
|
||||
app:srcCompat="@drawable/twotone_swap_horiz_24"
|
||||
app:tint="?attr/colorAccent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibFlipVertically"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ibFlipHorizontally"
|
||||
app:layout_constraintTop_toBottomOf="@id/civ"
|
||||
app:srcCompat="@drawable/twotone_swap_vert_24"
|
||||
app:tint="?attr/colorAccent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibCancel"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@android:string/cancel"
|
||||
android:scaleType="fitCenter"
|
||||
android:tooltipText="@android:string/cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ibFlip"
|
||||
app:layout_constraintStart_toEndOf="@id/ibFlipVertically"
|
||||
app:layout_constraintTop_toBottomOf="@id/civ"
|
||||
app:srcCompat="@drawable/twotone_close_24" />
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue