Some improvements
This commit is contained in:
parent
6c987e611b
commit
a205d072ca
|
@ -102,7 +102,7 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
|
||||||
}
|
}
|
||||||
//Redraws icon for locked accounts
|
//Redraws icon for locked accounts
|
||||||
final float scale = context.getResources().getDisplayMetrics().density;
|
final float scale = context.getResources().getDisplayMetrics().density;
|
||||||
if( account != null && account.isLocked()){
|
if( account.isLocked()){
|
||||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_lock_outline);
|
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_lock_outline);
|
||||||
assert img != null;
|
assert img != null;
|
||||||
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (20 * scale + 0.5f));
|
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (20 * scale + 0.5f));
|
||||||
|
@ -110,31 +110,38 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
|
||||||
}else{
|
}else{
|
||||||
holder.account_dn.setCompoundDrawables( null, null, null, null);
|
holder.account_dn.setCompoundDrawables( null, null, null, null);
|
||||||
}
|
}
|
||||||
if( account.isFollowing()){
|
|
||||||
holder.account_follow.hide();
|
|
||||||
}else{
|
|
||||||
holder.account_follow.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !account.getSocial().contains("OPENCOLLECTIVE")) {
|
if( !account.getSocial().contains("OPENCOLLECTIVE")) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
assert account != null;
|
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
||||||
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
} else {
|
} else {
|
||||||
assert account != null;
|
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
||||||
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
}
|
}
|
||||||
|
if( account.isFollowing()){
|
||||||
|
holder.account_follow.hide();
|
||||||
|
}else{
|
||||||
|
holder.account_follow.show();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
||||||
holder.account_un.setText(account.getAcct());
|
holder.account_un.setText(account.getAcct());
|
||||||
holder.account_follow.hide();
|
holder.account_follow.hide();
|
||||||
}
|
}
|
||||||
Helper.changeDrawableColor(context, R.drawable.ic_lock_outline,R.color.mastodonC4);
|
Helper.changeDrawableColor(context, R.drawable.ic_lock_outline,R.color.mastodonC4);
|
||||||
//Profile picture
|
//Profile picture
|
||||||
Glide.with(holder.account_pp.getContext())
|
|
||||||
.load(account.getAvatar())
|
if( account.getAvatar().startsWith("http")) {
|
||||||
.into(holder.account_pp);
|
Glide.with(holder.account_pp.getContext())
|
||||||
|
.load(account.getAvatar())
|
||||||
|
.into(holder.account_pp);
|
||||||
|
}else if(account.getSocial().contains("OPENCOLLECTIVE")){
|
||||||
|
Glide.with(holder.account_pp.getContext())
|
||||||
|
.load(R.drawable.missing)
|
||||||
|
.into(holder.account_pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if( !account.getSocial().contains("OPENCOLLECTIVE")) {
|
if( !account.getSocial().contains("OPENCOLLECTIVE")) {
|
||||||
|
@ -156,6 +163,13 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
holder.acccount_container.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Helper.openBrowser(context, account.getUrl());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 548 B |
Binary file not shown.
After Width: | Height: | Size: 902 B |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -161,7 +161,7 @@
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_opencollective"
|
android:id="@+id/nav_opencollective"
|
||||||
android:icon="@drawable/ic_attach_money"
|
android:icon="@drawable/ic_opencollective"
|
||||||
android:title="Open Collective" />
|
android:title="Open Collective" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_how_to"
|
android:id="@+id/nav_how_to"
|
||||||
|
|
Loading…
Reference in New Issue