Skip to content

Commit

Permalink
corrected spacing (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-alfresco authored Sep 13, 2021
1 parent 96990e2 commit 01bbfba
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ListViewPreview @JvmOverloads constructor(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL
)
binding.preview.scaleType = getScaleType(convertOrientationToDegree(rotation), true)
binding.preview.scaleType = getScaleType(convertOrientationToDegree(rotation))
}
}

Expand All @@ -75,7 +75,7 @@ class ListViewPreview @JvmOverloads constructor(
val rotation =
mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)
rotation?.let {
binding.preview.scaleType = getScaleType(it.toInt(), false)
binding.preview.scaleType = getScaleType(it.toInt())
}
}

Expand All @@ -88,15 +88,12 @@ class ListViewPreview @JvmOverloads constructor(
}
}

private fun getScaleType(rotation: Int, isPhoto: Boolean): ImageView.ScaleType {
private fun getScaleType(rotation: Int): ImageView.ScaleType {
val isTablet = context.resources.getBoolean(R.bool.isTablet)
return when {
isTablet && (rotation == ORIENTATION_0 || rotation == ORIENTATION_180) -> {
ImageView.ScaleType.FIT_CENTER
}
isPhoto && isTablet && (rotation == ORIENTATION_90 || rotation == ORIENTATION_270) -> {
ImageView.ScaleType.FIT_CENTER
}
!isTablet && (rotation == ORIENTATION_180 || rotation == ORIENTATION_0) -> {
ImageView.ScaleType.FIT_CENTER
}
Expand Down
2 changes: 1 addition & 1 deletion capture/src/main/res/layout-sw600dp/view_list_preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="640dp"
android:layout_height="560dp"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="8dp"
app:strokeWidth="2dp"
Expand Down
3 changes: 2 additions & 1 deletion capture/src/main/res/layout/fragment_save.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/capture_layout_margin"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
Expand Down Expand Up @@ -70,7 +71,7 @@
style="@style/Widget.Alfresco.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/capture_layout_margin"
android:layout_marginTop="@dimen/capture_layout_margin_button"
android:layout_marginBottom="@dimen/capture_layout_margin"
android:text="@string/capture_save_button" />
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion capture/src/main/res/layout/view_list_preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:layout_width="wrap_content"
app:strokeWidth="2dp"
app:strokeColor="@color/alfresco_gray_900_15"
android:layout_height="320dp"
android:layout_height="280dp"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
Expand Down
1 change: 1 addition & 0 deletions capture/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="capture_layout_margin">24dp</dimen>
<dimen name="capture_layout_margin_button">28dp</dimen>
<dimen name="capture_carousel_margin">32dp</dimen>
<dimen name="capture_layout_small_margin">16dp</dimen>
<dimen name="capture_button_size">40dp</dimen>
Expand Down

0 comments on commit 01bbfba

Please sign in to comment.