mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-02 17:56:56 +01:00
trying to change image view implementation
This commit is contained in:
parent
5e3e49f8f0
commit
a2f0cf6f56
@ -86,6 +86,7 @@ dependencies {
|
||||
compile 'ch.acra:acra:4.6.2'
|
||||
compile 'org.jraf:android-switch-backport:2.0.1'
|
||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.4'
|
||||
compile 'com.makeramen:roundedimageview:2.1.0'
|
||||
googleCompile 'com.google.android.gms:play-services-maps:7.5.0'
|
||||
googleCompile 'com.google.maps.android:android-maps-utils:0.3.4'
|
||||
fdroidCompile 'org.osmdroid:osmdroid-android:4.3'
|
||||
|
@ -88,7 +88,7 @@ public class TwidereImageDownloader extends BaseImageDownloader implements Const
|
||||
if (mUseThumbor && mPreferences.getBoolean(KEY_THUMBOR_ENABLED)) {
|
||||
final String address = mPreferences.getString(KEY_THUMBOR_ADDRESS, null);
|
||||
final String securityKey = mPreferences.getString(KEY_THUMBOR_SECURITY_KEY, null);
|
||||
if (URLUtil.isValidUrl(address)) {
|
||||
if (address != null && URLUtil.isValidUrl(address)) {
|
||||
if (TextUtils.isEmpty(securityKey)) {
|
||||
mThumbor = Thumbor.create(address);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import android.view.View.OnLongClickListener;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
|
||||
import org.mariotaku.twidere.Constants;
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.adapter.iface.ContentCardClickListener;
|
||||
@ -58,7 +60,7 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
|
||||
private final IStatusesAdapter<?> adapter;
|
||||
|
||||
private final ImageView replyRetweetIcon;
|
||||
private final ShapedImageView profileImageView;
|
||||
private final RoundedImageView profileImageView;
|
||||
private final ImageView profileTypeView;
|
||||
private final ImageView extraTypeView;
|
||||
private final TextView textView;
|
||||
@ -80,7 +82,7 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
|
||||
super(itemView);
|
||||
this.adapter = adapter;
|
||||
itemContent = (IColorLabelView) itemView.findViewById(R.id.item_content);
|
||||
profileImageView = (ShapedImageView) itemView.findViewById(R.id.profile_image);
|
||||
profileImageView = (RoundedImageView) itemView.findViewById(R.id.profile_image);
|
||||
profileTypeView = (ImageView) itemView.findViewById(R.id.profile_type);
|
||||
extraTypeView = (ImageView) itemView.findViewById(R.id.extra_type);
|
||||
textView = (TextView) itemView.findViewById(R.id.text);
|
||||
@ -545,7 +547,7 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
|
||||
return (CardView) itemView.findViewById(R.id.card);
|
||||
}
|
||||
|
||||
public ShapedImageView getProfileImageView() {
|
||||
public ImageView getProfileImageView() {
|
||||
return profileImageView;
|
||||
}
|
||||
|
||||
@ -631,7 +633,8 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
|
||||
public void setupViewOptions() {
|
||||
setTextSize(adapter.getTextSize());
|
||||
mediaPreview.setStyle(adapter.getMediaPreviewStyle());
|
||||
profileImageView.setStyle(adapter.getProfileImageStyle());
|
||||
// profileImageView.setStyle(adapter.getProfileImageStyle());
|
||||
profileImageView.setOval(adapter.getProfileImageStyle() == ShapedImageView.SHAPE_CIRCLE);
|
||||
actionButtons.setVisibility(adapter.isCardActionsHidden() ? View.GONE : View.VISIBLE);
|
||||
itemMenu.setVisibility(adapter.isCardActionsHidden() ? View.GONE : View.VISIBLE);
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
<org.mariotaku.twidere.view.ShapedImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/profile_image"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
|
@ -91,7 +91,7 @@
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="@dimen/element_spacing_normal">
|
||||
|
||||
<org.mariotaku.twidere.view.ShapedImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/profile_image"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_status_profile_image"
|
||||
|
@ -70,7 +70,7 @@
|
||||
tools:textSize="@dimen/text_size_extra_small"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ShapedImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/profile_image"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_status_profile_image"
|
||||
|
@ -32,6 +32,8 @@
|
||||
<item name="sivCornerRadiusRatio">10%p</item>
|
||||
<item name="sivBackgroundColor">?android:colorBackground</item>
|
||||
<item name="sivShape">circle</item>
|
||||
<item name="riv_oval">true</item>
|
||||
<item name="riv_corner_radius">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Light.ProfileImage" parent="Widget.Base">
|
||||
@ -40,6 +42,8 @@
|
||||
<item name="sivCornerRadiusRatio">10%p</item>
|
||||
<item name="sivBackgroundColor">?android:colorBackground</item>
|
||||
<item name="sivShape">circle</item>
|
||||
<item name="riv_oval">true</item>
|
||||
<item name="riv_corner_radius">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.ProfileImage.Large">
|
||||
@ -51,6 +55,7 @@
|
||||
<item name="sivBorderWidth">2dp</item>
|
||||
<item name="sivBackgroundColor">?android:colorBackground</item>
|
||||
<item name="sivShape">circle</item>
|
||||
<item name="riv_corner_radius">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Light.ProfileImage.Large">
|
||||
@ -62,6 +67,7 @@
|
||||
<item name="sivBorderWidth">2dp</item>
|
||||
<item name="sivBackgroundColor">?android:colorBackground</item>
|
||||
<item name="sivShape">circle</item>
|
||||
<item name="riv_corner_radius">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.ProfileType" parent="Widget.Base">
|
||||
|
Loading…
x
Reference in New Issue
Block a user