Making thy necessary adjustments for the thing to compile
This commit is contained in:
@@ -70,6 +70,7 @@ dependencies {
|
|||||||
implementation 'com.squareup:otto:1.3.8'
|
implementation 'com.squareup:otto:1.3.8'
|
||||||
implementation 'de.psdev:async-otto:1.0.3'
|
implementation 'de.psdev:async-otto:1.0.3'
|
||||||
implementation 'org.parceler:parceler-api:1.1.12'
|
implementation 'org.parceler:parceler-api:1.1.12'
|
||||||
|
implementation 'com.github.bottom-software-foundation:bottom-java:2.1.0'
|
||||||
annotationProcessor 'org.parceler:parceler:1.1.12'
|
annotationProcessor 'org.parceler:parceler:1.1.12'
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public class GlobalUserPreferences{
|
|||||||
|
|
||||||
private final static Type recentEmojisType = new TypeToken<Map<String, Integer>>() {}.getType();
|
private final static Type recentEmojisType = new TypeToken<Map<String, Integer>>() {}.getType();
|
||||||
public static Map<String, Integer> recentEmojis;
|
public static Map<String, Integer> recentEmojis;
|
||||||
public static boolean enablePreReleases;
|
|
||||||
|
|
||||||
private static SharedPreferences getPrefs(){
|
private static SharedPreferences getPrefs(){
|
||||||
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
protected HashMap<String, Account> knownAccounts=new HashMap<>();
|
protected HashMap<String, Account> knownAccounts=new HashMap<>();
|
||||||
protected HashMap<String, Relationship> relationships=new HashMap<>();
|
protected HashMap<String, Relationship> relationships=new HashMap<>();
|
||||||
protected Rect tmpRect=new Rect();
|
protected Rect tmpRect=new Rect();
|
||||||
protected ImageButton fab;
|
|
||||||
|
|
||||||
public BaseStatusListFragment(){
|
public BaseStatusListFragment(){
|
||||||
super(20);
|
super(20);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import android.widget.ImageView;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -832,7 +833,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
notifyButton.setSelected(relationship.notifying);
|
notifyButton.setSelected(relationship.notifying);
|
||||||
if (!isOwnProfile) {
|
if (!isOwnProfile) {
|
||||||
setNote(relationship.note);
|
setNote(relationship.note);
|
||||||
aboutFragment.setNote(relationship.note, accountID, profileAccountID);
|
// aboutFragment.setNote(relationship.note, accountID, profileAccountID);
|
||||||
}
|
}
|
||||||
notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,11 +270,11 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
needAppRestart=true;
|
needAppRestart=true;
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_translate_only_opened, R.drawable.ic_fluent_translate_24_regular, GlobalUserPreferences.translateButtonOpenedOnly, i->{
|
// items.add(new SwitchItem(R.string.sk_settings_translate_only_opened, R.drawable.ic_fluent_translate_24_regular, GlobalUserPreferences.translateButtonOpenedOnly, i->{
|
||||||
GlobalUserPreferences.translateButtonOpenedOnly=i.checked;
|
// GlobalUserPreferences.translateButtonOpenedOnly=i.checked;
|
||||||
GlobalUserPreferences.save();
|
// GlobalUserPreferences.save();
|
||||||
needAppRestart=true;
|
// needAppRestart=true;
|
||||||
}));
|
// }));
|
||||||
|
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.settings_notifications));
|
items.add(new HeaderItem(R.string.settings_notifications));
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public class Filter extends BaseModel{
|
|||||||
public String title;
|
public String title;
|
||||||
@RequiredField
|
@RequiredField
|
||||||
public String phrase;
|
public String phrase;
|
||||||
public String title;
|
|
||||||
public transient EnumSet<FilterContext> context=EnumSet.noneOf(FilterContext.class);
|
public transient EnumSet<FilterContext> context=EnumSet.noneOf(FilterContext.class);
|
||||||
public Instant expiresAt;
|
public Instant expiresAt;
|
||||||
public boolean irreversible;
|
public boolean irreversible;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
public static class Holder extends StatusDisplayItem.Holder<HeaderStatusDisplayItem> implements ImageLoaderViewHolder{
|
public static class Holder extends StatusDisplayItem.Holder<HeaderStatusDisplayItem> implements ImageLoaderViewHolder{
|
||||||
private final TextView name, username, timestamp, extraText, separator;
|
private final TextView name, username, timestamp, extraText, separator;
|
||||||
private final View collapseBtn;
|
private final View collapseBtn;
|
||||||
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator;
|
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator, collapseBtnIcon,botIcon;
|
||||||
private final PopupMenu optionsMenu;
|
private final PopupMenu optionsMenu;
|
||||||
private Relationship relationship;
|
private Relationship relationship;
|
||||||
private APIRequest<?> currentRelationshipRequest;
|
private APIRequest<?> currentRelationshipRequest;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.widget.Toast;
|
|||||||
import com.github.bottomSoftwareFoundation.bottom.Bottom;
|
import com.github.bottomSoftwareFoundation.bottom.Bottom;
|
||||||
import com.github.bottomSoftwareFoundation.bottom.TranslationError;
|
import com.github.bottomSoftwareFoundation.bottom.TranslationError;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.statuses.TranslateStatus;
|
import org.joinmastodon.android.api.requests.statuses.TranslateStatus;
|
||||||
import org.joinmastodon.android.api.session.AccountSession;
|
import org.joinmastodon.android.api.session.AccountSession;
|
||||||
@@ -26,6 +27,7 @@ import org.joinmastodon.android.model.StatusPrivacy;
|
|||||||
import org.joinmastodon.android.model.TranslatedStatus;
|
import org.joinmastodon.android.model.TranslatedStatus;
|
||||||
import org.joinmastodon.android.ui.text.HtmlParser;
|
import org.joinmastodon.android.ui.text.HtmlParser;
|
||||||
import org.joinmastodon.android.ui.utils.CustomEmojiHelper;
|
import org.joinmastodon.android.ui.utils.CustomEmojiHelper;
|
||||||
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.ui.views.LinkedTextView;
|
import org.joinmastodon.android.ui.views.LinkedTextView;
|
||||||
import org.joinmastodon.android.utils.StatusTextEncoder;
|
import org.joinmastodon.android.utils.StatusTextEncoder;
|
||||||
|
|
||||||
@@ -134,10 +136,10 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
|||||||
}
|
}
|
||||||
spoilerTitleInline.setTextIsSelectable(item.textSelectable);
|
spoilerTitleInline.setTextIsSelectable(item.textSelectable);
|
||||||
text.setInvalidateOnEveryFrame(false);
|
text.setInvalidateOnEveryFrame(false);
|
||||||
spoilerTitleInline.setBackground(item.inset ? null : backgroundColor);
|
spoilerTitleInline.setBackgroundColor(item.inset ? 0 : backgroundColor);
|
||||||
spoilerTitleInline.setPadding(spoilerTitleInline.getPaddingLeft(), item.inset ? 0 : V.dp(14), spoilerTitleInline.getPaddingRight(), item.inset ? 0 : V.dp(14));
|
spoilerTitleInline.setPadding(spoilerTitleInline.getPaddingLeft(), item.inset ? 0 : V.dp(14), spoilerTitleInline.getPaddingRight(), item.inset ? 0 : V.dp(14));
|
||||||
borderTop.setBackground(item.inset ? null : borderColor);
|
borderTop.setBackgroundColor(item.inset ? 0 : borderColor);
|
||||||
borderBottom.setBackground(item.inset ? null : borderColor);
|
borderBottom.setBackgroundColor(item.inset ? 0 : borderColor);
|
||||||
if(!TextUtils.isEmpty(item.status.spoilerText)){
|
if(!TextUtils.isEmpty(item.status.spoilerText)){
|
||||||
spoilerTitle.setText(item.parsedSpoilerText);
|
spoilerTitle.setText(item.parsedSpoilerText);
|
||||||
spoilerTitleInline.setText(item.parsedSpoilerText);
|
spoilerTitleInline.setText(item.parsedSpoilerText);
|
||||||
@@ -169,8 +171,8 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
|||||||
translateEnabled &&
|
translateEnabled &&
|
||||||
!item.status.visibility.isLessVisibleThan(StatusPrivacy.UNLISTED) &&
|
!item.status.visibility.isLessVisibleThan(StatusPrivacy.UNLISTED) &&
|
||||||
item.status.language != null &&
|
item.status.language != null &&
|
||||||
(item.session.preferences == null || !item.status.language.equalsIgnoreCase(item.session.preferences.postingDefaultLanguage))))
|
(item.session.preferences == null || !item.status.language.equalsIgnoreCase(item.session.preferences.postingDefaultLanguage))));
|
||||||
&& (!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable);
|
// && (!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable);
|
||||||
translateWrap.setVisibility(translateVisible ? View.VISIBLE : View.GONE);
|
translateWrap.setVisibility(translateVisible ? View.VISIBLE : View.GONE);
|
||||||
translateButton.setText(item.translated ? R.string.sk_translate_show_original : R.string.sk_translate_post);
|
translateButton.setText(item.translated ? R.string.sk_translate_show_original : R.string.sk_translate_post);
|
||||||
translateInfo.setText(item.translated ? itemView.getResources().getString(R.string.sk_translated_using, isBottomText ? "bottom-java" : item.translation.provider) : "");
|
translateInfo.setText(item.translated ? itemView.getResources().getString(R.string.sk_translated_using, isBottomText ? "bottom-java" : item.translation.provider) : "");
|
||||||
|
|||||||
@@ -178,6 +178,14 @@ public class UiUtils{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int alphaBlendColors(int color1, int color2, float alpha) {
|
||||||
|
float alpha0 = 1f - alpha;
|
||||||
|
int r = Math.round(((color1 >> 16) & 0xFF) * alpha0 + ((color2 >> 16) & 0xFF) * alpha);
|
||||||
|
int g = Math.round(((color1 >> 8) & 0xFF) * alpha0 + ((color2 >> 8) & 0xFF) * alpha);
|
||||||
|
int b = Math.round((color1 & 0xFF) * alpha0 + (color2 & 0xFF) * alpha);
|
||||||
|
return 0xFF000000 | (r << 16) | (g << 8) | b;
|
||||||
|
}
|
||||||
|
|
||||||
public static String formatRelativeTimestampAsMinutesAgo(Context context, Instant instant){
|
public static String formatRelativeTimestampAsMinutesAgo(Context context, Instant instant){
|
||||||
long t=instant.toEpochMilli();
|
long t=instant.toEpochMilli();
|
||||||
long now=System.currentTimeMillis();
|
long now=System.currentTimeMillis();
|
||||||
|
|||||||
Reference in New Issue
Block a user