Links in user bios can be clicked on.
This commit is contained in:
parent
62ff735878
commit
cad060282b
2 changed files with 11 additions and 4 deletions
|
@ -28,6 +28,7 @@ import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -110,7 +111,9 @@ public class AccountActivity extends AppCompatActivity {
|
||||||
tabLayout.setupWithViewPager(viewPager);
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
for (int i = 0; i < tabLayout.getTabCount(); i++) {
|
for (int i = 0; i < tabLayout.getTabCount(); i++) {
|
||||||
TabLayout.Tab tab = tabLayout.getTabAt(i);
|
TabLayout.Tab tab = tabLayout.getTabAt(i);
|
||||||
tab.setCustomView(adapter.getTabView(i));
|
if (tab != null) {
|
||||||
|
tab.setCustomView(adapter.getTabView(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +169,7 @@ public class AccountActivity extends AppCompatActivity {
|
||||||
|
|
||||||
note.setText(account.note);
|
note.setText(account.note);
|
||||||
note.setLinksClickable(true);
|
note.setLinksClickable(true);
|
||||||
|
note.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
||||||
ImageLoader imageLoader = VolleySingleton.getInstance(this).getImageLoader();
|
ImageLoader imageLoader = VolleySingleton.getInstance(this).getImageLoader();
|
||||||
if (!account.avatar.isEmpty()) {
|
if (!account.avatar.isEmpty()) {
|
||||||
|
@ -187,8 +191,10 @@ public class AccountActivity extends AppCompatActivity {
|
||||||
TabLayout.Tab tab = tabLayout.getTabAt(i);
|
TabLayout.Tab tab = tabLayout.getTabAt(i);
|
||||||
if (tab != null) {
|
if (tab != null) {
|
||||||
View view = tab.getCustomView();
|
View view = tab.getCustomView();
|
||||||
TextView total = (TextView) view.findViewById(R.id.total);
|
if (view != null) {
|
||||||
total.setText(counts[i]);
|
TextView total = (TextView) view.findViewById(R.id.total);
|
||||||
|
total.setText(counts[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,8 @@ public class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
public void setContent(Spanned content, Status.Mention[] mentions,
|
public void setContent(Spanned content, Status.Mention[] mentions,
|
||||||
final StatusActionListener listener) {
|
final StatusActionListener listener) {
|
||||||
// Redirect URLSpan's in the status content to the listener for viewing tag pages.
|
/* Redirect URLSpan's in the status content to the listener for viewing tag pages and
|
||||||
|
* account pages. */
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder(content);
|
SpannableStringBuilder builder = new SpannableStringBuilder(content);
|
||||||
URLSpan[] urlSpans = content.getSpans(0, content.length(), URLSpan.class);
|
URLSpan[] urlSpans = content.getSpans(0, content.length(), URLSpan.class);
|
||||||
for (URLSpan span : urlSpans) {
|
for (URLSpan span : urlSpans) {
|
||||||
|
|
Loading…
Reference in a new issue