mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-24 00:44:43 +01:00
Blur the preview image if the post is NSFW. Tweak some layouts. Optimize some methods.
This commit is contained in:
parent
4364e20e36
commit
6637cefc05
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -43,9 +43,9 @@ dependencies {
|
|||||||
implementation 'com.android.support:customtabs:28.0.0-rc01'
|
implementation 'com.android.support:customtabs:28.0.0-rc01'
|
||||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
||||||
implementation 'com.android.support:cardview-v7:28.0.0-rc01'
|
implementation 'com.android.support:cardview-v7:28.0.0-rc01'
|
||||||
implementation 'com.github.bumptech.glide:glide:4.6.1'
|
implementation 'com.github.bumptech.glide:glide:4.7.1'
|
||||||
implementation 'com.github.pwittchen:swipe-rx2:0.3.0'
|
implementation 'com.github.pwittchen:swipe-rx2:0.3.0'
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
|
||||||
// Room components
|
// Room components
|
||||||
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
|
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
|
||||||
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
|
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
|
||||||
@ -58,4 +58,5 @@ dependencies {
|
|||||||
implementation 'org.sufficientlysecure:html-textview:3.6'
|
implementation 'org.sufficientlysecure:html-textview:3.6'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
|
implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
|
||||||
|
implementation 'jp.wasabeef:glide-transformations:3.3.0'
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,18 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.RequestBuilder;
|
||||||
import com.bumptech.glide.RequestManager;
|
import com.bumptech.glide.RequestManager;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import de.hdodenhof.circleimageview.CircleImageView;
|
import de.hdodenhof.circleimageview.CircleImageView;
|
||||||
|
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by alex on 2/25/18.
|
* Created by alex on 2/25/18.
|
||||||
@ -171,19 +174,9 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||||||
((DataViewHolder) holder).relativeLayout.setVisibility(View.VISIBLE);
|
((DataViewHolder) holder).relativeLayout.setVisibility(View.VISIBLE);
|
||||||
((DataViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
|
((DataViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
|
||||||
((DataViewHolder) holder).imageView.setVisibility(View.VISIBLE);
|
((DataViewHolder) holder).imageView.setVisibility(View.VISIBLE);
|
||||||
}
|
|
||||||
|
|
||||||
if(mPostData.get(position).isStickied()) {
|
String previewUrl = mPostData.get(position).getPreviewUrl();
|
||||||
((DataViewHolder) holder).stickiedPostImageView.setVisibility(View.VISIBLE);
|
RequestBuilder imageRequestBuilder = glide.load(previewUrl).listener(new RequestListener<Drawable>() {
|
||||||
glide.load(R.drawable.thumbtack).into(((DataViewHolder) holder).stickiedPostImageView);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (mPostData.get(position).getPostType()) {
|
|
||||||
case PostData.IMAGE_TYPE:
|
|
||||||
((DataViewHolder) holder).typeTextView.setText("IMAGE");
|
|
||||||
final String previewImageUrl = mPostData.get(position).getPreviewUrl();
|
|
||||||
final String imageUrl = mPostData.get(position).getUrl();
|
|
||||||
glide.load(previewImageUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
||||||
return false;
|
return false;
|
||||||
@ -194,7 +187,26 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||||||
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
|
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).into(((DataViewHolder) holder).imageView);
|
});
|
||||||
|
|
||||||
|
if(mPostData.get(position).isNSFW()) {
|
||||||
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(25, 3)))
|
||||||
|
.into(((DataViewHolder) holder).imageView);
|
||||||
|
} else {
|
||||||
|
imageRequestBuilder.into(((DataViewHolder) holder).imageView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mPostData.get(position).isStickied()) {
|
||||||
|
((DataViewHolder) holder).stickiedPostImageView.setVisibility(View.VISIBLE);
|
||||||
|
glide.load(R.drawable.thumbtack).into(((DataViewHolder) holder).stickiedPostImageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (mPostData.get(position).getPostType()) {
|
||||||
|
case PostData.IMAGE_TYPE:
|
||||||
|
((DataViewHolder) holder).typeTextView.setText("IMAGE");
|
||||||
|
|
||||||
|
final String imageUrl = mPostData.get(position).getUrl();
|
||||||
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -209,20 +221,7 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||||||
break;
|
break;
|
||||||
case PostData.LINK_TYPE:
|
case PostData.LINK_TYPE:
|
||||||
((DataViewHolder) holder).typeTextView.setText("LINK");
|
((DataViewHolder) holder).typeTextView.setText("LINK");
|
||||||
String linkPreviewUrl = mPostData.get(position).getPreviewUrl();
|
|
||||||
glide.load(linkPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(((DataViewHolder) holder).imageView);
|
|
||||||
final String linkUrl = mPostData.get(position).getUrl();
|
|
||||||
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -231,29 +230,14 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||||||
builder.addDefaultShareMenuItem();
|
builder.addDefaultShareMenuItem();
|
||||||
builder.setToolbarColor(mContext.getResources().getColor(R.color.colorPrimary));
|
builder.setToolbarColor(mContext.getResources().getColor(R.color.colorPrimary));
|
||||||
CustomTabsIntent customTabsIntent = builder.build();
|
CustomTabsIntent customTabsIntent = builder.build();
|
||||||
customTabsIntent.launchUrl(mContext, Uri.parse(linkUrl));
|
customTabsIntent.launchUrl(mContext, Uri.parse(mPostData.get(position).getUrl()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case PostData.GIF_VIDEO_TYPE:
|
case PostData.GIF_VIDEO_TYPE:
|
||||||
((DataViewHolder) holder).typeTextView.setText("GIF");
|
((DataViewHolder) holder).typeTextView.setText("GIF");
|
||||||
String gifVideoPreviewUrl = mPostData.get(position).getPreviewUrl();
|
|
||||||
glide.load(gifVideoPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(((DataViewHolder) holder).imageView);
|
|
||||||
|
|
||||||
String gifVideoUrl = mPostData.get(position).getVideoUrl();
|
|
||||||
final Uri gifVideoUri = Uri.parse(gifVideoUrl);
|
|
||||||
|
|
||||||
|
final Uri gifVideoUri = Uri.parse(mPostData.get(position).getVideoUrl());
|
||||||
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -273,23 +257,8 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||||||
break;
|
break;
|
||||||
case PostData.VIDEO_TYPE:
|
case PostData.VIDEO_TYPE:
|
||||||
((DataViewHolder) holder).typeTextView.setText("VIDEO");
|
((DataViewHolder) holder).typeTextView.setText("VIDEO");
|
||||||
String videoPreviewUrl = mPostData.get(position).getPreviewUrl();
|
|
||||||
glide.load(videoPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(((DataViewHolder) holder).imageView);
|
|
||||||
|
|
||||||
String videoUrl = mPostData.get(position).getVideoUrl();
|
|
||||||
final Uri videoUri = Uri.parse(videoUrl);
|
|
||||||
|
|
||||||
|
final Uri videoUri = Uri.parse(mPostData.get(position).getVideoUrl());
|
||||||
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
((DataViewHolder) holder).imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -25,9 +25,11 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.RequestBuilder;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
|
||||||
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
||||||
@ -35,6 +37,7 @@ import org.sufficientlysecure.htmltextview.HtmlTextView;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import de.hdodenhof.circleimageview.CircleImageView;
|
import de.hdodenhof.circleimageview.CircleImageView;
|
||||||
|
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||||
|
|
||||||
public class ViewPostDetailActivity extends AppCompatActivity {
|
public class ViewPostDetailActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@ -132,6 +135,32 @@ public class ViewPostDetailActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mPostData.getPostType() != PostData.TEXT_TYPE && mPostData.getPostType() != PostData.NO_PREVIEW_LINK_TYPE) {
|
||||||
|
relativeLayout.setVisibility(View.VISIBLE);
|
||||||
|
imageView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
RequestBuilder imageRequestBuilder = Glide.with(this).load(mPostData.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
||||||
|
@Override
|
||||||
|
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
||||||
|
//Need to be implemented
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(mPostData.isNSFW()) {
|
||||||
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 3)))
|
||||||
|
.into(imageView);
|
||||||
|
} else {
|
||||||
|
imageRequestBuilder.into(imageView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mRecyclerView.setNestedScrollingEnabled(false);
|
mRecyclerView.setNestedScrollingEnabled(false);
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
|
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
|
||||||
@ -166,20 +195,6 @@ public class ViewPostDetailActivity extends AppCompatActivity {
|
|||||||
switch (mPostData.getPostType()) {
|
switch (mPostData.getPostType()) {
|
||||||
case PostData.IMAGE_TYPE:
|
case PostData.IMAGE_TYPE:
|
||||||
typeTextView.setText("IMAGE");
|
typeTextView.setText("IMAGE");
|
||||||
relativeLayout.setVisibility(View.VISIBLE);
|
|
||||||
Glide.with(this).load(mPostData.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
//Need to be implemented
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(imageView);
|
|
||||||
imageView.setOnClickListener(new View.OnClickListener() {
|
imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -193,26 +208,12 @@ public class ViewPostDetailActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case PostData.LINK_TYPE:
|
case PostData.LINK_TYPE:
|
||||||
relativeLayout.setVisibility(View.VISIBLE);
|
|
||||||
typeTextView.setText("LINK");
|
typeTextView.setText("LINK");
|
||||||
if(!mPostData.getSelfText().equals("")) {
|
if(!mPostData.getSelfText().equals("")) {
|
||||||
contentTextView.setVisibility(View.VISIBLE);
|
contentTextView.setVisibility(View.VISIBLE);
|
||||||
contentTextView.setHtml(mPostData.getSelfText());
|
contentTextView.setHtml(mPostData.getSelfText());
|
||||||
}
|
}
|
||||||
String linkPreviewUrl = mPostData.getPreviewUrl();
|
|
||||||
Glide.with(this).load(linkPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(imageView);
|
|
||||||
final String linkUrl = mPostData.getUrl();
|
|
||||||
imageView.setOnClickListener(new View.OnClickListener() {
|
imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -221,30 +222,14 @@ public class ViewPostDetailActivity extends AppCompatActivity {
|
|||||||
builder.addDefaultShareMenuItem();
|
builder.addDefaultShareMenuItem();
|
||||||
builder.setToolbarColor(getResources().getColor(R.color.colorPrimary));
|
builder.setToolbarColor(getResources().getColor(R.color.colorPrimary));
|
||||||
CustomTabsIntent customTabsIntent = builder.build();
|
CustomTabsIntent customTabsIntent = builder.build();
|
||||||
customTabsIntent.launchUrl(ViewPostDetailActivity.this, Uri.parse(linkUrl));
|
customTabsIntent.launchUrl(ViewPostDetailActivity.this, Uri.parse(mPostData.getUrl()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case PostData.GIF_VIDEO_TYPE:
|
case PostData.GIF_VIDEO_TYPE:
|
||||||
relativeLayout.setVisibility(View.VISIBLE);
|
|
||||||
typeTextView.setText("VIDEO");
|
typeTextView.setText("VIDEO");
|
||||||
String gifVideoPreviewUrl = mPostData.getPreviewUrl();
|
|
||||||
Glide.with(this).load(gifVideoPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(imageView);
|
|
||||||
|
|
||||||
String gifVideoUrl = mPostData.getVideoUrl();
|
|
||||||
final Uri gifVideoUri = Uri.parse(gifVideoUrl);
|
|
||||||
|
|
||||||
|
final Uri gifVideoUri = Uri.parse(mPostData.getVideoUrl());
|
||||||
imageView.setOnClickListener(new View.OnClickListener() {
|
imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -263,25 +248,9 @@ public class ViewPostDetailActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case PostData.VIDEO_TYPE:
|
case PostData.VIDEO_TYPE:
|
||||||
relativeLayout.setVisibility(View.VISIBLE);
|
|
||||||
typeTextView.setText("VIDEO");
|
typeTextView.setText("VIDEO");
|
||||||
String videoPreviewUrl = mPostData.getPreviewUrl();
|
|
||||||
Glide.with(this).load(videoPreviewUrl).listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).into(imageView);
|
|
||||||
|
|
||||||
String videoUrl = mPostData.getVideoUrl();
|
|
||||||
final Uri videoUri = Uri.parse(videoUrl);
|
|
||||||
|
|
||||||
|
final Uri videoUri = Uri.parse(mPostData.getVideoUrl());
|
||||||
imageView.setOnClickListener(new View.OnClickListener() {
|
imageView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/relative_view_view_post_detail"
|
android:id="@+id/relative_layout_view_post_detail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
@ -89,17 +89,17 @@
|
|||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/type_text_view_view_post_detail"
|
android:id="@+id/type_text_view_view_post_detail"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:background="@drawable/rounded_corner"
|
android:background="@drawable/rounded_corner"
|
||||||
android:textColor="@android:color/white" />
|
android:textColor="@android:color/white" />
|
||||||
|
|
||||||
@ -130,11 +130,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/nsfw"
|
android:text="@string/nsfw"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:background="@drawable/nsfw_rounded_corner"
|
android:background="@drawable/nsfw_rounded_corner"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/nsfw_rounded_corner"
|
android:background="@drawable/nsfw_rounded_corner"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user