Merged original_master into PhotonQyv-Baseline

This commit is contained in:
PhotonQyv 2017-10-15 16:00:38 +01:00
commit 42998e2e02
84 changed files with 549 additions and 522 deletions

View File

@ -7,8 +7,8 @@ android {
applicationId "fr.gouv.etalab.mastodon"
minSdkVersion 15
targetSdkVersion 26
versionCode 61
versionName "1.5.1"
versionCode 62
versionName "1.5.2"
}
buildTypes {
release {

View File

@ -972,14 +972,14 @@ public class MainActivity extends AppCompatActivity
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
changeDrawableColor(getApplicationContext(), R.drawable.ic_reply,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_more,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_open,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_more,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_globe,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_open,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_closed,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_favorite_border,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_remove_red_eye,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_translate,R.color.dark_text);

View File

@ -33,14 +33,17 @@ import android.support.annotation.RequiresApi;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.transition.Visibility;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.content.ContextCompat;
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.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.util.Log;
@ -117,7 +120,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
private Relationship relationship;
private boolean showMediaOnly, showPinned;
private ImageView pp_actionBar;
private LinearLayout small_info;
private ImageView header_edit_profile;
private List<Status> pins;
private String accountUrl;
@ -152,7 +154,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
Bundle b = getIntent().getExtras();
account_follow = (FloatingActionButton) findViewById(R.id.account_follow);
account_follow_request = (TextView) findViewById(R.id.account_follow_request);
small_info = (LinearLayout) findViewById(R.id.small_info);
header_edit_profile = (ImageView) findViewById(R.id.header_edit_profile);
account_follow.setEnabled(false);
if(b != null){
@ -293,10 +294,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
switch (item.getItemId()) {
case R.id.action_show_pinned:
showPinned = !showPinned;
if( showPinned )
item.setIcon(R.drawable.ic_clear_all);
else
item.setIcon(R.drawable.ic_action_pin);
if( tabLayout.getTabAt(0) != null)
//noinspection ConstantConditions
tabLayout.getTabAt(0).select();
@ -305,10 +302,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
return true;
case R.id.action_show_media:
showMediaOnly = !showMediaOnly;
if( showMediaOnly )
item.setIcon(R.drawable.ic_clear_all);
else
item.setIcon(R.drawable.ic_perm_media);
if( tabLayout.getTabAt(0) != null)
//noinspection ConstantConditions
tabLayout.getTabAt(0).select();
@ -448,27 +441,30 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (Math.abs(verticalOffset)-appBar.getTotalScrollRange() == 0) {
if( small_info.getVisibility() == View.GONE)
small_info.setVisibility(View.VISIBLE);
}else {
if( small_info.getVisibility() == View.VISIBLE)
small_info.setVisibility(View.GONE);
LinearLayout toolbarContent = findViewById(R.id.toolbar_content);
if( toolbarContent != null) {
if (Math.abs(verticalOffset) - appBar.getTotalScrollRange() == 0) {
if (toolbarContent.getVisibility() == View.GONE)
toolbarContent.setVisibility(View.VISIBLE);
} else {
if (toolbarContent.getVisibility() == View.VISIBLE)
toolbarContent.setVisibility(View.GONE);
}
}
if (maxScrollSize == 0)
maxScrollSize = appBarLayout.getTotalScrollRange();
int percentage = (Math.abs(verticalOffset)) * 100 / maxScrollSize;
if (percentage >= 20 && avatarShown) {
if (percentage >= 40 && avatarShown) {
avatarShown = false;
account_pp.animate()
.scaleY(0).scaleX(0)
.setDuration(200)
.setDuration(400)
.start();
}
if (percentage <= 20 && !avatarShown) {
if (percentage <= 40 && !avatarShown) {
avatarShown = true;
account_pp.animate()
.scaleY(1).scaleX(1)
@ -537,10 +533,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
switch (item.getItemId()) {
case R.id.action_show_pinned:
showPinned = !showPinned;
if( showPinned )
item.setIcon(R.drawable.ic_clear_all);
else
item.setIcon(R.drawable.ic_action_pin);
if( tabLayout.getTabAt(0) != null)
//noinspection ConstantConditions
tabLayout.getTabAt(0).select();
@ -549,10 +541,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
break;
case R.id.action_show_media:
showMediaOnly = !showMediaOnly;
if( showMediaOnly )
item.setIcon(R.drawable.ic_clear_all);
else
item.setIcon(R.drawable.ic_perm_media);
if( tabLayout.getTabAt(0) != null)
//noinspection ConstantConditions
tabLayout.getTabAt(0).select();

View File

@ -255,14 +255,14 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
//Manages theme for icon colors
if( theme == Helper.THEME_DARK){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_more,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_retweet,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_more,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_retweet,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_delete,R.color.dark_text);
@ -338,22 +338,22 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
Drawable imgFav, imgReblog;
if( status.isFavourited() || (status.getReblog() != null && status.getReblog().isFavourited())) {
changeDrawableColor(context, R.drawable.ic_favorite,R.color.yellowicon);
changeDrawableColor(context, R.drawable.ic_favorite,R.color.marked_icon);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_favorite);
}else {
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.black);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_favorite_border);
}
if( status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged())) {
changeDrawableColor(context, R.drawable.ic_boost,R.color.yellowicon);
changeDrawableColor(context, R.drawable.ic_boost,R.color.marked_icon);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_boost);
}else {
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.black);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_boost_border);
@ -363,7 +363,13 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
imgReblog.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (20 * iconSizePercent/100 * scale + 0.5f));
holder.status_favorite_count.setCompoundDrawables(imgFav, null, null, null);
holder.status_reblog_count.setCompoundDrawables(imgReblog, null, null, null);
if( theme == THEME_DARK){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
}else {
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.black));
}
if( status.getReblog() == null) {
if (status.getMedia_attachments().size() < 1) {

View File

@ -15,6 +15,7 @@ package fr.gouv.etalab.mastodon.drawers;
* see <http://www.gnu.org/licenses>. */
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
@ -35,8 +36,13 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.PopupMenu;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.util.Patterns;
import android.util.TypedValue;
@ -75,7 +81,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import fr.gouv.etalab.mastodon.activities.HashTagActivity;
import fr.gouv.etalab.mastodon.activities.MediaActivity;
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
import fr.gouv.etalab.mastodon.activities.ShowConversationActivity;
@ -218,7 +226,6 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_toot_date = (TextView) convertView.findViewById(R.id.status_toot_date);
holder.status_show_more = (Button) convertView.findViewById(R.id.status_show_more);
holder.status_more = (ImageView) convertView.findViewById(R.id.status_more);
holder.status_reblog_user = (TextView) convertView.findViewById(R.id.status_reblog_user);
holder.status_prev1 = (ImageView) convertView.findViewById(R.id.status_prev1);
holder.status_prev2 = (ImageView) convertView.findViewById(R.id.status_prev2);
holder.status_prev3 = (ImageView) convertView.findViewById(R.id.status_prev3);
@ -303,7 +310,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
if( status.isNew())
holder.new_element.setVisibility(View.VISIBLE);
else
holder.new_element.setVisibility(View.INVISIBLE);
holder.new_element.setVisibility(View.GONE);
int iconSizePercent = sharedpreferences.getInt(Helper.SET_ICON_SIZE, 130);
int textSizePercent = sharedpreferences.getInt(Helper.SET_TEXT_SIZE, 110);
boolean trans_forced = sharedpreferences.getBoolean(Helper.SET_TRANS_FORCED, false);
@ -316,7 +323,6 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_content.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14*textSizePercent/100);
holder.status_account_displayname.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14*textSizePercent/100);
holder.status_account_username.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12*textSizePercent/100);
holder.status_reblog_user.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14*textSizePercent/100);
holder.status_toot_date.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12*textSizePercent/100);
holder.status_spoiler.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14*textSizePercent/100);
holder.status_content_translated.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14*textSizePercent/100);
@ -349,16 +355,16 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
//Manages theme for icon colors
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_more,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_boost_header,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_action_pin_dark, R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_more,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_boost_header,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_action_pin_dark, R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_translate,R.color.dark_text);
@ -380,43 +386,61 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
//Redraws top icons (boost/reply)
final float scale = context.getResources().getDisplayMetrics().density;
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 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f));
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
}else if( status.getReblog() != null){
if( status.getReblog() != null){
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_boost_header);
img.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f));
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
holder.status_account_displayname.setVisibility(View.VISIBLE);
}else{
holder.status_account_displayname.setCompoundDrawables( null, null, null, null);
holder.status_account_displayname.setVisibility(View.GONE);
}
if( theme == THEME_DARK){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
}else {
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.black));
}
String content;
final String displayName;
final String username;
final String ppurl;
String name;
if( status.getReblog() != null){
content = status.getReblog().getContent();
displayName = Helper.shortnameToUnicode(status.getReblog().getAccount().getDisplay_name(), true);
username = status.getReblog().getAccount().getUsername();
holder.status_reblog_user.setText(displayName + " " +String.format("@%s",username));
ppurl = status.getReblog().getAccount().getAvatar();
holder.status_reblog_user.setVisibility(View.VISIBLE);
holder.status_account_displayname.setText(context.getResources().getString(R.string.reblog_by, status.getAccount().getUsername()));
holder.status_account_username.setText( "");
name = String.format("%s @%s",displayName,status.getReblog().getAccount().getAcct());
}else {
ppurl = status.getAccount().getAvatar();
content = status.getContent();
displayName = Helper.shortnameToUnicode(status.getAccount().getDisplay_name(), true);
username = status.getAccount().getUsername();
holder.status_reblog_user.setVisibility(View.GONE);
holder.status_account_displayname.setText(displayName);
holder.status_account_username.setText(String.format("@%s",username));
name = String.format("%s @%s",displayName,status.getAccount().getAcct());
}
Spannable wordtoSpan = new SpannableString(name);
if( theme == THEME_DARK) {
Pattern hashAcct;
if( status.getReblog() != null)
hashAcct = Pattern.compile("\\s(@"+status.getReblog().getAccount().getAcct()+")");
else
hashAcct = Pattern.compile("\\s(@"+status.getAccount().getAcct()+")");
Matcher matcherAcct = hashAcct.matcher(wordtoSpan);
while (matcherAcct.find()){
int matchStart = matcherAcct.start(1);
int matchEnd = matcherAcct.end();
if( wordtoSpan.length() >= matchEnd && matchStart < matchEnd)
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_icon)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
}
holder.status_account_username.setText(wordtoSpan);
if( status.getContent_translated() != null && status.getContent_translated().length() > 0){
holder.status_content_translated.setMovementMethod(null);
@ -614,31 +638,37 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
Drawable imgFav, imgReblog, imgPinned;
if( status.isFavourited() || (status.getReblog() != null && status.getReblog().isFavourited())) {
changeDrawableColor(context, R.drawable.ic_favorite,R.color.yellowicon);
changeDrawableColor(context, R.drawable.ic_favorite,R.color.marked_icon);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_favorite);
}else {
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_favorite_border,R.color.black);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_favorite_border);
}
if( status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged())) {
changeDrawableColor(context, R.drawable.ic_boost,R.color.yellowicon);
changeDrawableColor(context, R.drawable.ic_boost,R.color.marked_icon);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_boost);
}else {
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_boost_border,R.color.black);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_boost_border);
}
if( status.isPinned()|| (status.getReblog() != null && status.getReblog().isPinned()))
if( status.isPinned()|| (status.getReblog() != null && status.getReblog().isPinned())) {
changeDrawableColor(context, R.drawable.ic_action_pin_yellow,R.color.marked_icon);
imgPinned = ContextCompat.getDrawable(context, R.drawable.ic_action_pin_yellow);
else
}else {
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_action_pin_dark,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_action_pin_dark,R.color.black);
imgPinned = ContextCompat.getDrawable(context, R.drawable.ic_action_pin_dark);
}
imgFav.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (20 * iconSizePercent/100 * scale + 0.5f));
imgReblog.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (20 * iconSizePercent/100 * scale + 0.5f));
@ -648,11 +678,6 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_reblog_count.setCompoundDrawables(imgReblog, null, null, null);
holder.status_pin.setImageDrawable(imgPinned);
if( theme == Helper.THEME_LIGHT) {
holder.status_show_more.setTextColor(ContextCompat.getColor(context, R.color.white));
holder.status_spoiler_button.setTextColor(ContextCompat.getColor(context, R.color.white));
}
boolean isOwner = status.getAccount().getId().equals(userId);
// Pinning toots is only available on Mastodon 1._6_.0 instances.
@ -1398,7 +1423,6 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
TextView status_favorite_count;
TextView status_reblog_count;
TextView status_toot_date;
TextView status_reblog_user;
Button status_show_more;
ImageView status_more;
LinearLayout status_document_container;

View File

@ -17,15 +17,11 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -34,10 +30,7 @@ import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import fr.gouv.etalab.mastodon.activities.MainActivity;
import fr.gouv.etalab.mastodon.asynctasks.RetrieveMissingFeedsAsyncTask;
@ -139,7 +132,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
if( !comesFromSearch){
//Hide account header when scrolling for ShowAccountActivity
if (hideHeader && Build.VERSION.SDK_INT >= 21)
if (hideHeader )
ViewCompat.setNestedScrollingEnabled(lv_status, true);
lv_status.setOnScrollListener(new AbsListView.OnScrollListener() {
@ -149,25 +142,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
}
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (hideHeader && Build.VERSION.SDK_INT < 21) {
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);
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
} else if (currentFirstVisibleItem < lastFirstVisibleItem) {
Intent intent = new Intent(Helper.HEADER_ACCOUNT + instanceValue);
intent.putExtra("hide", false);
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
}
lastFirstVisibleItem = currentFirstVisibleItem;
}
}
if(firstVisibleItem + visibleItemCount == totalItemCount ) {
if(!flag_loading ) {
flag_loading = true;

View File

@ -309,10 +309,6 @@ public class SettingsNotificationsFragment extends Fragment {
}
}
if( theme == Helper.THEME_LIGHT) {
settings_time_from.setTextColor(ContextCompat.getColor(context, R.color.white));
settings_time_to.setTextColor(ContextCompat.getColor(context, R.color.white));
}
return rootView;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 552 B

View File

@ -33,180 +33,197 @@
android:layout_width="500dp"
android:layout_gravity="center_horizontal"
android:id="@+id/collapsingToolbarLayout"
android:layout_height="@dimen/layout_height_header"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp"
app:layout_scrollFlags="scroll|snap">
<ImageView
android:id="@+id/banner_pp"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
/>
<android.support.design.widget.FloatingActionButton
android:layout_gravity="end|bottom"
android:visibility="gone"
app:fabSize="mini"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:gravity="end|bottom"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="5dp"
/>
<ImageButton
android:id="@+id/account_menu"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="end|top"
android:src="@drawable/ic_more_white"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"/>
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/top_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/layout_height_header">
<ImageView
android:id="@+id/banner_pp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
tools:ignore="ContentDescription" />
<android.support.design.widget.FloatingActionButton
android:layout_gravity="end|bottom"
android:visibility="gone"
app:fabSize="mini"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="5dp"
/>
<ImageButton
android:id="@+id/account_menu"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_more_white"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"/>
</RelativeLayout>
<LinearLayout
android:layout_marginTop="60dp"
android:layout_below="@+id/top_banner"
android:id="@+id/main_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:gravity="center"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:orientation="vertical">
<LinearLayout
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"
>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:textColor="?attr/color_in_account_header"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
<ImageView
android:visibility="gone"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:gravity="center_horizontal|bottom"
android:src="@drawable/ic_edit"
android:id="@+id/header_edit_profile"
android:layout_width="20dp"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
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:id="@+id/account_follow_request"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:textColor="?attr/colorAccent"
android:text="@string/request_sent"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:textColor="?attr/color_in_account_header"
android:layout_width="match_parent"
android:maxLines="4"
android:autoLink="web"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways|snap"
/>
<LinearLayout
android:id="@+id/main_header_container"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:gravity="center"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:orientation="vertical">
>
<LinearLayout
android:id="@+id/header_container"
android:layout_marginTop="5dp"
android:id="@+id/toolbar_content"
android:animationCache="true"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:textColor="?attr/color_in_account_header"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
<ImageView
android:visibility="gone"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:gravity="center_horizontal|bottom"
android:src="@drawable/ic_edit"
android:id="@+id/header_edit_profile"
android:layout_width="20dp"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
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:id="@+id/account_follow_request"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:textColor="?attr/colorAccent"
android:text="@string/request_sent"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
android:orientation="horizontal">
<ImageView
android:id="@+id/pp_actionBar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="ContentDescription" />
<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"
android:textColor="?attr/actionBarTextColor"
/>
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:textColor="?attr/color_in_account_header"
android:layout_width="match_parent"
android:maxLines="4"
android:autoLink="web"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/small_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
android:padding="5dp"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/pp_actionBar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="ContentDescription" />
<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"
android:textColor="?attr/actionBarTextColor"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/account_tabLayout"
android:layout_width="match_parent"
@ -229,12 +246,11 @@
android:id="@+id/account_pp"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center_horizontal"
app:layout_anchor="@id/main_header_container"
app:layout_anchor="@id/banner_pp"
android:elevation="8dp"
app:civ_border_width="2dp"
app:civ_border_color="#FFF"
app:layout_scrollFlags="scroll"
app:layout_anchorGravity="top|center_horizontal"
app:layout_anchorGravity="center_horizontal|bottom"
/>
</android.support.design.widget.CoordinatorLayout>

View File

@ -267,6 +267,7 @@
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:src="@drawable/ic_action_globe"
tools:ignore="ContentDescription" />
</LinearLayout>

View File

@ -32,180 +32,197 @@
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:id="@+id/collapsingToolbarLayout"
android:layout_height="@dimen/layout_height_header"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp"
app:layout_scrollFlags="scroll|snap">
<ImageView
android:id="@+id/banner_pp"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
/>
<android.support.design.widget.FloatingActionButton
android:layout_gravity="end|bottom"
android:visibility="gone"
app:fabSize="mini"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:gravity="end|bottom"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="5dp"
/>
<ImageButton
android:id="@+id/account_menu"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="end|top"
android:src="@drawable/ic_more_white"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"/>
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/top_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/layout_height_header">
<ImageView
android:id="@+id/banner_pp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
tools:ignore="ContentDescription" />
<android.support.design.widget.FloatingActionButton
android:layout_gravity="end|bottom"
android:visibility="gone"
app:fabSize="mini"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="5dp"
/>
<ImageButton
android:id="@+id/account_menu"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_more_white"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"/>
</RelativeLayout>
<LinearLayout
android:layout_marginTop="60dp"
android:layout_below="@+id/top_banner"
android:id="@+id/main_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:gravity="center"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:orientation="vertical">
<LinearLayout
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"
>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:textColor="?attr/color_in_account_header"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
<ImageView
android:visibility="gone"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:gravity="center_horizontal|bottom"
android:src="@drawable/ic_edit"
android:id="@+id/header_edit_profile"
android:layout_width="20dp"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
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:id="@+id/account_follow_request"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:textColor="?attr/colorAccent"
android:text="@string/request_sent"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:textColor="?attr/color_in_account_header"
android:layout_width="match_parent"
android:maxLines="4"
android:autoLink="web"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways|snap"
/>
<LinearLayout
android:id="@+id/main_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:gravity="center"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:orientation="vertical">
>
<LinearLayout
android:id="@+id/header_container"
android:layout_marginTop="5dp"
android:id="@+id/toolbar_content"
android:animationCache="true"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:textColor="?attr/color_in_account_header"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
<ImageView
android:visibility="gone"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:gravity="center_horizontal|bottom"
android:src="@drawable/ic_edit"
android:id="@+id/header_edit_profile"
android:layout_width="20dp"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
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:id="@+id/account_follow_request"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:textColor="?attr/colorAccent"
android:text="@string/request_sent"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
android:orientation="horizontal">
<ImageView
android:id="@+id/pp_actionBar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="ContentDescription" />
<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"
android:textColor="?attr/actionBarTextColor"
/>
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:textColor="?attr/color_in_account_header"
android:layout_width="match_parent"
android:maxLines="4"
android:autoLink="web"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/small_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
android:padding="5dp"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/pp_actionBar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="ContentDescription" />
<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"
android:textColor="?attr/actionBarTextColor"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/account_tabLayout"
android:layout_width="match_parent"
@ -228,12 +245,11 @@
android:id="@+id/account_pp"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center_horizontal"
app:layout_anchor="@id/main_header_container"
app:layout_anchor="@id/banner_pp"
android:elevation="8dp"
app:civ_border_width="2dp"
app:civ_border_color="#FFF"
app:layout_scrollFlags="scroll"
app:layout_anchorGravity="top|center_horizontal"
app:layout_anchorGravity="center_horizontal|bottom"
/>
</android.support.design.widget.CoordinatorLayout>

View File

@ -43,7 +43,6 @@
android:layout_gravity="center"
android:gravity="center"
android:text="@string/accounts"
android:textColor="?attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout

View File

@ -38,59 +38,65 @@
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:baselineAligned="false">
<RelativeLayout
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="60dp"
android:orientation="vertical"
>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true"
android:id="@+id/status_account_profile"
tools:ignore="ContentDescription" />
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:visibility="gone"
android:id="@+id/status_account_profile_boost"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_account_profile_boost_by"
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_marginTop="25dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
style="?attr/shapeBorder"
android:visibility="gone"
tools:ignore="ContentDescription" />
</RelativeLayout>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true"
android:id="@+id/status_account_profile"
tools:ignore="ContentDescription" />
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:visibility="gone"
android:id="@+id/status_account_profile_boost"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_account_profile_boost_by"
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_marginTop="25dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
style="?attr/shapeBorder"
android:visibility="gone"
tools:ignore="ContentDescription" />
<ImageView
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"
android:id="@+id/new_element"
android:visibility="invisible"
android:visibility="gone"
android:src="@drawable/ic_fiber_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<android.support.design.widget.FloatingActionButton
android:layout_below="@+id/new_element"
android:visibility="gone"
android:id="@+id/status_translate"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
app:fabSize="mini"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/ic_translate" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
@ -98,45 +104,38 @@
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/status_account_displayname"
android:visibility="gone"
android:maxLines="1"
android:drawablePadding="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/status_account_displayname"
android:textSize="14sp"
android:textStyle="bold"
android:maxLines="1"
android:drawablePadding="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="0dp"
android:layout_weight="1"
android:id="@+id/status_account_username"
android:layout_height="wrap_content" />
<TextView
android:layout_marginStart="2dp"
android:layout_marginLeft="2dp"
android:id="@+id/status_toot_date"
android:layout_width="wrap_content"
android:layout_weight="0"
android:maxLines="1"
android:textSize="12sp"
android:layout_gravity="end"
android:gravity="end"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:visibility="gone"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:textSize="14sp"
android:maxLines="1"
android:id="@+id/status_reblog_user"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
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"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/status_spoiler_container"
android:layout_width="match_parent"
@ -165,6 +164,7 @@
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:text="@string/load_attachment_spoiler" />
</LinearLayout>
<LinearLayout
@ -337,6 +337,7 @@
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:text="@string/load_attachment" />
</LinearLayout>

View File

@ -31,7 +31,6 @@
android:orientation="vertical">
<TextView
android:id="@+id/tag_search_title"
android:textColor="?attr/colorPrimary"
android:visibility="gone"
android:textSize="18sp"
android:background="?attr/colorAccent"

View File

@ -267,6 +267,7 @@
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:src="@drawable/ic_action_globe"
tools:ignore="ContentDescription" />
</LinearLayout>

View File

@ -135,6 +135,7 @@
android:layout_marginLeft="10dp"
android:focusableInTouchMode="false"
android:id="@+id/settings_time_from"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -147,6 +148,7 @@
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:focusableInTouchMode="false"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:id="@+id/settings_time_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

View File

@ -67,6 +67,7 @@
<TextView
android:gravity="center_vertical"
android:id="@+id/displayedName"
android:textColor="@color/dark_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
@ -84,6 +85,7 @@
</LinearLayout>
<TextView
android:id="@+id/username"
android:textColor="@color/dark_text"
android:layout_width="wrap_content"
android:textSize="12sp"
android:maxLines="1"

View File

@ -24,6 +24,7 @@
android:layout_gravity="center_vertical"
android:id="@+id/picture_actionbar"
android:maxLines="1"
android:textColor="?attr/actionBarTextColor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp" />

View File

@ -33,6 +33,7 @@
android:layout_gravity="center_vertical"
android:id="@+id/webview_title"
android:maxLines="1"
android:textColor="?attr/actionBarTextColor"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="12sp"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="layout_height_header">200dp</dimen>
<dimen name="layout_height_header">180dp</dimen>
</resources>

View File

@ -6,5 +6,5 @@
<dimen name="activity_vertical_margin">30dp</dimen>
<dimen name="activity_padding_top_header">16dp</dimen>
<bool name="isTablet">true</bool>
<dimen name="layout_height_header">250dp</dimen>
<dimen name="layout_height_header">220dp</dimen>
</resources>

View File

@ -20,6 +20,8 @@
<color name="header3D">#607D8B</color>
<color name="dark_text">#f3f3f3</color>
<color name="dark_icon">#66708a</color>
<color name="marked_icon">#ca8f04</color>
<color name="transparent">#00000000</color>
@ -29,8 +31,6 @@
<color name="white">#FFF</color>
<color name="blue_light">#C5CAE9</color>
<color name="light_grey">#E0E0E0</color>
<color name="darkicon">#424242</color>
<color name="yellowicon">#FDD835</color>
<color name="background_image">#282c37</color>

View File

@ -9,5 +9,5 @@
<dimen name="drawer_padding">2dp</dimen>
<dimen name="toot_padding">20dp</dimen>
<bool name="isTablet">false</bool>
<dimen name="layout_height_header">200dp</dimen>
<dimen name="layout_height_header">180dp</dimen>
</resources>

View File

@ -980,14 +980,14 @@ public class MainActivity extends AppCompatActivity
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
changeDrawableColor(getApplicationContext(), R.drawable.ic_reply,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_more,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_open,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_favorite_border,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_more,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_globe,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_open,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_action_lock_closed,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_favorite_border,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_remove_red_eye,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_translate,R.color.dark_text);