Skip to content
Permalink
Browse files

close #89

  • Loading branch information
ramack committed Oct 19, 2019
1 parent 4918f60 commit c98a89664cadd6857d93d041af6202228d638b4a
@@ -33,10 +33,7 @@ public ImageViewBindingAdapter(Picasso picasso) {
}

@BindingAdapter("android:src") public void loadImage(ImageView imageView, String url) {
picasso.load(url)
.fit()
.centerCrop()
.into(imageView);
picasso.load(url).into(imageView); // centering and cropping is done by ImageView from the resources
}

@BindingAdapter("heightRatio") public void setHeighRatio(ImageView imageView, double ratio) {
@@ -131,7 +131,7 @@ public void onError(Throwable e) {
// NO: NEVER throw an exception here
// throw new RuntimeException(e);
Log.e(TAG, "CategoriesSubscriber: " + e.getMessage());
// TODO: highlight problem to the user
// TODO: #161 highlight problem to the user
}
}

@@ -182,7 +182,7 @@ public void onError(Throwable e) {
// NO: NEVER throw an exception here
// throw new RuntimeException(e);
Log.e(TAG, "ImagesSubscriber: " + e.getMessage());
// TODO: highlight problem to the user
// TODO: #161 highlight problem to the user
}
}

@@ -24,7 +24,10 @@
android:src="@{viewModel.url}"
android:contentDescription="@{viewModel.title}"
android:onClick="@{viewModel::onClickDo}"
app:heightRatio="@{0.66}" />
app:heightRatio="@{0.66}"
android:cropToPadding="false"
android:scaleType="centerCrop"
/>

<LinearLayout
android:layout_width="match_parent"
@@ -42,12 +42,13 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@{viewModel.url}"
android:adjustViewBounds="false"
android:contentDescription="@{viewModel.title}"
android:cropToPadding="false"
android:onClick="@{viewModel::onClickDo}"
app:heightRatio="@{1}"
/>
android:scaleType="centerCrop"
android:src="@{viewModel.url}"
app:heightRatio="@{1}" />

</androidx.cardview.widget.CardView>
</layout>

0 comments on commit c98a896

Please sign in to comment.
You can’t perform that action at this time.