Last fixes

This commit is contained in:
stom79 2019-02-13 18:36:29 +01:00
parent 51e8531e24
commit da1b128daa
10 changed files with 1076 additions and 55 deletions

View File

@ -244,8 +244,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
final LinearLayoutManager mLayoutManager;
mLayoutManager = new LinearLayoutManager(this);
lv_status.setLayoutManager(mLayoutManager);
boolean compactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
lv_status.addItemDecoration(new ConversationDecoration(ShowConversationActivity.this, theme, compactMode));
lv_status.addItemDecoration(new ConversationDecoration(ShowConversationActivity.this, theme));
lv_status.setAdapter(statusListAdapter);
String statusIdToFetch = null;
if( initialStatus != null)

View File

@ -38,9 +38,9 @@ public class ConversationDecoration extends RecyclerView.ItemDecoration{
private Drawable divider;
private Context context;
private boolean compactMode;
private boolean compactMode, consoleMode;
public ConversationDecoration(Context context, int theme, boolean compactMode){
public ConversationDecoration(Context context, int theme){
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
if( theme == Helper.THEME_BLACK)
divider = ContextCompat.getDrawable(context,R.drawable.line_divider_black);
@ -48,15 +48,20 @@ public class ConversationDecoration extends RecyclerView.ItemDecoration{
divider = ContextCompat.getDrawable(context,R.drawable.line_divider_dark);
else if(theme == Helper.THEME_LIGHT)
divider = ContextCompat.getDrawable(context,R.drawable.line_divider_light);
this.compactMode = compactMode;
this.context = context;
this.compactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
this.consoleMode = sharedpreferences.getBoolean(Helper.SET_CONSOLE_MODE, false);
}
@Override
public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
int leftSide;
if( compactMode)
if( consoleMode)
leftSide = (int) Helper.convertDpToPixel(6, context);
else if( compactMode)
leftSide = (int) Helper.convertDpToPixel(12, context);
else
leftSide = (int) Helper.convertDpToPixel(28, context);

View File

@ -40,8 +40,12 @@ import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.URLSpan;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -152,6 +156,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
private static final int DISPLAYED_STATUS = 1;
static final int FOCUSED_STATUS = 2;
private static final int COMPACT_STATUS = 3;
private static final int CONSOLE_STATUS = 4;
private int conversationPosition;
private List<String> timedMute;
private boolean redraft;
@ -235,7 +240,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
@Override
public void onViewAttachedToWindow(@NonNull RecyclerView.ViewHolder holder) {
super.onViewAttachedToWindow(holder);
if( type != RetrieveFeedsAsyncTask.Type.ART && type != RetrieveFeedsAsyncTask.Type.PIXELFED && (tagTimeline == null || !tagTimeline.isART()) && (holder.getItemViewType() == DISPLAYED_STATUS || holder.getItemViewType() == COMPACT_STATUS)) {
if( type != RetrieveFeedsAsyncTask.Type.ART && type != RetrieveFeedsAsyncTask.Type.PIXELFED && (tagTimeline == null || !tagTimeline.isART()) && (holder.getItemViewType() == DISPLAYED_STATUS || holder.getItemViewType() == COMPACT_STATUS|| holder.getItemViewType() == CONSOLE_STATUS)) {
final ViewHolder viewHolder = (ViewHolder) holder;
// Bug workaround for losing text selection ability, see:
// https://code.google.com/p/android/issues/detail?id=208169
@ -424,12 +429,19 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
if( type == RetrieveFeedsAsyncTask.Type.CONTEXT && position == conversationPosition)
boolean isConsoleMode = sharedpreferences.getBoolean(Helper.SET_CONSOLE_MODE, false);
if( !isConsoleMode && type == RetrieveFeedsAsyncTask.Type.CONTEXT && position == conversationPosition)
return FOCUSED_STATUS;
else if( type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !Helper.filterToots(context, statuses.get(position), timedMute, type))
return HIDDEN_STATUS;
else
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
else {
if( isCompactMode)
return COMPACT_STATUS;
else if( isConsoleMode)
return CONSOLE_STATUS;
else
return DISPLAYED_STATUS;
}
}
@NonNull
@ -439,6 +451,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status, parent, false));
else if(viewType == COMPACT_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status_compact, parent, false));
else if(viewType == CONSOLE_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status_console, parent, false));
else if(viewType == FOCUSED_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status_focused, parent, false));
else
@ -464,6 +478,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
boolean displayBookmarkButton = sharedpreferences.getBoolean(Helper.SET_SHOW_BOOKMARK, false);
boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
boolean isConsoleMode = sharedpreferences.getBoolean(Helper.SET_CONSOLE_MODE, false);
int iconSizePercent = sharedpreferences.getInt(Helper.SET_ICON_SIZE, 130);
int textSizePercent = sharedpreferences.getInt(Helper.SET_TEXT_SIZE, 110);
final boolean trans_forced = sharedpreferences.getBoolean(Helper.SET_TRANS_FORCED, false);
@ -483,7 +498,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
int translator = sharedpreferences.getInt(Helper.SET_TRANSLATOR, Helper.TRANS_YANDEX);
int behaviorWithAttachments = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !isCompactMode && displayBookmarkButton)
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !isCompactMode && !isConsoleMode && displayBookmarkButton)
holder.status_bookmark.setVisibility(View.VISIBLE);
else
holder.status_bookmark.setVisibility(View.GONE);
@ -584,14 +599,14 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_privacy.getLayoutParams().width = (int) Helper.convertDpToPixel((20 * iconSizePercent / 100), context);
if (isCompactMode && type == RetrieveFeedsAsyncTask.Type.CONTEXT && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS && viewHolder.getAdapterPosition() != 0) {
if ((isCompactMode || isConsoleMode) && type == RetrieveFeedsAsyncTask.Type.CONTEXT && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS && viewHolder.getAdapterPosition() != 0) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
);
params.setMargins((int) Helper.convertDpToPixel(25, context), 0, 0, 0);
holder.main_container.setLayoutParams(params);
} else if (isCompactMode && type == RetrieveFeedsAsyncTask.Type.CONTEXT && getItemViewType(viewHolder.getAdapterPosition()) == FOCUSED_STATUS && viewHolder.getAdapterPosition() != 0) {
} else if ((isCompactMode || isConsoleMode) && type == RetrieveFeedsAsyncTask.Type.CONTEXT && getItemViewType(viewHolder.getAdapterPosition()) == FOCUSED_STATUS && viewHolder.getAdapterPosition() != 0) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
@ -637,7 +652,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
changeDrawableColor(context, R.drawable.ic_fiber_new, R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_http, R.color.mastodonC4);
if (getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS)
if (getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == CONSOLE_STATUS )
holder.status_privacy.setVisibility(View.GONE);
else
holder.status_privacy.setVisibility(View.VISIBLE);
@ -797,13 +812,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams paramsB = new LinearLayout.LayoutParams((int)Helper.convertDpToPixel(60, context), LinearLayout.LayoutParams.WRAP_CONTENT);
if( status.getReblog() == null && !isCompactMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
if( status.getReblog() == null && !isCompactMode && !isConsoleMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
params.setMargins(0,-(int)Helper.convertDpToPixel(10, context),0,0);
if (status.getSpoiler_text() != null && status.getSpoiler_text().trim().length() > 0 )
paramsB.setMargins(0,(int)Helper.convertDpToPixel(10, context),0,0);
else
paramsB.setMargins(0,(int)Helper.convertDpToPixel(15, context),0,0);
}else if( !isCompactMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
}else if( !isCompactMode && !isConsoleMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
if( status.getContent() == null || status.getContent().trim().equals("")) {
params.setMargins(0, -(int) Helper.convertDpToPixel(20, context), 0, 0);
paramsB.setMargins(0,(int) Helper.convertDpToPixel(20, context),0,0);
@ -832,7 +847,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
});
//Click on a conversation
if( MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.GNU && MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA)
if ((getItemViewType(viewHolder.getAdapterPosition()) == DISPLAYED_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS)) {
if ((getItemViewType(viewHolder.getAdapterPosition()) == DISPLAYED_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == CONSOLE_STATUS )) {
holder.status_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -874,7 +889,128 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
});
}
holder.status_content.setText(status.getContentSpan(), TextView.BufferType.SPANNABLE);
holder.status_translate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
translateToot(status);
}
});
if( isConsoleMode){
String starting = "";
String acct = status.getAccount().getAcct();
String acctReblog = null;
if( !acct.contains("@"))
acct += "@" + Helper.getLiveInstance(context);
if( status.getReblog() != null){
acctReblog = status.getReblog().getAccount().getAcct();
if( !acctReblog.contains("@"))
acctReblog += "@" + Helper.getLiveInstance(context);
}
SpannableString acctSpan = new SpannableString(acct+":~$");
SpannableString acctReblogSpan = null;
if( acctReblog != null)
acctReblogSpan = new SpannableString( " <" + acctReblog + ">");
if (theme == THEME_LIGHT)
acctSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), (acctSpan.length()-3), acctSpan.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_DARK)
acctSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), (acctSpan.length()-3), acctSpan.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_BLACK)
acctSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), (acctSpan.length()-3), acctSpan.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
URLSpan[] urls = acctSpan.getSpans(0, (acctSpan.length()-3), URLSpan.class);
for(URLSpan span : urls)
acctSpan.removeSpan(span);
acctSpan.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View textView) {
Intent intent = new Intent(context, ShowAccountActivity.class);
Bundle b = new Bundle();
b.putParcelable("account", status.getAccount());
intent.putExtras(b);
context.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
if (theme == THEME_DARK)
ds.setColor(ContextCompat.getColor(context, R.color.console_name));
else if (theme == THEME_BLACK)
ds.setColor(ContextCompat.getColor(context, R.color.console_name));
else if (theme == THEME_LIGHT)
ds.setColor(ContextCompat.getColor(context, R.color.console_name));
}
},
0, (acctSpan.length()-3),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
SpannableString startingSpan = new SpannableString(starting);
if( acctReblogSpan != null) {
for(URLSpan span : urls)
acctReblogSpan.removeSpan(span);
acctReblogSpan.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View textView) {
Intent intent = new Intent(context, ShowAccountActivity.class);
Bundle b = new Bundle();
b.putParcelable("account", status.getReblog().getAccount());
intent.putExtras(b);
context.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
if (theme == THEME_DARK)
ds.setColor(ContextCompat.getColor(context, R.color.console_reblog_name));
else if (theme == THEME_BLACK)
ds.setColor(ContextCompat.getColor(context, R.color.console_reblog_name));
else if (theme == THEME_LIGHT)
ds.setColor(ContextCompat.getColor(context, R.color.console_reblog_name));
}
},
2, acctReblogSpan.length()-1,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
if (theme == THEME_LIGHT)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), 1, 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_DARK)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), 1, 2,Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_BLACK)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), 1, 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
if (theme == THEME_LIGHT)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), acctReblogSpan.length()-1, acctReblogSpan.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_DARK)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), acctReblogSpan.length()-1, acctReblogSpan.length(),Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
else if (theme == THEME_BLACK)
acctReblogSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.console_marker)), acctReblogSpan.length()-1, acctReblogSpan.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
startingSpan = new SpannableString(TextUtils.concat(acctSpan, " ", acctReblogSpan));
}else
startingSpan = acctSpan;
if( status.getReblog() == null && status.getSpoiler_text() != null && status.getSpoiler_text().length() > 0) {
holder.status_spoiler.setText(TextUtils.concat(startingSpan, " ", status.getContentSpanCW()), TextView.BufferType.SPANNABLE);
holder.status_content.setText(status.getContentSpan(), TextView.BufferType.SPANNABLE);
}else if( status.getReblog() != null && status.getReblog().getSpoiler_text() != null && status.getReblog().getSpoiler_text().length() > 0) {
holder.status_spoiler.setText(TextUtils.concat(startingSpan, " ", status.getContentSpanCW()), TextView.BufferType.SPANNABLE);
holder.status_content.setText(status.getContentSpan(), TextView.BufferType.SPANNABLE);
} else {
holder.status_spoiler.setText(status.getContentSpanCW(), TextView.BufferType.SPANNABLE);
holder.status_content.setText(TextUtils.concat(startingSpan, " ", status.getContentSpan()!=null?status.getContentSpan():""), TextView.BufferType.SPANNABLE);
}
}else {
holder.status_content.setText(status.getContentSpan(), TextView.BufferType.SPANNABLE);
holder.status_spoiler.setText(status.getContentSpanCW(), TextView.BufferType.SPANNABLE);
}
holder.status_content.setMovementMethod(LinkMovementMethod.getInstance());
holder.status_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
if (truncate_toots_size > 0) {
holder.status_content.setMaxLines(truncate_toots_size);
if (status.getNumberLines() == -1) {
@ -909,17 +1045,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
notifyStatusChanged(status);
}
});
holder.status_spoiler.setText(status.getContentSpanCW(), TextView.BufferType.SPANNABLE);
holder.status_content.setMovementMethod(LinkMovementMethod.getInstance());
holder.status_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
holder.status_translate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
translateToot(status);
}
});
holder.status_bookmark.setOnClickListener(new View.OnClickListener() {
@Override
@ -1050,7 +1176,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_mention_spoiler.setText(Helper.makeMentionsClick(context, status.getMentions()), TextView.BufferType.SPANNABLE);
holder.status_mention_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
if (getItemViewType(viewHolder.getAdapterPosition()) != COMPACT_STATUS) {
if (getItemViewType(viewHolder.getAdapterPosition()) != COMPACT_STATUS && getItemViewType(viewHolder.getAdapterPosition()) != CONSOLE_STATUS) {
if (status.getReblog() == null)
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
else
@ -1137,7 +1263,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
differentLanguage = status.getReblog().getLanguage() != null && !status.getReblog().getLanguage().trim().equals(currentLocale);
if ((getItemViewType(viewHolder.getAdapterPosition()) != COMPACT_STATUS) && (trans_forced || (translator != Helper.TRANS_NONE && currentLocale != null && differentLanguage))) {
if ((getItemViewType(viewHolder.getAdapterPosition()) != COMPACT_STATUS) && getItemViewType(viewHolder.getAdapterPosition()) != CONSOLE_STATUS && (trans_forced || (translator != Helper.TRANS_NONE && currentLocale != null && differentLanguage))) {
if (status.getSpoiler_text() != null && status.getSpoiler_text().length() > 0) {
if (status.isSpoilerShown() || getItemViewType(viewHolder.getAdapterPosition()) == FOCUSED_STATUS) {
holder.status_translate.setVisibility(View.VISIBLE);
@ -1305,7 +1431,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_content.setVisibility(View.VISIBLE);
holder.status_content_translated_container.setVisibility(View.GONE);
}
if( contentCheck.trim().length() < 2 && !contentCheck.trim().matches("\\w+"))
if( !isConsoleMode && contentCheck.trim().length() < 2 && !contentCheck.trim().matches("\\w+"))
holder.status_content.setVisibility(View.GONE);
else
holder.status_content.setVisibility(View.VISIBLE);
@ -1393,13 +1519,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
imgReply.setBounds(0, 0, (int) (20 * iconSizePercent / 100 * scale + 0.5f), (int) (20 * iconSizePercent / 100 * scale + 0.5f));
if (isCompactMode && ((status.getReblog() == null && status.getReplies_count() > 1) || (status.getReblog() != null && status.getReblog().getReplies_count() > 1))) {
if ((isCompactMode || isConsoleMode) && ((status.getReblog() == null && status.getReplies_count() > 1) || (status.getReblog() != null && status.getReblog().getReplies_count() > 1))) {
Drawable img = context.getResources().getDrawable(R.drawable.ic_plus_one);
holder.status_reply.setCompoundDrawablesWithIntrinsicBounds(imgReply, null, img, null);
} else {
holder.status_reply.setCompoundDrawablesWithIntrinsicBounds(imgReply, null, null, null);
}
if (isCompactMode) {
if ((isCompactMode || isConsoleMode) ) {
if (((status.getReblog() == null && status.getReplies_count() == 1) || (status.getReblog() != null && status.getReblog().getReplies_count() == 1)))
holder.status_reply.setText(String.valueOf(status.getReblog() != null ? status.getReblog().getReplies_count() : status.getReplies_count()));
} else {
@ -1433,7 +1559,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_pin.setVisibility(View.GONE);
}
if( (isAdmin || isModerator) && !isCompactMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
if( (isAdmin || isModerator) && !isCompactMode && !isConsoleMode && getItemViewType(viewHolder.getAdapterPosition()) != FOCUSED_STATUS){
holder.status_remove.setVisibility(View.VISIBLE);
}else {
holder.status_remove.setVisibility(View.GONE);

View File

@ -442,19 +442,41 @@ public class SettingsFragment extends Fragment {
});
boolean compact_mode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
final CheckBox set_compact_mode = rootView.findViewById(R.id.set_compact_mode);
set_compact_mode.setChecked(compact_mode);
set_compact_mode.setOnClickListener(new View.OnClickListener() {
boolean console_mode = sharedpreferences.getBoolean(Helper.SET_CONSOLE_MODE, false);
RadioGroup set_mode = rootView.findViewById(R.id.set_mode);
if( compact_mode){
set_mode.check(R.id.set_compact_mode);
}else if(console_mode){
set_mode.check(R.id.set_console_mode);
}else {
set_mode.check(R.id.set_normal_mode);
}
set_mode.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_COMPACT_MODE, set_compact_mode.isChecked());
editor.apply();
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch(checkedId) {
case R.id.set_compact_mode:
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_COMPACT_MODE, true);
editor.putBoolean(Helper.SET_CONSOLE_MODE, false);
editor.apply();
break;
case R.id.set_console_mode:
editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_COMPACT_MODE, false);
editor.putBoolean(Helper.SET_CONSOLE_MODE, true);
editor.apply();
break;
case R.id.set_normal_mode:
editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_COMPACT_MODE, false);
editor.putBoolean(Helper.SET_CONSOLE_MODE, false);
editor.apply();
break;
}
}
});
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
final CheckBox set_share_details = rootView.findViewById(R.id.set_share_details);
set_share_details.setChecked(share_details);

View File

@ -286,6 +286,7 @@ public class Helper {
public static final String SET_SHOW_BOOKMARK = "set_show_bookmark";
public static final String SET_FULL_PREVIEW = "set_full_preview";
public static final String SET_COMPACT_MODE = "set_compact_mode";
public static final String SET_CONSOLE_MODE = "set_console_mode";
public static final String SET_SHARE_DETAILS = "set_share_details";
public static final String SET_NOTIF_SOUND = "set_notif_sound";
public static final String SET_ENABLE_TIME_SLOT = "set_enable_time_slot";

View File

@ -204,13 +204,31 @@
android:background="?colorAccent" />
</LinearLayout>
<!-- COMPACT MODE -->
<CheckBox
android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_compact_mode"
<TextView
android:text="@string/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_normal_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_normal"
/>
<RadioButton android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_compact"
/>
<RadioButton android:id="@+id/set_console_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_console"
/>
</RadioGroup>
<!-- HIDE FOLLOW INSTANCE BUTTON -->
<CheckBox

View File

@ -0,0 +1,824 @@
<?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 Mastalab; 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:paddingTop="10dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:divider="?android:dividerHorizontal"
android:showDividers="end"
android:orientation="vertical">
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:baselineAligned="false">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="50dp"
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"
android:contentDescription="@string/profile_picture" />
<LinearLayout
android:id="@+id/conversation_pp"
android:visibility="gone"
android:layout_width="50dp"
android:layout_height="50dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/conversation_pp_1"
android:layout_width="0dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_height="match_parent"
android:contentDescription="@string/profile_picture" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:id="@+id/conversation_pp_2_container"
android:orientation="vertical"
>
<ImageView
android:id="@+id/conversation_pp_2"
android:scaleType="fitCenter"
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_weight="1"
android:adjustViewBounds="true"
android:contentDescription="@string/profile_picture" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:id="@+id/conversation_pp_3_container"
android:baselineAligned="false">
<ImageView
android:id="@+id/conversation_pp_3"
android:layout_width="0dp"
android:layout_weight="1"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
android:contentDescription="@string/profile_picture" />
<ImageView
android:id="@+id/conversation_pp_4"
android:layout_width="0dp"
android:layout_weight="1"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
android:contentDescription="@string/profile_picture" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:visibility="gone"
android:id="@+id/status_account_profile_boost"
android:contentDescription="@string/profile_picture" />
<ImageView
android:id="@+id/status_account_profile_boost_by"
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="25dp"
style="?attr/shapeBorder"
android:visibility="gone"
android:contentDescription="@string/profile_picture" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/left_buttons"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
<LinearLayout
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/status_account_displayname"
android:maxLines="1"
android:drawablePadding="2dp"
android:layout_marginTop="-2dp"
android:layout_marginStart="-2dp"
android:layout_marginLeft="-2dp"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/status_account_displayname_owner"
android:maxLines="1"
android:drawablePadding="2dp"
android:textStyle="bold"
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: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>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/status_spoiler_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_spoiler"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/status_spoiler_button"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_remove_red_eye"
android:drawableStart="@drawable/ic_remove_red_eye"
android:gravity="center_vertical"
android:drawablePadding="5dp"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:paddingRight="10dp"
android:paddingEnd="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?attr/borderless"
android:text="@string/load_attachment_spoiler" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_content_container"
android:layout_width="match_parent"
android:layout_marginBottom="5dp"
android:orientation="vertical"
android:layout_height="wrap_content">
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_content"
android:textIsSelectable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/status_show_more_content"
android:visibility="gone"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_more_toot_content"
android:drawableStart="@drawable/ic_more_toot_content"
android:gravity="center_vertical"
android:drawablePadding="5dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?attr/borderless"
android:text="@string/display_toot_truncate" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/status_translate"
android:gravity="center"
android:tint="@android:color/white"
style="?attr/borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_translate"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
/>
<ImageButton
android:id="@+id/status_bookmark"
android:gravity="center"
android:tint="@android:color/white"
style="?attr/borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_bookmark_border"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/status_content_translated_container"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/status_content_translated"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/yandex_translate"
android:layout_width="match_parent"
android:padding="2dp"
android:gravity="end"
android:text="Powered by Yandex.Translate"
android:layout_height="wrap_content"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_cardview"
android:padding="5dp"
android:layout_marginTop="5dp"
android:visibility="gone"
android:background="@drawable/card_border_light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:padding="1dp"
android:layout_gravity="center"
android:id="@+id/status_cardview_image"
android:layout_width="60dp"
android:gravity="center"
android:scaleType="centerCrop"
android:layout_height="60dp"
android:contentDescription="@string/card_view_image"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_marginLeft="2dp"
android:gravity="center_vertical"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:textSize="14sp"
android:maxLines="1"
android:textStyle="bold"
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:id="@+id/status_cardview_content"
android:layout_width="match_parent"
android:textSize="12sp"
android:maxLines="4"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/status_cardview_url"
android:layout_marginTop="5dp"
android:textSize="12sp"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:visibility="gone"
android:layout_gravity="center"
android:id="@+id/status_cardview_video"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
>
<RelativeLayout
android:id="@+id/webview_preview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/webview_preview_card"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/video_preview"
android:layout_height="30dp"
android:contentDescription="@string/play_video"/>
</RelativeLayout>
<WebView
android:visibility="gone"
android:id="@+id/status_cardview_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
<RelativeLayout
android:id="@+id/status_horizontal_document_container"
android:visibility="gone"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="horizontal"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev1_h"
android:layout_width="match_parent"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev1_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/horizontal_second_image"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
>
<ImageView
android:id="@+id/status_prev2_h"
android:scaleType="fitCenter"
android:layout_width="match_parent"
android:adjustViewBounds="true"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev2_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="1dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev3_h"
android:layout_width="match_parent"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev3_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
>
<ImageView
android:id="@+id/status_prev4_h"
android:layout_width="match_parent"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev4_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/hide_preview_h"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_remove_red_eye_img"
android:layout_height="wrap_content"
android:contentDescription="@string/hide_media"/>
</RelativeLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/status_document_container"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginBottom="5dp"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev1"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev1_play"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video" />
<ImageView
android:id="@+id/hide_preview"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_remove_red_eye_img"
android:layout_height="wrap_content"
android:contentDescription="@string/hide_media" />
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:id="@+id/status_container2"
android:layout_weight="1"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:id="@+id/status_prev2"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
/>
<ImageView
android:visibility="gone"
android:id="@+id/status_prev2_play"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video"/>
</RelativeLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="2dp"
android:id="@+id/status_container3"
android:layout_height="0dp"
android:baselineAligned="false">
<RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_prev3"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev3_play"
android:layout_centerInParent="true"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:visibility="gone"
android:layout_height="30dp"
android:contentDescription="@string/play_video"/>
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:layout_width="0dp"
android:id="@+id/status_prev4_container"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_prev4"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
/>
<ImageView
android:id="@+id/status_prev4_play"
android:layout_centerInParent="true"
android:visibility="gone"
android:layout_width="30dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="30dp"
android:contentDescription="@string/play_video"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/status_show_more"
android:visibility="gone"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_photo"
android:drawableStart="@drawable/ic_photo"
android:gravity="center_vertical"
android:drawablePadding="5dp"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:paddingRight="10dp"
android:paddingEnd="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?attr/borderless"
android:text="@string/load_attachment" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_spoiler_mention_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<TextView
android:id="@+id/status_mention_spoiler"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:visibility="gone"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:id="@+id/status_toot_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:layout_gravity="end"
android:gravity="end"
android:layout_marginBottom="5dp"
android:textStyle="italic"
android:textSize="16sp"
android:textColor="?attr/colorAccent"
/>
<LinearLayout
android:id="@+id/status_action_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<ImageView
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
android:id="@+id/new_element"
android:visibility="gone"
android:src="@drawable/ic_fiber_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/new_toot" />
<TextView
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:layout_height="wrap_content">
<com.varunest.sparkbutton.SparkButton
android:id="@+id/spark_button_reblog"
android:layout_width="30dp"
android:layout_height="30dp"
app:sparkbutton_activeImage="@drawable/ic_repeat_boost"
app:sparkbutton_inActiveImage="@drawable/ic_repeat"
app:sparkbutton_iconSize="20dp"
android:contentDescription="@string/reblog"
/>
<TextView
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_reblog_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:layout_height="wrap_content">
<com.varunest.sparkbutton.SparkButton
android:id="@+id/spark_button_fav"
android:layout_width="30dp"
android:layout_height="30dp"
android:contentDescription="@string/favourite"
app:sparkbutton_activeImage="@drawable/ic_star"
app:sparkbutton_inActiveImage="@drawable/ic_star_border"
app:sparkbutton_iconSize="20dp"
/>
<TextView
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_favorite_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ImageView
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:id="@+id/status_remove"
android:gravity="center"
android:visibility="gone"
android:layout_gravity="center_horizontal"
android:layout_width="20dp"
android:layout_height="20dp"
android:contentDescription="@string/delete"
android:src="@drawable/ic_clear_toot"
android:layout_marginTop="5dp"
/>
<ImageView
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:id="@+id/status_pin"
android:contentDescription="@string/pin_add"
android:layout_gravity="center_vertical"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_pin_drop"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="end"
android:gravity="end"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_privacy"
android:layout_gravity="center_vertical"
android:contentDescription="@string/toot_visibility_tilte"
android:layout_width="25dp"
android:layout_height="25dp"
/>
<ImageView
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:id="@+id/status_more"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/ic_more_horiz"
android:contentDescription="@string/display_toot_truncate" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_marginBottom="10dp"
android:id="@+id/status_replies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:id="@+id/status_replies_profile_pictures"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
<Button
android:id="@+id/fetch_more"
android:visibility="gone"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_fetch_more"
android:drawableStart="@drawable/ic_fetch_more"
android:gravity="center"
android:layout_gravity="center"
android:drawablePadding="5dp"
android:textStyle="bold"
android:textSize="16sp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?attr/borderless"
android:text="@string/fetch_more_toots" />
</LinearLayout>

View File

@ -209,13 +209,31 @@
</LinearLayout>
<!-- COMPACT MODE -->
<CheckBox
android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_compact_mode"
<TextView
android:text="@string/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_normal_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_normal"
/>
<RadioButton android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_compact"
/>
<RadioButton android:id="@+id/set_console_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_console"
/>
</RadioGroup>
<!-- HIDE FOLLOW INSTANCE BUTTON -->
<CheckBox

View File

@ -118,4 +118,8 @@
<color name="pixelfed_like">#dc3545</color>
<color name="ic_launcher_background">#454b5a</color>
<color name="console_name">#5E8D87</color>
<color name="console_reblog_name">#5F819D</color>
<color name="console_marker">#CC6666</color>
</resources>

View File

@ -874,6 +874,10 @@
<string name="more_about_opencollective">Open Collective enables groups to quickly set up a collective, raise funds and manage them transparently.</string>
<string name="copy_link">Copy link</string>
<string name="connect_instance">Connect</string>
<string name="set_normal">Nomal</string>
<string name="set_compact">Compact</string>
<string name="set_console">Console</string>
<string name="set_mode">Set display mode</string>
<!-- end languages -->