hiding approve/deny follow request for third party credentials

fixed #504
This commit is contained in:
Mariotaku Lee 2016-04-17 14:38:16 +08:00
parent 3629c4cba0
commit 844233bc7f
3 changed files with 16 additions and 9 deletions

View File

@ -19,6 +19,7 @@
package org.mariotaku.twidere.fragment;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
@ -70,6 +71,7 @@ public class IncomingFriendshipsFragment extends CursorSupportUsersListFragment
mTwitterWrapper.denyFriendshipAsync(user.account_key, user.key);
}
@SuppressLint("SwitchIntDef")
@Override
protected boolean shouldRemoveUser(int position, FriendshipTaskEvent event) {
if (!event.isSucceeded()) return false;

View File

@ -47,6 +47,7 @@ import org.mariotaku.twidere.util.KeyboardShortcutsHandler;
import org.mariotaku.twidere.util.KeyboardShortcutsHandler.KeyboardShortcutCallback;
import org.mariotaku.twidere.util.ParcelUtils;
import org.mariotaku.twidere.util.RecyclerViewNavigationHelper;
import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.view.holder.UserViewHolder;
import java.util.List;
@ -102,7 +103,11 @@ public abstract class ParcelableUsersFragment extends AbsContentListRecyclerView
@Override
protected ParcelableUsersAdapter onCreateAdapter(Context context, boolean compact) {
final ParcelableUsersAdapter adapter = new ParcelableUsersAdapter(context);
adapter.setFollowClickListener(this);
if (Utils.isOfficialCredentials(context, Utils.getAccountKey(context, getArguments()))) {
adapter.setFollowClickListener(this);
} else {
adapter.setFollowClickListener(null);
}
return adapter;
}
@ -211,10 +216,6 @@ public abstract class ParcelableUsersFragment extends AbsContentListRecyclerView
return data == null || !data.isEmpty();
}
protected void removeUsers(String... ids) {
//TODO remove from adapter
}
public final List<ParcelableUser> getData() {
return getAdapter().getData();
}

View File

@ -69,9 +69,13 @@ public class HtmlSpanBuilder {
}
private static void applyTag(SpannableStringBuilder sb, int start, int end, TagInfo info) {
final Object span = createSpan(info);
if (span == null) return;
sb.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
if (info.name.equalsIgnoreCase("br")) {
sb.append('\n');
} else {
final Object span = createSpan(info);
if (span == null) return;
sb.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
private static Object createSpan(TagInfo info) {
@ -142,7 +146,7 @@ public class HtmlSpanBuilder {
public HtmlSpanHandler(HtmlParsingConfiguration conf) {
super(conf);
this.sb = new SpannableStringBuilder();
sb = new SpannableStringBuilder();
tagInfo = new ArrayList<>();
}