Improves layout for accounts

This commit is contained in:
tom79 2017-07-31 19:29:14 +02:00
parent 8a1be63a4e
commit 8aac521e0c
36 changed files with 220 additions and 151 deletions

View File

@ -24,6 +24,7 @@ import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
@ -32,9 +33,13 @@ import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
@ -46,6 +51,7 @@ import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
@ -87,14 +93,14 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
private DisplayImageOptions options;
private List<Status> statuses;
private StatusListAdapter statusListAdapter;
private Button account_follow;
private FloatingActionButton account_follow;
private static final int NUM_PAGES = 3;
private ViewPager mPager;
private String accountId;
private TabLayout tabLayout;
private BroadcastReceiver hide_header;
private TextView account_note;
private TextView account_note, account_follow_request;
private String userId;
private boolean isHiddingShowing = false;
private static int instanceValue = 0;
@ -118,10 +124,12 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
}else {
setTheme(R.style.AppThemeDark);
}
setTitle("");
setContentView(R.layout.activity_show_account);
instanceValue += 1;
Bundle b = getIntent().getExtras();
account_follow = (Button) findViewById(R.id.account_follow);
account_follow = (FloatingActionButton) findViewById(R.id.account_follow);
account_follow_request = (TextView) findViewById(R.id.account_follow_request);
account_follow.setEnabled(false);
if(b != null){
accountId = b.getString("accountId");
@ -148,7 +156,7 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
boolean isOnWifi = Helper.isOnWIFI(getApplicationContext());
int behaviorWithAttachments = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
statusListAdapter = new StatusListAdapter(getApplicationContext(), RetrieveFeedsAsyncTask.Type.USER, accountId, isOnWifi, behaviorWithAttachments, this.statuses);
options = new DisplayImageOptions.Builder().displayer(new SimpleBitmapDisplayer()).cacheInMemory(false)
options = new DisplayImageOptions.Builder().displayer(new RoundedBitmapDisplayer(80)).cacheInMemory(false)
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
@ -210,13 +218,11 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
if( !isHiddingShowing ){
isHiddingShowing = true;
ImageView account_pp = (ImageView) findViewById(R.id.account_pp);
TextView account_ac = (TextView) findViewById(R.id.account_ac);
boolean hide = intent.getBooleanExtra("hide", false);
if( hide){
account_follow.setVisibility(View.GONE);
account_note.setVisibility(View.GONE);
tabLayout.setVisibility(View.GONE);
account_ac.setVisibility(View.GONE);
account_pp.getLayoutParams().width = (int) Helper.convertDpToPixel(50, context);
account_pp.getLayoutParams().height = (int) Helper.convertDpToPixel(50, context);
}else {
@ -224,7 +230,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
if( accountId != null && accountId.equals(userId)){
account_follow.setVisibility(View.GONE);
}
account_ac.setVisibility(View.VISIBLE);
account_pp.getLayoutParams().width = (int) Helper.convertDpToPixel(80, context);
account_pp.getLayoutParams().height = (int) Helper.convertDpToPixel(80, context);
tabLayout.setVisibility(View.VISIBLE);
@ -301,17 +306,26 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
ImageView account_pp = (ImageView) findViewById(R.id.account_pp);
TextView account_dn = (TextView) findViewById(R.id.account_dn);
TextView account_un = (TextView) findViewById(R.id.account_un);
TextView account_ac = (TextView) findViewById(R.id.account_ac);
ActionBar actionBar = getSupportActionBar();
LayoutInflater mInflater = LayoutInflater.from(ShowAccountActivity.this);
if( actionBar != null){
View show_account_actionbar = mInflater.inflate(R.layout.showaccount_actionbar, null);
TextView actionbar_title = (TextView) show_account_actionbar.findViewById(R.id.show_account_title);
if( account != null && account.getAcct() != null)
actionbar_title.setText(account.getAcct());
actionBar.setCustomView(show_account_actionbar);
actionBar.setDisplayShowCustomEnabled(true);
}else {
if( account != null && account.getAcct() != null)
setTitle(account.getAcct());
}
if( account != null){
setTitle(account.getAcct());
account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
account_un.setText(String.format("@%s", account.getUsername()));
if( account.getAcct() != null && account.getAcct().equals(account.getUsername()))
account_ac.setVisibility(View.GONE);
else
account_ac.setText(account.getAcct());
account_note = Helper.clickableElementsDescription(ShowAccountActivity.this, account_note,account.getNote());
SpannableString spannableString = Helper.clickableElementsDescription(ShowAccountActivity.this, account.getNote());
account_note.setText(spannableString, TextView.BufferType.SPANNABLE);
account_note.setMovementMethod(LinkMovementMethod.getInstance());
tabLayout.getTabAt(0).setText(getString(R.string.status_cnt, account.getStatuses_count()));
tabLayout.getTabAt(1).setText(getString(R.string.following_cnt, account.getFollowing_count()));
tabLayout.getTabAt(2).setText(getString(R.string.followers_cnt, account.getFollowers_count()));
@ -347,21 +361,20 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
}
account_follow.setEnabled(true);
if( relationship.isBlocking()){
account_follow.setText(R.string.action_unblock);
account_follow.setImageResource(R.drawable.ic_unlock_alt);
doAction = action.UNBLOCK;
}else if( relationship.isRequested()){
account_follow.setText(R.string.request_sent);
account_follow.getBackground().setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary), PorterDuff.Mode.MULTIPLY);
account_follow_request.setVisibility(View.VISIBLE);
account_follow.setVisibility(View.GONE);
doAction = action.NOTHING;
}else if( relationship.isFollowing()){
account_follow.setText(R.string.action_unfollow);
account_follow.setImageResource(R.drawable.ic_user_times);
doAction = action.UNFOLLOW;
}else if( !relationship.isFollowing()){
account_follow.setText(R.string.action_follow);
account_follow.setImageResource(R.drawable.ic_user_plus);
doAction = action.FOLLOW;
}else{
account_follow.setText(R.string.action_no_action);
account_follow.getBackground().setColorFilter(ContextCompat.getColor(this, R.color.red_1), PorterDuff.Mode.MULTIPLY);
account_follow.setVisibility(View.GONE);
doAction = action.NOTHING;
}

View File

@ -109,7 +109,8 @@ public class AccountsListAdapter extends BaseAdapter implements OnPostActionInte
.denyCacheImageMultipleSizesInMemory()
.diskCache(new UnlimitedDiskCache(cacheDir))
.build();
imageLoader.init(configImg);
if( !imageLoader.isInited())
imageLoader.init(configImg);
DisplayImageOptions options = new DisplayImageOptions.Builder().displayer(new SimpleBitmapDisplayer()).cacheInMemory(false)
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
final Account account = accounts.get(position);

View File

@ -119,7 +119,6 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
holder.notification_status_content = (TextView) convertView.findViewById(R.id.notification_status_content);
holder.notification_account_username = (TextView) convertView.findViewById(R.id.notification_account_username);
holder.notification_type = (TextView) convertView.findViewById(R.id.notification_type);
holder.notification_account_displayname = (TextView) convertView.findViewById(R.id.notification_account_displayname);
holder.notification_account_profile = (ImageView) convertView.findViewById(R.id.notification_account_profile);
holder.status_favorite_count = (TextView) convertView.findViewById(R.id.status_favorite_count);
holder.status_reblog_count = (TextView) convertView.findViewById(R.id.status_reblog_count);
@ -136,16 +135,28 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
String typeString = "";
switch (type){
case "mention":
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_mention));
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),context.getString(R.string.notif_mention));
else
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_mention));
break;
case "reblog":
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_reblog));
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),context.getString(R.string.notif_reblog));
else
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_reblog));
break;
case "favourite":
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_favourite));
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),context.getString(R.string.notif_favourite));
else
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_favourite));
break;
case "follow":
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_follow));
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),context.getString(R.string.notif_follow));
else
typeString = String.format("@%s %s", notification.getAccount().getAcct(),context.getString(R.string.notif_follow));
break;
}
holder.notification_type.setText(typeString);
@ -191,13 +202,13 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
if( (status.getIn_reply_to_account_id() != null && !status.getIn_reply_to_account_id().equals("null")) || (status.getIn_reply_to_id() != null && !status.getIn_reply_to_id().equals("null")) ){
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_reply);
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (15 * scale + 0.5f));
holder.notification_account_displayname.setCompoundDrawables( img, null, null, null);
holder.notification_account_username.setCompoundDrawables( img, null, null, null);
}else if( status.isReblogged()){
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_retweet);
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (15 * scale + 0.5f));
holder.notification_account_displayname.setCompoundDrawables( img, null, null, null);
holder.notification_account_username.setCompoundDrawables( img, null, null, null);
}else{
holder.notification_account_displayname.setCompoundDrawables( null, null, null, null);
holder.notification_account_username.setCompoundDrawables( null, null, null, null);
}
SpannableString spannableString = Helper.clickableElements(context, status.getContent(),
@ -329,7 +340,6 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
displayConfirmationNotificationDialog(notification);
}
});
holder.notification_account_displayname.setText(Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true));
holder.notification_account_username.setText( String.format("@%s",notification.getAccount().getUsername()));
//Profile picture
imageLoader.displayImage(notification.getAccount().getAvatar(), holder.notification_account_profile, options);
@ -487,7 +497,6 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
TextView notification_status_content;
TextView notification_type;
TextView notification_account_username;
TextView notification_account_displayname;
ImageView notification_account_profile;
ImageView notification_delete;
TextView status_favorite_count;

View File

@ -123,7 +123,8 @@ public class SearchListAdapter extends BaseAdapter {
.denyCacheImageMultipleSizesInMemory()
.diskCache(new UnlimitedDiskCache(cacheDir))
.build();
imageLoader.init(configImg);
if( !imageLoader.isInited())
imageLoader.init(configImg);
DisplayImageOptions options = new DisplayImageOptions.Builder().displayer(new SimpleBitmapDisplayer()).cacheInMemory(false)
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
int type = getItemViewType(position);

View File

@ -142,7 +142,8 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
.denyCacheImageMultipleSizesInMemory()
.diskCache(new UnlimitedDiskCache(cacheDir))
.build();
imageLoader.init(configImg);
if( !imageLoader.isInited())
imageLoader.init(configImg);
options = new DisplayImageOptions.Builder().displayer(new SimpleBitmapDisplayer()).cacheInMemory(false)
.cacheOnDisk(true).resetViewBeforeLoading(true).build();

View File

@ -118,7 +118,11 @@ public class DisplayAccountsFragment extends Fragment implements OnRetrieveAccou
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (view.getId() == lv_accounts.getId() && totalItemCount > visibleItemCount) {
if(firstVisibleItem == 0 && Helper.listIsAtTop(lv_accounts)){
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
intent.putExtra("hide", false);
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
}else if (view.getId() == lv_accounts.getId() && totalItemCount > visibleItemCount) {
final int currentFirstVisibleItem = lv_accounts.getFirstVisiblePosition();
if (currentFirstVisibleItem > lastFirstVisibleItem) {

View File

@ -128,9 +128,13 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (view.getId() == lv_status.getId() && totalItemCount > visibleItemCount) {
final int currentFirstVisibleItem = lv_status.getFirstVisiblePosition();
if(firstVisibleItem == 0 && Helper.listIsAtTop(lv_status)){
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
intent.putExtra("hide", false);
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
}else if (view.getId() == lv_status.getId() && totalItemCount > visibleItemCount) {
final int currentFirstVisibleItem = lv_status.getFirstVisiblePosition();
if (currentFirstVisibleItem > lastFirstVisibleItem) {
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
intent.putExtra("hide", true);
@ -231,7 +235,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
}
@Override
public void onCreate(Bundle saveInstance)
{

View File

@ -56,6 +56,7 @@ import android.text.method.ArrowKeyMovementMethod;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.DisplayMetrics;
import android.util.Patterns;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
@ -67,6 +68,7 @@ import android.webkit.URLUtil;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
@ -226,7 +228,7 @@ public class Helper {
private static final Pattern SHORTNAME_PATTERN = Pattern.compile(":([-+\\w]+):");
private static final Pattern urlPattern = Pattern.compile(
"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))",
"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,10}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))",
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL);
private static final Pattern hashtagPattern = Pattern.compile("(#[\\w_À-ú-]{1,})");
@ -1023,7 +1025,7 @@ public class Helper {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean embedded_browser = sharedpreferences.getBoolean(Helper.SET_EMBEDDED_BROWSER, true);
if( embedded_browser){
Matcher matcher = urlPattern.matcher(spannableString);
Matcher matcher = Patterns.WEB_URL.matcher(spannableString);
while (matcher.find()){
int matchStart = matcher.start(1);
int matchEnd = matcher.end();
@ -1033,7 +1035,10 @@ public class Helper {
public void onClick(View textView) {
Intent intent = new Intent(context, WebviewActivity.class);
Bundle b = new Bundle();
b.putString("url", url);
String finalUrl = url;
if( !url.startsWith("http://") && ! url.startsWith("https://"))
finalUrl = "http://" + url;
b.putString("url", finalUrl);
intent.putExtras(b);
context.startActivity(intent);
}
@ -1098,14 +1103,6 @@ public class Helper {
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
return spannableString;
/*
statusTV.setText(spannableString, TextView.BufferType.SPANNABLE);
statusTV.setMovementMethod(null);
statusTV.setMovementMethod(LinkMovementMethod.getInstance());
statusTV.setMovementMethod(ArrowKeyMovementMethod.getInstance());
statusTV.setFocusable(true);
statusTV.setFocusableInTouchMode(true);
return statusTV;*/
}
@ -1115,11 +1112,10 @@ public class Helper {
* Click on url => webview or external app
* Click on tag => HashTagActivity
* @param context Context
* @param statusTV Textview
* @param fullContent String, should be the st
* @return TextView
*/
public static TextView clickableElementsDescription(final Context context, TextView statusTV, String fullContent) {
public static SpannableString clickableElementsDescription(final Context context, String fullContent) {
SpannableString spannableString;
fullContent = Helper.shortnameToUnicode(fullContent, true);
@ -1131,7 +1127,7 @@ public class Helper {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean embedded_browser = sharedpreferences.getBoolean(Helper.SET_EMBEDDED_BROWSER, true);
if( embedded_browser){
Matcher matcher = urlPattern.matcher(spannableString);
Matcher matcher = Patterns.WEB_URL.matcher(spannableString);
while (matcher.find()){
int matchStart = matcher.start(1);
int matchEnd = matcher.end();
@ -1172,11 +1168,7 @@ public class Helper {
}
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
statusTV.setText(spannableString, TextView.BufferType.SPANNABLE);
statusTV.setMovementMethod(null);
statusTV.setMovementMethod(LinkMovementMethod.getInstance());
return statusTV;
return spannableString;
}
@ -1398,4 +1390,13 @@ public class Helper {
}
}
}
/**
* Returns true if a ListView is at its top position
* @param listView ListView
* @return boolean
*/
public static boolean listIsAtTop(ListView listView) {
return listView.getChildCount() == 0 || listView.getChildAt(0).getTop() == 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -17,96 +17,108 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
>
android:orientation="vertical">
<LinearLayout
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:layout_height="wrap_content"
>
<ImageView
android:padding="10dp"
android:id="@+id/account_pp"
android:layout_width="80dp"
android:layout_height="80dp"
tools:ignore="ContentDescription" />
android:orientation="vertical">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_height="wrap_content">
android:id="@+id/header_container"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:layout_height="wrap_content"
>
<ImageView
android:padding="10dp"
android:id="@+id/account_pp"
android:layout_width="80dp"
android:layout_height="80dp"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/account_dn"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
android:gravity="center"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/account_dn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
<android.support.design.widget.FloatingActionButton
android:layout_gravity="top|end"
app:fabSize="mini"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:gravity="center"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/account_un"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:id="@+id/account_followed_by"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:textColor="?attr/colorAccent"
android:text="@string/followed_by"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/account_follow_request"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:textColor="?attr/colorAccent"
android:text="@string/request_sent"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
/>
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/account_followed_by"
android:layout_gravity="center"
android:gravity="center"
android:textColor="?attr/colorAccent"
android:text="@string/followed_by"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:id="@+id/account_ac"
android:gravity="center"
android:maxLines="1"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:layout_marginTop="10dp"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:gravity="center"
android:layout_gravity="end"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginBottom="10dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/action_follow" />
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="10dp"
android:gravity="center"
android:layout_width="match_parent"
android:maxLines="4"
android:autoLink="web"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="5dp"
android:gravity="center"
android:layout_width="match_parent"
android:maxLines="3"
android:autoLink="web"
android:layout_height="wrap_content" />
<android.support.design.widget.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"

View File

@ -64,29 +64,19 @@
<TextView
android:padding="5dp"
android:id="@+id/notification_type"
android:textStyle="bold"
android:textSize="16sp"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/notification_account_displayname"
android:drawablePadding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:id="@+id/notification_account_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:id="@+id/notification_account_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/status_date"
android:layout_width="match_parent"
android:textSize="12sp"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:layout_gravity="end"

View File

@ -101,7 +101,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/status_account_displayname"
android:textSize="16sp"
android:textSize="14sp"
android:textStyle="bold"
android:maxLines="1"
android:drawablePadding="2dp"
@ -110,8 +110,7 @@
<TextView
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:textSize="14sp"
android:textStyle="bold"
android:textSize="12sp"
android:maxLines="1"
android:id="@+id/status_account_username"
android:layout_width="wrap_content"
@ -130,6 +129,7 @@
android:id="@+id/status_toot_date"
android:layout_width="match_parent"
android:paddingRight="10dp"
android:textSize="12sp"
android:paddingLeft="10dp"
android:layout_gravity="end"
android:gravity="end"

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Mastalab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_gravity="center_vertical"
android:id="@+id/show_account_title"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
/>
</LinearLayout>