some more work on thumbnails

This commit is contained in:
Andrew Dolgov 2015-07-08 15:28:24 +03:00
parent 49f820110d
commit 618fe0aa1d
6 changed files with 10 additions and 26 deletions

View File

@ -172,11 +172,5 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc
m_needRestart = Arrays.asList(filter).indexOf(key) != -1; m_needRestart = Arrays.asList(filter).indexOf(key) != -1;
} }
public int dpToPx(int dp) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int px = Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
return px;
}
} }

View File

@ -862,13 +862,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
m_imageLoader.displayImage(imgSrc, imageAware, displayImageOptions); m_imageLoader.displayImage(imgSrc, imageAware, displayImageOptions);
holder.textImage.setTag(imgSrc); holder.textImage.setTag(imgSrc);
} }
holder.textImage.getLayoutParams().width = m_activity.dpToPx(64);
holder.textImage.getLayoutParams().height = m_activity.dpToPx(64);
} else {
holder.textImage.getLayoutParams().width = m_activity.dpToPx(48);
holder.textImage.getLayoutParams().height = m_activity.dpToPx(48);
} }
holder.textImage.setOnClickListener(new OnClickListener() { holder.textImage.setOnClickListener(new OnClickListener() {

View File

@ -603,9 +603,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
if (holder.textImage != null) { if (holder.textImage != null) {
updateTextCheckedState(holder, article); updateTextCheckedState(holder, article);
holder.textImage.getLayoutParams().width = m_activity.dpToPx(48);
holder.textImage.getLayoutParams().height = m_activity.dpToPx(48);
holder.textImage.setOnClickListener(new OnClickListener() { holder.textImage.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {

View File

@ -17,8 +17,8 @@
<ImageView <ImageView
android:clickable="true" android:clickable="true"
android:layout_width="64dp" android:layout_width="48dp"
android:layout_height="64dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:id="@+id/text_image"/> android:id="@+id/text_image"/>

View File

@ -13,13 +13,13 @@
<FrameLayout <FrameLayout
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:layout_gravity="center_vertical|left" android:layout_gravity="center_vertical|left"
android:layout_width="64dp" android:layout_width="wrap_content"
android:layout_height="64dp"> android:layout_height="wrap_content">
<ImageView <ImageView
android:clickable="true" android:clickable="true"
android:layout_width="64dp" android:layout_width="48dp"
android:layout_height="64dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:id="@+id/text_image"/> android:id="@+id/text_image"/>

View File

@ -13,13 +13,13 @@
<FrameLayout <FrameLayout
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:layout_gravity="center_vertical|left" android:layout_gravity="center_vertical|left"
android:layout_width="64dp" android:layout_width="wrap_content"
android:layout_height="64dp"> android:layout_height="wrap_content">
<ImageView <ImageView
android:clickable="true" android:clickable="true"
android:layout_width="64dp" android:layout_width="48dp"
android:layout_height="64dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:id="@+id/text_image"/> android:id="@+id/text_image"/>