Profile about tab
This commit is contained in:
@@ -22,7 +22,7 @@ import me.grishka.appkit.imageloader.requests.UrlImageLoaderRequest;
|
||||
import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.utils.V;
|
||||
|
||||
public class TextStatusDisplayItem extends StatusDisplayItem implements LinkSpan.OnLinkClickListener{
|
||||
public class TextStatusDisplayItem extends StatusDisplayItem{
|
||||
private CharSequence text;
|
||||
private ImageLoaderRequest[] emojiRequests;
|
||||
private Fragment parentFragment;
|
||||
@@ -37,10 +37,6 @@ public class TextStatusDisplayItem extends StatusDisplayItem implements LinkSpan
|
||||
for(int i=0; i<emojiSpans.length; i++){
|
||||
emojiRequests[i]=new UrlImageLoaderRequest(emojiSpans[i].emoji.url, emojiSize, emojiSize);
|
||||
}
|
||||
LinkSpan[] linkSpans=((Spanned) text).getSpans(0, text.length(), LinkSpan.class);
|
||||
for(LinkSpan span:linkSpans){
|
||||
span.setListener(this);
|
||||
}
|
||||
}else{
|
||||
emojiRequests=new ImageLoaderRequest[0];
|
||||
}
|
||||
@@ -61,14 +57,6 @@ public class TextStatusDisplayItem extends StatusDisplayItem implements LinkSpan
|
||||
return emojiRequests[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLinkClick(LinkSpan span){
|
||||
switch(span.getType()){
|
||||
case URL -> UiUtils.launchWebBrowser(parentFragment.getActivity(), span.getLink());
|
||||
case HASHTAG, MENTION -> Toast.makeText(parentFragment.getActivity(), "Not implemented yet", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Holder extends StatusDisplayItem.Holder<TextStatusDisplayItem> implements ImageLoaderViewHolder{
|
||||
private final LinkedTextView text;
|
||||
private CustomEmojiSpan[] emojiSpans;
|
||||
|
||||
@@ -323,6 +323,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
|
||||
params.height=item.getHeight();
|
||||
wrap.setBackground(listener.getPhotoViewCurrentDrawable(getAbsoluteAdapterPosition()));
|
||||
if(itemView.isAttachedToWindow()){
|
||||
reset();
|
||||
prepareAndStartPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.joinmastodon.android.ui.text;
|
||||
import android.content.Context;
|
||||
import android.text.TextPaint;
|
||||
import android.text.style.CharacterStyle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
|
||||
public class LinkSpan extends CharacterStyle {
|
||||
|
||||
@@ -31,8 +34,10 @@ public class LinkSpan extends CharacterStyle {
|
||||
}
|
||||
|
||||
public void onClick(Context context){
|
||||
if(listener!=null)
|
||||
listener.onLinkClick(this);
|
||||
switch(getType()){
|
||||
case URL -> UiUtils.launchWebBrowser(context, link);
|
||||
case HASHTAG, MENTION -> Toast.makeText(context, "Not implemented yet", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public String getLink(){
|
||||
|
||||
@@ -52,7 +52,7 @@ public class NestedRecyclerScrollView extends CustomScrollView{
|
||||
private boolean isScrolledToTop(RecyclerView rv) {
|
||||
final LinearLayoutManager lm = (LinearLayoutManager) rv.getLayoutManager();
|
||||
return lm.findFirstVisibleItemPosition() == 0
|
||||
&& lm.findViewByPosition(0).getTop() == 0;
|
||||
&& lm.findViewByPosition(0).getTop() == rv.getPaddingTop();
|
||||
}
|
||||
|
||||
public void setScrollableChildSupplier(Supplier<RecyclerView> scrollableChildSupplier){
|
||||
|
||||
Reference in New Issue
Block a user