Compare commits
106 Commits
v1.1.5+for
...
v1.1.5+for
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c8096274a | ||
|
|
7291b2da5a | ||
|
|
4ff98140cb | ||
|
|
c2a993c5c1 | ||
|
|
1b04440546 | ||
|
|
c0c276f03e | ||
|
|
d30b1f7bbd | ||
|
|
c0ee16cf08 | ||
|
|
a37fb33a68 | ||
|
|
59095e4ffe | ||
|
|
626614c03d | ||
|
|
58ab0c0fc1 | ||
|
|
32a8d38edf | ||
|
|
82534f7c4a | ||
|
|
c6d7242043 | ||
|
|
c4e23b0fe6 | ||
|
|
a5c753a9f8 | ||
|
|
e3520df57e | ||
|
|
66cede567e | ||
|
|
6916f435b3 | ||
|
|
dab0c560e9 | ||
|
|
1b23ef31d5 | ||
|
|
dd7af8b5d3 | ||
|
|
5914ef8fad | ||
|
|
a26ddfe70f | ||
|
|
cb067ca4fa | ||
|
|
3df9a3eecc | ||
|
|
987cbc86ec | ||
|
|
66dcaa9169 | ||
|
|
7162feea31 | ||
|
|
1a51744807 | ||
|
|
f83a28a1b3 | ||
|
|
f5d4e2a0b5 | ||
|
|
4aaf0c4fa4 | ||
|
|
38e133bee4 | ||
|
|
87bc01d985 | ||
|
|
d5561674cd | ||
|
|
48ec9e9fc6 | ||
|
|
63775c6eb9 | ||
|
|
79a61f6865 | ||
|
|
5f7e03a562 | ||
|
|
c93c4efe1d | ||
|
|
69771269fc | ||
|
|
e7a28696c6 | ||
|
|
124ad1df06 | ||
|
|
3a6ace53d5 | ||
|
|
1e825c979c | ||
|
|
c67b2b35f3 | ||
|
|
8588ca8ae3 | ||
|
|
7bb280e8b8 | ||
|
|
ad1e1b112b | ||
|
|
29139a8f4d | ||
|
|
ddfeaabd44 | ||
|
|
51219bf98a | ||
|
|
335f734698 | ||
|
|
512cb70347 | ||
|
|
c7e0adfbd4 | ||
|
|
ad7a9626a4 | ||
|
|
92f37fdf16 | ||
|
|
900e8fb2e9 | ||
|
|
be4b032527 | ||
|
|
95cb04530f | ||
|
|
4b6a0b71a0 | ||
|
|
187190c07e | ||
|
|
5142851f57 | ||
|
|
763c5fe2a7 | ||
|
|
7f0265fe24 | ||
|
|
f87827700b | ||
|
|
fb2c0c0ec2 | ||
|
|
ec40488ed1 | ||
|
|
88851a085e | ||
|
|
87c743886e | ||
|
|
f3cde5441b | ||
|
|
7a9534772d | ||
|
|
42faa62a5f | ||
|
|
6e718d6765 | ||
|
|
b26d491eda | ||
|
|
abdbab9d7b | ||
|
|
af1c7194e6 | ||
|
|
8e507e7970 | ||
|
|
3b542730b1 | ||
|
|
b038f81718 | ||
|
|
e1206703cf | ||
|
|
924affee14 | ||
|
|
0c5da34cd6 | ||
|
|
b44e6b9f0a | ||
|
|
9d3369f601 | ||
|
|
f607ed314d | ||
|
|
2cdf642ca3 | ||
|
|
5d278eb5aa | ||
|
|
860c2826e3 | ||
|
|
3060c36cca | ||
|
|
a1b0632c75 | ||
|
|
14cbb1107f | ||
|
|
dd5f352f5e | ||
|
|
d148883ab2 | ||
|
|
cfa93424cc | ||
|
|
ff575f75c7 | ||
|
|
6fec7a5205 | ||
|
|
0693495e12 | ||
|
|
04381d57f2 | ||
|
|
9f4adcab23 | ||
|
|
00dba5981c | ||
|
|
ae838fe4d7 | ||
|
|
2110861f1b | ||
|
|
4f6476c807 |
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,25 +8,35 @@ assignees: ''
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
**To reproduce**
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Does this happen in the official app?**
|
||||
|
||||
Does this issue also occur with the respective upstream release?
|
||||
(Please test using the respective `upstream-xxxxxx.apk` provided in [Releases](https://github.com/sk22/megalodon/releases) or at least using the current Mastodon version from the Play Store)
|
||||
|
||||
> No / Yes
|
||||
|
||||
> In case it does, please consider filing an [upstream bug report](https://github.com/mastodon/mastodon-android/issues) instead.
|
||||
> If this bug is seriously impacting your usage or you think I might want to try to fix it for Megalodon, feel free to still create this issue!
|
||||
|
||||
**Screenshots and screen recordings**
|
||||
|
||||
If applicable, add screenshots (and screen recordings, if possible) to help explain your problem.
|
||||
|
||||
**Version**
|
||||
|
||||
Megalodon version: [e.g. v1.1.4+fork.#]
|
||||
|
||||
**Additional context**
|
||||
- Does this issue also occur with the respective upstream release? (Please test using the respective `upstream-xxxxxx.apk` provided in [Releases](https://github.com/sk22/megalodon/releases)) No / Yes (`mastodon#…`)
|
||||
|
||||
> In this case, please consider filing an [upstream bug report](https://github.com/mastodon/mastodon-android/issues) instead. If this bug is seriously impacting your usage or you think I might want to try to fix it for Megalodon, feel free to still create this issue!
|
||||
|
||||
**Crash log**
|
||||
|
||||
If you know your way around Android development tools, please consider attaching a crash log, if possible.
|
||||
|
||||
@@ -9,8 +9,8 @@ android {
|
||||
applicationId "org.joinmastodon.android.sk"
|
||||
minSdk 23
|
||||
targetSdk 33
|
||||
versionCode 67
|
||||
versionName "1.1.5+fork.67"
|
||||
versionCode 70
|
||||
versionName "1.1.5+fork.70"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW"
|
||||
}
|
||||
|
||||
@@ -14,12 +14,14 @@ import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import org.joinmastodon.android.BuildConfig;
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.MastodonApp;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.MastodonAPIController;
|
||||
@@ -113,64 +115,70 @@ public class GithubSelfUpdaterImpl extends GithubSelfUpdater{
|
||||
|
||||
private void actuallyCheckForUpdates(){
|
||||
Request req=new Request.Builder()
|
||||
.url("https://api.github.com/repos/sk22/megalodon/releases/latest")
|
||||
.url("https://api.github.com/repos/sk22/megalodon/releases")
|
||||
.build();
|
||||
Call call=MastodonAPIController.getHttpClient().newCall(req);
|
||||
try(Response resp=call.execute()){
|
||||
JsonObject obj=JsonParser.parseReader(resp.body().charStream()).getAsJsonObject();
|
||||
String tag=obj.get("tag_name").getAsString();
|
||||
String changelog=obj.get("body").getAsString();
|
||||
Pattern pattern=Pattern.compile("v?(\\d+)\\.(\\d+)\\.(\\d+)\\+fork\\.(\\d+)");
|
||||
Matcher matcher=pattern.matcher(tag);
|
||||
if(!matcher.find()){
|
||||
Log.w(TAG, "actuallyCheckForUpdates: release tag has wrong format: "+tag);
|
||||
return;
|
||||
}
|
||||
int newMajor=Integer.parseInt(matcher.group(1)),
|
||||
newMinor=Integer.parseInt(matcher.group(2)),
|
||||
newRevision=Integer.parseInt(matcher.group(3)),
|
||||
newForkNumber=Integer.parseInt(matcher.group(4));
|
||||
matcher=pattern.matcher(BuildConfig.VERSION_NAME);
|
||||
String[] currentParts=BuildConfig.VERSION_NAME.split("[.+]");
|
||||
if(!matcher.find()){
|
||||
Log.w(TAG, "actuallyCheckForUpdates: current version has wrong format: "+BuildConfig.VERSION_NAME);
|
||||
return;
|
||||
}
|
||||
int curMajor=Integer.parseInt(matcher.group(1)),
|
||||
curMinor=Integer.parseInt(matcher.group(2)),
|
||||
curRevision=Integer.parseInt(matcher.group(3)),
|
||||
curForkNumber=Integer.parseInt(matcher.group(4));
|
||||
long newVersion=((long)newMajor << 32) | ((long)newMinor << 16) | newRevision;
|
||||
long curVersion=((long)curMajor << 32) | ((long)curMinor << 16) | curRevision;
|
||||
if(newVersion>curVersion || newForkNumber>curForkNumber){
|
||||
String version=newMajor+"."+newMinor+"."+newRevision+"+fork."+newForkNumber;
|
||||
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
||||
for(JsonElement el:obj.getAsJsonArray("assets")){
|
||||
JsonObject asset=el.getAsJsonObject();
|
||||
if("megalodon.apk".equals(asset.get("name").getAsString()) && "application/vnd.android.package-archive".equals(asset.get("content_type").getAsString()) && "uploaded".equals(asset.get("state").getAsString())){
|
||||
long size=asset.get("size").getAsLong();
|
||||
String url=asset.get("browser_download_url").getAsString();
|
||||
JsonArray arr=JsonParser.parseReader(resp.body().charStream()).getAsJsonArray();
|
||||
for (JsonElement jsonElement : arr) {
|
||||
JsonObject obj = jsonElement.getAsJsonObject();
|
||||
if (obj.get("prerelease").getAsBoolean() && !GlobalUserPreferences.enablePreReleases) continue;
|
||||
|
||||
UpdateInfo info=new UpdateInfo();
|
||||
info.size=size;
|
||||
info.version=version;
|
||||
info.changelog=changelog;
|
||||
this.info=info;
|
||||
String tag=obj.get("tag_name").getAsString();
|
||||
String changelog=obj.get("body").getAsString();
|
||||
Pattern pattern=Pattern.compile("v?(\\d+)\\.(\\d+)\\.(\\d+)\\+fork\\.(\\d+)");
|
||||
Matcher matcher=pattern.matcher(tag);
|
||||
if(!matcher.find()){
|
||||
Log.w(TAG, "actuallyCheckForUpdates: release tag has wrong format: "+tag);
|
||||
return;
|
||||
}
|
||||
int newMajor=Integer.parseInt(matcher.group(1)),
|
||||
newMinor=Integer.parseInt(matcher.group(2)),
|
||||
newRevision=Integer.parseInt(matcher.group(3)),
|
||||
newForkNumber=Integer.parseInt(matcher.group(4));
|
||||
matcher=pattern.matcher(BuildConfig.VERSION_NAME);
|
||||
String[] currentParts=BuildConfig.VERSION_NAME.split("[.+]");
|
||||
if(!matcher.find()){
|
||||
Log.w(TAG, "actuallyCheckForUpdates: current version has wrong format: "+BuildConfig.VERSION_NAME);
|
||||
return;
|
||||
}
|
||||
int curMajor=Integer.parseInt(matcher.group(1)),
|
||||
curMinor=Integer.parseInt(matcher.group(2)),
|
||||
curRevision=Integer.parseInt(matcher.group(3)),
|
||||
curForkNumber=Integer.parseInt(matcher.group(4));
|
||||
long newVersion=((long)newMajor << 32) | ((long)newMinor << 16) | newRevision;
|
||||
long curVersion=((long)curMajor << 32) | ((long)curMinor << 16) | curRevision;
|
||||
if(newVersion>curVersion || newForkNumber>curForkNumber){
|
||||
String version=newMajor+"."+newMinor+"."+newRevision+"+fork."+newForkNumber;
|
||||
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
||||
for(JsonElement el:obj.getAsJsonArray("assets")){
|
||||
JsonObject asset=el.getAsJsonObject();
|
||||
if("megalodon.apk".equals(asset.get("name").getAsString()) && "application/vnd.android.package-archive".equals(asset.get("content_type").getAsString()) && "uploaded".equals(asset.get("state").getAsString())){
|
||||
long size=asset.get("size").getAsLong();
|
||||
String url=asset.get("browser_download_url").getAsString();
|
||||
|
||||
getPrefs().edit()
|
||||
.putLong("apkSize", size)
|
||||
.putString("version", version)
|
||||
.putString("apkURL", url)
|
||||
.putString("changelog", changelog)
|
||||
.putInt("checkedByBuild", BuildConfig.VERSION_CODE)
|
||||
.remove("downloadID")
|
||||
.apply();
|
||||
UpdateInfo info=new UpdateInfo();
|
||||
info.size=size;
|
||||
info.version=version;
|
||||
info.changelog=changelog;
|
||||
this.info=info;
|
||||
|
||||
break;
|
||||
getPrefs().edit()
|
||||
.putLong("apkSize", size)
|
||||
.putString("version", version)
|
||||
.putString("apkURL", url)
|
||||
.putString("changelog", changelog)
|
||||
.putInt("checkedByBuild", BuildConfig.VERSION_CODE)
|
||||
.remove("downloadID")
|
||||
.apply();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
getPrefs().edit().putLong("lastCheck", System.currentTimeMillis()).apply();
|
||||
break;
|
||||
}
|
||||
getPrefs().edit().putLong("lastCheck", System.currentTimeMillis()).apply();
|
||||
}catch(Exception x){
|
||||
Log.w(TAG, "actuallyCheckForUpdates", x);
|
||||
}finally{
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
|
||||
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name=".MastodonApp"
|
||||
android:allowBackup="true"
|
||||
|
||||
@@ -83,3 +83,7 @@ mirr0r.city underage
|
||||
nnia.space underage
|
||||
ignorelist.com malicious
|
||||
repl.co malicious
|
||||
|
||||
# custom
|
||||
|
||||
pawoo.net csam
|
||||
|
||||
|
@@ -8,6 +8,8 @@ import android.content.SharedPreferences;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -20,7 +22,6 @@ public class GlobalUserPreferences{
|
||||
public static boolean showReplies;
|
||||
public static boolean showBoosts;
|
||||
public static boolean loadNewPosts;
|
||||
public static boolean showFederatedTimeline;
|
||||
public static boolean showInteractionCounts;
|
||||
public static boolean alwaysExpandContentWarnings;
|
||||
public static boolean disableMarquee;
|
||||
@@ -31,18 +32,25 @@ public class GlobalUserPreferences{
|
||||
public static boolean uniformNotificationIcon;
|
||||
public static boolean reduceMotion;
|
||||
public static boolean keepOnlyLatestNotification;
|
||||
public static boolean disableAltTextReminder;
|
||||
public static boolean showAltIndicator;
|
||||
public static boolean showNoAltIndicator;
|
||||
public static boolean enablePreReleases;
|
||||
public static String publishButtonText;
|
||||
public static ThemePreference theme;
|
||||
public static ColorPreference color;
|
||||
|
||||
private final static Type recentLanguagesType = new TypeToken<Map<String, List<String>>>() {}.getType();
|
||||
private final static Type pinnedTimelinesType = new TypeToken<Map<String, List<TimelineDefinition>>>() {}.getType();
|
||||
public static Map<String, List<String>> recentLanguages;
|
||||
public static Map<String, List<TimelineDefinition>> pinnedTimelines;
|
||||
|
||||
private static SharedPreferences getPrefs(){
|
||||
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
private static <T> T fromJson(String json, Type type, T orElse) {
|
||||
if (json == null) return orElse;
|
||||
try { return gson.fromJson(json, type); }
|
||||
catch (JsonSyntaxException ignored) { return orElse; }
|
||||
}
|
||||
@@ -55,7 +63,6 @@ public class GlobalUserPreferences{
|
||||
showReplies=prefs.getBoolean("showReplies", true);
|
||||
showBoosts=prefs.getBoolean("showBoosts", true);
|
||||
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
||||
showFederatedTimeline=prefs.getBoolean("showFederatedTimeline", !BuildConfig.BUILD_TYPE.equals("playRelease"));
|
||||
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
||||
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
||||
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
||||
@@ -66,9 +73,14 @@ public class GlobalUserPreferences{
|
||||
uniformNotificationIcon=prefs.getBoolean("uniformNotificationIcon", false);
|
||||
reduceMotion=prefs.getBoolean("reduceMotion", false);
|
||||
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
|
||||
disableAltTextReminder=prefs.getBoolean("disableAltTextReminder", false);
|
||||
showAltIndicator=prefs.getBoolean("showAltIndicator", true);
|
||||
showNoAltIndicator=prefs.getBoolean("showNoAltIndicator", true);
|
||||
enablePreReleases=prefs.getBoolean("enablePreReleases", false);
|
||||
publishButtonText=prefs.getString("publishButtonText", "");
|
||||
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
||||
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
|
||||
recentLanguages=fromJson(prefs.getString("recentLanguages", null), recentLanguagesType, new HashMap<>());
|
||||
pinnedTimelines=fromJson(prefs.getString("pinnedTimelines", null), pinnedTimelinesType, new HashMap<>());
|
||||
|
||||
try {
|
||||
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.PINK.name()));
|
||||
@@ -85,7 +97,6 @@ public class GlobalUserPreferences{
|
||||
.putBoolean("showReplies", showReplies)
|
||||
.putBoolean("showBoosts", showBoosts)
|
||||
.putBoolean("loadNewPosts", loadNewPosts)
|
||||
.putBoolean("showFederatedTimeline", showFederatedTimeline)
|
||||
.putBoolean("trueBlackTheme", trueBlackTheme)
|
||||
.putBoolean("showInteractionCounts", showInteractionCounts)
|
||||
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
||||
@@ -96,10 +107,15 @@ public class GlobalUserPreferences{
|
||||
.putBoolean("uniformNotificationIcon", uniformNotificationIcon)
|
||||
.putBoolean("reduceMotion", reduceMotion)
|
||||
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
|
||||
.putBoolean("disableAltTextReminder", disableAltTextReminder)
|
||||
.putBoolean("showAltIndicator", showAltIndicator)
|
||||
.putBoolean("showNoAltIndicator", showNoAltIndicator)
|
||||
.putBoolean("enablePreReleases", enablePreReleases)
|
||||
.putString("publishButtonText", publishButtonText)
|
||||
.putInt("theme", theme.ordinal())
|
||||
.putString("color", color.name())
|
||||
.putString("recentLanguages", gson.toJson(recentLanguages))
|
||||
.putString("pinnedTimelines", gson.toJson(pinnedTimelines))
|
||||
.apply();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,12 +39,13 @@ public class MainActivity extends FragmentStackActivity{
|
||||
AccountSession session;
|
||||
Bundle args=new Bundle();
|
||||
Intent intent=getIntent();
|
||||
if(intent.getBooleanExtra("fromNotification", false)){
|
||||
boolean fromNotification = intent.getBooleanExtra("fromNotification", false);
|
||||
boolean hasNotification = intent.hasExtra("notification");
|
||||
if(fromNotification){
|
||||
String accountID=intent.getStringExtra("accountID");
|
||||
try{
|
||||
session=AccountSessionManager.getInstance().getAccount(accountID);
|
||||
if(!intent.hasExtra("notification"))
|
||||
args.putString("tab", "notifications");
|
||||
if(!hasNotification) args.putString("tab", "notifications");
|
||||
}catch(IllegalStateException x){
|
||||
session=AccountSessionManager.getInstance().getLastActiveAccount();
|
||||
}
|
||||
@@ -54,13 +55,13 @@ public class MainActivity extends FragmentStackActivity{
|
||||
args.putString("account", session.getID());
|
||||
Fragment fragment=session.activated ? new HomeFragment() : new AccountActivationFragment();
|
||||
fragment.setArguments(args);
|
||||
showFragmentClearingBackStack(fragment);
|
||||
if(intent.getBooleanExtra("fromNotification", false) && intent.hasExtra("notification")){
|
||||
if(fromNotification && hasNotification){
|
||||
Notification notification=Parcels.unwrap(intent.getParcelableExtra("notification"));
|
||||
showFragmentForNotification(notification, session.getID());
|
||||
}else if(intent.getBooleanExtra("compose", false)){
|
||||
} else if (intent.getBooleanExtra("compose", false)){
|
||||
showCompose();
|
||||
}else{
|
||||
} else {
|
||||
showFragmentClearingBackStack(fragment);
|
||||
maybeRequestNotificationsPermission();
|
||||
}
|
||||
}
|
||||
@@ -139,4 +140,30 @@ public class MainActivity extends FragmentStackActivity{
|
||||
requestPermissions(new String[]{Manifest.permission.POST_NOTIFICATIONS}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* when opening app through a notification: if (thread) fragment "can go back", clear back stack
|
||||
* and show home fragment. upstream's implementation doesn't require this as it opens home first
|
||||
* and then immediately switches to the notification's ThreadFragment. this causes a black
|
||||
* screen in megalodon, for some reason, so i'm working around this that way.
|
||||
*/
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
Fragment currentFragment = getFragmentManager().findFragmentById(
|
||||
(fragmentContainers.get(fragmentContainers.size() - 1)).getId()
|
||||
);
|
||||
Bundle currentArgs = currentFragment.getArguments();
|
||||
if (this.fragmentContainers.size() == 1
|
||||
&& currentArgs.getBoolean("_can_go_back", false)
|
||||
&& currentArgs.containsKey("account")) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("account", currentArgs.getString("account"));
|
||||
args.putString("tab", "notifications");
|
||||
Fragment fragment=new HomeFragment();
|
||||
fragment.setArguments(args);
|
||||
showFragmentClearingBackStack(fragment);
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,12 +144,16 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
||||
.setAutoCancel(true)
|
||||
.setColor(context.getColor(R.color.primary_700));
|
||||
|
||||
if (!GlobalUserPreferences.uniformNotificationIcon) switch (pn.notificationType) {
|
||||
case FAVORITE -> builder.setSmallIcon(R.drawable.ic_fluent_star_24_filled);
|
||||
case REBLOG -> builder.setSmallIcon(R.drawable.ic_fluent_arrow_repeat_all_24_filled);
|
||||
case FOLLOW -> builder.setSmallIcon(R.drawable.ic_fluent_person_add_24_filled);
|
||||
case MENTION -> builder.setSmallIcon(R.drawable.ic_fluent_mention_24_filled);
|
||||
case POLL -> builder.setSmallIcon(R.drawable.ic_fluent_poll_24_filled);
|
||||
if (!GlobalUserPreferences.uniformNotificationIcon) {
|
||||
builder.setSmallIcon(switch (pn.notificationType) {
|
||||
case FAVORITE -> R.drawable.ic_fluent_star_24_filled;
|
||||
case REBLOG -> R.drawable.ic_fluent_arrow_repeat_all_24_filled;
|
||||
case FOLLOW -> R.drawable.ic_fluent_person_add_24_filled;
|
||||
case MENTION -> R.drawable.ic_fluent_mention_24_filled;
|
||||
case POLL -> R.drawable.ic_fluent_poll_24_filled;
|
||||
case STATUS -> R.drawable.ic_fluent_chat_24_filled;
|
||||
case UPDATE -> R.drawable.ic_fluent_history_24_filled;
|
||||
});
|
||||
}
|
||||
|
||||
if(avatar!=null){
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.joinmastodon.android.api.requests.lists;
|
||||
|
||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
|
||||
public class GetList extends MastodonAPIRequest<ListTimeline> {
|
||||
public GetList(String id) {
|
||||
super(HttpMethod.GET, "/lists/" + id, ListTimeline.class);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public class RegisterForPushNotifications extends MastodonAPIRequest<PushSubscri
|
||||
Request r=new Request();
|
||||
r.subscription.endpoint="https://app.joinmastodon.org/relay-to/fcm/"+deviceToken+"/"+accountID;
|
||||
r.data.alerts=alerts;
|
||||
r.data.policy=policy;
|
||||
r.policy=policy;
|
||||
r.subscription.keys.p256dh=encryptionKey;
|
||||
r.subscription.keys.auth=authKey;
|
||||
setRequestBody(r);
|
||||
@@ -18,6 +18,7 @@ public class RegisterForPushNotifications extends MastodonAPIRequest<PushSubscri
|
||||
private static class Request{
|
||||
public Subscription subscription=new Subscription();
|
||||
public Data data=new Data();
|
||||
public PushSubscription.Policy policy;
|
||||
|
||||
private static class Keys{
|
||||
public String p256dh;
|
||||
@@ -31,7 +32,6 @@ public class RegisterForPushNotifications extends MastodonAPIRequest<PushSubscri
|
||||
|
||||
private static class Data{
|
||||
public PushSubscription.Alerts alerts;
|
||||
public PushSubscription.Policy policy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,23 +3,36 @@ package org.joinmastodon.android.api.requests.notifications;
|
||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
import org.joinmastodon.android.model.PushSubscription;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
public class UpdatePushSettings extends MastodonAPIRequest<PushSubscription>{
|
||||
private final PushSubscription.Policy policy;
|
||||
|
||||
public UpdatePushSettings(PushSubscription.Alerts alerts, PushSubscription.Policy policy){
|
||||
super(HttpMethod.PUT, "/push/subscription", PushSubscription.class);
|
||||
setRequestBody(new Request(alerts, policy));
|
||||
this.policy=policy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAndPostprocessResponse(PushSubscription respObj, Response httpResponse) throws IOException{
|
||||
super.validateAndPostprocessResponse(respObj, httpResponse);
|
||||
respObj.policy=policy;
|
||||
}
|
||||
|
||||
private static class Request{
|
||||
public Data data=new Data();
|
||||
public PushSubscription.Policy policy;
|
||||
|
||||
public Request(PushSubscription.Alerts alerts, PushSubscription.Policy policy){
|
||||
this.data.alerts=alerts;
|
||||
this.data.policy=policy;
|
||||
this.policy=policy;
|
||||
}
|
||||
|
||||
private static class Data{
|
||||
public PushSubscription.Alerts alerts;
|
||||
public PushSubscription.Policy policy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.joinmastodon.android.events;
|
||||
|
||||
public class HashtagUpdatedEvent {
|
||||
public final String name;
|
||||
public final boolean following;
|
||||
|
||||
public HashtagUpdatedEvent(String name, boolean following) {
|
||||
this.name = name;
|
||||
this.following = following;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.joinmastodon.android.events;
|
||||
|
||||
public class ListDeletedEvent {
|
||||
public final String id;
|
||||
|
||||
public ListDeletedEvent(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.joinmastodon.android.events;
|
||||
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
|
||||
public class ListUpdatedCreatedEvent {
|
||||
public final String id;
|
||||
public final String title;
|
||||
public final ListTimeline.RepliesPolicy repliesPolicy;
|
||||
|
||||
public ListUpdatedCreatedEvent(String id, String title, ListTimeline.RepliesPolicy repliesPolicy) {
|
||||
this.id = id;
|
||||
this.title = title;
|
||||
this.repliesPolicy = repliesPolicy;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class AnnouncementsFragment extends BaseStatusListFragment<Announcement>
|
||||
instanceUser.avatar = instanceUser.avatarStatic = instance.thumbnail;
|
||||
instanceUser.emojis = List.of();
|
||||
Status fakeStatus = a.toStatus();
|
||||
TextStatusDisplayItem textItem = new TextStatusDisplayItem(a.id, HtmlParser.parse(a.content, a.emojis, a.mentions, a.tags, accountID), this, fakeStatus);
|
||||
TextStatusDisplayItem textItem = new TextStatusDisplayItem(a.id, HtmlParser.parse(a.content, a.emojis, a.mentions, a.tags, accountID), this, fakeStatus, true);
|
||||
textItem.textSelectable = true;
|
||||
return List.of(
|
||||
HeaderStatusDisplayItem.fromAnnouncement(a, fakeStatus, instanceUser, this, accountID, this::onMarkAsRead),
|
||||
@@ -77,12 +77,7 @@ public class AnnouncementsFragment extends BaseStatusListFragment<Announcement>
|
||||
public void onMarkAsRead(String id) {
|
||||
if (unreadIDs == null) return;
|
||||
unreadIDs.remove(id);
|
||||
if (unreadIDs.size() == 0) setResult(true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (unreadIDs.isEmpty()) setResult(true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,7 +96,8 @@ public class AnnouncementsFragment extends BaseStatusListFragment<Announcement>
|
||||
List<Announcement> read = result.stream().filter(a -> a.read).collect(toList());
|
||||
onDataLoaded(unread, true);
|
||||
onDataLoaded(read, false);
|
||||
unreadIDs = unread.stream().map(a -> a.id).collect(toList());
|
||||
if (unread.isEmpty()) setResult(true, null);
|
||||
else unreadIDs = unread.stream().map(a -> a.id).collect(toList());
|
||||
}
|
||||
})
|
||||
.exec(accountID);
|
||||
|
||||
@@ -327,7 +327,19 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
sensitiveItem=view.findViewById(R.id.sensitive_item);
|
||||
replyText=view.findViewById(R.id.reply_text);
|
||||
|
||||
mediaBtn.setOnClickListener(v->openFilePicker());
|
||||
if (isPhotoPickerAvailable()) {
|
||||
PopupMenu attachPopup = new PopupMenu(getContext(), mediaBtn);
|
||||
attachPopup.inflate(R.menu.attach);
|
||||
attachPopup.setOnMenuItemClickListener(i -> {
|
||||
openFilePicker(i.getItemId() == R.id.media);
|
||||
return true;
|
||||
});
|
||||
UiUtils.enablePopupMenuIcons(getContext(), attachPopup);
|
||||
mediaBtn.setOnClickListener(v->attachPopup.show());
|
||||
mediaBtn.setOnTouchListener(attachPopup.getDragToOpenListener());
|
||||
} else {
|
||||
mediaBtn.setOnClickListener(v -> openFilePicker(false));
|
||||
}
|
||||
pollBtn.setOnClickListener(v->togglePoll());
|
||||
emojiBtn.setOnClickListener(v->emojiKeyboard.toggleKeyboardPopup(mainEditText));
|
||||
spoilerBtn.setOnClickListener(v->toggleSpoiler());
|
||||
@@ -405,6 +417,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
spoilerBg.setDrawableByLayerId(R.id.right_drawable, new SpoilerStripesDrawable());
|
||||
spoilerEdit.setBackground(spoilerBg);
|
||||
if((savedInstanceState!=null && savedInstanceState.getBoolean("hasSpoiler", false)) || hasSpoiler){
|
||||
hasSpoiler=true;
|
||||
spoilerEdit.setVisibility(View.VISIBLE);
|
||||
spoilerBtn.setSelected(true);
|
||||
}else if(editingStatus!=null && !TextUtils.isEmpty(editingStatus.spoilerText)){
|
||||
@@ -778,6 +791,11 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
draftsBtn.setOnTouchListener(draftOptionsPopup.getDragToOpenListener());
|
||||
updateScheduledAt(scheduledAt != null ? scheduledAt : scheduledStatus != null ? scheduledStatus.scheduledAt : null);
|
||||
buildLanguageSelector(languageButton);
|
||||
|
||||
if (editingStatus != null && scheduledStatus == null) {
|
||||
// editing an already published post
|
||||
draftsBtn.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void navigateToUnsentPosts() {
|
||||
@@ -813,7 +831,8 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
btn.setOnClickListener(v->languagePopup.show());
|
||||
|
||||
Preferences prefs = AccountSessionManager.getInstance().getAccount(accountID).preferences;
|
||||
updateLanguage(prefs != null && prefs.postingDefaultLanguage != null && prefs.postingDefaultLanguage.length() > 0
|
||||
if (language != null) updateLanguage(language);
|
||||
else updateLanguage(prefs != null && prefs.postingDefaultLanguage != null && prefs.postingDefaultLanguage.length() > 0
|
||||
? languageResolver.from(prefs.postingDefaultLanguage)
|
||||
: languageResolver.getDefault());
|
||||
|
||||
@@ -951,6 +970,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
}
|
||||
|
||||
private void publish(){
|
||||
publish(false);
|
||||
}
|
||||
|
||||
private void publish(boolean force){
|
||||
String text=mainEditText.getText().toString();
|
||||
CreateStatus.Request req=new CreateStatus.Request();
|
||||
req.status=text;
|
||||
@@ -960,6 +983,30 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
req.scheduledAt = scheduledAt;
|
||||
if(!attachments.isEmpty()){
|
||||
req.mediaIds=attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList());
|
||||
Optional<DraftMediaAttachment> withoutAltText = attachments.stream().filter(a -> a.description == null || a.description.isBlank()).findFirst();
|
||||
boolean isDraft = scheduledAt != null && scheduledAt.isAfter(DRAFTS_AFTER_INSTANT);
|
||||
if (!force && !GlobalUserPreferences.disableAltTextReminder && !isDraft && withoutAltText.isPresent()) {
|
||||
new M3AlertDialogBuilder(getActivity())
|
||||
.setTitle(R.string.sk_alt_text_missing_title)
|
||||
.setMessage(R.string.sk_alt_text_missing)
|
||||
.setPositiveButton(R.string.add_alt_text, (d, w) -> editMediaDescription(withoutAltText.get()))
|
||||
.setNegativeButton(R.string.sk_publish_anyway, (d, w) -> publish(true))
|
||||
.show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ask whether to publish now when editing an existing draft
|
||||
if (!force && editingStatus != null && scheduledAt != null && scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)) {
|
||||
new M3AlertDialogBuilder(getActivity())
|
||||
.setTitle(R.string.sk_save_draft)
|
||||
.setMessage(R.string.sk_save_draft_message)
|
||||
.setPositiveButton(R.string.save, (d, w) -> publish(true))
|
||||
.setNegativeButton(R.string.publish, (d, w) -> {
|
||||
updateScheduledAt(null);
|
||||
publish();
|
||||
})
|
||||
.show();
|
||||
return;
|
||||
}
|
||||
if(replyTo!=null || (editingStatus != null && editingStatus.inReplyToId!=null)){
|
||||
req.inReplyToId=editingStatus!=null ? editingStatus.inReplyToId : replyTo.id;
|
||||
@@ -1160,9 +1207,9 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
*
|
||||
* <p>For earlier versions use the built in docs ui via {@link Intent#ACTION_GET_CONTENT}
|
||||
*/
|
||||
private void openFilePicker(){
|
||||
private void openFilePicker(boolean photoPicker){
|
||||
Intent intent;
|
||||
boolean usePhotoPicker = isPhotoPickerAvailable();
|
||||
boolean usePhotoPicker = photoPicker && isPhotoPickerAvailable();
|
||||
if (usePhotoPicker) {
|
||||
intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
|
||||
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, MediaStore.getPickImagesMaxLimit());
|
||||
@@ -1524,6 +1571,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
DraftMediaAttachment att=(DraftMediaAttachment) v.getTag();
|
||||
if(att.serverAttachment==null)
|
||||
return;
|
||||
editMediaDescription(att);
|
||||
}
|
||||
|
||||
private void editMediaDescription(DraftMediaAttachment att) {
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountID);
|
||||
args.putString("attachment", att.serverAttachment.id);
|
||||
@@ -1600,18 +1651,20 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
menu.getMenu().add(0, 2, 0, getResources().getQuantityString(R.plurals.x_minutes, 30, 30));
|
||||
menu.getMenu().add(0, 3, 0, getResources().getQuantityString(R.plurals.x_hours, 1, 1));
|
||||
menu.getMenu().add(0, 4, 0, getResources().getQuantityString(R.plurals.x_hours, 6, 6));
|
||||
menu.getMenu().add(0, 5, 0, getResources().getQuantityString(R.plurals.x_days, 1, 1));
|
||||
menu.getMenu().add(0, 6, 0, getResources().getQuantityString(R.plurals.x_days, 3, 3));
|
||||
menu.getMenu().add(0, 7, 0, getResources().getQuantityString(R.plurals.x_days, 7, 7));
|
||||
menu.getMenu().add(0, 5, 0, getResources().getQuantityString(R.plurals.x_hours, 12, 12));
|
||||
menu.getMenu().add(0, 6, 0, getResources().getQuantityString(R.plurals.x_days, 1, 1));
|
||||
menu.getMenu().add(0, 7, 0, getResources().getQuantityString(R.plurals.x_days, 3, 3));
|
||||
menu.getMenu().add(0, 8, 0, getResources().getQuantityString(R.plurals.x_days, 7, 7));
|
||||
menu.setOnMenuItemClickListener(item->{
|
||||
pollDuration=switch(item.getItemId()){
|
||||
case 1 -> 5*60;
|
||||
case 2 -> 30*60;
|
||||
case 3 -> 3600;
|
||||
case 4 -> 6*3600;
|
||||
case 5 -> 24*3600;
|
||||
case 6 -> 3*24*3600;
|
||||
case 7 -> 7*24*3600;
|
||||
case 5 -> 12*3600;
|
||||
case 6 -> 24*3600;
|
||||
case 7 -> 3*24*3600;
|
||||
case 8 -> 7*24*3600;
|
||||
default -> throw new IllegalStateException("Unexpected value: "+item.getItemId());
|
||||
};
|
||||
pollDurationView.setText(getString(R.string.compose_poll_duration, pollDurationStr=item.getTitle().toString()));
|
||||
@@ -1742,10 +1795,13 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
statusVisibility = (StatusPrivacy) savedInstanceState.getSerializable("visibility");
|
||||
}
|
||||
|
||||
Preferences prefs = AccountSessionManager.getInstance().getAccount(accountID).preferences;
|
||||
if (prefs != null) {
|
||||
AccountSessionManager asm = AccountSessionManager.getInstance();
|
||||
Preferences prefs = asm.getAccount(accountID).preferences;
|
||||
if (prefs != null && replyTo != null) {
|
||||
// Only override the reply visibility if our preference is more private
|
||||
if (prefs.postingDefaultVisibility.isLessVisibleThan(statusVisibility)) {
|
||||
// (or we're replying to ourselves)
|
||||
if (prefs.postingDefaultVisibility.isLessVisibleThan(statusVisibility) &&
|
||||
!asm.isSelf(accountID, replyTo.account)) {
|
||||
statusVisibility = switch (prefs.postingDefaultVisibility) {
|
||||
case PUBLIC -> StatusPrivacy.PUBLIC;
|
||||
case UNLISTED -> StatusPrivacy.UNLISTED;
|
||||
@@ -1753,11 +1809,11 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
case DIRECT -> StatusPrivacy.DIRECT;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// A saved privacy setting from a previous compose session wins over all
|
||||
if(savedInstanceState !=null){
|
||||
statusVisibility = (StatusPrivacy) savedInstanceState.getSerializable("visibility");
|
||||
}
|
||||
// A saved privacy setting from a previous compose session wins over all
|
||||
if(savedInstanceState !=null){
|
||||
statusVisibility = (StatusPrivacy) savedInstanceState.getSerializable("visibility");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,351 @@
|
||||
package org.joinmastodon.android.fragments;
|
||||
|
||||
import static android.view.Menu.NONE;
|
||||
|
||||
import static org.joinmastodon.android.ui.utils.UiUtils.makeBackItem;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.requests.lists.GetLists;
|
||||
import org.joinmastodon.android.api.requests.tags.GetFollowedHashtags;
|
||||
import org.joinmastodon.android.model.Hashtag;
|
||||
import org.joinmastodon.android.model.HeaderPaginationList;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.ui.views.TextInputFrameLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import me.grishka.appkit.api.Callback;
|
||||
import me.grishka.appkit.api.ErrorResponse;
|
||||
import me.grishka.appkit.fragments.BaseRecyclerFragment;
|
||||
import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.views.UsableRecyclerView;
|
||||
|
||||
public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefinition> implements ScrollableToTop {
|
||||
private String accountID;
|
||||
private TimelinesAdapter adapter;
|
||||
private final ItemTouchHelper itemTouchHelper;
|
||||
private Menu optionsMenu;
|
||||
private boolean updated;
|
||||
private final Map<MenuItem, TimelineDefinition> timelineByMenuItem = new HashMap<>();
|
||||
private final List<ListTimeline> listTimelines = new ArrayList<>();
|
||||
private final List<Hashtag> hashtags = new ArrayList<>();
|
||||
|
||||
public EditTimelinesFragment() {
|
||||
super(10);
|
||||
ItemTouchHelper.SimpleCallback itemTouchCallback = new ItemTouchHelperCallback() ;
|
||||
itemTouchHelper = new ItemTouchHelper(itemTouchCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
setTitle(R.string.sk_timelines);
|
||||
accountID = getArguments().getString("account");
|
||||
|
||||
new GetLists().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> result) {
|
||||
listTimelines.addAll(result);
|
||||
updateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
new GetFollowedHashtags().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Hashtag> result) {
|
||||
hashtags.addAll(result);
|
||||
updateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShown(){
|
||||
super.onShown();
|
||||
if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading) loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
itemTouchHelper.attachToRecyclerView(list);
|
||||
refreshLayout.setEnabled(false);
|
||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 0.5f, 56, 16));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
this.optionsMenu = menu;
|
||||
updateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.menu_back) {
|
||||
updateOptionsMenu();
|
||||
optionsMenu.performIdentifierAction(R.id.menu_add_timeline, 0);
|
||||
return true;
|
||||
}
|
||||
TimelineDefinition tl = timelineByMenuItem.get(item);
|
||||
if (tl != null) {
|
||||
data.add(tl.copy());
|
||||
adapter.notifyItemInserted(data.size());
|
||||
saveTimelines();
|
||||
updateOptionsMenu();
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addTimelineToOptions(TimelineDefinition tl, Menu menu) {
|
||||
if (data.contains(tl)) return;
|
||||
MenuItem item = menu.add(0, View.generateViewId(), Menu.NONE, tl.getTitle(getContext()));
|
||||
item.setIcon(tl.getIcon().iconRes);
|
||||
timelineByMenuItem.put(item, tl);
|
||||
}
|
||||
|
||||
private void updateOptionsMenu() {
|
||||
optionsMenu.clear();
|
||||
timelineByMenuItem.clear();
|
||||
|
||||
SubMenu menu = optionsMenu.addSubMenu(0, R.id.menu_add_timeline, NONE, R.string.sk_timelines_add);
|
||||
menu.getItem().setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||
menu.getItem().setIcon(R.drawable.ic_fluent_add_24_regular);
|
||||
|
||||
SubMenu timelinesMenu = menu.addSubMenu(R.string.sk_timeline);
|
||||
timelinesMenu.getItem().setIcon(R.drawable.ic_fluent_timeline_24_regular);
|
||||
SubMenu listsMenu = menu.addSubMenu(R.string.sk_list);
|
||||
listsMenu.getItem().setIcon(R.drawable.ic_fluent_people_list_24_regular);
|
||||
SubMenu hashtagsMenu = menu.addSubMenu(R.string.sk_hashtag);
|
||||
hashtagsMenu.getItem().setIcon(R.drawable.ic_fluent_number_symbol_24_regular);
|
||||
|
||||
makeBackItem(timelinesMenu);
|
||||
makeBackItem(listsMenu);
|
||||
makeBackItem(hashtagsMenu);
|
||||
|
||||
TimelineDefinition.ALL_TIMELINES.forEach(tl -> addTimelineToOptions(tl, timelinesMenu));
|
||||
listTimelines.stream().map(TimelineDefinition::ofList).forEach(tl -> addTimelineToOptions(tl, listsMenu));
|
||||
hashtags.stream().map(TimelineDefinition::ofHashtag).forEach(tl -> addTimelineToOptions(tl, hashtagsMenu));
|
||||
|
||||
timelinesMenu.getItem().setVisible(timelinesMenu.size() > 0);
|
||||
listsMenu.getItem().setVisible(listsMenu.size() > 0);
|
||||
hashtagsMenu.getItem().setVisible(hashtagsMenu.size() > 0);
|
||||
|
||||
UiUtils.enableOptionsMenuIcons(getContext(), optionsMenu, R.id.menu_add_timeline);
|
||||
}
|
||||
|
||||
private void saveTimelines() {
|
||||
updated = true;
|
||||
GlobalUserPreferences.pinnedTimelines.put(accountID, data.size() > 0 ? data : List.of(TimelineDefinition.HOME_TIMELINE));
|
||||
GlobalUserPreferences.save();
|
||||
}
|
||||
|
||||
private void removeTimeline(int position) {
|
||||
data.remove(position);
|
||||
adapter.notifyItemRemoved(position);
|
||||
saveTimelines();
|
||||
updateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count){
|
||||
onDataLoaded(GlobalUserPreferences.pinnedTimelines.getOrDefault(accountID, TimelineDefinition.DEFAULT_TIMELINES), false);
|
||||
updateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RecyclerView.Adapter<TimelineViewHolder> getAdapter() {
|
||||
return adapter = new TimelinesAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
smoothScrollRecyclerViewToTop(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (updated) UiUtils.restartApp();
|
||||
}
|
||||
|
||||
private class TimelinesAdapter extends RecyclerView.Adapter<TimelineViewHolder>{
|
||||
@NonNull
|
||||
@Override
|
||||
public TimelineViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||
return new TimelineViewHolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull TimelineViewHolder holder, int position) {
|
||||
holder.bind(data.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
}
|
||||
|
||||
private class TimelineViewHolder extends BindableViewHolder<TimelineDefinition> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final ImageView dragger;
|
||||
|
||||
public TimelineViewHolder(){
|
||||
super(getActivity(), R.layout.item_text, list);
|
||||
title=findViewById(R.id.title);
|
||||
dragger=findViewById(R.id.dragger_thingy);
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void onBind(TimelineDefinition item) {
|
||||
title.setText(item.getTitle(getContext()));
|
||||
title.setCompoundDrawablesRelativeWithIntrinsicBounds(itemView.getContext().getDrawable(item.getIcon().iconRes), null, null, null);
|
||||
dragger.setVisibility(View.VISIBLE);
|
||||
dragger.setOnTouchListener((View v, MotionEvent event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
itemTouchHelper.startDrag(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void onClick() {
|
||||
Context ctx = getContext();
|
||||
LinearLayout view = (LinearLayout) getActivity().getLayoutInflater()
|
||||
.inflate(R.layout.edit_timeline, (ViewGroup) itemView, false);
|
||||
|
||||
TextInputFrameLayout inputLayout = view.findViewById(R.id.input);
|
||||
EditText editText = inputLayout.getEditText();
|
||||
editText.setText(item.getCustomTitle());
|
||||
editText.setHint(item.getDefaultTitle(ctx));
|
||||
|
||||
ImageButton btn = view.findViewById(R.id.button);
|
||||
PopupMenu popup = new PopupMenu(ctx, btn);
|
||||
TimelineDefinition.Icon currentIcon = item.getIcon();
|
||||
btn.setImageResource(currentIcon.iconRes);
|
||||
btn.setContentDescription(ctx.getString(currentIcon.nameRes));
|
||||
btn.setOnTouchListener(popup.getDragToOpenListener());
|
||||
btn.setOnClickListener(l -> popup.show());
|
||||
|
||||
Menu menu = popup.getMenu();
|
||||
TimelineDefinition.Icon defaultIcon = item.getDefaultIcon();
|
||||
menu.add(0, currentIcon.ordinal(), NONE, currentIcon.nameRes).setIcon(currentIcon.iconRes);
|
||||
if (!currentIcon.equals(defaultIcon)) {
|
||||
menu.add(0, defaultIcon.ordinal(), NONE, defaultIcon.nameRes).setIcon(defaultIcon.iconRes);
|
||||
}
|
||||
for (TimelineDefinition.Icon icon : TimelineDefinition.Icon.values()) {
|
||||
if (icon.hidden || icon.equals(item.getIcon())) continue;
|
||||
menu.add(0, icon.ordinal(), NONE, icon.nameRes).setIcon(icon.iconRes);
|
||||
}
|
||||
UiUtils.enablePopupMenuIcons(ctx, popup);
|
||||
|
||||
popup.setOnMenuItemClickListener(menuItem -> {
|
||||
TimelineDefinition.Icon icon = TimelineDefinition.Icon.values()[menuItem.getItemId()];
|
||||
btn.setImageResource(icon.iconRes);
|
||||
btn.setContentDescription(ctx.getString(icon.nameRes));
|
||||
item.setIcon(icon);
|
||||
return true;
|
||||
});
|
||||
|
||||
new M3AlertDialogBuilder(ctx)
|
||||
.setTitle(R.string.sk_edit_timeline)
|
||||
.setView(view)
|
||||
.setPositiveButton(R.string.save, (d, which) -> {
|
||||
item.setTitle(editText.getText().toString().trim());
|
||||
rebind();
|
||||
saveTimelines();
|
||||
})
|
||||
.setNeutralButton(R.string.sk_remove, (d, which) ->
|
||||
removeTimeline(getAbsoluteAdapterPosition()))
|
||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
||||
.show();
|
||||
|
||||
btn.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private class ItemTouchHelperCallback extends ItemTouchHelper.SimpleCallback {
|
||||
public ItemTouchHelperCallback() {
|
||||
super(ItemTouchHelper.UP | ItemTouchHelper.DOWN, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
|
||||
int fromPosition = viewHolder.getAbsoluteAdapterPosition();
|
||||
int toPosition = target.getAbsoluteAdapterPosition();
|
||||
if (Math.max(fromPosition, toPosition) >= data.size() || Math.min(fromPosition, toPosition) < 0) {
|
||||
return false;
|
||||
} else {
|
||||
Collections.swap(data, fromPosition, toPosition);
|
||||
adapter.notifyItemMoved(fromPosition, toPosition);
|
||||
saveTimelines();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectedChanged(@Nullable RecyclerView.ViewHolder viewHolder, int actionState) {
|
||||
if (actionState == ItemTouchHelper.ACTION_STATE_DRAG && viewHolder != null) {
|
||||
viewHolder.itemView.animate().alpha(0.65f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearView(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
|
||||
super.clearView(recyclerView, viewHolder);
|
||||
viewHolder.itemView.animate().alpha(1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
int position = viewHolder.getAbsoluteAdapterPosition();
|
||||
removeTimeline(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.joinmastodon.android.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
@@ -10,12 +11,15 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.requests.tags.GetHashtag;
|
||||
import org.joinmastodon.android.api.requests.tags.SetHashtagFollowed;
|
||||
import org.joinmastodon.android.api.requests.timelines.GetHashtagTimeline;
|
||||
import org.joinmastodon.android.events.HashtagUpdatedEvent;
|
||||
import org.joinmastodon.android.model.Hashtag;
|
||||
import org.joinmastodon.android.model.Status;
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,7 +30,7 @@ import me.grishka.appkit.api.ErrorResponse;
|
||||
import me.grishka.appkit.api.SimpleCallback;
|
||||
import me.grishka.appkit.utils.V;
|
||||
|
||||
public class HashtagTimelineFragment extends StatusListFragment{
|
||||
public class HashtagTimelineFragment extends PinnableStatusListFragment {
|
||||
private String hashtag;
|
||||
private boolean following;
|
||||
private ImageButton fab;
|
||||
@@ -41,7 +45,6 @@ public class HashtagTimelineFragment extends StatusListFragment{
|
||||
super.onAttach(activity);
|
||||
updateTitle(getArguments().getString("hashtag"));
|
||||
following=getArguments().getBoolean("following", false);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@@ -54,16 +57,37 @@ public class HashtagTimelineFragment extends StatusListFragment{
|
||||
this.following = newFollowing;
|
||||
followButton.setTitle(getString(newFollowing ? R.string.unfollow_user : R.string.follow_user, "#" + hashtag));
|
||||
followButton.setIcon(newFollowing ? R.drawable.ic_fluent_person_delete_24_filled : R.drawable.ic_fluent_person_add_24_regular);
|
||||
E.post(new HashtagUpdatedEvent(hashtag, following));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.hashtag_timeline, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
followButton = menu.findItem(R.id.follow_hashtag);
|
||||
updateFollowingState(following);
|
||||
|
||||
followButton.setOnMenuItemClickListener(i -> {
|
||||
new GetHashtag(hashtag).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Hashtag hashtag) {
|
||||
updateTitle(hashtag.name);
|
||||
updateFollowingState(hashtag.following);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getActivity());
|
||||
}
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (super.onOptionsItemSelected(item)) return true;
|
||||
if (item.getItemId() == R.id.follow_hashtag) {
|
||||
updateFollowingState(!following);
|
||||
getToolbar().performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
||||
new SetHashtagFollowed(hashtag, following).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Hashtag i) {
|
||||
@@ -78,20 +102,13 @@ public class HashtagTimelineFragment extends StatusListFragment{
|
||||
}
|
||||
}).exec(accountID);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
new GetHashtag(hashtag).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Hashtag hashtag) {
|
||||
updateTitle(hashtag.name);
|
||||
updateFollowingState(hashtag.following);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getActivity());
|
||||
}
|
||||
}).exec(accountID);
|
||||
@Override
|
||||
protected TimelineDefinition makeTimelineDefinition() {
|
||||
return TimelineDefinition.ofHashtag(hashtag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.joinmastodon.android.fragments;
|
||||
|
||||
import static org.joinmastodon.android.GlobalUserPreferences.reduceMotion;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -39,21 +41,26 @@ import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.requests.announcements.GetAnnouncements;
|
||||
import org.joinmastodon.android.api.requests.lists.GetLists;
|
||||
import org.joinmastodon.android.api.requests.tags.GetFollowedHashtags;
|
||||
import org.joinmastodon.android.events.HashtagUpdatedEvent;
|
||||
import org.joinmastodon.android.events.ListDeletedEvent;
|
||||
import org.joinmastodon.android.events.ListUpdatedCreatedEvent;
|
||||
import org.joinmastodon.android.events.SelfUpdateStateChangedEvent;
|
||||
import org.joinmastodon.android.fragments.discover.FederatedTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.discover.LocalTimelineFragment;
|
||||
import org.joinmastodon.android.model.Announcement;
|
||||
import org.joinmastodon.android.model.Hashtag;
|
||||
import org.joinmastodon.android.model.HeaderPaginationList;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
import org.joinmastodon.android.ui.SimpleViewHolder;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import me.grishka.appkit.Nav;
|
||||
import me.grishka.appkit.api.Callback;
|
||||
@@ -67,14 +74,12 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
private static final int ANNOUNCEMENTS_RESULT = 654;
|
||||
|
||||
private String accountID;
|
||||
private MenuItem announcements;
|
||||
private MenuItem announcements, announcementsAction, settings, settingsAction;
|
||||
// private ImageView toolbarLogo;
|
||||
private Button toolbarShowNewPostsBtn;
|
||||
private boolean newPostsBtnShown;
|
||||
private AnimatorSet currentNewPostsAnim;
|
||||
private ViewPager2 pager;
|
||||
private final List<Fragment> fragments = new ArrayList<>();
|
||||
private final List<FrameLayout> tabViews = new ArrayList<>();
|
||||
private View switcher;
|
||||
private FrameLayout toolbarFrame;
|
||||
private ImageView timelineIcon;
|
||||
@@ -83,11 +88,29 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
private PopupMenu switcherPopup;
|
||||
private final Map<Integer, ListTimeline> listItems = new HashMap<>();
|
||||
private final Map<Integer, Hashtag> hashtagsItems = new HashMap<>();
|
||||
private List<TimelineDefinition> timelineDefinitions;
|
||||
private int count;
|
||||
private Fragment[] fragments;
|
||||
private FrameLayout[] tabViews;
|
||||
private TimelineDefinition[] timelines;
|
||||
private final Map<Integer, TimelineDefinition> timelinesByMenuItem = new HashMap<>();
|
||||
private SubMenu hashtagsMenu, listsMenu;
|
||||
private Menu optionsMenu;
|
||||
private MenuInflater optionsMenuInflater;
|
||||
private boolean announcementsBadged, settingsBadged;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
E.register(this);
|
||||
accountID = getArguments().getString("account");
|
||||
timelineDefinitions = GlobalUserPreferences.pinnedTimelines.getOrDefault(accountID, TimelineDefinition.DEFAULT_TIMELINES);
|
||||
assert timelineDefinitions != null;
|
||||
if (timelineDefinitions.size() == 0) timelineDefinitions = List.of(TimelineDefinition.HOME_TIMELINE);
|
||||
count = timelineDefinitions.size();
|
||||
fragments = new Fragment[count];
|
||||
tabViews = new FrameLayout[count];
|
||||
timelines = new TimelineDefinition[count];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,25 +125,28 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
pager = new ViewPager2(getContext());
|
||||
toolbarFrame = (FrameLayout) LayoutInflater.from(getContext()).inflate(R.layout.home_toolbar, getToolbar(), false);
|
||||
|
||||
if (fragments.size() == 0) {
|
||||
if (fragments[0] == null) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("account", accountID);
|
||||
args.putBoolean("__is_tab", true);
|
||||
args.putBoolean("onlyPosts", true);
|
||||
|
||||
fragments.add(new HomeTimelineFragment());
|
||||
fragments.add(new LocalTimelineFragment());
|
||||
if (GlobalUserPreferences.showFederatedTimeline) fragments.add(new FederatedTimelineFragment());
|
||||
for (int i = 0; i < timelineDefinitions.size(); i++) {
|
||||
TimelineDefinition tl = timelineDefinitions.get(i);
|
||||
fragments[i] = tl.getFragment();
|
||||
timelines[i] = tl;
|
||||
}
|
||||
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
for (int i = 0; i < fragments.size(); i++) {
|
||||
fragments.get(i).setArguments(args);
|
||||
for (int i = 0; i < count; i++) {
|
||||
fragments[i].setArguments(timelines[i].populateArguments(new Bundle(args)));
|
||||
FrameLayout tabView = new FrameLayout(getActivity());
|
||||
tabView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
tabView.setVisibility(View.GONE);
|
||||
tabView.setId(i + 1);
|
||||
transaction.add(i + 1, fragments.get(i));
|
||||
transaction.add(i + 1, fragments[i]);
|
||||
view.addView(tabView);
|
||||
tabViews.add(tabView);
|
||||
tabViews[i] = tabView;
|
||||
}
|
||||
transaction.commit();
|
||||
}
|
||||
@@ -140,37 +166,36 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
collapsedChevron = toolbarFrame.findViewById(R.id.collapsed_chevron);
|
||||
switcher = toolbarFrame.findViewById(R.id.switcher_btn);
|
||||
switcherPopup = new PopupMenu(getContext(), switcher);
|
||||
switcherPopup.inflate(R.menu.home_switcher);
|
||||
switcherPopup.setOnMenuItemClickListener(this::onSwitcherItemSelected);
|
||||
UiUtils.enablePopupMenuIcons(getContext(), switcherPopup);
|
||||
switcher.setOnClickListener(v->{
|
||||
updateSwitcherMenu();
|
||||
switcherPopup.show();
|
||||
});
|
||||
View.OnTouchListener listener = switcherPopup.getDragToOpenListener();
|
||||
switcher.setOnTouchListener((v, m)-> {
|
||||
updateSwitcherMenu();
|
||||
return listener.onTouch(v, m);
|
||||
});
|
||||
switcher.setOnClickListener(v->switcherPopup.show());
|
||||
switcher.setOnTouchListener(switcherPopup.getDragToOpenListener());
|
||||
updateSwitcherMenu();
|
||||
|
||||
UiUtils.reduceSwipeSensitivity(pager);
|
||||
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
||||
pager.setAdapter(new HomePagerAdapter());
|
||||
pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback(){
|
||||
pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position){
|
||||
if (!reduceMotion) {
|
||||
// setting this here because page transformer appears to fire too late so the
|
||||
// animation can appear bumpy, especially when navigating to a further-away tab
|
||||
switcher.setScaleY(0.85f);
|
||||
switcher.setScaleX(0.85f);
|
||||
switcher.setAlpha(0.65f);
|
||||
}
|
||||
updateSwitcherIcon(position);
|
||||
if (position==0) return;
|
||||
hideNewPostsButton();
|
||||
if (fragments.get(position) instanceof BaseRecyclerFragment<?> page){
|
||||
if (!timelines[position].equals(TimelineDefinition.HOME_TIMELINE)) hideNewPostsButton();
|
||||
if (fragments[position] instanceof BaseRecyclerFragment<?> page){
|
||||
if(!page.loaded && !page.isDataLoading()) page.loadData();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!GlobalUserPreferences.reduceMotion) {
|
||||
if (!reduceMotion) {
|
||||
pager.setPageTransformer((v, pos) -> {
|
||||
if (tabViews.get(pager.getCurrentItem()) != v) return;
|
||||
if (reduceMotion || tabViews[pager.getCurrentItem()] != v) return;
|
||||
float scaleFactor = Math.max(0.85f, 1 - Math.abs(pos) * 0.06f);
|
||||
switcher.setScaleY(scaleFactor);
|
||||
switcher.setScaleX(scaleFactor);
|
||||
@@ -180,34 +205,56 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
|
||||
updateToolbarLogo();
|
||||
|
||||
if(GithubSelfUpdater.needSelfUpdating()){
|
||||
E.register(this);
|
||||
updateUpdateState(GithubSelfUpdater.getInstance().getState());
|
||||
ViewTreeObserver vto = getToolbar().getViewTreeObserver();
|
||||
if (vto.isAlive()) {
|
||||
vto.addOnGlobalLayoutListener(() -> {
|
||||
Toolbar t = getToolbar();
|
||||
if (t == null) return;
|
||||
int toolbarWidth = t.getWidth();
|
||||
if (toolbarWidth == 0) return;
|
||||
|
||||
int toolbarFrameWidth = toolbarFrame.getWidth();
|
||||
int padding = toolbarWidth - toolbarFrameWidth;
|
||||
FrameLayout parent = ((FrameLayout) toolbarShowNewPostsBtn.getParent());
|
||||
if (padding == parent.getPaddingStart()) return;
|
||||
|
||||
// toolbar frame goes from screen edge to beginning of right-aligned option buttons.
|
||||
// centering button by applying the same space on the left
|
||||
parent.setPaddingRelative(padding, 0, 0, 0);
|
||||
toolbarShowNewPostsBtn.setMaxWidth(toolbarWidth - padding * 2);
|
||||
|
||||
switcher.setPivotX(V.dp(28)); // padding + half of icon
|
||||
switcher.setPivotY(switcher.getHeight() / 2f);
|
||||
});
|
||||
}
|
||||
|
||||
new GetLists().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> lists) {
|
||||
addItemsToMap(lists, listItems);
|
||||
}
|
||||
if(GithubSelfUpdater.needSelfUpdating()){
|
||||
updateUpdateState(GithubSelfUpdater.getInstance().getState());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
private void addListsToOptionsMenu() {
|
||||
Context ctx = getContext();
|
||||
listsMenu.clear();
|
||||
listsMenu.getItem().setVisible(listItems.size() > 0);
|
||||
UiUtils.insetPopupMenuIcon(ctx, UiUtils.makeBackItem(listsMenu));
|
||||
listItems.forEach((id, list) -> {
|
||||
MenuItem item = listsMenu.add(Menu.NONE, id, Menu.NONE, list.title);
|
||||
item.setIcon(R.drawable.ic_fluent_people_list_24_regular);
|
||||
UiUtils.insetPopupMenuIcon(ctx, item);
|
||||
});
|
||||
}
|
||||
|
||||
new GetFollowedHashtags().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Hashtag> hashtags) {
|
||||
addItemsToMap(hashtags, hashtagsItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
private void addHashtagsToOptionsMenu() {
|
||||
Context ctx = getContext();
|
||||
hashtagsMenu.clear();
|
||||
hashtagsMenu.getItem().setVisible(hashtagsItems.size() > 0);
|
||||
UiUtils.insetPopupMenuIcon(ctx, UiUtils.makeBackItem(hashtagsMenu));
|
||||
hashtagsItems.forEach((id, hashtag) -> {
|
||||
MenuItem item = hashtagsMenu.add(Menu.NONE, id, Menu.NONE, hashtag.name);
|
||||
item.setIcon(R.drawable.ic_fluent_number_symbol_24_regular);
|
||||
UiUtils.insetPopupMenuIcon(ctx, item);
|
||||
});
|
||||
}
|
||||
|
||||
public void updateToolbarLogo(){
|
||||
@@ -222,11 +269,6 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
|
||||
updateSwitcherIcon(pager.getCurrentItem());
|
||||
|
||||
// toolbarLogo=new ImageView(getActivity());
|
||||
// toolbarLogo.setScaleType(ImageView.ScaleType.CENTER);
|
||||
// toolbarLogo.setImageResource(R.drawable.logo);
|
||||
// toolbarLogo.setImageTintList(ColorStateList.valueOf(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary)));
|
||||
|
||||
toolbarShowNewPostsBtn=toolbarFrame.findViewById(R.id.show_new_posts_btn);
|
||||
toolbarShowNewPostsBtn.setCompoundDrawableTintList(toolbarShowNewPostsBtn.getTextColors());
|
||||
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N) UiUtils.fixCompoundDrawableTintOnAndroid6(toolbarShowNewPostsBtn);
|
||||
@@ -247,44 +289,68 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
toolbarShowNewPostsBtn.setScaleY(.8f);
|
||||
timelineTitle.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
ViewTreeObserver vto = toolbar.getViewTreeObserver();
|
||||
if (vto.isAlive()) {
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
Toolbar t = getToolbar();
|
||||
if (t == null) return;
|
||||
int toolbarWidth = t.getWidth();
|
||||
if (toolbarWidth == 0) return;
|
||||
t.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
private void createOptionsMenu() {
|
||||
optionsMenu.clear();
|
||||
optionsMenuInflater.inflate(R.menu.home, optionsMenu);
|
||||
announcements = optionsMenu.findItem(R.id.announcements);
|
||||
announcementsAction = optionsMenu.findItem(R.id.announcements_action);
|
||||
settings = optionsMenu.findItem(R.id.settings);
|
||||
settingsAction = optionsMenu.findItem(R.id.settings_action);
|
||||
hashtagsMenu = optionsMenu.findItem(R.id.hashtags).getSubMenu();
|
||||
listsMenu = optionsMenu.findItem(R.id.lists).getSubMenu();
|
||||
|
||||
int toolbarFrameWidth = toolbarFrame.getWidth();
|
||||
int padding = toolbarWidth - toolbarFrameWidth;
|
||||
// toolbar frame goes from screen edge to beginning of right-aligned option buttons.
|
||||
// centering button by applying the same space on the left
|
||||
((FrameLayout) toolbarShowNewPostsBtn.getParent()).setPaddingRelative(padding, 0, 0, 0);
|
||||
toolbarShowNewPostsBtn.setMaxWidth(toolbarWidth - padding * 2);
|
||||
announcements.setVisible(!announcementsBadged);
|
||||
announcementsAction.setVisible(announcementsBadged);
|
||||
settings.setVisible(!settingsBadged);
|
||||
settingsAction.setVisible(settingsBadged);
|
||||
|
||||
switcher.setPivotX(V.dp(28)); // padding + half of icon
|
||||
switcher.setPivotY(switcher.getHeight() / 2f);
|
||||
timelineTitle.setPivotX(timelineTitle.getWidth() - V.dp(8));
|
||||
timelineTitle.setPivotY(timelineTitle.getHeight() / 2f);
|
||||
}
|
||||
});
|
||||
}
|
||||
UiUtils.enableOptionsMenuIcons(getContext(), optionsMenu,
|
||||
R.id.overflow, R.id.announcements_action, R.id.settings_action);
|
||||
|
||||
addListsToOptionsMenu();
|
||||
addHashtagsToOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
|
||||
inflater.inflate(R.menu.home, menu);
|
||||
announcements = menu.findItem(R.id.announcements);
|
||||
this.optionsMenu = menu;
|
||||
this.optionsMenuInflater = inflater;
|
||||
createOptionsMenu();
|
||||
|
||||
new GetLists().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> lists) {
|
||||
updateList(lists, listItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
new GetFollowedHashtags().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Hashtag> hashtags) {
|
||||
updateList(hashtags, hashtagsItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
new GetAnnouncements(false).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<Announcement> result) {
|
||||
boolean hasUnread = result.stream().anyMatch(a -> !a.read);
|
||||
announcements.setIcon(hasUnread ? R.drawable.ic_announcements_24_badged : R.drawable.ic_fluent_megaphone_24_regular);
|
||||
if (result.stream().anyMatch(a -> !a.read)) {
|
||||
announcementsBadged = true;
|
||||
announcements.setVisible(false);
|
||||
announcementsAction.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,69 +360,52 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
||||
private <T> void addItemsToMap(List<T> addItems, Map<Integer, T> items) {
|
||||
private <T> void updateList(List<T> addItems, Map<Integer, T> items) {
|
||||
if (addItems.size() == 0) return;
|
||||
for (int i = 0; i < addItems.size(); i++) items.put(View.generateViewId(), addItems.get(i));
|
||||
updateSwitcherMenu();
|
||||
createOptionsMenu();
|
||||
}
|
||||
|
||||
private void updateSwitcherMenu() {
|
||||
Context context = getContext();
|
||||
switcherPopup.getMenu().findItem(R.id.federated).setVisible(GlobalUserPreferences.showFederatedTimeline);
|
||||
Menu switcherMenu = switcherPopup.getMenu();
|
||||
switcherMenu.clear();
|
||||
timelinesByMenuItem.clear();
|
||||
|
||||
if (!listItems.isEmpty()) {
|
||||
MenuItem listsItem = switcherPopup.getMenu().findItem(R.id.lists);
|
||||
listsItem.setVisible(true);
|
||||
SubMenu listsMenu = listsItem.getSubMenu();
|
||||
listsMenu.clear();
|
||||
listItems.forEach((id, list) -> {
|
||||
MenuItem item = listsMenu.add(Menu.NONE, id, Menu.NONE, list.title);
|
||||
item.setIcon(R.drawable.ic_fluent_people_list_24_regular);
|
||||
UiUtils.insetPopupMenuIcon(context, item);
|
||||
});
|
||||
for (TimelineDefinition tl : timelines) {
|
||||
int menuItemId = View.generateViewId();
|
||||
timelinesByMenuItem.put(menuItemId, tl);
|
||||
MenuItem item = switcherMenu.add(0, menuItemId, 0, tl.getTitle(getContext()));
|
||||
item.setIcon(tl.getIcon().iconRes);
|
||||
}
|
||||
|
||||
if (!hashtagsItems.isEmpty()) {
|
||||
MenuItem hashtagsItem = switcherPopup.getMenu().findItem(R.id.followed_hashtags);
|
||||
hashtagsItem.setVisible(true);
|
||||
SubMenu hashtagsMenu = hashtagsItem.getSubMenu();
|
||||
hashtagsMenu.clear();
|
||||
hashtagsItems.forEach((id, hashtag) -> {
|
||||
MenuItem item = hashtagsMenu.add(Menu.NONE, id, Menu.NONE, hashtag.name);
|
||||
item.setIcon(R.drawable.ic_fluent_number_symbol_24_regular);
|
||||
UiUtils.insetPopupMenuIcon(context, item);
|
||||
});
|
||||
}
|
||||
UiUtils.enablePopupMenuIcons(getContext(), switcherPopup);
|
||||
}
|
||||
|
||||
private boolean onSwitcherItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
ListTimeline list;
|
||||
Hashtag hashtag;
|
||||
if (id == R.id.home) {
|
||||
navigateTo(0);
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("account", accountID);
|
||||
|
||||
if (id == R.id.menu_back) {
|
||||
switcher.post(() -> switcherPopup.show());
|
||||
return true;
|
||||
} else if (id == R.id.local) {
|
||||
navigateTo(1);
|
||||
return true;
|
||||
} else if (id == R.id.federated) {
|
||||
navigateTo(2);
|
||||
return true;
|
||||
} else if ((list = listItems.get(id)) != null) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("account", accountID);
|
||||
args.putString("listID", list.id);
|
||||
args.putString("listTitle", list.title);
|
||||
args.putInt("repliesPolicy", list.repliesPolicy.ordinal());
|
||||
Nav.go(getActivity(), ListTimelineFragment.class, args);
|
||||
} else if ((hashtag = hashtagsItems.get(id)) != null) {
|
||||
UiUtils.openHashtagTimeline(getActivity(), accountID, hashtag.name, hashtag.following);
|
||||
}
|
||||
|
||||
TimelineDefinition tl = timelinesByMenuItem.get(id);
|
||||
if (tl != null) {
|
||||
for (int i = 0; i < timelines.length; i++) {
|
||||
if (timelines[i] == tl) {
|
||||
navigateTo(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void navigateTo(int i) {
|
||||
navigateTo(i, !GlobalUserPreferences.reduceMotion);
|
||||
navigateTo(i, !reduceMotion);
|
||||
}
|
||||
|
||||
private void navigateTo(int i, boolean smooth) {
|
||||
@@ -365,32 +414,44 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}
|
||||
|
||||
private void updateSwitcherIcon(int i) {
|
||||
timelineIcon.setImageResource(switch (i) {
|
||||
default -> R.drawable.ic_fluent_home_24_regular;
|
||||
case 1 -> R.drawable.ic_fluent_people_community_24_regular;
|
||||
case 2 -> R.drawable.ic_fluent_earth_24_regular;
|
||||
});
|
||||
timelineTitle.setText(switch (i) {
|
||||
default -> R.string.sk_timeline_home;
|
||||
case 1 -> R.string.sk_timeline_local;
|
||||
case 2 -> R.string.sk_timeline_federated;
|
||||
});
|
||||
timelineIcon.setImageResource(timelines[i].getIcon().iconRes);
|
||||
timelineTitle.setText(timelines[i].getTitle(getContext()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item){
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountID);
|
||||
if (item.getItemId() == R.id.settings) Nav.go(getActivity(), SettingsFragment.class, args);
|
||||
if (item.getItemId() == R.id.announcements) {
|
||||
int id = item.getItemId();
|
||||
ListTimeline list;
|
||||
Hashtag hashtag;
|
||||
|
||||
if (item.getItemId() == R.id.menu_back) {
|
||||
createOptionsMenu();
|
||||
optionsMenu.performIdentifierAction(R.id.overflow, 0);
|
||||
return true;
|
||||
} else if (id == R.id.settings || id == R.id.settings_action) {
|
||||
Nav.go(getActivity(), SettingsFragment.class, args);
|
||||
} else if (id == R.id.announcements || id == R.id.announcements_action) {
|
||||
Nav.goForResult(getActivity(), AnnouncementsFragment.class, args, ANNOUNCEMENTS_RESULT, this);
|
||||
} else if (id == R.id.edit_timelines) {
|
||||
Nav.go(getActivity(), EditTimelinesFragment.class, args);
|
||||
} else if ((list = listItems.get(id)) != null) {
|
||||
args.putString("listID", list.id);
|
||||
args.putString("listTitle", list.title);
|
||||
if (list.repliesPolicy != null) args.putInt("repliesPolicy", list.repliesPolicy.ordinal());
|
||||
Nav.go(getActivity(), ListTimelineFragment.class, args);
|
||||
} else if ((hashtag = hashtagsItems.get(id)) != null) {
|
||||
args.putString("hashtag", hashtag.name);
|
||||
args.putBoolean("following", hashtag.following);
|
||||
Nav.go(getActivity(), HashtagTimelineFragment.class, args);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToTop(){
|
||||
((ScrollableToTop) fragments.get(pager.getCurrentItem())).scrollToTop();
|
||||
((ScrollableToTop) fragments[pager.getCurrentItem()]).scrollToTop();
|
||||
}
|
||||
|
||||
public void hideNewPostsButton(){
|
||||
@@ -411,7 +472,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
ObjectAnimator.ofFloat(toolbarShowNewPostsBtn, View.SCALE_Y, .8f),
|
||||
ObjectAnimator.ofFloat(collapsedChevron, View.ALPHA, 0f)
|
||||
);
|
||||
set.setDuration(GlobalUserPreferences.reduceMotion ? 0 : 300);
|
||||
set.setDuration(reduceMotion ? 0 : 300);
|
||||
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||
set.addListener(new AnimatorListenerAdapter(){
|
||||
@Override
|
||||
@@ -426,7 +487,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}
|
||||
|
||||
public void showNewPostsButton(){
|
||||
if(newPostsBtnShown || pager == null || pager.getCurrentItem() != 0)
|
||||
if(newPostsBtnShown || pager == null || !timelines[pager.getCurrentItem()].equals(TimelineDefinition.HOME_TIMELINE))
|
||||
return;
|
||||
newPostsBtnShown=true;
|
||||
if(currentNewPostsAnim!=null){
|
||||
@@ -444,7 +505,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
ObjectAnimator.ofFloat(toolbarShowNewPostsBtn, View.SCALE_Y, 1f),
|
||||
ObjectAnimator.ofFloat(collapsedChevron, View.ALPHA, 1f)
|
||||
);
|
||||
set.setDuration(GlobalUserPreferences.reduceMotion ? 0 : 300);
|
||||
set.setDuration(reduceMotion ? 0 : 300);
|
||||
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||
set.addListener(new AnimatorListenerAdapter(){
|
||||
@Override
|
||||
@@ -469,15 +530,20 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentResult(int reqCode, boolean noMoreUnread, Bundle result){
|
||||
if (reqCode == ANNOUNCEMENTS_RESULT && noMoreUnread) {
|
||||
announcements.setIcon(R.drawable.ic_fluent_megaphone_24_regular);
|
||||
public void onFragmentResult(int reqCode, boolean success, Bundle result){
|
||||
if (reqCode == ANNOUNCEMENTS_RESULT && success) {
|
||||
announcementsBadged = false;
|
||||
announcements.setVisible(true);
|
||||
announcementsAction.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateUpdateState(GithubSelfUpdater.UpdateState state){
|
||||
if(state!=GithubSelfUpdater.UpdateState.NO_UPDATE && state!=GithubSelfUpdater.UpdateState.CHECKING)
|
||||
getToolbar().getMenu().findItem(R.id.settings).setIcon(R.drawable.ic_settings_24_badged);
|
||||
if(state!=GithubSelfUpdater.UpdateState.NO_UPDATE && state!=GithubSelfUpdater.UpdateState.CHECKING) {
|
||||
settingsBadged = true;
|
||||
settingsAction.setVisible(true);
|
||||
settings.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -502,6 +568,13 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShown() {
|
||||
super.onShown();
|
||||
Object pinnedTimelines = GlobalUserPreferences.pinnedTimelines.get(accountID);
|
||||
if (pinnedTimelines != null && timelineDefinitions != pinnedTimelines) UiUtils.restartApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewStateRestored(Bundle savedInstanceState) {
|
||||
super.onViewStateRestored(savedInstanceState);
|
||||
@@ -515,11 +588,59 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
outState.putInt("selectedTab", pager.getCurrentItem());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onHashtagUpdatedEvent(HashtagUpdatedEvent event) {
|
||||
handleListEvent(hashtagsItems, h -> h.name.equalsIgnoreCase(event.name), event.following, () -> {
|
||||
Hashtag hashtag = new Hashtag();
|
||||
hashtag.name = event.name;
|
||||
hashtag.following = true;
|
||||
return hashtag;
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onListDeletedEvent(ListDeletedEvent event) {
|
||||
handleListEvent(listItems, l -> l.id.equals(event.id), false, null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onListUpdatedCreatedEvent(ListUpdatedCreatedEvent event) {
|
||||
handleListEvent(listItems, l -> l.id.equals(event.id), true, () -> {
|
||||
ListTimeline list = new ListTimeline();
|
||||
list.id = event.id;
|
||||
list.title = event.title;
|
||||
list.repliesPolicy = event.repliesPolicy;
|
||||
return list;
|
||||
});
|
||||
}
|
||||
|
||||
private <T> void handleListEvent(
|
||||
Map<Integer, T> existingThings,
|
||||
Predicate<T> matchExisting,
|
||||
boolean shouldBeInList,
|
||||
Supplier<T> makeNewThing
|
||||
) {
|
||||
Optional<Map.Entry<Integer, T>> existingThing = existingThings.entrySet().stream()
|
||||
.filter(e -> matchExisting.test(e.getValue())).findFirst();
|
||||
if (shouldBeInList) {
|
||||
existingThings.put(existingThing.isPresent()
|
||||
? existingThing.get().getKey() : View.generateViewId(), makeNewThing.get());
|
||||
createOptionsMenu();
|
||||
} else if (existingThing.isPresent() && !shouldBeInList) {
|
||||
existingThings.remove(existingThing.get().getKey());
|
||||
createOptionsMenu();
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<Hashtag> getHashtags() {
|
||||
return hashtagsItems.values();
|
||||
}
|
||||
|
||||
private class HomePagerAdapter extends RecyclerView.Adapter<SimpleViewHolder> {
|
||||
@NonNull
|
||||
@Override
|
||||
public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
FrameLayout tabView = tabViews.get(viewType % getItemCount());
|
||||
FrameLayout tabView = tabViews[viewType % getItemCount()];
|
||||
((ViewGroup)tabView.getParent()).removeView(tabView);
|
||||
tabView.setVisibility(View.VISIBLE);
|
||||
return new SimpleViewHolder(tabView);
|
||||
@@ -530,7 +651,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
|
||||
@Override
|
||||
public int getItemCount(){
|
||||
return fragments.size();
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.requests.markers.SaveMarkers;
|
||||
import org.joinmastodon.android.api.requests.timelines.GetHomeTimeline;
|
||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||
import org.joinmastodon.android.events.StatusCreatedEvent;
|
||||
@@ -32,6 +35,7 @@ import me.grishka.appkit.utils.V;
|
||||
public class HomeTimelineFragment extends FabStatusListFragment {
|
||||
private HomeTabFragment parent;
|
||||
private String maxID;
|
||||
private String lastSavedMarkerID;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity){
|
||||
@@ -91,6 +95,29 @@ public class HomeTimelineFragment extends FabStatusListFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHidden(){
|
||||
super.onHidden();
|
||||
if(!data.isEmpty()){
|
||||
String topPostID=displayItems.get(Math.max(0, list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset())).parentID;
|
||||
if(!topPostID.equals(lastSavedMarkerID)){
|
||||
lastSavedMarkerID=topPostID;
|
||||
new SaveMarkers(topPostID, null)
|
||||
.setCallback(new Callback<>(){
|
||||
@Override
|
||||
public void onSuccess(SaveMarkers.Response result){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error){
|
||||
lastSavedMarkerID=null;
|
||||
}
|
||||
})
|
||||
.exec(accountID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onStatusCreated(StatusCreatedEvent ev){
|
||||
prependItems(Collections.singletonList(ev.status), true);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package org.joinmastodon.android.fragments;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public interface IsOnTop {
|
||||
boolean isOnTop();
|
||||
|
||||
default boolean isRecyclerViewOnTop(RecyclerView list) {
|
||||
default boolean isRecyclerViewOnTop(@Nullable RecyclerView list) {
|
||||
if (list == null) return true;
|
||||
return !list.canScrollVertically(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,18 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.requests.lists.CreateList;
|
||||
import org.joinmastodon.android.api.requests.lists.GetList;
|
||||
import org.joinmastodon.android.api.requests.lists.UpdateList;
|
||||
import org.joinmastodon.android.api.requests.timelines.GetListTimeline;
|
||||
import org.joinmastodon.android.events.ListDeletedEvent;
|
||||
import org.joinmastodon.android.events.ListUpdatedCreatedEvent;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
import org.joinmastodon.android.model.Status;
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.ui.views.ListTimelineEditor;
|
||||
@@ -28,9 +34,10 @@ import me.grishka.appkit.api.SimpleCallback;
|
||||
import me.grishka.appkit.utils.V;
|
||||
|
||||
|
||||
public class ListTimelineFragment extends StatusListFragment {
|
||||
public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
private String listID;
|
||||
private String listTitle;
|
||||
@Nullable
|
||||
private ListTimeline.RepliesPolicy repliesPolicy;
|
||||
private ImageButton fab;
|
||||
|
||||
@@ -48,18 +55,34 @@ public class ListTimelineFragment extends StatusListFragment {
|
||||
|
||||
setTitle(listTitle);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
new GetList(listID).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(ListTimeline listTimeline) {
|
||||
// TODO: save updated info
|
||||
if (!listTimeline.title.equals(listTitle)) setTitle(listTimeline.title);
|
||||
if (listTimeline.repliesPolicy != null && !listTimeline.repliesPolicy.equals(repliesPolicy)) {
|
||||
repliesPolicy = listTimeline.repliesPolicy;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
inflater.inflate(R.menu.list, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
UiUtils.enableOptionsMenuIcons(getContext(), menu, R.id.pin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("listID", listID);
|
||||
if (super.onOptionsItemSelected(item)) return true;
|
||||
if (item.getItemId() == R.id.edit) {
|
||||
ListTimelineEditor editor = new ListTimelineEditor(getContext());
|
||||
editor.applyList(listTitle, repliesPolicy);
|
||||
@@ -68,19 +91,20 @@ public class ListTimelineFragment extends StatusListFragment {
|
||||
.setIcon(R.drawable.ic_fluent_people_list_28_regular)
|
||||
.setView(editor)
|
||||
.setPositiveButton(R.string.save, (d, which) -> {
|
||||
new UpdateList(listID, editor.getTitle(), editor.getRepliesPolicy()).setCallback(new Callback<>() {
|
||||
String newTitle = editor.getTitle().trim();
|
||||
setTitle(newTitle);
|
||||
new UpdateList(listID, newTitle, editor.getRepliesPolicy()).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(ListTimeline list) {
|
||||
setTitle(list.title);
|
||||
listTitle = list.title;
|
||||
repliesPolicy = list.repliesPolicy;
|
||||
args.putString("listTitle", listTitle);
|
||||
args.putInt("repliesPolicy", repliesPolicy.ordinal());
|
||||
setResult(true, args);
|
||||
E.post(new ListUpdatedCreatedEvent(listID, listTitle, repliesPolicy));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
setTitle(listTitle);
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
@@ -89,14 +113,18 @@ public class ListTimelineFragment extends StatusListFragment {
|
||||
.show();
|
||||
} else if (item.getItemId() == R.id.delete) {
|
||||
UiUtils.confirmDeleteList(getActivity(), accountID, listID, listTitle, () -> {
|
||||
args.putBoolean("deleted", true);
|
||||
setResult(true, args);
|
||||
E.post(new ListDeletedEvent(listID));
|
||||
Nav.finish(this);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TimelineDefinition makeTimelineDefinition() {
|
||||
return TimelineDefinition.ofList(listID, listTitle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count) {
|
||||
currentRequest=new GetListTimeline(listID, offset==0 ? null : getMaxID(), null, count, null)
|
||||
|
||||
@@ -12,12 +12,17 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
import org.joinmastodon.android.api.requests.lists.AddAccountsToList;
|
||||
import org.joinmastodon.android.api.requests.lists.CreateList;
|
||||
import org.joinmastodon.android.api.requests.lists.GetLists;
|
||||
import org.joinmastodon.android.api.requests.lists.RemoveAccountsFromList;
|
||||
import org.joinmastodon.android.events.ListDeletedEvent;
|
||||
import org.joinmastodon.android.events.ListUpdatedCreatedEvent;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||
@@ -37,210 +42,217 @@ import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.views.UsableRecyclerView;
|
||||
|
||||
public class ListTimelinesFragment extends BaseRecyclerFragment<ListTimeline> implements ScrollableToTop {
|
||||
private static final int LIST_CHANGED_RESULT = 987;
|
||||
private String accountId;
|
||||
private String profileAccountId;
|
||||
private final HashMap<String, Boolean> userInListBefore = new HashMap<>();
|
||||
private final HashMap<String, Boolean> userInList = new HashMap<>();
|
||||
private ListsAdapter adapter;
|
||||
|
||||
private String accountId;
|
||||
private String profileAccountId;
|
||||
private String profileDisplayUsername;
|
||||
private HashMap<String, Boolean> userInListBefore = new HashMap<>();
|
||||
private HashMap<String, Boolean> userInList = new HashMap<>();
|
||||
private int inProgress = 0;
|
||||
private ListsAdapter adapter;
|
||||
public ListTimelinesFragment() {
|
||||
super(10);
|
||||
}
|
||||
|
||||
public ListTimelinesFragment() {
|
||||
super(10);
|
||||
}
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bundle args=getArguments();
|
||||
accountId=args.getString("account");
|
||||
setHasOptionsMenu(true);
|
||||
E.register(this);
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bundle args=getArguments();
|
||||
accountId=args.getString("account");
|
||||
setHasOptionsMenu(true);
|
||||
if(args.containsKey("profileAccount")){
|
||||
profileAccountId=args.getString("profileAccount");
|
||||
String profileDisplayUsername = args.getString("profileDisplayUsername");
|
||||
setTitle(getString(R.string.sk_lists_with_user, profileDisplayUsername));
|
||||
} else {
|
||||
setTitle(R.string.sk_your_lists);
|
||||
}
|
||||
}
|
||||
|
||||
if(args.containsKey("profileAccount")){
|
||||
profileAccountId=args.getString("profileAccount");
|
||||
profileDisplayUsername=args.getString("profileDisplayUsername");
|
||||
setTitle(getString(R.string.sk_lists_with_user, profileDisplayUsername));
|
||||
} else {
|
||||
setTitle(R.string.sk_your_lists);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onShown(){
|
||||
super.onShown();
|
||||
if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading)
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShown(){
|
||||
super.onShown();
|
||||
if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading)
|
||||
loadData();
|
||||
}
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 0.5f, 56, 16));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 0.5f, 56, 16));
|
||||
}
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.menu_list, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.menu_list, menu);
|
||||
}
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.create) {
|
||||
ListTimelineEditor editor = new ListTimelineEditor(getContext());
|
||||
new M3AlertDialogBuilder(getActivity())
|
||||
.setTitle(R.string.sk_create_list_title)
|
||||
.setIcon(R.drawable.ic_fluent_people_add_28_regular)
|
||||
.setView(editor)
|
||||
.setPositiveButton(R.string.sk_create, (d, which) ->
|
||||
new CreateList(editor.getTitle(), editor.getRepliesPolicy()).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(ListTimeline list) {
|
||||
saveListMembership(list.id, true);
|
||||
data.add(0, list);
|
||||
adapter.notifyItemRangeInserted(0, 1);
|
||||
E.post(new ListUpdatedCreatedEvent(list.id, list.title, list.repliesPolicy));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.create) {
|
||||
ListTimelineEditor editor = new ListTimelineEditor(getContext());
|
||||
new M3AlertDialogBuilder(getActivity())
|
||||
.setTitle(R.string.sk_create_list_title)
|
||||
.setIcon(R.drawable.ic_fluent_people_add_28_regular)
|
||||
.setView(editor)
|
||||
.setPositiveButton(R.string.sk_create, (d, which) -> {
|
||||
new CreateList(editor.getTitle(), editor.getRepliesPolicy()).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(ListTimeline list) {
|
||||
saveListMembership(list.id, true);
|
||||
data.add(0, list);
|
||||
adapter.notifyItemRangeInserted(0, 1);
|
||||
}
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountId)
|
||||
)
|
||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
||||
.show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountId);
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
||||
.show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void saveListMembership(String listId, boolean isMember) {
|
||||
userInList.put(listId, isMember);
|
||||
List<String> accountIdList = Collections.singletonList(profileAccountId);
|
||||
MastodonAPIRequest<Object> req = isMember ? new AddAccountsToList(listId, accountIdList) : new RemoveAccountsFromList(listId, accountIdList);
|
||||
req.setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {}
|
||||
|
||||
private void saveListMembership(String listId, boolean isMember) {
|
||||
userInList.put(listId, isMember);
|
||||
List<String> accountIdList = Collections.singletonList(profileAccountId);
|
||||
MastodonAPIRequest<Object> req = isMember ? new AddAccountsToList(listId, accountIdList) : new RemoveAccountsFromList(listId, accountIdList);
|
||||
req.setCallback(new SimpleCallback<>(this) {
|
||||
@Override
|
||||
public void onSuccess(Object o) {}
|
||||
}).exec(accountId);
|
||||
}
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count){
|
||||
userInListBefore.clear();
|
||||
userInList.clear();
|
||||
currentRequest=(profileAccountId != null ? new GetLists(profileAccountId) : new GetLists())
|
||||
.setCallback(new SimpleCallback<>(this) {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> lists) {
|
||||
for (ListTimeline l : lists) userInListBefore.put(l.id, true);
|
||||
userInList.putAll(userInListBefore);
|
||||
if (profileAccountId == null || !lists.isEmpty()) onDataLoaded(lists, false);
|
||||
if (profileAccountId == null) return;
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count){
|
||||
userInListBefore.clear();
|
||||
userInList.clear();
|
||||
currentRequest=(profileAccountId != null ? new GetLists(profileAccountId) : new GetLists())
|
||||
.setCallback(new SimpleCallback<>(this) {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> lists) {
|
||||
for (ListTimeline l : lists) userInListBefore.put(l.id, true);
|
||||
userInList.putAll(userInListBefore);
|
||||
if (profileAccountId == null || !lists.isEmpty()) onDataLoaded(lists, false);
|
||||
if (profileAccountId == null) return;
|
||||
|
||||
currentRequest=new GetLists().setCallback(new SimpleCallback<>(ListTimelinesFragment.this) {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> allLists) {
|
||||
List<ListTimeline> newLists = new ArrayList<>();
|
||||
for (ListTimeline l : allLists) {
|
||||
if (lists.stream().noneMatch(e -> e.id.equals(l.id))) newLists.add(l);
|
||||
if (!userInListBefore.containsKey(l.id)) {
|
||||
userInListBefore.put(l.id, false);
|
||||
}
|
||||
}
|
||||
userInList.putAll(userInListBefore);
|
||||
onDataLoaded(newLists, false);
|
||||
}
|
||||
}).exec(accountId);
|
||||
}
|
||||
})
|
||||
.exec(accountId);
|
||||
}
|
||||
currentRequest=new GetLists().setCallback(new SimpleCallback<>(ListTimelinesFragment.this) {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> allLists) {
|
||||
List<ListTimeline> newLists = new ArrayList<>();
|
||||
for (ListTimeline l : allLists) {
|
||||
if (lists.stream().noneMatch(e -> e.id.equals(l.id))) newLists.add(l);
|
||||
if (!userInListBefore.containsKey(l.id)) {
|
||||
userInListBefore.put(l.id, false);
|
||||
}
|
||||
}
|
||||
userInList.putAll(userInListBefore);
|
||||
onDataLoaded(newLists, false);
|
||||
}
|
||||
}).exec(accountId);
|
||||
}
|
||||
})
|
||||
.exec(accountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentResult(int reqCode, boolean listChanged, Bundle result){
|
||||
if (reqCode == LIST_CHANGED_RESULT && listChanged) {
|
||||
String listID = result.getString("listID");
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
ListTimeline item = data.get(i);
|
||||
if (item.id.equals(listID)) {
|
||||
if (result.getBoolean("deleted")) {
|
||||
data.remove(i);
|
||||
adapter.notifyItemRemoved(i);
|
||||
} else {
|
||||
item.title = result.getString("listTitle", item.title);
|
||||
item.repliesPolicy = ListTimeline.RepliesPolicy.values()[result.getInt("repliesPolicy")];
|
||||
adapter.notifyItemChanged(i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Subscribe
|
||||
public void onListDeletedEvent(ListDeletedEvent event) {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
ListTimeline item = data.get(i);
|
||||
if (item.id.equals(event.id)) {
|
||||
data.remove(i);
|
||||
adapter.notifyItemRemoved(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RecyclerView.Adapter<ListViewHolder> getAdapter() {
|
||||
return adapter = new ListsAdapter();
|
||||
}
|
||||
@Subscribe
|
||||
public void onListUpdatedCreatedEvent(ListUpdatedCreatedEvent event) {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
ListTimeline item = data.get(i);
|
||||
if (item.id.equals(event.id)) {
|
||||
item.title = event.title;
|
||||
item.repliesPolicy = event.repliesPolicy;
|
||||
adapter.notifyItemChanged(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
smoothScrollRecyclerViewToTop(list);
|
||||
}
|
||||
@Override
|
||||
protected RecyclerView.Adapter<ListViewHolder> getAdapter() {
|
||||
return adapter = new ListsAdapter();
|
||||
}
|
||||
|
||||
private class ListsAdapter extends RecyclerView.Adapter<ListViewHolder>{
|
||||
@NonNull
|
||||
@Override
|
||||
public ListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||
return new ListViewHolder();
|
||||
}
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
smoothScrollRecyclerViewToTop(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ListViewHolder holder, int position) {
|
||||
holder.bind(data.get(position));
|
||||
}
|
||||
private class ListsAdapter extends RecyclerView.Adapter<ListViewHolder>{
|
||||
@NonNull
|
||||
@Override
|
||||
public ListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||
return new ListViewHolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ListViewHolder holder, int position) {
|
||||
holder.bind(data.get(position));
|
||||
}
|
||||
|
||||
private class ListViewHolder extends BindableViewHolder<ListTimeline> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final CheckBox listToggle;
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
}
|
||||
|
||||
public ListViewHolder(){
|
||||
super(getActivity(), R.layout.item_text, list);
|
||||
title=findViewById(R.id.title);
|
||||
listToggle=findViewById(R.id.list_toggle);
|
||||
}
|
||||
private class ListViewHolder extends BindableViewHolder<ListTimeline> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final CheckBox listToggle;
|
||||
|
||||
@Override
|
||||
public void onBind(ListTimeline item) {
|
||||
title.setText(item.title);
|
||||
title.setCompoundDrawablesRelativeWithIntrinsicBounds(itemView.getContext().getDrawable(R.drawable.ic_fluent_people_list_24_regular), null, null, null);
|
||||
if (profileAccountId != null) {
|
||||
Boolean checked = userInList.get(item.id);
|
||||
listToggle.setVisibility(View.VISIBLE);
|
||||
listToggle.setChecked(userInList.containsKey(item.id) && checked != null && checked);
|
||||
listToggle.setOnClickListener(this::onClickToggle);
|
||||
} else {
|
||||
listToggle.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
public ListViewHolder(){
|
||||
super(getActivity(), R.layout.item_text, list);
|
||||
title=findViewById(R.id.title);
|
||||
listToggle=findViewById(R.id.list_toggle);
|
||||
}
|
||||
|
||||
private void onClickToggle(View view) {
|
||||
saveListMembership(item.id, listToggle.isChecked());
|
||||
}
|
||||
@Override
|
||||
public void onBind(ListTimeline item) {
|
||||
title.setText(item.title);
|
||||
title.setCompoundDrawablesRelativeWithIntrinsicBounds(itemView.getContext().getDrawable(R.drawable.ic_fluent_people_list_24_regular), null, null, null);
|
||||
if (profileAccountId != null) {
|
||||
Boolean checked = userInList.get(item.id);
|
||||
listToggle.setVisibility(View.VISIBLE);
|
||||
listToggle.setChecked(userInList.containsKey(item.id) && checked != null && checked);
|
||||
listToggle.setOnClickListener(this::onClickToggle);
|
||||
} else {
|
||||
listToggle.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountId);
|
||||
args.putString("listID", item.id);
|
||||
args.putString("listTitle", item.title);
|
||||
args.putInt("repliesPolicy", item.repliesPolicy.ordinal());
|
||||
Nav.goForResult(getActivity(), ListTimelineFragment.class, args, LIST_CHANGED_RESULT, ListTimelinesFragment.this);
|
||||
}
|
||||
}
|
||||
private void onClickToggle(View view) {
|
||||
saveListMembership(item.id, listToggle.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountId);
|
||||
args.putString("listID", item.id);
|
||||
args.putString("listTitle", item.title);
|
||||
if (item.repliesPolicy != null) args.putInt("repliesPolicy", item.repliesPolicy.ordinal());
|
||||
Nav.go(getActivity(), ListTimelineFragment.class, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
private FrameLayout[] tabViews;
|
||||
private TabLayoutMediator tabLayoutMediator;
|
||||
|
||||
private NotificationsListFragment allNotificationsFragment, mentionsFragment, postsFragment;
|
||||
private NotificationsListFragment allNotificationsFragment, mentionsFragment;
|
||||
|
||||
private String accountID;
|
||||
|
||||
@@ -104,13 +104,12 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
pager=view.findViewById(R.id.pager);
|
||||
UiUtils.reduceSwipeSensitivity(pager);
|
||||
|
||||
tabViews=new FrameLayout[3];
|
||||
tabViews=new FrameLayout[2];
|
||||
for(int i=0;i<tabViews.length;i++){
|
||||
FrameLayout tabView=new FrameLayout(getActivity());
|
||||
tabView.setId(switch(i){
|
||||
case 0 -> R.id.notifications_all;
|
||||
case 1 -> R.id.notifications_mentions;
|
||||
case 2 -> R.id.notifications_posts;
|
||||
default -> throw new IllegalStateException("Unexpected value: "+i);
|
||||
});
|
||||
tabView.setVisibility(View.GONE);
|
||||
@@ -120,6 +119,18 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
|
||||
tabLayout.setTabTextSize(V.dp(16));
|
||||
tabLayout.setTabTextColors(UiUtils.getThemeColor(getActivity(), R.attr.colorTabInactive), UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary));
|
||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
scrollToTop();
|
||||
}
|
||||
});
|
||||
|
||||
pager.setOffscreenPageLimit(4);
|
||||
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
||||
@@ -150,15 +161,9 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
mentionsFragment=new NotificationsListFragment();
|
||||
mentionsFragment.setArguments(args);
|
||||
|
||||
args=new Bundle(args);
|
||||
args.putBoolean("onlyPosts", true);
|
||||
postsFragment=new NotificationsListFragment();
|
||||
postsFragment.setArguments(args);
|
||||
|
||||
getChildFragmentManager().beginTransaction()
|
||||
.add(R.id.notifications_all, allNotificationsFragment)
|
||||
.add(R.id.notifications_mentions, mentionsFragment)
|
||||
.add(R.id.notifications_posts, postsFragment)
|
||||
.commit();
|
||||
}
|
||||
|
||||
@@ -168,7 +173,6 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
tab.setText(switch(position){
|
||||
case 0 -> R.string.all_notifications;
|
||||
case 1 -> R.string.mentions;
|
||||
case 2 -> R.string.posts;
|
||||
default -> throw new IllegalStateException("Unexpected value: "+position);
|
||||
});
|
||||
tab.view.textView.setAllCaps(true);
|
||||
@@ -211,13 +215,13 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
protected void updateToolbar(){
|
||||
super.updateToolbar();
|
||||
getToolbar().setOutlineProvider(null);
|
||||
getToolbar().setOnClickListener(v->scrollToTop());
|
||||
}
|
||||
|
||||
private NotificationsListFragment getFragmentForPage(int page){
|
||||
return switch(page){
|
||||
case 0 -> allNotificationsFragment;
|
||||
case 1 -> mentionsFragment;
|
||||
case 2 -> postsFragment;
|
||||
default -> throw new IllegalStateException("Unexpected value: "+page);
|
||||
};
|
||||
}
|
||||
@@ -238,7 +242,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
|
||||
@Override
|
||||
public int getItemCount(){
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,8 +2,6 @@ package org.joinmastodon.android.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
@@ -21,6 +19,7 @@ import org.joinmastodon.android.ui.displayitems.AccountCardStatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.displayitems.HeaderStatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.displayitems.ImageStatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.displayitems.StatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.utils.DiscoverInfoBannerHelper;
|
||||
import org.joinmastodon.android.ui.utils.InsetStatusItemDecoration;
|
||||
import org.parceler.Parcels;
|
||||
|
||||
@@ -41,6 +40,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
private boolean onlyMentions;
|
||||
private boolean onlyPosts;
|
||||
private String maxID;
|
||||
private final DiscoverInfoBannerHelper bannerHelper = new DiscoverInfoBannerHelper(DiscoverInfoBannerHelper.BannerType.POST_NOTIFICATIONS);
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState){
|
||||
@@ -78,6 +78,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
case REBLOG -> getString(R.string.notification_boosted);
|
||||
case FAVORITE -> getString(R.string.user_favorited);
|
||||
case POLL -> getString(R.string.poll_ended);
|
||||
case UPDATE -> getString(R.string.sk_post_edited);
|
||||
};
|
||||
HeaderStatusDisplayItem titleItem=extraText!=null ? new HeaderStatusDisplayItem(n.id, n.account, n.createdAt, this, accountID, null, extraText, n, null) : null;
|
||||
if(n.status!=null){
|
||||
@@ -175,6 +176,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
list.addItemDecoration(new InsetStatusItemDecoration(this));
|
||||
if (onlyPosts) bannerHelper.maybeAddBanner(contentWrap);
|
||||
}
|
||||
|
||||
private Notification getNotificationByID(String id){
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.joinmastodon.android.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.model.TimelineDefinition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class PinnableStatusListFragment extends StatusListFragment {
|
||||
protected List<TimelineDefinition> pinnedTimelines;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
pinnedTimelines = new ArrayList<>(GlobalUserPreferences.pinnedTimelines.getOrDefault(accountID, TimelineDefinition.DEFAULT_TIMELINES));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
updatePinButton(menu.findItem(R.id.pin));
|
||||
}
|
||||
|
||||
protected boolean isPinned() {
|
||||
return pinnedTimelines.contains(makeTimelineDefinition());
|
||||
}
|
||||
|
||||
protected void updatePinButton(MenuItem pin) {
|
||||
boolean pinned = isPinned();
|
||||
pin.setIcon(pinned ?
|
||||
R.drawable.ic_fluent_pin_24_filled :
|
||||
R.drawable.ic_fluent_pin_24_regular);
|
||||
pin.setTitle(pinned ? R.string.sk_unpin_timeline : R.string.sk_pin_timeline);
|
||||
}
|
||||
|
||||
protected abstract TimelineDefinition makeTimelineDefinition();
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.pin) {
|
||||
togglePin(item);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
protected void togglePin(MenuItem pin) {
|
||||
onPinnedUpdated(true);
|
||||
getToolbar().performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
||||
TimelineDefinition def = makeTimelineDefinition();
|
||||
boolean pinned = isPinned();
|
||||
if (pinned) pinnedTimelines.remove(def);
|
||||
else pinnedTimelines.add(def);
|
||||
Toast.makeText(getContext(), pinned ? R.string.sk_unpinned_timeline : R.string.sk_pinned_timeline, Toast.LENGTH_SHORT).show();
|
||||
GlobalUserPreferences.pinnedTimelines.put(accountID, pinnedTimelines);
|
||||
GlobalUserPreferences.save();
|
||||
updatePinButton(pin);
|
||||
}
|
||||
|
||||
public void onPinnedUpdated(boolean pinned) {}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ScheduledStatusListFragment extends BaseStatusListFragment<Schedule
|
||||
|
||||
@Override
|
||||
protected List<StatusDisplayItem> buildDisplayItems(ScheduledStatus s) {
|
||||
return StatusDisplayItem.buildItems(this, s.toStatus(), accountID, s, knownAccounts, false, false, null);
|
||||
return StatusDisplayItem.buildItems(this, s.toStatus(), accountID, s, knownAccounts, false, false, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -163,13 +163,14 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
GlobalUserPreferences.reduceMotion=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.sk_settings_show_alt_indicator, R.drawable.ic_fluent_scan_text_24_regular, GlobalUserPreferences.showAltIndicator, i->{
|
||||
GlobalUserPreferences.showAltIndicator=i.checked;
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.sk_settings_show_no_alt_indicator, R.drawable.ic_fluent_important_24_regular, GlobalUserPreferences.showNoAltIndicator, i->{
|
||||
GlobalUserPreferences.showNoAltIndicator=i.checked;
|
||||
}));
|
||||
|
||||
items.add(new HeaderItem(R.string.settings_behavior));
|
||||
items.add(new SwitchItem(R.string.sk_settings_show_federated_timeline, R.drawable.ic_fluent_earth_24_regular, GlobalUserPreferences.showFederatedTimeline, i->{
|
||||
GlobalUserPreferences.showFederatedTimeline=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
needAppRestart=true;
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.settings_gif, R.drawable.ic_fluent_gif_24_regular, GlobalUserPreferences.playGifs, i->{
|
||||
GlobalUserPreferences.playGifs=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
@@ -196,6 +197,14 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
GlobalUserPreferences.save();
|
||||
needAppRestart=true;
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.sk_settings_disable_alt_text_reminder, R.drawable.ic_fluent_image_alt_text_24_regular, GlobalUserPreferences.disableAltTextReminder, i->{
|
||||
GlobalUserPreferences.disableAltTextReminder=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.sk_settings_single_notification, R.drawable.ic_fluent_convert_range_24_regular, GlobalUserPreferences.keepOnlyLatestNotification, i->{
|
||||
GlobalUserPreferences.keepOnlyLatestNotification=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
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.save();
|
||||
@@ -227,11 +236,8 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
items.add(new SwitchItem(R.string.notify_follow, R.drawable.ic_fluent_person_add_24_regular, pushSubscription.alerts.follow, i->onNotificationsChanged(PushNotification.Type.FOLLOW, i.checked)));
|
||||
items.add(new SwitchItem(R.string.notify_reblog, R.drawable.ic_fluent_arrow_repeat_all_24_regular, pushSubscription.alerts.reblog, i->onNotificationsChanged(PushNotification.Type.REBLOG, i.checked)));
|
||||
items.add(new SwitchItem(R.string.notify_mention, R.drawable.ic_fluent_mention_24_regular, pushSubscription.alerts.mention, i->onNotificationsChanged(PushNotification.Type.MENTION, i.checked)));
|
||||
items.add(new SwitchItem(R.string.sk_notify_update, R.drawable.ic_fluent_history_24_regular, pushSubscription.alerts.update, i->onNotificationsChanged(PushNotification.Type.UPDATE, i.checked)));
|
||||
items.add(new SwitchItem(R.string.sk_notify_posts, R.drawable.ic_fluent_alert_24_regular, pushSubscription.alerts.status, i->onNotificationsChanged(PushNotification.Type.STATUS, i.checked)));
|
||||
items.add(new SwitchItem(R.string.sk_settings_single_notification, R.drawable.ic_fluent_convert_range_24_regular, GlobalUserPreferences.keepOnlyLatestNotification, i->{
|
||||
GlobalUserPreferences.keepOnlyLatestNotification=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
|
||||
items.add(new HeaderItem(R.string.settings_account));
|
||||
items.add(new TextItem(R.string.sk_settings_profile, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/settings/profile"), R.drawable.ic_fluent_open_24_regular));
|
||||
@@ -253,16 +259,20 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
items.add(new HeaderItem(R.string.sk_settings_about));
|
||||
items.add(new TextItem(R.string.sk_settings_contribute, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/sk22/megalodon"), R.drawable.ic_fluent_open_24_regular));
|
||||
items.add(new TextItem(R.string.sk_settings_donate, ()->UiUtils.launchWebBrowser(getActivity(), "https://ko-fi.com/xsk22"), R.drawable.ic_fluent_heart_24_regular));
|
||||
if (GithubSelfUpdater.needSelfUpdating()) {
|
||||
checkForUpdateItem = new TextItem(R.string.sk_check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
||||
items.add(checkForUpdateItem);
|
||||
}
|
||||
clearImageCacheItem = new TextItem(R.string.settings_clear_cache, UiUtils.formatFileSize(getContext(), imageCache.getDiskCache().size(), true), this::clearImageCache, 0);
|
||||
items.add(clearImageCacheItem);
|
||||
items.add(new TextItem(R.string.sk_clear_recent_languages, ()->UiUtils.showConfirmationAlert(getActivity(), R.string.sk_clear_recent_languages, R.string.sk_confirm_clear_recent_languages, R.string.clear, ()->{
|
||||
GlobalUserPreferences.recentLanguages.remove(accountID);
|
||||
GlobalUserPreferences.save();
|
||||
})));
|
||||
if (GithubSelfUpdater.needSelfUpdating()) {
|
||||
items.add(new SwitchItem(R.string.sk_updater_enable_pre_releases, 0, GlobalUserPreferences.enablePreReleases, i->{
|
||||
GlobalUserPreferences.enablePreReleases=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
checkForUpdateItem = new TextItem(R.string.sk_check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
||||
items.add(checkForUpdateItem);
|
||||
}
|
||||
|
||||
items.add(new FooterItem(getString(R.string.sk_settings_app_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)));
|
||||
}
|
||||
@@ -317,11 +327,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){
|
||||
AccountSessionManager.getInstance().getAccount(accountID).getPushSubscriptionManager().updatePushSettings(pushSubscription);
|
||||
}
|
||||
if(needAppRestart){
|
||||
Intent intent = Intent.makeRestartActivityTask(MastodonApp.context.getPackageManager().getLaunchIntentForPackage(MastodonApp.context.getPackageName()).getComponent());
|
||||
MastodonApp.context.startActivity(intent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
if(needAppRestart) UiUtils.restartApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -425,6 +431,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
case REBLOG -> subscription.alerts.reblog=enabled;
|
||||
case MENTION -> subscription.alerts.mention=subscription.alerts.poll=enabled;
|
||||
case STATUS -> subscription.alerts.status=enabled;
|
||||
case UPDATE -> subscription.alerts.update=enabled;
|
||||
}
|
||||
needUpdateNotificationSettings=true;
|
||||
}
|
||||
@@ -754,7 +761,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
@Override
|
||||
public void onBind(SwitchItem item){
|
||||
text.setText(item.text);
|
||||
icon.setImageResource(item.icon);
|
||||
if (item.icon == 0) {
|
||||
icon.setVisibility(View.GONE);
|
||||
} else {
|
||||
icon.setVisibility(View.VISIBLE);
|
||||
icon.setImageResource(item.icon);
|
||||
}
|
||||
checkbox.setChecked(item.checked && item.enabled);
|
||||
checkbox.setEnabled(item.enabled);
|
||||
}
|
||||
|
||||
@@ -126,4 +126,14 @@ public class ThreadFragment extends StatusListFragment{
|
||||
public boolean isItemEnabled(String id){
|
||||
return !id.equals(mainStatus.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wantsLightStatusBar(){
|
||||
return !UiUtils.isDarkTheme();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wantsLightNavigationBar(){
|
||||
return !UiUtils.isDarkTheme();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N)
|
||||
setRetainInstance(true);
|
||||
loadData();
|
||||
setEmptyText(R.string.sk_recent_searches_placeholder);
|
||||
resetEmptyText();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,6 +71,10 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
imm=activity.getSystemService(InputMethodManager.class);
|
||||
}
|
||||
|
||||
private void resetEmptyText() {
|
||||
setEmptyText(R.string.sk_recent_searches_placeholder);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<StatusDisplayItem> buildDisplayItems(SearchResult s){
|
||||
return switch(s.type){
|
||||
@@ -120,6 +124,7 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count){
|
||||
resetEmptyText();
|
||||
if(isInRecentMode()){
|
||||
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().getRecentSearches(sr->{
|
||||
if(getActivity()==null)
|
||||
@@ -129,11 +134,13 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
onDataLoaded(sr, false);
|
||||
});
|
||||
}else{
|
||||
setEmptyText(R.string.sk_searching);
|
||||
progressVisibilityListener.onProgressVisibilityChanged(true);
|
||||
currentRequest=new GetSearchResults(currentQuery, null, true)
|
||||
.setCallback(new Callback<>(){
|
||||
@Override
|
||||
public void onSuccess(SearchResults result){
|
||||
setEmptyText(R.string.sk_no_results);
|
||||
ArrayList<SearchResult> results=new ArrayList<>();
|
||||
if(result.accounts!=null){
|
||||
for(Account acc:result.accounts)
|
||||
@@ -154,6 +161,7 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error){
|
||||
resetEmptyText();
|
||||
currentRequest=null;
|
||||
Activity a=getActivity();
|
||||
if(a==null)
|
||||
|
||||
@@ -47,26 +47,26 @@ public class Attachment extends BaseModel{
|
||||
|
||||
public int getWidth(){
|
||||
if(meta==null)
|
||||
return 0;
|
||||
return 1920;
|
||||
if(meta.width>0)
|
||||
return meta.width;
|
||||
if(meta.original!=null && meta.original.width>0)
|
||||
return meta.original.width;
|
||||
if(meta.small!=null && meta.small.width>0)
|
||||
return meta.small.width;
|
||||
return 0;
|
||||
return 1920;
|
||||
}
|
||||
|
||||
public int getHeight(){
|
||||
if(meta==null)
|
||||
return 0;
|
||||
return 1080;
|
||||
if(meta.height>0)
|
||||
return meta.height;
|
||||
if(meta.original!=null && meta.original.height>0)
|
||||
return meta.original.height;
|
||||
if(meta.small!=null && meta.small.height>0)
|
||||
return meta.small.height;
|
||||
return 0;
|
||||
return 1080;
|
||||
}
|
||||
|
||||
public double getDuration(){
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.joinmastodon.android.api.RequiredField;
|
||||
@@ -11,9 +13,9 @@ public class ListTimeline extends BaseModel {
|
||||
public String id;
|
||||
@RequiredField
|
||||
public String title;
|
||||
@RequiredField
|
||||
public RepliesPolicy repliesPolicy;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "List{" +
|
||||
|
||||
@@ -48,6 +48,8 @@ public class Notification extends BaseModel implements DisplayItemsParent{
|
||||
@SerializedName("poll")
|
||||
POLL,
|
||||
@SerializedName("status")
|
||||
STATUS
|
||||
STATUS,
|
||||
@SerializedName("update")
|
||||
UPDATE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ public class PushNotification extends BaseModel{
|
||||
@SerializedName("poll")
|
||||
POLL(R.string.notification_type_poll),
|
||||
@SerializedName("status")
|
||||
STATUS(R.string.sk_notification_type_status);
|
||||
STATUS(R.string.sk_notification_type_status),
|
||||
@SerializedName("update")
|
||||
UPDATE(R.string.sk_notification_type_update);
|
||||
|
||||
@StringRes
|
||||
public final int localizedName;
|
||||
|
||||
@@ -23,6 +23,7 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
", endpoint='"+endpoint+'\''+
|
||||
", alerts="+alerts+
|
||||
", serverKey='"+serverKey+'\''+
|
||||
", policy="+policy+
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -44,10 +45,11 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
public boolean mention;
|
||||
public boolean poll;
|
||||
public boolean status;
|
||||
public boolean update;
|
||||
|
||||
public static Alerts ofAll(){
|
||||
Alerts alerts=new Alerts();
|
||||
alerts.follow=alerts.favourite=alerts.reblog=alerts.mention=alerts.poll=alerts.status=true;
|
||||
alerts.follow=alerts.favourite=alerts.reblog=alerts.mention=alerts.poll=alerts.status=alerts.update=true;
|
||||
return alerts;
|
||||
}
|
||||
|
||||
@@ -60,6 +62,7 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
", mention="+mention+
|
||||
", poll="+poll+
|
||||
", status="+status+
|
||||
", update="+update+
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ScheduledStatus extends BaseModel implements DisplayItemsParent{
|
||||
s.id = id;
|
||||
s.mediaAttachments = mediaAttachments;
|
||||
s.createdAt = scheduledAt;
|
||||
s.inReplyToId = "" + params.inReplyToId;
|
||||
s.inReplyToId = params.inReplyToId > 0 ? "" + params.inReplyToId : null;
|
||||
s.content = s.text = params.text;
|
||||
s.spoilerText = params.spoilerText;
|
||||
s.visibility = params.visibility;
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import org.joinmastodon.android.BuildConfig;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.fragments.HashtagTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.HomeTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.ListTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.NotificationsListFragment;
|
||||
import org.joinmastodon.android.fragments.discover.FederatedTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.discover.LocalTimelineFragment;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class TimelineDefinition {
|
||||
private TimelineType type;
|
||||
private String title;
|
||||
private @Nullable Icon icon;
|
||||
|
||||
private @Nullable String listId;
|
||||
private @Nullable String listTitle;
|
||||
|
||||
private @Nullable String hashtagName;
|
||||
|
||||
public static TimelineDefinition ofList(String listId, String listTitle) {
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.LIST, listTitle);
|
||||
def.listId = listId;
|
||||
def.listTitle = listTitle;
|
||||
return def;
|
||||
}
|
||||
|
||||
public static TimelineDefinition ofList(ListTimeline list) {
|
||||
return ofList(list.id, list.title);
|
||||
}
|
||||
|
||||
public static TimelineDefinition ofHashtag(String hashtag) {
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.HASHTAG, hashtag);
|
||||
def.hashtagName = hashtag;
|
||||
return def;
|
||||
}
|
||||
|
||||
public static TimelineDefinition ofHashtag(Hashtag hashtag) {
|
||||
return ofHashtag(hashtag.name);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public TimelineDefinition() {}
|
||||
|
||||
public TimelineDefinition(TimelineType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public TimelineDefinition(TimelineType type, String title) {
|
||||
this.type = type;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle(Context ctx) {
|
||||
return title != null ? title : getDefaultTitle(ctx);
|
||||
}
|
||||
|
||||
public String getCustomTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title == null || title.isBlank() ? null : title;
|
||||
}
|
||||
|
||||
public String getDefaultTitle(Context ctx) {
|
||||
return switch (type) {
|
||||
case HOME -> ctx.getString(R.string.sk_timeline_home);
|
||||
case LOCAL -> ctx.getString(R.string.sk_timeline_local);
|
||||
case FEDERATED -> ctx.getString(R.string.sk_timeline_federated);
|
||||
case POST_NOTIFICATIONS -> ctx.getString(R.string.sk_timeline_posts);
|
||||
case LIST -> listTitle;
|
||||
case HASHTAG -> hashtagName;
|
||||
};
|
||||
}
|
||||
|
||||
public Icon getDefaultIcon() {
|
||||
return switch (type) {
|
||||
case HOME -> Icon.HOME;
|
||||
case LOCAL -> Icon.LOCAL;
|
||||
case FEDERATED -> Icon.FEDERATED;
|
||||
case POST_NOTIFICATIONS -> Icon.POST_NOTIFICATIONS;
|
||||
case LIST -> Icon.LIST;
|
||||
case HASHTAG -> Icon.HASHTAG;
|
||||
};
|
||||
}
|
||||
|
||||
public Fragment getFragment() {
|
||||
return switch (type) {
|
||||
case HOME -> new HomeTimelineFragment();
|
||||
case LOCAL -> new LocalTimelineFragment();
|
||||
case FEDERATED -> new FederatedTimelineFragment();
|
||||
case LIST -> new ListTimelineFragment();
|
||||
case HASHTAG -> new HashtagTimelineFragment();
|
||||
case POST_NOTIFICATIONS -> new NotificationsListFragment();
|
||||
};
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return icon == null ? getDefaultIcon() : icon;
|
||||
}
|
||||
|
||||
public void setIcon(@Nullable Icon icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public TimelineType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
TimelineDefinition that = (TimelineDefinition) o;
|
||||
if (type != that.type) return false;
|
||||
if (type == TimelineType.LIST) return Objects.equals(listId, that.listId);
|
||||
if (type == TimelineType.HASHTAG) return Objects.equals(hashtagName.toLowerCase(), that.hashtagName.toLowerCase());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = type.ordinal();
|
||||
result = 31 * result + (listId != null ? listId.hashCode() : 0);
|
||||
result = 31 * result + (hashtagName.toLowerCase() != null ? hashtagName.toLowerCase().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public TimelineDefinition copy() {
|
||||
TimelineDefinition def = new TimelineDefinition(type, title);
|
||||
def.listId = listId;
|
||||
def.listTitle = listTitle;
|
||||
def.hashtagName = hashtagName;
|
||||
def.icon = icon == null ? null : Icon.values()[icon.ordinal()];
|
||||
return def;
|
||||
}
|
||||
|
||||
public Bundle populateArguments(Bundle args) {
|
||||
if (type == TimelineType.LIST) {
|
||||
args.putString("listTitle", title);
|
||||
args.putString("listID", listId);
|
||||
} else if (type == TimelineType.HASHTAG) {
|
||||
args.putString("hashtag", hashtagName);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
public enum TimelineType { HOME, LOCAL, FEDERATED, POST_NOTIFICATIONS, LIST, HASHTAG }
|
||||
|
||||
public enum Icon {
|
||||
HEART(R.drawable.ic_fluent_heart_24_regular, R.string.sk_icon_heart),
|
||||
STAR(R.drawable.ic_fluent_star_24_regular, R.string.sk_icon_star),
|
||||
PEOPLE(R.drawable.ic_fluent_people_24_regular, R.string.sk_icon_people),
|
||||
CITY(R.drawable.ic_fluent_city_24_regular, R.string.sk_icon_city),
|
||||
IMAGE(R.drawable.ic_fluent_image_24_regular, R.string.sk_icon_image),
|
||||
NEWS(R.drawable.ic_fluent_news_24_regular, R.string.sk_icon_news),
|
||||
COLOR_PALETTE(R.drawable.ic_fluent_color_24_regular, R.string.sk_icon_color_palette),
|
||||
CAT(R.drawable.ic_fluent_animal_cat_24_regular, R.string.sk_icon_cat),
|
||||
DOG(R.drawable.ic_fluent_animal_dog_24_regular, R.string.sk_icon_dog),
|
||||
RABBIT(R.drawable.ic_fluent_animal_rabbit_24_regular, R.string.sk_icon_rabbit),
|
||||
TURTLE(R.drawable.ic_fluent_animal_turtle_24_regular, R.string.sk_icon_turtle),
|
||||
ACADEMIC_CAP(R.drawable.ic_fluent_hat_graduation_24_regular, R.string.sk_icon_academic_cap),
|
||||
BOT(R.drawable.ic_fluent_bot_24_regular, R.string.sk_icon_bot),
|
||||
IMPORTANT(R.drawable.ic_fluent_important_24_regular, R.string.sk_icon_important),
|
||||
PIN(R.drawable.ic_fluent_pin_24_regular, R.string.sk_icon_pin),
|
||||
SHIELD(R.drawable.ic_fluent_shield_24_regular, R.string.sk_icon_shield),
|
||||
CHAT(R.drawable.ic_fluent_chat_multiple_24_regular, R.string.sk_icon_chat),
|
||||
TAG(R.drawable.ic_fluent_tag_24_regular, R.string.sk_icon_tag),
|
||||
TRAIN(R.drawable.ic_fluent_vehicle_subway_24_regular, R.string.sk_icon_train),
|
||||
BICYCLE(R.drawable.ic_fluent_vehicle_bicycle_24_regular, R.string.sk_icon_bicycle),
|
||||
MAP(R.drawable.ic_fluent_map_24_regular, R.string.sk_icon_map),
|
||||
BACKPACK(R.drawable.ic_fluent_backpack_24_regular, R.string.sk_icon_backpack),
|
||||
BRIEFCASE(R.drawable.ic_fluent_briefcase_24_regular, R.string.sk_icon_briefcase),
|
||||
BOOK(R.drawable.ic_fluent_book_open_24_regular, R.string.sk_icon_book),
|
||||
LANGUAGE(R.drawable.ic_fluent_local_language_24_regular, R.string.sk_icon_language),
|
||||
WEATHER(R.drawable.ic_fluent_weather_rain_showers_day_24_regular, R.string.sk_icon_weather),
|
||||
APERTURE(R.drawable.ic_fluent_scan_24_regular, R.string.sk_icon_aperture),
|
||||
MUSIC(R.drawable.ic_fluent_music_note_2_24_regular, R.string.sk_icon_music),
|
||||
LOCATION(R.drawable.ic_fluent_location_24_regular, R.string.sk_icon_location),
|
||||
GLOBE(R.drawable.ic_fluent_globe_24_regular, R.string.sk_icon_globe),
|
||||
MEGAPHONE(R.drawable.ic_fluent_megaphone_loud_24_regular, R.string.sk_icon_megaphone),
|
||||
MICROPHONE(R.drawable.ic_fluent_mic_24_regular, R.string.sk_icon_microphone),
|
||||
MICROSCOPE(R.drawable.ic_fluent_microscope_24_regular, R.string.sk_icon_microscope),
|
||||
STETHOSCOPE(R.drawable.ic_fluent_stethoscope_24_regular, R.string.sk_icon_stethoscope),
|
||||
KEYBOARD(R.drawable.ic_fluent_midi_24_regular, R.string.sk_icon_keyboard),
|
||||
COFFEE(R.drawable.ic_fluent_drink_coffee_24_regular, R.string.sk_icon_coffee),
|
||||
CLAPPER_BOARD(R.drawable.ic_fluent_movies_and_tv_24_regular, R.string.sk_icon_clapper_board),
|
||||
LAUGH(R.drawable.ic_fluent_emoji_laugh_24_regular, R.string.sk_icon_laugh),
|
||||
BALLOON(R.drawable.ic_fluent_balloon_24_regular, R.string.sk_icon_balloon),
|
||||
PI(R.drawable.ic_fluent_pi_24_regular, R.string.sk_icon_pi),
|
||||
MATH_FORMULA(R.drawable.ic_fluent_math_formula_24_regular, R.string.sk_icon_math_formula),
|
||||
GAMES(R.drawable.ic_fluent_games_24_regular, R.string.sk_icon_games),
|
||||
CODE(R.drawable.ic_fluent_code_24_regular, R.string.sk_icon_code),
|
||||
BUG(R.drawable.ic_fluent_bug_24_regular, R.string.sk_icon_bug),
|
||||
LIGHT_BULB(R.drawable.ic_fluent_lightbulb_24_regular, R.string.sk_icon_light_bulb),
|
||||
FIRE(R.drawable.ic_fluent_fire_24_regular, R.string.sk_icon_fire),
|
||||
LEAVES(R.drawable.ic_fluent_leaf_three_24_regular, R.string.sk_icon_leaves),
|
||||
SPORT(R.drawable.ic_fluent_sport_24_regular, R.string.sk_icon_sport),
|
||||
HEALTH(R.drawable.ic_fluent_heart_pulse_24_regular, R.string.sk_icon_health),
|
||||
PIZZA(R.drawable.ic_fluent_food_pizza_24_regular, R.string.sk_icon_pizza),
|
||||
GAVEL(R.drawable.ic_fluent_gavel_24_regular, R.string.sk_icon_gavel),
|
||||
GAUGE(R.drawable.ic_fluent_gauge_24_regular, R.string.sk_icon_gauge),
|
||||
HEADPHONES(R.drawable.ic_fluent_headphones_sound_wave_24_regular, R.string.sk_icon_headphones),
|
||||
HUMAN(R.drawable.ic_fluent_accessibility_24_regular, R.string.sk_icon_human),
|
||||
|
||||
HOME(R.drawable.ic_fluent_home_24_regular, R.string.sk_timeline_home, true),
|
||||
LOCAL(R.drawable.ic_fluent_people_community_24_regular, R.string.sk_timeline_local, true),
|
||||
FEDERATED(R.drawable.ic_fluent_earth_24_regular, R.string.sk_timeline_federated, true),
|
||||
POST_NOTIFICATIONS(R.drawable.ic_fluent_chat_24_regular, R.string.sk_timeline_posts, true),
|
||||
LIST(R.drawable.ic_fluent_people_list_24_regular, R.string.sk_list, true),
|
||||
HASHTAG(R.drawable.ic_fluent_number_symbol_24_regular, R.string.sk_hashtag, true);
|
||||
|
||||
public final int iconRes, nameRes;
|
||||
public final boolean hidden;
|
||||
|
||||
Icon(@DrawableRes int iconRes, @StringRes int nameRes) {
|
||||
this(iconRes, nameRes, false);
|
||||
}
|
||||
|
||||
Icon(@DrawableRes int iconRes, @StringRes int nameRes, boolean hidden) {
|
||||
this.iconRes = iconRes;
|
||||
this.nameRes = nameRes;
|
||||
this.hidden = hidden;
|
||||
}
|
||||
}
|
||||
|
||||
public static final TimelineDefinition HOME_TIMELINE = new TimelineDefinition(TimelineType.HOME);
|
||||
public static final TimelineDefinition LOCAL_TIMELINE = new TimelineDefinition(TimelineType.LOCAL);
|
||||
public static final TimelineDefinition FEDERATED_TIMELINE = new TimelineDefinition(TimelineType.FEDERATED);
|
||||
public static final TimelineDefinition POSTS_TIMELINE = new TimelineDefinition(TimelineType.POST_NOTIFICATIONS);
|
||||
|
||||
public static final List<TimelineDefinition> DEFAULT_TIMELINES = BuildConfig.BUILD_TYPE.equals("playRelease")
|
||||
? List.of(HOME_TIMELINE.copy(), LOCAL_TIMELINE.copy())
|
||||
: List.of(HOME_TIMELINE.copy(), LOCAL_TIMELINE.copy(), FEDERATED_TIMELINE.copy());
|
||||
public static final List<TimelineDefinition> ALL_TIMELINES = List.of(
|
||||
HOME_TIMELINE.copy(),
|
||||
LOCAL_TIMELINE.copy(),
|
||||
FEDERATED_TIMELINE.copy(),
|
||||
POSTS_TIMELINE.copy()
|
||||
);
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import org.joinmastodon.android.api.session.AccountSession;
|
||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||
import org.joinmastodon.android.fragments.ComposeFragment;
|
||||
import org.joinmastodon.android.fragments.ListTimelinesFragment;
|
||||
import org.joinmastodon.android.fragments.NotificationsListFragment;
|
||||
import org.joinmastodon.android.fragments.ProfileFragment;
|
||||
import org.joinmastodon.android.fragments.ThreadFragment;
|
||||
@@ -180,7 +181,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
final Bundle args=new Bundle();
|
||||
args.putString("account", item.parentFragment.getAccountID());
|
||||
args.putParcelable("editStatus", Parcels.wrap(item.status));
|
||||
if (id==R.id.delete_and_redraft) {
|
||||
boolean redraft = id==R.id.delete_and_redraft;
|
||||
if (redraft) {
|
||||
args.putBoolean("redraftStatus", true);
|
||||
if (item.parentFragment instanceof ThreadFragment thread && !thread.isItemEnabled(item.status.id)) {
|
||||
// ("enabled" = clickable; opened status is not clickable)
|
||||
@@ -188,7 +190,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
args.putBoolean("navigateToStatus", true);
|
||||
}
|
||||
}
|
||||
if(TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText)){
|
||||
if(!redraft && TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText)){
|
||||
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
|
||||
}else if(item.scheduledStatus!=null){
|
||||
args.putString("sourceText", item.status.text);
|
||||
@@ -203,7 +205,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
public void onSuccess(GetStatusSourceText.Response result){
|
||||
args.putString("sourceText", result.text);
|
||||
args.putString("sourceSpoiler", result.spoilerText);
|
||||
if (id==R.id.delete_and_redraft) {
|
||||
if (redraft) {
|
||||
UiUtils.confirmDeletePost(item.parentFragment.getActivity(), item.parentFragment.getAccountID(), item.status, s->{
|
||||
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
|
||||
}, true);
|
||||
@@ -261,6 +263,12 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
UiUtils.confirmToggleBlockDomain(activity, item.parentFragment.getAccountID(), account.getDomain(), relationship!=null && relationship.domainBlocking, ()->{});
|
||||
}else if(id==R.id.bookmark){
|
||||
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(item.status, !item.status.bookmarked);
|
||||
}else if(id==R.id.manage_user_lists){
|
||||
final Bundle args=new Bundle();
|
||||
args.putString("account", item.parentFragment.getAccountID());
|
||||
args.putString("profileAccount", account.id);
|
||||
args.putString("profileDisplayUsername", account.getDisplayUsername());
|
||||
Nav.go(item.parentFragment.getActivity(), ListTimelinesFragment.class, args);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
@@ -445,6 +453,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
MenuItem block=menu.findItem(R.id.block);
|
||||
MenuItem report=menu.findItem(R.id.report);
|
||||
MenuItem follow=menu.findItem(R.id.follow);
|
||||
MenuItem manageUserLists = menu.findItem(R.id.manage_user_lists);
|
||||
MenuItem bookmark=menu.findItem(R.id.bookmark);
|
||||
bookmark.setVisible(false);
|
||||
/* disabled in megalodon: add/remove bookmark is already available through status footer
|
||||
@@ -461,6 +470,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
report.setVisible(false);
|
||||
follow.setVisible(false);
|
||||
blockDomain.setVisible(false);
|
||||
manageUserLists.setVisible(false);
|
||||
}else{
|
||||
mute.setVisible(true);
|
||||
block.setVisible(true);
|
||||
@@ -481,6 +491,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
boolean following = relationship!=null && relationship.following;
|
||||
follow.setTitle(item.parentFragment.getString(following ? R.string.unfollow_user : R.string.follow_user, account.getShortUsername()));
|
||||
follow.setIcon(following ? R.drawable.ic_fluent_person_delete_24_regular : R.drawable.ic_fluent_person_add_24_regular);
|
||||
manageUserLists.setVisible(relationship != null && relationship.following);
|
||||
manageUserLists.setTitle(item.parentFragment.getString(R.string.sk_lists_with_user, account.getShortUsername()));
|
||||
UiUtils.insetPopupMenuIcon(item.parentFragment.getContext(), follow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
package org.joinmastodon.android.ui.displayitems;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||
import org.joinmastodon.android.model.Attachment;
|
||||
@@ -10,6 +22,8 @@ import org.joinmastodon.android.model.Status;
|
||||
import org.joinmastodon.android.ui.PhotoLayoutHelper;
|
||||
|
||||
import me.grishka.appkit.imageloader.requests.UrlImageLoaderRequest;
|
||||
import me.grishka.appkit.utils.CubicBezierInterpolator;
|
||||
import me.grishka.appkit.utils.V;
|
||||
|
||||
public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
public PhotoStatusDisplayItem(String parentID, Status status, Attachment photo, BaseStatusListFragment parentFragment, int index, int totalPhotos, PhotoLayoutHelper.TiledLayoutResult tiledLayout, PhotoLayoutHelper.TiledLayoutResult.Tile thisTile){
|
||||
@@ -23,9 +37,141 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
}
|
||||
|
||||
public static class Holder extends ImageStatusDisplayItem.Holder<PhotoStatusDisplayItem>{
|
||||
private final FrameLayout altTextWrapper, altTextOpen;
|
||||
private final TextView altTextButton;
|
||||
private final ImageView noAltTextButton;
|
||||
private final View altTextScroller;
|
||||
private final ImageButton altTextClose;
|
||||
private final TextView altText;
|
||||
|
||||
private View altOrNoAltButton;
|
||||
private boolean altTextShown;
|
||||
private AnimatorSet currentAnim;
|
||||
|
||||
public Holder(Activity activity, ViewGroup parent){
|
||||
super(activity, R.layout.display_item_photo, parent);
|
||||
altTextWrapper=findViewById(R.id.alt_text_wrapper);
|
||||
altTextOpen=findViewById(R.id.alt_text_open);
|
||||
altTextButton=findViewById(R.id.alt_button);
|
||||
noAltTextButton=findViewById(R.id.no_alt_button);
|
||||
altTextScroller=findViewById(R.id.alt_text_scroller);
|
||||
altTextClose=findViewById(R.id.alt_text_close);
|
||||
altText=findViewById(R.id.alt_text);
|
||||
|
||||
altTextClose.setOnClickListener(this::onShowHideClick);
|
||||
// altTextScroller.setNestedScrollingEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind(ImageStatusDisplayItem item){
|
||||
super.onBind(item);
|
||||
boolean altTextMissing = TextUtils.isEmpty(item.attachment.description);
|
||||
altOrNoAltButton = altTextMissing ? noAltTextButton : altTextButton;
|
||||
altTextShown=false;
|
||||
if(currentAnim!=null)
|
||||
currentAnim.cancel();
|
||||
|
||||
altTextScroller.setVisibility(View.GONE);
|
||||
altTextClose.setVisibility(View.GONE);
|
||||
altTextButton.setVisibility(View.VISIBLE);
|
||||
noAltTextButton.setVisibility(View.VISIBLE);
|
||||
altTextButton.setAlpha(1f);
|
||||
noAltTextButton.setAlpha(1f);
|
||||
altTextWrapper.setVisibility(View.VISIBLE);
|
||||
altTextOpen.setOnClickListener(this::onShowHideClick);
|
||||
|
||||
if (altTextMissing){
|
||||
if (GlobalUserPreferences.showNoAltIndicator) {
|
||||
noAltTextButton.setVisibility(View.VISIBLE);
|
||||
altTextWrapper.setBackgroundResource(R.drawable.bg_image_no_alt_overlay);
|
||||
altTextButton.setVisibility(View.GONE);
|
||||
altText.setText(R.string.sk_no_alt_text);
|
||||
altText.setPadding(V.dp(8), 0, 0, 0);
|
||||
} else {
|
||||
altTextWrapper.setVisibility(View.GONE);
|
||||
}
|
||||
}else{
|
||||
if (GlobalUserPreferences.showAltIndicator) {
|
||||
noAltTextButton.setVisibility(View.GONE);
|
||||
altTextWrapper.setBackgroundResource(R.drawable.bg_image_alt_overlay);
|
||||
altTextButton.setVisibility(View.VISIBLE);
|
||||
altTextButton.setText(R.string.sk_alt_button);
|
||||
altText.setText(item.attachment.description);
|
||||
altText.setPadding(0, 0, 0, 0);
|
||||
} else {
|
||||
altTextWrapper.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onShowHideClick(View v){
|
||||
boolean show=v.getId()==R.id.alt_text_open;
|
||||
|
||||
altTextOpen.setOnClickListener(show ? null : this::onShowHideClick);
|
||||
|
||||
if(altTextShown==show)
|
||||
return;
|
||||
if(currentAnim!=null)
|
||||
currentAnim.cancel();
|
||||
|
||||
altTextShown=show;
|
||||
if(show){
|
||||
altTextScroller.setVisibility(View.VISIBLE);
|
||||
altTextClose.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
altOrNoAltButton.setVisibility(View.VISIBLE);
|
||||
// Hide these views temporarily so FrameLayout measures correctly
|
||||
altTextScroller.setVisibility(View.GONE);
|
||||
altTextClose.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// This is the current size...
|
||||
int prevLeft=altTextWrapper.getLeft();
|
||||
int prevRight=altTextWrapper.getRight();
|
||||
int prevBottom=altTextWrapper.getBottom();
|
||||
int prevTop=altTextOpen.getTop();
|
||||
altTextWrapper.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
|
||||
@Override
|
||||
public boolean onPreDraw(){
|
||||
altTextWrapper.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
|
||||
// ...and this is after the layout pass, right now the FrameLayout has its final size, but we animate that change
|
||||
if(!show){
|
||||
// Show these views again so they're visible for the duration of the animation.
|
||||
// No one would notice they were missing during measure/layout.
|
||||
altTextScroller.setVisibility(View.VISIBLE);
|
||||
altTextClose.setVisibility(View.VISIBLE);
|
||||
}
|
||||
AnimatorSet set=new AnimatorSet();
|
||||
set.playTogether(
|
||||
ObjectAnimator.ofInt(altTextWrapper, "left", prevLeft, altTextWrapper.getLeft()),
|
||||
ObjectAnimator.ofInt(altTextWrapper, "right", prevRight, altTextWrapper.getRight()),
|
||||
ObjectAnimator.ofInt(altTextWrapper, "bottom", prevBottom, altTextWrapper.getBottom()),
|
||||
ObjectAnimator.ofInt(altTextOpen, "top", prevTop, altTextOpen.getTop()),
|
||||
ObjectAnimator.ofFloat(altOrNoAltButton, View.ALPHA, show ? 1f : 0f, show ? 0f : 1f),
|
||||
ObjectAnimator.ofFloat(altTextScroller, View.ALPHA, show ? 0f : 1f, show ? 1f : 0f),
|
||||
ObjectAnimator.ofFloat(altTextClose, View.ALPHA, show ? 0f : 1f, show ? 1f : 0f)
|
||||
);
|
||||
set.setDuration(300);
|
||||
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||
set.addListener(new AnimatorListenerAdapter(){
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation){
|
||||
if(show){
|
||||
altOrNoAltButton.setVisibility(View.GONE);
|
||||
}else{
|
||||
altTextScroller.setVisibility(View.GONE);
|
||||
altTextClose.setVisibility(View.GONE);
|
||||
}
|
||||
currentAnim=null;
|
||||
}
|
||||
});
|
||||
set.start();
|
||||
currentAnim=set;
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,15 @@ import android.view.ViewGroup;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||
import org.joinmastodon.android.fragments.HashtagTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.HomeTabFragment;
|
||||
import org.joinmastodon.android.fragments.HomeTimelineFragment;
|
||||
import org.joinmastodon.android.fragments.ProfileFragment;
|
||||
import org.joinmastodon.android.fragments.ThreadFragment;
|
||||
import org.joinmastodon.android.model.Account;
|
||||
import org.joinmastodon.android.model.Attachment;
|
||||
import org.joinmastodon.android.model.DisplayItemsParent;
|
||||
import org.joinmastodon.android.model.Hashtag;
|
||||
import org.joinmastodon.android.model.Notification;
|
||||
import org.joinmastodon.android.model.Poll;
|
||||
import org.joinmastodon.android.model.ScheduledStatus;
|
||||
@@ -27,6 +31,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import me.grishka.appkit.Nav;
|
||||
@@ -77,6 +82,10 @@ public abstract class StatusDisplayItem{
|
||||
}
|
||||
|
||||
public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment fragment, Status status, String accountID, DisplayItemsParent parentObject, Map<String, Account> knownAccounts, boolean inset, boolean addFooter, Notification notification){
|
||||
return buildItems(fragment, status, accountID, parentObject, knownAccounts, inset, addFooter, notification, false);
|
||||
}
|
||||
|
||||
public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment fragment, Status status, String accountID, DisplayItemsParent parentObject, Map<String, Account> knownAccounts, boolean inset, boolean addFooter, Notification notification, boolean disableTranslate){
|
||||
String parentID=parentObject.getID();
|
||||
ArrayList<StatusDisplayItem> items=new ArrayList<>();
|
||||
Status statusForContent=status.getContentStatus();
|
||||
@@ -96,11 +105,27 @@ public abstract class StatusDisplayItem{
|
||||
args.putParcelable("profileAccount", Parcels.wrap(account));
|
||||
Nav.go(fragment.getActivity(), ProfileFragment.class, args);
|
||||
}));
|
||||
} else if (!(status.tags.isEmpty() || fragment instanceof HashtagTimelineFragment) &&
|
||||
fragment.getParentFragment() instanceof HomeTabFragment home
|
||||
) {
|
||||
home.getHashtags().stream()
|
||||
.filter(followed -> status.tags.stream()
|
||||
.anyMatch(hashtag -> followed.name.equalsIgnoreCase(hashtag.name)))
|
||||
.findAny()
|
||||
// post contains a hashtag the user is following
|
||||
.ifPresent(hashtag -> items.add(new ReblogOrReplyLineStatusDisplayItem(
|
||||
parentID, fragment, hashtag.name, List.of(),
|
||||
R.drawable.ic_fluent_number_symbol_20_filled, null,
|
||||
i -> {
|
||||
args.putString("hashtag", hashtag.name);
|
||||
Nav.go(fragment.getActivity(), HashtagTimelineFragment.class, args);
|
||||
}
|
||||
)));
|
||||
}
|
||||
HeaderStatusDisplayItem header;
|
||||
items.add(header=new HeaderStatusDisplayItem(parentID, statusForContent.account, statusForContent.createdAt, fragment, accountID, statusForContent, null, notification, scheduledStatus));
|
||||
if(!TextUtils.isEmpty(statusForContent.content))
|
||||
items.add(new TextStatusDisplayItem(parentID, HtmlParser.parse(statusForContent.content, statusForContent.emojis, statusForContent.mentions, statusForContent.tags, accountID), fragment, statusForContent));
|
||||
items.add(new TextStatusDisplayItem(parentID, HtmlParser.parse(statusForContent.content, statusForContent.emojis, statusForContent.mentions, statusForContent.tags, accountID), fragment, statusForContent, disableTranslate));
|
||||
else
|
||||
header.needBottomPadding=true;
|
||||
List<Attachment> imageAttachments=statusForContent.mediaAttachments.stream().filter(att->att.type.isImage()).collect(Collectors.toList());
|
||||
|
||||
@@ -42,14 +42,16 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
||||
private CharSequence parsedSpoilerText;
|
||||
public boolean textSelectable;
|
||||
public final Status status;
|
||||
public boolean disableTranslate;
|
||||
public boolean translated = false;
|
||||
public TranslatedStatus translation = null;
|
||||
private AccountSession session;
|
||||
|
||||
public TextStatusDisplayItem(String parentID, CharSequence text, BaseStatusListFragment parentFragment, Status status){
|
||||
public TextStatusDisplayItem(String parentID, CharSequence text, BaseStatusListFragment parentFragment, Status status, boolean disableTranslate){
|
||||
super(parentID, parentFragment);
|
||||
this.text=text;
|
||||
this.status=status;
|
||||
this.disableTranslate=disableTranslate;
|
||||
emojiHelper.setText(text);
|
||||
if(!TextUtils.isEmpty(status.spoilerText)){
|
||||
parsedSpoilerText=HtmlParser.parseCustomEmoji(status.spoilerText, status.emojis);
|
||||
@@ -139,7 +141,8 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
||||
}
|
||||
|
||||
Instance instanceInfo = AccountSessionManager.getInstance().getInstanceInfo(item.session.domain);
|
||||
boolean translateEnabled = instanceInfo.v2 != null && instanceInfo.v2.configuration.translation != null && instanceInfo.v2.configuration.translation.enabled;
|
||||
boolean translateEnabled = !item.disableTranslate && instanceInfo.v2 != null &&
|
||||
instanceInfo.v2.configuration.translation != null && instanceInfo.v2.configuration.translation.enabled;
|
||||
|
||||
translateWrap.setVisibility(
|
||||
(!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable) &&
|
||||
|
||||
@@ -37,6 +37,7 @@ public class DiscoverInfoBannerHelper{
|
||||
case TRENDING_LINKS -> R.string.trending_links_info_banner;
|
||||
case LOCAL_TIMELINE -> R.string.local_timeline_info_banner;
|
||||
case FEDERATED_TIMELINE -> R.string.sk_federated_timeline_info_banner;
|
||||
case POST_NOTIFICATIONS -> R.string.sk_notify_posts_info_banner;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -61,6 +62,7 @@ public class DiscoverInfoBannerHelper{
|
||||
TRENDING_LINKS,
|
||||
LOCAL_TIMELINE,
|
||||
FEDERATED_TIMELINE,
|
||||
POST_NOTIFICATIONS,
|
||||
// ACCOUNTS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.joinmastodon.android.ui.utils;
|
||||
|
||||
import static android.view.Menu.NONE;
|
||||
import static org.joinmastodon.android.GlobalUserPreferences.theme;
|
||||
import static org.joinmastodon.android.GlobalUserPreferences.trueBlackTheme;
|
||||
|
||||
@@ -35,6 +36,7 @@ import android.util.Log;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.Button;
|
||||
@@ -772,11 +774,20 @@ public class UiUtils{
|
||||
item.setTitle(ssb);
|
||||
}
|
||||
|
||||
public static void resetPopupItemTint(MenuItem item) {
|
||||
if(Build.VERSION.SDK_INT>=26) {
|
||||
item.setIconTintList(null);
|
||||
} else {
|
||||
Drawable icon=item.getIcon().mutate();
|
||||
icon.setTintList(null);
|
||||
item.setIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
public static void enableOptionsMenuIcons(Context context, Menu menu, @IdRes int... asAction) {
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try {
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
enableMenuIcons(context, menu, asAction);
|
||||
@@ -789,6 +800,8 @@ public class UiUtils{
|
||||
ColorStateList iconTint=ColorStateList.valueOf(UiUtils.getThemeColor(context, android.R.attr.textColorSecondary));
|
||||
for(int i=0;i<m.size();i++){
|
||||
MenuItem item=m.getItem(i);
|
||||
SubMenu subMenu = item.getSubMenu();
|
||||
if (subMenu != null) enableMenuIcons(context, subMenu, exclude);
|
||||
if (item.getIcon() == null || Arrays.stream(exclude).anyMatch(id -> id == item.getItemId())) continue;
|
||||
insetPopupMenuIcon(item, iconTint);
|
||||
}
|
||||
@@ -887,6 +900,18 @@ public class UiUtils{
|
||||
builder.show();
|
||||
}
|
||||
|
||||
public static void restartApp() {
|
||||
Intent intent = Intent.makeRestartActivityTask(MastodonApp.context.getPackageManager().getLaunchIntentForPackage(MastodonApp.context.getPackageName()).getComponent());
|
||||
MastodonApp.context.startActivity(intent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
||||
public static MenuItem makeBackItem(Menu m) {
|
||||
MenuItem back = m.add(0, R.id.menu_back, NONE, R.string.back);
|
||||
back.setIcon(R.drawable.ic_fluent_arrow_left_24_regular);
|
||||
return back;
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface InteractionPerformer {
|
||||
void interact(StatusInteractionController ic, Status status, Consumer<Status> resultConsumer);
|
||||
|
||||
@@ -10,6 +10,9 @@ import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupMenu;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.model.ListTimeline;
|
||||
|
||||
@@ -37,9 +40,9 @@ public class ListTimelineEditor extends LinearLayout {
|
||||
setRepliesPolicy(ListTimeline.RepliesPolicy.LIST);
|
||||
}
|
||||
|
||||
public void applyList(String title, ListTimeline.RepliesPolicy policy) {
|
||||
public void applyList(String title, @Nullable ListTimeline.RepliesPolicy policy) {
|
||||
input.getEditText().setText(title);
|
||||
setRepliesPolicy(policy);
|
||||
if (policy != null) setRepliesPolicy(policy);
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
@@ -50,7 +53,7 @@ public class ListTimelineEditor extends LinearLayout {
|
||||
return policy;
|
||||
}
|
||||
|
||||
public void setRepliesPolicy(ListTimeline.RepliesPolicy policy) {
|
||||
public void setRepliesPolicy(@NonNull ListTimeline.RepliesPolicy policy) {
|
||||
this.policy = policy;
|
||||
switch (policy) {
|
||||
case FOLLOWED -> button.setText(R.string.sk_list_replies_policy_followed);
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.joinmastodon.android.ui.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
public class NestableScrollView extends ScrollView{
|
||||
private float downY, touchslop;
|
||||
private boolean didDisallow;
|
||||
|
||||
public NestableScrollView(Context context){
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public NestableScrollView(Context context, AttributeSet attrs){
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public NestableScrollView(Context context, AttributeSet attrs, int defStyleAttr){
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
public NestableScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
touchslop=ViewConfiguration.get(getContext()).getScaledTouchSlop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev){
|
||||
if(ev.getAction()==MotionEvent.ACTION_DOWN){
|
||||
if(canScrollVertically(-1) || canScrollVertically(1)){
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
didDisallow=true;
|
||||
}else{
|
||||
didDisallow=false;
|
||||
}
|
||||
downY=ev.getY();
|
||||
}else if(didDisallow && ev.getAction()==MotionEvent.ACTION_MOVE){
|
||||
if(Math.abs(downY-ev.getY())>=touchslop){
|
||||
if(!canScrollVertically((int)(downY-ev.getY()))){
|
||||
didDisallow=false;
|
||||
getParent().requestDisallowInterceptTouchEvent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onTouchEvent(ev);
|
||||
}
|
||||
}
|
||||
5
mastodon/src/main/res/drawable/bg_image_alt_overlay.xml
Normal file
5
mastodon/src/main/res/drawable/bg_image_alt_overlay.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#D9000000"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#E894000C"/>
|
||||
<corners android:radius="24dp"/>
|
||||
</shape>
|
||||
5
mastodon/src/main/res/drawable/ic_baseline_close_24.xml
Normal file
5
mastodon/src/main/res/drawable/ic_baseline_close_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M10.5 5c0 0.641 0.402 1.188 0.968 1.403 0.35 0.085 0.714 0.085 1.063 0C13.098 6.19 13.5 5.641 13.5 5c0-0.828-0.672-1.5-1.5-1.5-0.829 0-1.5 0.672-1.5 1.5zM9.026 5.399C9.01 5.269 9 5.135 9 5c0-1.657 1.343-3 3-3s3 1.343 3 3c0 0.135-0.009 0.268-0.026 0.399l2.876-1.221c1.143-0.485 2.468 0.044 2.962 1.184 0.495 1.143-0.034 2.467-1.181 2.954l-3.628 1.54v3.717l1.874 5.444c0.404 1.175-0.22 2.455-1.395 2.86-1.175 0.404-2.455-0.22-2.86-1.395L12 15.772l-1.622 4.71c-0.404 1.175-1.685 1.799-2.86 1.394-1.175-0.404-1.8-1.685-1.394-2.86l1.878-5.456V9.857L4.37 8.316c-1.147-0.487-1.676-1.81-1.18-2.954 0.493-1.14 1.818-1.67 2.96-1.184l2.877 1.22zm1.996 2.438c-0.165-0.045-0.328-0.1-0.487-0.168l-4.971-2.11c-0.385-0.164-0.833 0.016-1 0.399-0.163 0.38 0.011 0.816 0.392 0.977L8.74 8.542c0.462 0.196 0.761 0.649 0.761 1.15v3.91c0 0.138-0.023 0.275-0.068 0.406l-1.892 5.497c-0.135 0.392 0.073 0.818 0.465 0.953 0.391 0.135 0.818-0.073 0.953-0.465l2.108-6.123c0.306-0.888 1.56-0.884 1.864 0l2.108 6.123c0.135 0.392 0.562 0.6 0.954 0.465 0.391-0.134 0.6-0.561 0.465-0.953l-1.888-5.483c-0.046-0.131-0.069-0.268-0.069-0.407V9.69c0-0.501 0.3-0.954 0.762-1.15l3.78-1.605c0.381-0.161 0.555-0.598 0.391-0.977-0.166-0.383-0.614-0.563-0.999-0.4l-4.97 2.11c-0.16 0.068-0.323 0.125-0.489 0.17C12.671 7.942 12.342 8 12 8c-0.342 0-0.671-0.057-0.978-0.163z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M11.75 3c0.38 0 0.693 0.282 0.743 0.648L12.5 3.75 12.501 11h7.253c0.415 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.743L19.754 12.5h-7.253l0.002 7.25c0 0.413-0.335 0.75-0.75 0.75-0.38 0-0.693-0.283-0.743-0.649l-0.007-0.102-0.002-7.249H3.752c-0.414 0-0.75-0.336-0.75-0.75 0-0.38 0.282-0.694 0.648-0.743L3.752 11h7.25L11 3.75C11 3.336 11.336 3 11.75 3z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M15.492 3.507c-0.84 0.075-1.499 0.782-1.499 1.643V10c0 0.414-0.335 0.75-0.75 0.75-1.443 0-2.457 0.588-3.207 1.488-0.772 0.928-1.275 2.206-1.59 3.557-0.313 1.343-0.427 2.696-0.462 3.722C7.973 19.9 7.97 20.232 7.974 20.5h7.019v-0.75c0-1.243-1.007-2.25-2.249-2.25h-1.25c-0.413 0-0.749-0.336-0.749-0.75S11.081 16 11.495 16h1.249c2.07 0 3.748 1.679 3.748 3.75v0.75h0.75c0.413 0 0.75-0.336 0.75-0.75v-10c0-0.414 0.335-0.75 0.749-0.75h0.506c0.98 0 1.578-1.076 1.062-1.909l-0.62-1C19.462 5.724 19.06 5.5 18.628 5.5h-2.386c-0.414 0-0.75-0.336-0.75-0.75V3.507zM6.474 20.5c-0.003-0.284-0.001-0.634 0.012-1.033 0.036-1.083 0.157-2.542 0.5-4.012 0.34-1.462 0.915-2.996 1.899-4.177 0.872-1.047 2.055-1.801 3.61-1.985V5.15c0-1.74 1.409-3.15 3.147-3.15 0.746 0 1.35 0.604 1.35 1.35V4h1.636c0.95 0 1.834 0.492 2.335 1.3l0.62 1c1.092 1.763-0.084 4.02-2.093 4.19v9.26c0 1.243-1.006 2.25-2.248 2.25H5.795C3.7 22 2 20.3 2 18.202c0-0.963 0.365-1.889 1.021-2.592l1.135-1.217c0.764-0.819 1.02-1.99 0.665-3.053-0.15-0.45-0.403-0.86-0.738-1.195L2.969 9.03c-0.293-0.292-0.293-0.767 0-1.06 0.293-0.293 0.767-0.293 1.06 0l1.114 1.114c0.5 0.5 0.877 1.11 1.1 1.782 0.528 1.584 0.148 3.33-0.99 4.55l-1.136 1.217C3.72 17.06 3.499 17.62 3.499 18.202c0 1.269 1.029 2.298 2.297 2.298h0.678z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M13.25 2h3.185c0.509 0 1.007 0.141 1.44 0.408l2.768 1.703C20.865 4.248 21 4.49 21 4.75v1.5c0 1.243-1.007 2.25-2.25 2.25H18.5v9.047c0.997 0.134 1.695 0.555 2.095 1.275 0.223 0.403 0.318 0.84 0.362 1.243C21 20.456 21 20.865 21 21.225v0.025c0 0.414-0.336 0.75-0.75 0.75H5.833C3.716 22 2 20.284 2 18.167c0-1.398 0.749-2.62 1.864-3.29 0.355-0.213 0.816-0.097 1.029 0.258 0.213 0.355 0.098 0.816-0.258 1.029C3.954 16.573 3.5 17.317 3.5 18.167c0 1.288 1.045 2.333 2.333 2.333 0.319 0 0.517-0.083 0.649-0.176 0.139-0.098 0.248-0.238 0.332-0.407 0.084-0.17 0.133-0.35 0.16-0.493 0.013-0.07 0.02-0.126 0.023-0.162L7 19.227v-0.035l0.004-0.143c0.005-0.122 0.013-0.296 0.03-0.51 0.032-0.426 0.098-1.017 0.23-1.676 0.26-1.292 0.796-2.968 1.952-4.14 0.848-0.86 1.309-2.119 1.547-3.364C11 8.13 11 7.008 11 6.5V4.25C11 3.008 12.006 2 13.25 2zm-5.5 17.25l0.75 0.026v0.006l-0.001 0.01-0.002 0.028-0.007 0.09c-0.007 0.073-0.02 0.173-0.042 0.29-0.04 0.213-0.113 0.5-0.251 0.8h7.25c-0.09-0.494-0.34-1.006-1.013-1.32L14.4 19.164c-0.052-0.028-0.202-0.077-0.45-0.116-0.23-0.036-0.484-0.055-0.701-0.055l-0.283 0.004-0.141 0.002h-0.06c-0.415 0.009-0.757-0.321-0.764-0.735-0.008-0.414 0.322-0.756 0.736-0.764H12.8l0.143-0.002 0.307-0.004c0.235 0 0.495 0.016 0.75 0.047v-2.287c0-0.414 0.336-0.75 0.75-0.75s0.75 0.336 0.75 0.75v2.804c1.065 0.682 1.374 1.703 1.463 2.443h2.524c-0.004-0.093-0.011-0.183-0.021-0.27-0.033-0.301-0.094-0.52-0.183-0.68C19.153 19.316 18.85 19 17.75 19 17.336 19 17 18.664 17 18.25V7.75C17 7.336 17.336 7 17.75 7h1c0.414 0 0.75-0.336 0.75-0.75V5.17l-2.411-1.485C16.892 3.564 16.666 3.5 16.435 3.5h-3.186c-0.414 0-0.749 0.335-0.749 0.75v2.232c0.013 0.228 0.092 0.425 0.205 0.554 0.101 0.115 0.26 0.214 0.545 0.214 0.287 0 0.453-0.101 0.556-0.219C13.92 6.9 14 6.696 14 6.45c0-0.414 0.336-0.75 0.75-0.75s0.75 0.336 0.75 0.75c0 0.554-0.177 1.125-0.566 1.569-0.4 0.457-0.984 0.731-1.684 0.731-0.312 0-0.599-0.054-0.855-0.154-0.038 0.332-0.09 0.684-0.158 1.045-0.262 1.366-0.801 2.968-1.953 4.136-0.845 0.856-1.308 2.18-1.549 3.38-0.117 0.588-0.176 1.117-0.206 1.498-0.015 0.19-0.022 0.343-0.025 0.446L8.5 19.217v0.059L7.75 19.25zm8.5 2.75v-0.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M7.75 19c-1.463 0-2.658-1.141-2.745-2.582L5 16.25V15c-1.657 0-3-1.344-3-3 0-1.657 1.343-3 3-3 1.074 0 2.031 0.57 2.562 1.44 0.512-0.247 1.08-0.398 1.68-0.432L9.5 10h4l0.248 0.007 0.245 0.02 0.127 0.017 0.11-0.167 0.131-0.178-1.777-1.777c-0.7-0.7-0.773-1.788-0.22-2.57l0.103-0.134 0.117-0.128c0.74-0.74 1.918-0.78 2.705-0.117l0.127 0.117 5.412 5.413c1.563 1.562 1.563 4.095 0 5.657-0.72 0.72-1.665 1.122-2.642 1.167l-0.225 0.004-0.182-0.007-0.026 0.064c-0.386 0.85-1.189 1.462-2.138 1.588l-0.192 0.019L15.249 19H7.75zm6.605-12.849c-0.196-0.196-0.514-0.196-0.71 0-0.175 0.175-0.194 0.445-0.058 0.641l0.058 0.07 2.808 2.808-0.638 0.642c-0.21 0.21-0.385 0.444-0.523 0.696L15.195 11.2l-0.266 0.584-0.618-0.173c-0.196-0.055-0.398-0.09-0.604-0.104L13.499 11.5H9.5c-0.7 0-1.343 0.24-1.853 0.64l-0.143 0.12-0.165 0.16-0.093 0.1-0.111 0.134-0.121 0.167-0.042 0.064c-0.041 0.063-0.08 0.129-0.115 0.196l-0.058 0.112-0.062 0.137-0.034 0.084-0.051 0.142-0.055 0.184c-0.025 0.097-0.046 0.197-0.062 0.297L6.524 14.12l-0.018 0.19L6.5 14.5v1.75c0 0.648 0.492 1.18 1.122 1.244L7.75 17.5h4.251v-0.246c0-0.648-0.491-1.18-1.121-1.244l-0.128-0.006h-1c-0.414 0-0.75-0.336-0.75-0.75 0-0.38 0.282-0.694 0.648-0.743l0.102-0.007h1c1.462 0 2.658 1.141 2.745 2.582l0.005 0.168L13.5 17.5h1.748c0.592 0 1.095-0.414 1.219-0.975l0.02-0.122 0.1-0.84 0.822 0.198c0.842 0.204 1.734-0.038 2.358-0.662 0.934-0.934 0.974-2.423 0.122-3.405l-0.122-0.13-5.413-5.413zM5 10.501C4.17 10.5 3.5 11.17 3.5 12c0 0.78 0.595 1.42 1.355 1.492L5 13.5l0.115-0.005 0.005-0.025c0.035-0.15 0.077-0.295 0.126-0.438l0.097-0.255 0.106-0.236 0.057-0.113 0.13-0.234 0.088-0.14 0.145-0.21 0.074-0.098 0.108-0.134 0.129-0.147 0.15-0.157c-0.21-0.4-0.59-0.69-1.037-0.778l-0.151-0.022L5 10.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M10.997 5.998c2.623 0 4.946 1.665 5.8 4.126l0.075 0.233 0.044 0.144h2.33c1.462 0 2.658 1.142 2.744 2.582l0.005 0.167v1c0 0.917-0.707 1.67-1.606 1.743l-0.143 0.005H18.62l0.241 0.584c0.35 0.846-0.015 1.808-0.813 2.22l-0.137 0.064c-0.159 0.065-0.326 0.107-0.496 0.124l-0.171 0.008h-1.787c-0.625 0-1.199-0.333-1.51-0.867l-0.072-0.137-0.539-1.143 0.054-0.007c-1.4 0.186-2.817 0.208-4.221 0.066l-0.497-0.057-0.535 1.136c-0.289 0.614-0.905 1.005-1.583 1.005H4.75c-0.229 0-0.455-0.045-0.667-0.132-0.893-0.367-1.319-1.39-0.951-2.283l0.433-1.05c-0.94-0.569-1.57-1.6-1.57-2.78 0-0.38 0.282-0.693 0.648-0.742L2.745 12h1.88l0.497-1.643c0.784-2.588 3.17-4.359 5.875-4.359zm6.777 9.694c-0.771 0.31-1.559 0.564-2.356 0.764l-0.549 0.129 0.362 0.77c0.025 0.053 0.067 0.094 0.117 0.119l0.053 0.018 0.056 0.007h1.787c0.033 0 0.065-0.007 0.095-0.02 0.107-0.043 0.166-0.152 0.153-0.26l-0.017-0.065-0.478-1.156h-0.043l0.411-0.148 0.409-0.159zm-13.552 0l0.39 0.151L5 15.984 4.518 17.15c-0.052 0.127 0.009 0.273 0.136 0.326 0.03 0.012 0.063 0.019 0.096 0.019h1.804l0.057-0.007c0.073-0.017 0.136-0.067 0.17-0.137l0.359-0.763 0.044 0.01c-1.005-0.216-1.996-0.518-2.962-0.906zm6.775-8.195c-1.971 0-3.718 1.245-4.371 3.087l-0.069 0.207-1.135 3.75 0.163 0.059c3.372 1.158 7.025 1.202 10.42 0.133L16.41 14.6l0.162-0.059-1.136-3.75c-0.55-1.816-2.145-3.1-4.006-3.274l-0.216-0.015-0.218-0.005zm-6.977 6.5l0.151-0.5L3.664 13.5l0.026 0.05c0.086 0.166 0.198 0.316 0.33 0.446zM17.37 12l0.756 2.498 2.12 0.001c0.118 0 0.217-0.082 0.243-0.192l0.007-0.058V13.25c0-0.647-0.492-1.179-1.122-1.243l-0.128-0.006H17.37z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M10.417 8C9.082 8 8 9.082 8 10.417 8 11.29 8.709 12 9.583 12h4.834C15.29 12 16 11.291 16 10.417 16 9.082 14.918 8 13.583 8h-3.166zM9.5 10.417C9.5 9.91 9.91 9.5 10.417 9.5h3.166c0.507 0 0.917 0.41 0.917 0.917 0 0.046-0.037 0.083-0.083 0.083H9.583c-0.046 0-0.083-0.037-0.083-0.083zM12 2c-1.961 0-3.57 1.506-3.736 3.424C5.728 6.766 4 9.431 4 12.5v6.25C4 20.545 5.455 22 7.25 22h9.5c1.795 0 3.25-1.455 3.25-3.25V12.5c0-3.069-1.728-5.734-4.264-7.076C15.571 3.506 13.961 2 12 2zm6.5 12h-13v-1.5C5.5 8.91 8.41 6 12 6s6.5 2.91 6.5 6.5V14zM8 17.25C8 17.664 8.336 18 8.75 18s0.75-0.336 0.75-0.75v-1.536h9v3.036c0 0.966-0.784 1.75-1.75 1.75h-9.5c-0.966 0-1.75-0.784-1.75-1.75v-3.036H8v1.536zM12 4.5c-0.698 0-1.374 0.09-2.02 0.257C10.347 4.012 11.114 3.5 12 3.5c0.886 0 1.653 0.512 2.02 1.257C13.374 4.59 12.698 4.5 12 4.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12.018 5.665c0.095-0.404 0.498-0.654 0.902-0.559 1.468 0.346 2.623 1.499 2.972 2.966 0.095 0.403-0.154 0.807-0.557 0.903-0.403 0.096-0.807-0.153-0.903-0.556-0.217-0.915-0.94-1.637-1.856-1.853-0.403-0.095-0.653-0.498-0.558-0.901zM5 9c0-3.866 3.134-7 7-7s7 3.134 7 7c0 2.025-0.67 4.236-1.85 5.956-1.042 1.52-2.543 2.731-4.4 2.992v0.302c0 0.414 0.336 0.75 0.75 0.75h3.25c1.243 0 2.25 1.007 2.25 2.25v1c0 0.414-0.336 0.75-0.75 0.75s-0.75-0.336-0.75-0.75v-1c0-0.414-0.336-0.75-0.75-0.75H13.5c-1.243 0-2.25-1.007-2.25-2.25v-0.302c-1.857-0.261-3.357-1.473-4.4-2.992C5.67 13.236 5 11.025 5 9zm7-5.5C8.962 3.5 6.5 5.962 6.5 9c0 1.725 0.58 3.64 1.586 5.107C9.094 15.575 10.453 16.5 12 16.5c1.547 0 2.906-0.925 3.914-2.393C16.92 12.639 17.5 10.725 17.5 9c0-3.038-2.462-5.5-5.5-5.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 19.137C11.499 19.67 10.788 20 10 20H3.75C2.784 20 2 19.216 2 18.25V5.75C2 4.784 2.784 4 3.75 4H10c0.788 0 1.499 0.331 2 0.862C12.501 4.332 13.212 4 14 4h6.25C21.216 4 22 4.784 22 5.75v12.5c0 0.966-0.784 1.75-1.75 1.75H14c-0.788 0-1.499-0.331-2-0.863zM3.5 5.75v12.5c0 0.138 0.112 0.25 0.25 0.25H10c0.69 0 1.25-0.56 1.25-1.25V6.75c0-0.69-0.56-1.25-1.25-1.25H3.75C3.612 5.5 3.5 5.612 3.5 5.75zm9.25 11.5c0 0.69 0.56 1.25 1.25 1.25h6.25c0.138 0 0.25-0.112 0.25-0.25V5.75c0-0.138-0.112-0.25-0.25-0.25H14c-0.69 0-1.25 0.56-1.25 1.25v10.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M17.753 14c1.243 0 2.25 1.007 2.25 2.25v0.904c0 1.094-0.477 2.133-1.307 2.846-1.565 1.344-3.806 2-6.696 2-2.89 0-5.128-0.656-6.69-2-0.83-0.712-1.306-1.75-1.306-2.843v-0.908c0-1.242 1.007-2.25 2.25-2.25h11.5zm0 1.5h-11.5c-0.413 0-0.75 0.335-0.75 0.75v0.907c0 0.655 0.287 1.278 0.784 1.706C7.545 19.945 9.441 20.5 12 20.5c2.56 0 4.458-0.557 5.72-1.64 0.497-0.427 0.783-1.05 0.783-1.707V16.25c0-0.414-0.335-0.75-0.75-0.75zM11.9 2.006L12 2c0.38 0 0.693 0.282 0.743 0.648L12.75 2.75v0.749h3.5c1.243 0 2.25 1.008 2.25 2.25v4.505c0 1.243-1.007 2.25-2.25 2.25h-8.5c-1.242 0-2.25-1.007-2.25-2.25V5.75c0-1.243 1.008-2.25 2.25-2.25l3.5-0.001V2.75c0-0.38 0.283-0.693 0.649-0.743L12 2l-0.102 0.007zM16.25 5h-8.5C7.336 5 7 5.335 7 5.75v4.504c0 0.414 0.336 0.75 0.75 0.75h8.5c0.415 0 0.75-0.336 0.75-0.75V5.75C17 5.335 16.665 5 16.25 5zm-6.5 1.5c0.69 0 1.249 0.559 1.249 1.249 0 0.69-0.56 1.25-1.25 1.25S8.5 8.438 8.5 7.748s0.56-1.25 1.25-1.25zm4.492 0c0.69 0 1.25 0.559 1.25 1.249 0 0.69-0.56 1.25-1.25 1.25s-1.249-0.56-1.249-1.25 0.56-1.25 1.25-1.25z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M8.75 3h6.5c0.38 0 0.694 0.282 0.743 0.648L16 3.75V7h1.75C19.545 7 21 8.455 21 10.25v6.5c0 1.795-1.455 3.25-3.25 3.25H6.25C4.455 20 3 18.545 3 16.75v-6.5C3 8.455 4.455 7 6.25 7H8V3.75c0-0.38 0.282-0.693 0.648-0.743L8.75 3h6.5-6.5zm9 5.5H6.25c-0.966 0-1.75 0.784-1.75 1.75v6.5c0 0.966 0.784 1.75 1.75 1.75h11.5c0.966 0 1.75-0.784 1.75-1.75v-6.5c0-0.966-0.784-1.75-1.75-1.75zm-3.25-4h-5V7h5V4.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M10.5 2.752c0-0.414-0.336-0.75-0.75-0.75S9 2.338 9 2.752v0.752c0 0.632 0.196 1.22 0.53 1.703-1.393 0.48-2.415 1.755-2.52 3.284H6.752c-1.242-0.005-2.246-1.017-2.24-2.26l0.006-1.485C4.52 4.332 4.186 3.995 3.772 3.993 3.358 3.99 3.02 4.326 3.019 4.74L3.013 6.225c-0.01 2.072 1.663 3.757 3.734 3.766H7v1.51H2.75C2.336 11.5 2 11.836 2 12.25 2 12.665 2.336 13 2.75 13H7v1.992H6.747C4.676 15 3.004 16.687 3.013 18.758l0.006 1.486c0.001 0.414 0.338 0.749 0.753 0.747 0.414-0.002 0.748-0.339 0.747-0.753l-0.006-1.486c-0.006-1.242 0.998-2.254 2.24-2.26h0.473c0.635 2.034 2.532 3.51 4.774 3.51s4.14-1.476 4.774-3.51h0.473c1.242 0.006 2.246 1.018 2.24 2.26l-0.006 1.486c-0.001 0.414 0.333 0.751 0.747 0.753 0.414 0.002 0.752-0.333 0.753-0.747l0.006-1.486c0.01-2.07-1.663-3.756-3.734-3.765H17V13h4.251c0.415 0 0.75-0.336 0.75-0.75 0-0.415-0.335-0.75-0.75-0.75H17V9.99h0.253c2.071-0.009 3.743-1.694 3.735-3.766L20.98 4.74c-0.001-0.414-0.339-0.749-0.753-0.747-0.414 0.002-0.748 0.339-0.747 0.753l0.006 1.486c0.006 1.242-0.997 2.254-2.24 2.259H16.99c-0.106-1.529-1.128-2.805-2.52-3.284C14.803 4.723 15 4.137 15 3.504V2.752c0-0.414-0.336-0.75-0.75-0.75s-0.75 0.336-0.75 0.75v0.752c0 0.828-0.672 1.5-1.5 1.5s-1.5-0.671-1.5-1.5V2.752zm-2 6.002c0-1.243 1.007-2.25 2.25-2.25h2.5c1.243 0 2.25 1.007 2.25 2.25v6.247c0 1.933-1.567 3.5-3.5 3.5s-3.5-1.567-3.5-3.5V8.754z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10c-1.64 0-3.225-0.396-4.644-1.142l-4.29 1.117c-0.455 0.119-0.92-0.154-1.037-0.608-0.037-0.14-0.037-0.288 0-0.428l1.116-4.289C2.397 15.23 2 13.643 2 12 2 6.477 6.477 2 12 2zm1.252 11H8.75l-0.102 0.007C8.282 13.057 8 13.37 8 13.75s0.282 0.694 0.648 0.743L8.75 14.5h4.502l0.101-0.007c0.367-0.05 0.649-0.363 0.649-0.743s-0.282-0.694-0.649-0.743L13.252 13zm1.998-3.5h-6.5L8.648 9.507C8.282 9.557 8 9.87 8 10.25s0.282 0.694 0.648 0.743L8.75 11h6.5l0.102-0.007C15.718 10.943 16 10.63 16 10.25s-0.282-0.694-0.648-0.743L15.25 9.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10c-1.618 0-3.182-0.385-4.587-1.112l-3.826 1.067c-0.665 0.186-1.354-0.202-1.54-0.867-0.062-0.22-0.062-0.453 0-0.673l1.068-3.823C2.386 15.186 2 13.62 2 12 2 6.477 6.477 2 12 2zm0 1.5c-4.694 0-8.5 3.806-8.5 8.5 0 1.47 0.373 2.883 1.073 4.137l0.15 0.27-1.112 3.984 3.986-1.112 0.27 0.15C9.12 20.13 10.532 20.5 12 20.5c4.694 0 8.5-3.806 8.5-8.5S16.694 3.5 12 3.5zM8.75 13h4.498c0.415 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.743L13.248 14.5H8.75C8.336 14.5 8 14.164 8 13.75c0-0.38 0.282-0.694 0.648-0.743L8.75 13h4.498H8.75zm0-3.5h6.505c0.414 0 0.75 0.336 0.75 0.75 0 0.38-0.283 0.694-0.649 0.743L15.255 11H8.75C8.336 11 8 10.664 8 10.25c0-0.38 0.282-0.694 0.648-0.743L8.75 9.5h6.505H8.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 1.996c0.414 0 0.75 0.336 0.75 0.75V4h2c0.966 0 1.75 0.784 1.75 1.75V11h2.25c0.966 0 1.75 0.784 1.75 1.75v7.5c0 0.967-0.784 1.75-1.75 1.75H5.25c-0.966 0-1.75-0.783-1.75-1.75v-8.43c0-0.619 0.327-1.192 0.86-1.507L7.5 8.458V5.749C7.5 4.783 8.284 4 9.25 4h2V2.746c0-0.414 0.336-0.75 0.75-0.75zM9 8.018c0.81 0.12 1.5 0.806 1.5 1.734v10.747h3v-7.75c0-0.881 0.652-1.61 1.5-1.732V5.75c0-0.138-0.112-0.25-0.25-0.25h-5.5C9.112 5.5 9 5.611 9 5.75v2.269zm6.25 4.481c-0.138 0-0.25 0.112-0.25 0.25v7.75h3.75c0.138 0 0.25-0.111 0.25-0.25v-7.5c0-0.138-0.112-0.25-0.25-0.25h-3.5zM8.623 9.537l-3.5 2.068C5.047 11.65 5 11.732 5 11.82v8.43c0 0.137 0.112 0.25 0.25 0.25H9V9.751c0-0.194-0.21-0.314-0.377-0.215z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M8.066 18.943l6.5-14.5c0.17-0.378 0.613-0.547 0.99-0.377 0.347 0.155 0.518 0.54 0.414 0.895l-0.036 0.096-6.5 14.5c-0.17 0.378-0.613 0.547-0.99 0.378-0.347-0.156-0.518-0.542-0.414-0.896l0.036-0.096 6.5-14.5-6.5 14.5zM2.22 11.47l4.25-4.25c0.293-0.293 0.767-0.293 1.06 0 0.267 0.266 0.29 0.683 0.073 0.976L7.53 8.281 3.81 12l3.72 3.719c0.293 0.293 0.293 0.768 0 1.06-0.266 0.267-0.683 0.291-0.976 0.073L6.47 16.78l-4.25-4.25c-0.267-0.266-0.29-0.682-0.073-0.976L2.22 11.47l4.25-4.25-4.25 4.25zm14.25-4.25c0.266-0.266 0.683-0.29 0.976-0.073L17.53 7.22l4.25 4.25c0.267 0.266 0.29 0.683 0.073 0.976l-0.073 0.085-4.25 4.25c-0.293 0.292-0.767 0.292-1.06 0-0.267-0.267-0.29-0.683-0.073-0.977l0.073-0.084L20.19 12l-3.72-3.72c-0.293-0.292-0.293-0.767 0-1.06z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M18.5 20c0 0.275-0.224 0.5-0.5 0.5H6c-0.276 0-0.5-0.225-0.5-0.5V4c0-0.275 0.224-0.5 0.5-0.5h6V8c0 1.104 0.896 2 2 2h4.5v10zm-5-15.379L17.378 8.5H14c-0.276 0-0.5-0.225-0.5-0.5V4.621zm5.914 3.793l-5.829-5.828C13.559 2.56 13.527 2.54 13.5 2.516c-0.071-0.064-0.141-0.127-0.219-0.18-0.04-0.027-0.086-0.045-0.128-0.068-0.071-0.04-0.141-0.084-0.216-0.116-0.197-0.082-0.409-0.123-0.624-0.138C12.266 2.011 12.22 2 12.172 2H6C4.896 2 4 2.896 4 4v16c0 1.104 0.896 2 2 2h12c1.104 0 2-0.896 2-2V9.828c0-0.53-0.211-1.039-0.586-1.414z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M5.5 2.75C5.5 2.336 5.164 2 4.75 2S4 2.336 4 2.75c0 1.27 0.928 1.917 1.506 2.32L5.57 5.114C6.25 5.59 6.5 5.82 6.5 6.25 6.5 6.664 6.836 7 7.25 7S8 6.664 8 6.25c0-1.27-0.928-1.917-1.506-2.32L6.43 3.886C5.75 3.41 5.5 3.18 5.5 2.75zM3 9.821C3 8.816 3.816 8 4.821 8H17.18C18.185 8 19 8.816 19 9.821V10.5h0.75c1.795 0 3.25 1.455 3.25 3.25S21.545 17 19.75 17h-1.331c-1.187 2.932-4.062 5-7.419 5-4.418 0-8-3.582-8-8V9.821zm14.5 0c0-0.177-0.144-0.321-0.321-0.321H4.82C4.644 9.5 4.5 9.644 4.5 9.821V14c0 3.59 2.91 6.5 6.5 6.5s6.5-2.91 6.5-6.5V9.821zM19.75 12H19v2c0 0.513-0.048 1.014-0.14 1.5h0.89c0.966 0 1.75-0.784 1.75-1.75S20.716 12 19.75 12zm-11-10C9.164 2 9.5 2.336 9.5 2.75c0 0.431 0.25 0.66 0.93 1.136l0.064 0.044C11.072 4.333 12 4.98 12 6.25 12 6.664 11.664 7 11.25 7S10.5 6.664 10.5 6.25c0-0.431-0.25-0.66-0.93-1.136L9.506 5.07C8.928 4.667 8 4.02 8 2.75 8 2.336 8.336 2 8.75 2zm4.75 0.75C13.5 2.336 13.164 2 12.75 2S12 2.336 12 2.75c0 1.27 0.928 1.917 1.506 2.32l0.064 0.044C14.25 5.59 14.5 5.82 14.5 6.25 14.5 6.664 14.836 7 15.25 7S16 6.664 16 6.25c0-1.27-0.928-1.917-1.506-2.32L14.43 3.886C13.75 3.41 13.5 3.18 13.5 2.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M6.75 12c-0.212 0-0.412 0.089-0.555 0.244-0.142 0.156-0.212 0.364-0.193 0.574C6.282 15.892 8.552 18.5 12 18.5c3.448 0 5.717-2.608 5.998-5.682 0.019-0.21-0.051-0.418-0.193-0.574C17.663 12.09 17.462 12 17.25 12H6.749zM12 17c-2.257 0-3.871-1.48-4.368-3.5h8.736C15.872 15.52 14.258 17 12 17zm3.25-8.25c-0.408 0-0.71 0.287-0.758 0.61-0.06 0.41-0.442 0.693-0.852 0.632-0.41-0.06-0.693-0.442-0.632-0.852 0.162-1.09 1.123-1.89 2.242-1.89s2.08 0.8 2.242 1.89c0.06 0.41-0.222 0.791-0.632 0.852-0.41 0.06-0.791-0.222-0.852-0.632-0.048-0.323-0.35-0.61-0.758-0.61zM7.992 9.36C8.04 9.037 8.342 8.75 8.75 8.75c0.409 0 0.71 0.287 0.758 0.61 0.06 0.41 0.442 0.693 0.852 0.632 0.41-0.06 0.693-0.442 0.632-0.852-0.161-1.09-1.123-1.89-2.242-1.89s-2.08 0.8-2.242 1.89C6.448 9.55 6.731 9.931 7.14 9.992c0.41 0.06 0.791-0.222 0.852-0.632zM12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM3.5 12c0-4.694 3.806-8.5 8.5-8.5s8.5 3.806 8.5 8.5-3.806 8.5-8.5 8.5-8.5-3.806-8.5-8.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12.538 4.295c0.323-0.244 0.644-0.431 0.93-0.563 0.088 2.127 1.127 3.726 2.129 5.14l0.272 0.382c1.083 1.518 2.011 2.819 2.112 4.54 0.117 1.982-0.377 3.657-1.336 4.824C15.7 19.77 14.24 20.5 12.25 20.5c-2.061 0-3.61-0.529-4.691-1.416-1.077-0.883-1.764-2.181-1.994-3.872-0.226-1.663 0.176-2.845 0.611-3.603 0.086-0.149 0.173-0.282 0.258-0.4l0.315 0.598c0.551 1.046 1.83 1.472 2.898 0.965 1.306-0.62 1.584-2.213 1.17-3.33-0.29-0.783-0.445-1.737-0.11-2.694 0.377-1.072 1.091-1.896 1.831-2.454zM6.156 9.322L6.154 9.325 6.15 9.328 6.14 9.336 6.11 9.36C6.084 9.38 6.052 9.406 6.013 9.44c-0.076 0.067-0.18 0.164-0.301 0.29-0.24 0.253-0.548 0.629-0.837 1.132-0.582 1.015-1.071 2.528-0.796 4.551 0.271 1.997 1.11 3.666 2.528 4.83C8.021 21.404 9.935 22 12.25 22c2.387 0 4.293-0.895 5.554-2.43 1.25-1.521 1.808-3.596 1.675-5.864-0.128-2.176-1.313-3.827-2.36-5.285L16.82 8.004c-1.142-1.612-2.043-3.097-1.824-5.175 0.022-0.212-0.046-0.423-0.189-0.58C14.665 2.09 14.463 2 14.25 2c-0.382 0-0.82 0.118-1.242 0.296-0.436 0.183-0.91 0.452-1.373 0.8-0.925 0.698-1.85 1.75-2.343 3.156C8.8 7.654 9.05 8.99 9.41 9.963c0.237 0.639-0.02 1.27-0.406 1.454-0.342 0.162-0.752 0.026-0.928-0.31L7.27 9.576C7.167 9.38 6.985 9.24 6.77 9.193c-0.214-0.049-0.439 0-0.615 0.13z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M9 10.99c0.552 0 1-0.447 1-1 0-0.552-0.448-1-1-1s-1 0.448-1 1c0 0.553 0.448 1 1 1zm5 1.998c0 0.553-0.448 1-1 1s-1-0.447-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1zm-5 3.998c0.552 0 1-0.448 1-1 0-0.553-0.448-1-1-1s-1 0.447-1 1c0 0.552 0.448 1 1 1zM5 4.66c0-1.497 1.23-2.805 2.82-2.648C13.146 2.539 17.882 5.07 21.262 8.84c1.07 1.193 0.737 2.964-0.479 3.845-1.582 1.148-3.94 2.857-5.283 3.833-0.002 0.437-0.002 0.721-0.001 1.092v0.628c0 0.946-0.763 1.75-1.75 1.75-0.105 0-0.207-0.009-0.306-0.026-0.204 0.826-0.932 1.527-1.944 1.527-0.7 0-1.262-0.335-1.609-0.815l-1.325 0.957c-1.488 1.074-3.57 0.011-3.569-1.826L5 4.661zm2.673-1.155C7.064 3.446 6.499 3.949 6.499 4.66v0.52c5.254 0.22 9.911 2.749 12.985 6.594l0.419-0.304c0.578-0.42 0.652-1.173 0.242-1.63-3.138-3.5-7.533-5.848-12.472-6.335zm-1.177 16.3c0 0.612 0.694 0.967 1.19 0.608l2.128-1.534c0.229-0.164 0.53-0.186 0.78-0.058s0.408 0.386 0.408 0.667c0 0.27 0.209 0.5 0.497 0.5 0.292 0 0.502-0.233 0.502-0.5v-1.251c0-0.415 0.335-0.75 0.75-0.75 0.414 0 0.75 0.335 0.75 0.75 0 0.14 0.111 0.25 0.248 0.25 0.138 0 0.25-0.111 0.25-0.25v-0.622c-0.001-0.47-0.002-0.808 0.005-1.489 0.002-0.237 0.116-0.46 0.308-0.6 0.902-0.656 2.496-1.812 3.956-2.87-2.801-3.474-7.016-5.756-11.77-5.974L6.497 19.806z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M14.998 5c3.866 0 7 3.134 7 7 0 3.786-3.005 6.87-6.76 6.996L14.998 19H9.002c-3.866 0-7-3.134-7-7 0-3.785 3.005-6.87 6.76-6.996L9.002 5h5.996zm0 1.5H9.002c-3.038 0-5.5 2.462-5.5 5.5 0 2.963 2.344 5.38 5.279 5.496L9.002 17.5h5.996c3.037 0 5.5-2.462 5.5-5.5 0-2.963-2.344-5.38-5.279-5.496L14.998 6.5zM8 9c0.414 0 0.75 0.336 0.75 0.75v1.498h1.5c0.414 0 0.75 0.337 0.75 0.75 0 0.415-0.336 0.75-0.75 0.75h-1.5v1.502C8.75 14.664 8.414 15 8 15s-0.75-0.336-0.75-0.75v-1.502h-1.5c-0.414 0-0.75-0.335-0.75-0.75 0-0.413 0.336-0.75 0.75-0.75h1.5V9.75C7.25 9.336 7.586 9 8 9zm6.75 3.5c0.69 0 1.25 0.56 1.25 1.25S15.44 15 14.75 15s-1.25-0.56-1.25-1.25 0.56-1.25 1.25-1.25zm2-3.5C17.44 9 18 9.56 18 10.25s-0.56 1.25-1.25 1.25-1.25-0.56-1.25-1.25S16.06 9 16.75 9z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M7.934 16.066c0.293 0.293 0.293 0.768 0 1.06-0.293 0.293-0.768 0.293-1.06 0-2.832-2.83-2.832-7.421 0-10.253 1.844-1.844 4.436-2.486 6.798-1.928 0.403 0.095 0.653 0.499 0.558 0.902-0.095 0.403-0.5 0.653-0.902 0.557-1.878-0.443-3.932 0.068-5.394 1.53-2.245 2.246-2.245 5.886 0 8.132zm9.954-6.924c0.39-0.137 0.819 0.069 0.955 0.46 0.89 2.544 0.32 5.489-1.716 7.524-0.293 0.293-0.768 0.293-1.061 0-0.293-0.292-0.293-0.767 0-1.06 1.613-1.613 2.068-3.948 1.362-5.969-0.137-0.391 0.069-0.819 0.46-0.955zm-2.009-2.475c0.227-0.194 0.56-0.2 0.794-0.015 0.235 0.185 0.305 0.51 0.168 0.776l-0.13 0.25c-0.081 0.16-0.2 0.388-0.343 0.664-0.286 0.55-0.673 1.291-1.072 2.05-0.4 0.757-0.814 1.533-1.156 2.156-0.171 0.31-0.326 0.586-0.452 0.803-0.118 0.201-0.233 0.391-0.32 0.5-0.642 0.812-1.82 0.95-2.633 0.307-0.812-0.643-0.95-1.822-0.307-2.634 0.086-0.109 0.244-0.265 0.413-0.425 0.182-0.173 0.414-0.387 0.678-0.625 0.527-0.476 1.187-1.058 1.832-1.62 0.646-0.564 1.278-1.11 1.748-1.516l0.566-0.487 0.214-0.184zM22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10zM3.5 12c0 4.694 3.806 8.5 8.5 8.5s8.5-3.806 8.5-8.5-3.806-8.5-8.5-8.5S3.5 7.306 3.5 12z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M14.14 2.98c-0.814-1.119-2.434-1.246-3.412-0.268L7.264 6.177C6.26 7.18 6.425 8.852 7.606 9.64l2.01 1.339-6.873 6.743c-0.996 0.977-1.004 2.579-0.017 3.565 0.98 0.98 2.569 0.98 3.549 0l6.872-6.872 1.216 1.91c0.773 1.215 2.472 1.402 3.49 0.384l3.436-3.436c0.978-0.978 0.85-2.598-0.268-3.411l-3.888-2.828c-0.064-0.046-0.12-0.102-0.166-0.166L14.14 2.98zm-2.35 0.792c0.325-0.325 0.865-0.283 1.136 0.09l0.46 0.632L9.068 8.81l-0.63-0.42C8.045 8.13 7.99 7.573 8.324 7.238l3.465-3.465zM10.34 9.66l3.939-3.938 1.475 2.028c0.139 0.19 0.306 0.358 0.496 0.497l1.96 1.423-3.852 3.851-1.054-1.657c-0.168-0.264-0.39-0.49-0.65-0.664L10.34 9.66zm4.842 5.159l4.255-4.255 0.702 0.51c0.373 0.272 0.415 0.812 0.09 1.138l-3.437 3.436c-0.34 0.34-0.906 0.277-1.163-0.127l-0.447-0.702zm-2.86-1.7l-7.108 7.108c-0.394 0.394-1.033 0.394-1.427 0-0.397-0.397-0.394-1.042 0.006-1.435l7.097-6.963 0.93 0.62c0.088 0.058 0.161 0.134 0.217 0.222l0.285 0.447zM14.75 19C14.336 19 14 19.337 14 19.75s0.336 0.75 0.75 0.75h-2c-0.414 0-0.75 0.336-0.75 0.75S12.336 22 12.75 22h8.5c0.414 0 0.75-0.336 0.75-0.75s-0.336-0.75-0.75-0.75h-2c0.414 0 0.75-0.336 0.75-0.75S19.664 19 19.25 19h-4.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M9.909 3.7c1.274-0.816 2.908-0.816 4.182 0l8.064 5.17c0.214 0.137 0.344 0.373 0.345 0.628 0.001 0.254-0.127 0.492-0.34 0.63L19 12.195v5.557c0 0.162-0.053 0.32-0.15 0.45l-0.001 0.001-0.001 0.002-0.003 0.004-0.009 0.01-0.015 0.02-0.01 0.012c-0.02 0.026-0.05 0.06-0.086 0.102-0.073 0.084-0.178 0.197-0.317 0.33-0.277 0.267-0.69 0.614-1.25 0.958C16.037 20.33 14.339 21 12 21c-2.339 0-4.036-0.67-5.159-1.36-0.559-0.344-0.971-0.69-1.25-0.957-0.138-0.134-0.243-0.247-0.316-0.33-0.043-0.05-0.085-0.099-0.124-0.15L5.15 18.2C5.053 18.07 5 17.913 5 17.75v-5.558l-2-1.306v5.364C3 16.665 2.664 17 2.25 17S1.5 16.665 1.5 16.25V9.5c0-0.27 0.143-0.508 0.358-0.64l8.05-5.16zm4.21 11.682c-1.287 0.842-2.95 0.841-4.238 0L6.5 13.174v4.296c0.037 0.038 0.08 0.082 0.13 0.13 0.211 0.203 0.54 0.481 0.997 0.762 0.909 0.56 2.337 1.139 4.373 1.139s3.464-0.58 4.373-1.139c0.456-0.28 0.786-0.56 0.996-0.761L17.5 17.47v-4.296l-3.38 2.208zM13.282 4.963c-0.781-0.5-1.783-0.5-2.564 0L3.63 9.507l7.071 4.62c0.79 0.515 1.809 0.515 2.598 0l7.07-4.62-7.087-4.544z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M3.5 12c0-4.694 3.806-8.5 8.5-8.5s8.5 3.806 8.5 8.5v2h-2.25c-0.414 0-0.75 0.336-0.75 0.75v6.5c0 0.414 0.336 0.75 0.75 0.75H19c1.657 0 3-1.343 3-3v-7c0-5.523-4.477-10-10-10S2 6.477 2 12v7c0 1.657 1.343 3 3 3h0.75c0.414 0 0.75-0.336 0.75-0.75v-6.5C6.5 14.336 6.164 14 5.75 14H3.5v-2zm17 3.5V19c0 0.828-0.672 1.5-1.5 1.5v-5h1.5zM3.5 19v-3.5H5v5c-0.828 0-1.5-0.672-1.5-1.5zm9.25-7.25c0-0.414-0.336-0.75-0.75-0.75s-0.75 0.336-0.75 0.75v10.5c0 0.414 0.336 0.75 0.75 0.75s0.75-0.336 0.75-0.75v-10.5zm-4 2.25c0.414 0 0.75 0.335 0.75 0.75v4.5C9.5 19.664 9.164 20 8.75 20S8 19.664 8 19.25v-4.5C8 14.335 8.336 14 8.75 14zM16 14.75c0-0.414-0.336-0.75-0.75-0.75s-0.75 0.336-0.75 0.75v4.5c0 0.414 0.336 0.75 0.75 0.75S16 19.664 16 19.25v-4.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12.82 5.58L12 6.401l-0.824-0.824c-2.1-2.099-5.502-2.099-7.601 0C2.108 7.045 1.665 9.15 2.249 11h1.605C3.196 9.57 3.456 7.82 4.635 6.64c1.514-1.513 3.967-1.513 5.48 0l1.358 1.357c0.298 0.298 0.782 0.293 1.073-0.012L13.88 6.64c1.517-1.517 3.972-1.517 5.489 0 1.18 1.18 1.438 2.926 0.779 4.36h1.605c0.584-1.852 0.145-3.953-1.323-5.42-2.103-2.104-5.508-2.104-7.611 0zm-1.35 15.495L4.894 14.5h1.963c0.051 0 0.102-0.003 0.152-0.007L12 19.484l4.988-4.985h2.122l-6.58 6.576c-0.292 0.293-0.767 0.293-1.06 0zM9.42 8.415C9.294 8.156 9.03 7.995 8.743 8c-0.287 0.003-0.547 0.17-0.67 0.429l-1.69 3.57H2.75C2.336 12 2 12.335 2 12.75s0.336 0.75 0.75 0.75h4.107c0.29 0 0.554-0.167 0.678-0.429l1.234-2.606 2.56 5.12c0.117 0.236 0.349 0.392 0.61 0.413 0.262 0.021 0.515-0.096 0.669-0.308l2.698-3.736 1.13 1.29C16.578 13.406 16.784 13.5 17 13.5h4.25c0.414 0 0.75-0.335 0.75-0.75 0-0.414-0.336-0.75-0.75-0.75h-3.91l-1.526-1.743c-0.15-0.172-0.37-0.266-0.599-0.256-0.228 0.011-0.44 0.125-0.573 0.31l-2.525 3.496-2.696-5.392z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M19.25 12c0-4.004-3.246-7.25-7.25-7.25-1.662 0-3.194 0.56-4.417 1.5H8.25c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.552 0-1-0.448-1-1V7H4.216L4.25 6.948V4.25c0-0.552 0.448-1 1-1s1 0.448 1 1v0.504C7.829 3.499 9.827 2.75 12 2.75c5.109 0 9.25 4.141 9.25 9.25s-4.141 9.25-9.25 9.25S2.75 17.109 2.75 12c0-0.383 0.023-0.76 0.068-1.13C2.881 10.358 3.334 10 3.85 10c0.59 0 1.017 0.569 0.949 1.156C4.766 11.433 4.75 11.714 4.75 12c0 4.004 3.246 7.25 7.25 7.25s7.25-3.246 7.25-7.25zM13 8c0-0.552-0.448-1-1-1s-1 0.448-1 1v5c0 0.552 0.448 1 1 1h3c0.552 0 1-0.448 1-1s-0.448-1-1-1h-2V8z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M19.5 12c0-4.142-3.358-7.5-7.5-7.5-1.97 0-3.76 0.759-5.1 2h1.35C8.664 6.5 9 6.836 9 7.25S8.664 8 8.25 8h-3C4.836 8 4.5 7.664 4.5 7.25v-3c0-0.414 0.336-0.75 0.75-0.75S6 3.836 6 4.25v1.042C7.592 3.867 9.695 3 12 3c4.97 0 9 4.03 9 9s-4.03 9-9 9-9-4.03-9-9c0-0.468 0.036-0.928 0.105-1.377C3.16 10.256 3.486 10 3.857 10c0.46 0 0.791 0.438 0.724 0.892C4.528 11.254 4.5 11.624 4.5 12c0 4.142 3.358 7.5 7.5 7.5 4.142 0 7.5-3.358 7.5-7.5zm-7-4.25C12.5 7.336 12.164 7 11.75 7S11 7.336 11 7.75v4.5c0 0.414 0.336 0.75 0.75 0.75h2.5c0.414 0 0.75-0.336 0.75-0.75s-0.336-0.75-0.75-0.75H12.5V7.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M18.75 4C20.545 4 22 5.455 22 7.25v11.5c0 1.795-1.455 3.25-3.25 3.25H7.25C5.455 22 4 20.545 4 18.75v-6.248c0.474 0.198 0.977 0.34 1.5 0.422v5.826c0 0.208 0.036 0.408 0.103 0.594l5.823-5.701c0.833-0.816 2.142-0.854 3.02-0.116l0.128 0.116 5.822 5.702c0.067-0.186 0.104-0.386 0.104-0.595V7.25c0-0.966-0.784-1.75-1.75-1.75h-5.826C12.843 4.977 12.7 4.474 12.502 4h6.248zm-6.191 10.644l-0.084 0.07-5.807 5.687C6.85 20.465 7.046 20.5 7.25 20.5h11.5c0.203 0 0.399-0.035 0.58-0.099l-5.805-5.686c-0.265-0.26-0.675-0.283-0.966-0.071zM16.252 7.5c1.244 0 2.252 1.008 2.252 2.252 0 1.244-1.008 2.252-2.252 2.252-1.244 0-2.252-1.008-2.252-2.252C14 8.508 15.008 7.5 16.252 7.5zM6.5 1C9.538 1 12 3.462 12 6.5S9.538 12 6.5 12 1 9.538 1 6.5 3.462 1 6.5 1zm9.752 8C15.837 9 15.5 9.337 15.5 9.752s0.337 0.752 0.752 0.752c0.416 0 0.752-0.336 0.752-0.752C17.004 9.337 16.667 9 16.252 9zM6.5 3L6.41 3.006C6.206 3.044 6.045 3.205 6.008 3.41L6 3.5V6H3.498l-0.09 0.008C3.204 6.045 3.043 6.206 3.006 6.41L2.998 6.5l0.008 0.09c0.037 0.204 0.198 0.365 0.402 0.402L3.498 7H6v2.504l0.008 0.09C6.045 9.798 6.206 9.958 6.41 9.995l0.09 0.009 0.09-0.009c0.204-0.037 0.365-0.197 0.402-0.402L7 9.503V7h2.505l0.09-0.008c0.203-0.037 0.363-0.198 0.4-0.402l0.009-0.09-0.009-0.09C9.96 6.206 9.8 6.045 9.595 6.008L9.504 6H7V3.5L6.992 3.41C6.955 3.204 6.794 3.043 6.59 3.006L6.5 3z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="16dp" android:height="16dp" android:viewportWidth="16" android:viewportHeight="16">
|
||||
<path android:pathData="M5.96 4.457C5.722 3.18 6.7 2 8 2s2.279 1.18 2.04 2.457l-0.856 4.56C9.077 9.587 8.58 10 8 10S6.923 9.587 6.816 9.017L5.96 4.457zM9.5 12.5C9.5 13.328 8.828 14 8 14s-1.5-0.672-1.5-1.5S7.172 11 8 11s1.5 0.672 1.5 1.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||
<path android:pathData="M10 2C8.343 2 7 3.343 7 5c0 2.227 0.789 5.204 1.225 6.685C8.459 12.48 9.19 13 10 13c0.81 0 1.54-0.518 1.775-1.31C12.212 10.213 13 7.25 13 5c0-1.657-1.343-3-3-3zm0 12c-1.105 0-2 0.895-2 2s0.895 2 2 2 2-0.895 2-2-0.895-2-2-2z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2.002c-2.14 0-3.875 1.735-3.875 3.875 0 2.92 1.207 6.552 1.813 8.199 0.323 0.878 1.159 1.423 2.064 1.423 0.904 0 1.739-0.542 2.063-1.418 0.606-1.64 1.81-5.254 1.81-8.204 0-2.14-1.734-3.875-3.875-3.875zm0.001 14.999c-1.381 0-2.501 1.12-2.501 2.501 0 1.381 1.12 2.501 2.501 2.501 1.382 0 2.501-1.12 2.501-2.5 0-1.382-1.12-2.502-2.5-2.502z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2.002c-2.14 0-3.875 1.735-3.875 3.875 0 2.92 1.207 6.552 1.813 8.199 0.323 0.878 1.159 1.423 2.064 1.423 0.904 0 1.739-0.542 2.063-1.418 0.606-1.64 1.81-5.254 1.81-8.204 0-2.14-1.734-3.875-3.875-3.875zM9.625 5.877c0-1.312 1.063-2.375 2.375-2.375s2.376 1.063 2.376 2.375c0 2.654-1.112 6.043-1.718 7.684-0.096 0.258-0.35 0.438-0.655 0.438-0.308 0-0.562-0.18-0.657-0.44-0.607-1.652-1.721-5.058-1.721-7.682zm2.376 11.124c-1.381 0-2.501 1.12-2.501 2.501 0 1.381 1.12 2.501 2.501 2.501 1.382 0 2.501-1.12 2.501-2.5 0-1.382-1.12-2.502-2.5-2.502zM11 19.502c0-0.553 0.448-1.001 1.001-1.001 0.553 0 1.001 0.448 1.001 1.001 0 0.553-0.448 1.001-1 1.001-0.554 0-1.002-0.448-1.002-1z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M19 7.5c0 0.52-0.072 1.023-0.207 1.5h1.62C21.29 9 22 9.71 22 10.586V15.5c0 3.59-2.91 6.5-6.5 6.5-1.525 0-2.927-0.525-4.035-1.404L10.28 21.78c-0.292 0.293-0.767 0.293-1.06 0-0.293-0.293-0.293-0.767 0-1.06l1.184-1.185c-0.395-0.497-0.718-1.054-0.954-1.655C9.062 17.96 8.66 18 8.25 18c-3.314 0-6-2.686-6-6V7.514C2.25 6.678 2.928 6 3.764 6h4.443C8.86 3.692 10.982 2 13.5 2h4.06C18.354 2 19 2.645 19 3.44V7.5zM9.722 6.182c1.695 0.427 3.103 1.576 3.879 3.1C14.2 9.099 14.838 9 15.5 9h1.71c0.187-0.463 0.29-0.97 0.29-1.5v-4h-4c-1.747 0-3.233 1.12-3.778 2.682zm2.813 13.344c0.83 0.612 1.855 0.974 2.965 0.974 2.761 0 5-2.239 5-5v-4.914c0-0.047-0.039-0.086-0.086-0.086H15.5c-2.761 0-5 2.239-5 5 0 1.11 0.362 2.136 0.974 2.965l4.246-4.245c0.293-0.293 0.768-0.293 1.06 0 0.293 0.293 0.293 0.767 0 1.06l-4.245 4.246zM9 15.5c0-0.592 0.08-1.166 0.228-1.711L6.47 11.03c-0.293-0.293-0.293-0.767 0-1.06 0.293-0.293 0.767-0.293 1.06 0l2.318 2.317c0.566-0.994 1.388-1.824 2.375-2.402C11.466 8.466 9.971 7.5 8.25 7.5H3.759L3.754 7.505 3.751 7.509 3.75 7.514V12c0 2.485 2.015 4.5 4.5 4.5 0.278 0 0.551-0.025 0.816-0.074C9.021 16.124 9 15.815 9 15.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2.001c4.004 0 7.25 3.246 7.25 7.25 0 2.096-0.9 4.02-2.663 5.742-0.077 0.075-0.137 0.166-0.175 0.265l-0.032 0.103-1.13 4.895c-0.223 0.964-1.046 1.662-2.02 1.737L13.057 22h-2.114c-0.99 0-1.855-0.645-2.147-1.577l-0.045-0.167-1.13-4.895c-0.032-0.14-0.104-0.268-0.206-0.368-1.68-1.64-2.577-3.463-2.659-5.444L4.75 9.251l0.004-0.24C4.88 5.119 8.076 2.002 12 2.002zm2.115 16.498H9.884l0.329 1.42c0.07 0.305 0.323 0.531 0.627 0.573l0.103 0.008h2.114c0.314 0 0.591-0.196 0.7-0.483l0.03-0.099 0.328-1.419zM12 3.501c-3.102 0-5.63 2.456-5.746 5.53L6.25 9.25l0.007 0.277c0.076 1.563 0.8 3.02 2.206 4.392 0.264 0.258 0.46 0.576 0.571 0.926l0.049 0.178 0.455 1.975h4.923l0.458-1.976c0.083-0.36 0.253-0.692 0.493-0.97l0.127-0.133c1.404-1.373 2.128-2.828 2.204-4.392L17.75 9.25l-0.004-0.22C17.63 5.956 15.102 3.5 12 3.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M9.34 6.372l0.05 0.105 5.56 14.5c0.147 0.385-0.04 0.82-0.418 0.971-0.347 0.139-0.734-0.01-0.91-0.333l-0.043-0.092-1.433-3.737H5.06L4.965 17.78 3.42 21.54c-0.16 0.382-0.59 0.562-0.965 0.4-0.344-0.146-0.52-0.528-0.427-0.885l0.033-0.096 5.964-14.5c0.24-0.585 1.023-0.61 1.315-0.088zm9.406-4.37c0.38 0 0.693 0.283 0.743 0.65l0.007 0.1V7.5h1.75c0.38 0 0.693 0.283 0.743 0.649l0.007 0.102c0 0.38-0.282 0.693-0.648 0.743L21.245 9l-1.75-0.001v7.25c0 0.38-0.282 0.694-0.648 0.744L18.745 17c-0.38 0-0.694-0.282-0.743-0.648l-0.007-0.102V2.753c0-0.414 0.335-0.75 0.75-0.75zM8.81 8.748l-3.16 7.538h6.11L8.81 8.747zm1.937-6.744h5.498c0.38 0 0.693 0.282 0.743 0.648l0.006 0.102v3.004c0 2.344-1.9 4.245-4.245 4.245-0.414 0-0.75-0.336-0.75-0.75s0.336-0.75 0.75-0.75c1.46 0 2.654-1.14 2.74-2.578l0.005-0.167V3.503h-4.747c-0.414 0-0.75-0.336-0.75-0.75 0-0.38 0.282-0.694 0.648-0.743l0.102-0.007h5.498-5.498z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M5.843 4.568c3.4-3.4 8.913-3.4 12.314 0 3.4 3.4 3.4 8.914 0 12.314l-1.187 1.174c-0.875 0.858-2.01 1.962-3.406 3.312-0.872 0.843-2.256 0.843-3.128 0l-3.491-3.396c-0.44-0.431-0.806-0.794-1.102-1.09-3.4-3.4-3.4-8.914 0-12.314zm11.253 1.06c-2.815-2.814-7.378-2.814-10.192 0-2.815 2.815-2.815 7.379 0 10.193L8.39 17.29c0.82 0.801 1.849 1.801 3.089 3 0.29 0.282 0.752 0.282 1.042 0l3.395-3.3c0.47-0.461 0.863-0.85 1.18-1.168 2.815-2.814 2.815-7.378 0-10.192zM12 7.999c1.658-0.001 3 1.343 3 3.001s-1.343 3.002-3.001 3.002S8.998 12.658 8.998 11c0-1.658 1.344-3.002 3.002-3.002zm0 1.5c-0.83 0-1.502 0.673-1.502 1.502 0 0.83 0.673 1.502 1.502 1.502 0.83 0 1.501-0.673 1.501-1.502 0-0.83-0.672-1.502-1.501-1.502z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M9.203 4L9.25 3.997l0.046 0.001 0.068 0.008L9.38 4.01c0.085 0.014 0.17 0.044 0.25 0.092l0.053 0.034 5.07 3.565 5.067-3.562c0.468-0.329 1.102-0.033 1.174 0.51l0.007 0.104v10.632c0 0.21-0.087 0.408-0.238 0.548L20.683 16l-5.5 3.866c-0.267 0.188-0.588 0.172-0.828 0.023L9.25 16.297l-5.07 3.565c-0.467 0.329-1.101 0.033-1.174-0.51l-0.007-0.104V8.616c0-0.21 0.087-0.408 0.238-0.548l0.08-0.066 5.5-3.866c0.065-0.045 0.132-0.079 0.2-0.101L9.14 4.007l0.063-0.008zm10.298 2.197l-4 2.812v8.799l4-2.812v-8.8zM8.5 6.193l-4 2.812v8.8l4-2.813V6.193zm1.502 0v8.8l4 2.811V9.005l-4-2.812z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12.482 3.827c-1.113-0.824-2.696-0.091-2.788 1.29L9.535 7.5h2.715C12.664 7.5 13 7.835 13 8.25 13 8.664 12.664 9 12.25 9H9.435l-0.6 9.006c-0.18 2.685-3.358 4.002-5.383 2.23l-0.196-0.172c-0.312-0.273-0.343-0.746-0.07-1.058 0.272-0.312 0.746-0.343 1.058-0.07l0.195 0.17c1.091 0.955 2.803 0.246 2.899-1.2L7.932 9H5.75C5.336 9 5 8.664 5 8.25 5 7.835 5.336 7.5 5.75 7.5h2.282l0.165-2.483c0.171-2.565 3.112-3.926 5.178-2.395l0.371 0.275c0.333 0.247 0.403 0.716 0.157 1.05-0.247 0.332-0.717 0.402-1.05 0.155l-0.371-0.275zm1.23 8.936c-0.224-0.426-0.786-0.533-1.152-0.22l-0.322 0.276c-0.314 0.27-0.788 0.233-1.057-0.081-0.27-0.315-0.234-0.788 0.08-1.058l0.323-0.276c1.097-0.94 2.783-0.618 3.456 0.66l0.977 1.858 2.703-2.703c0.293-0.292 0.767-0.292 1.06 0 0.293 0.293 0.293 0.768 0 1.061l-3.031 3.032 1.539 2.924c0.224 0.427 0.786 0.534 1.152 0.22l0.322-0.276c0.314-0.27 0.788-0.233 1.058 0.082 0.269 0.314 0.233 0.788-0.082 1.057l-0.322 0.276c-1.097 0.94-2.783 0.618-3.456-0.66l-1.322-2.513-3.358 3.358c-0.292 0.293-0.767 0.293-1.06 0-0.293-0.293-0.293-0.768 0-1.06l3.687-3.687-1.195-2.27z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M17.212 2.237c0.13-0.393-0.082-0.817-0.474-0.948-0.393-0.131-0.818 0.081-0.95 0.474l-0.75 2.249c-0.13 0.393 0.082 0.818 0.475 0.949 0.393 0.13 0.818-0.082 0.949-0.474l0.75-2.25zM21.78 2.22c0.293 0.293 0.293 0.768 0 1.06l-2.5 2.5c-0.293 0.293-0.767 0.293-1.06 0-0.293-0.292-0.293-0.767 0-1.06l2.5-2.5c0.293-0.293 0.767-0.293 1.06 0zM9.076 4.318c0.71-1.473 2.679-1.772 3.795-0.577l7.006 7.506c1.09 1.169 0.704 3.065-0.758 3.712l-3.42 1.516C15.893 16.945 16 17.46 16 18c0 2.21-1.79 4-4 4-1.595 0-2.973-0.934-3.614-2.285l-1.418 0.628c-0.663 0.294-1.437 0.161-1.964-0.336L3.565 18.65c-0.57-0.538-0.727-1.384-0.386-2.091l5.897-12.24zm0.682 14.789C10.166 19.932 11.017 20.5 12 20.5c1.381 0 2.5-1.12 2.5-2.5 0-0.324-0.061-0.633-0.173-0.917l-4.57 2.024zm2.016-14.342C11.378 4.34 10.68 4.447 10.428 4.97L4.53 17.21c-0.057 0.118-0.03 0.26 0.064 0.35l1.439 1.356c0.088 0.083 0.217 0.105 0.327 0.056l12.151-5.383c0.52-0.23 0.657-0.903 0.27-1.317l-7.007-7.506zM19 8.249c0-0.414 0.336-0.75 0.75-0.75h2c0.414 0 0.75 0.336 0.75 0.75C22.5 8.664 22.164 9 21.75 9h-2C19.336 9 19 8.664 19 8.25z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M18.25 11c0.38 0 0.694 0.282 0.743 0.648L19 11.75v0.5c0 3.56-2.755 6.475-6.249 6.732L12.75 21.25c0 0.414-0.336 0.75-0.75 0.75-0.38 0-0.694-0.282-0.743-0.648L11.25 21.25v-2.268c-3.417-0.25-6.127-3.044-6.246-6.496L5 12.25v-0.5C5 11.336 5.336 11 5.75 11c0.38 0 0.694 0.282 0.743 0.648L6.5 11.75v0.5c0 2.827 2.235 5.132 5.034 5.246L11.75 17.5h0.5c2.827 0 5.132-2.234 5.246-5.034L17.5 12.25v-0.5c0-0.414 0.336-0.75 0.75-0.75zM12 2c2.21 0 4 1.79 4 4v6c0 2.21-1.79 4-4 4s-4-1.79-4-4V6c0-2.21 1.79-4 4-4zm0 1.5c-1.38 0-2.5 1.12-2.5 2.5v6c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V6c0-1.38-1.12-2.5-2.5-2.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M8 2.75C8 2.336 8.336 2 8.75 2h1.5C10.664 2 11 2.336 11 2.75V3h1.25C12.664 3 13 3.336 13 3.75v1.785c0.008 0 0.017 0 0.025 0.002 2.112 0.199 4.065 1.204 5.456 2.805 1.39 1.602 2.11 3.678 2.01 5.796-0.1 2.119-1.012 4.117-2.546 5.581-0.3 0.285-0.617 0.546-0.951 0.781h3.256c0.414 0 0.75 0.336 0.75 0.75S20.664 22 20.25 22H3.75C3.336 22 3 21.664 3 21.25s0.336-0.75 0.75-0.75h8.527c1.725-0.007 3.383-0.674 4.632-1.866 1.256-1.198 2.002-2.833 2.084-4.566 0.081-1.734-0.508-3.432-1.645-4.742C16.236 8.044 14.683 7.23 13 7.042v5.208c0 0.414-0.336 0.75-0.75 0.75H11.5v1c0 1.105-0.895 2-2 2s-2-0.895-2-2v-1H6.75C6.336 13 6 12.664 6 12.25v-8.5C6 3.336 6.336 3 6.75 3H8V2.75zM9 13v1c0 0.276 0.224 0.5 0.5 0.5S10 14.276 10 14v-1H9zm-1.5-1.5h4v-7h-4v7zm-1.75 6C5.336 17.5 5 17.836 5 18.25S5.336 19 5.75 19h7.5c0.414 0 0.75-0.336 0.75-0.75s-0.336-0.75-0.75-0.75h-7.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M21.25 4.002c0.38 0 0.694 0.282 0.743 0.648L22 4.752v14.5c0 0.38-0.282 0.693-0.648 0.743l-0.102 0.007H2.75c-0.38 0-0.693-0.282-0.743-0.648L2 19.252v-14.5c0-0.38 0.282-0.693 0.648-0.743L2.75 4.002h18.5zM6 12.5H3.5v6h17v-6H18v3.749c0 0.414-0.336 0.75-0.75 0.75-0.38 0-0.694-0.282-0.743-0.648L16.5 16.25V12.5h-2v3.749c0 0.414-0.336 0.75-0.75 0.75-0.38 0-0.694-0.282-0.743-0.648L13 16.25V12.5h-2v3.749c0 0.414-0.336 0.75-0.75 0.75-0.38 0-0.694-0.282-0.743-0.648L9.5 16.25V12.5h-2v3.749C7.5 16.664 7.164 17 6.75 17c-0.38 0-0.694-0.282-0.743-0.648L6 16.25V12.5zm14.5-7h-17V11h17V5.5zm-11.25 2C9.664 7.5 10 7.837 10 8.25 10 8.665 9.664 9 9.25 9S8.5 8.667 8.5 8.252c0-0.413 0.336-0.75 0.75-0.75zm8 0C17.664 7.5 18 7.837 18 8.25c0 0.38-0.282 0.693-0.648 0.743L17.25 9.001h-2.5C14.336 9 14 8.665 14 8.25c0-0.38 0.282-0.694 0.648-0.743L14.75 7.5h2.5zm-11 0C6.664 7.5 7 7.836 7 8.25S6.664 9 6.25 9 5.5 8.664 5.5 8.25 5.836 7.5 6.25 7.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M19.729 3.917l0.05 0.16 0.552 1.922c0.105 0.365-0.08 0.745-0.418 0.893l-0.096 0.035L9.09 10.002h11.16c0.379 0 0.693 0.283 0.742 0.65l0.007 0.1v8.499c0 1.462-1.141 2.658-2.582 2.745L18.249 22H5.75c-1.462 0-2.658-1.142-2.745-2.582L3 19.25v-8.392l-0.522-1.82c-0.403-1.406 0.365-2.87 1.726-3.35l0.16-0.052 12.014-3.445c1.406-0.403 2.87 0.365 3.35 1.726zm-0.23 7.585H4.5v7.749c0 0.604 0.429 1.108 0.998 1.224l0.124 0.02L5.75 20.5h12.5c0.646 0 1.179-0.492 1.243-1.122l0.006-0.128v-7.749zM6.272 6.649L4.777 7.08C4.155 7.256 3.78 7.875 3.891 8.498l0.03 0.125 0.344 1.201L4.56 9.74l1.713-3.09zm4.756-1.364l-2.717 0.78-1.714 3.09 2.718-0.778 1.713-3.092zm4.758-1.364l-2.718 0.78-1.713 3.09 2.716-0.778 1.715-3.092zm1.847-0.233l-1.521 2.74 2.569-0.737-0.344-1.2c-0.107-0.375-0.373-0.66-0.704-0.803z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M19.698 2.148C19.888 2.29 20 2.513 20 2.75v13.5c0 0.027-0.001 0.053-0.004 0.079C19.999 16.386 20 16.443 20 16.5c0 1.933-1.567 3.5-3.5 3.5S13 18.433 13 16.5s1.567-3.5 3.5-3.5c0.744 0 1.433 0.232 2 0.627V7.758l-8.5 2.55v7.942c0 0.027-0.001 0.053-0.004 0.079C9.999 18.386 10 18.443 10 18.5c0 1.933-1.567 3.5-3.5 3.5S3 20.433 3 18.5 4.567 15 6.5 15c0.744 0 1.433 0.232 2 0.627V5.75c0-0.331 0.217-0.623 0.534-0.718l10-3c0.228-0.069 0.474-0.025 0.664 0.116zM10 8.742l8.5-2.55V3.758L10 6.308v2.434zM6.5 16.5c-1.105 0-2 0.895-2 2s0.895 2 2 2 2-0.895 2-2-0.895-2-2-2zm8 0c0 1.105 0.895 2 2 2s2-0.895 2-2-0.895-2-2-2-2 0.895-2 2z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M18.75 20H5.25c-1.733 0-3.15-1.357-3.245-3.066L2 16.75V6.25c0-1.19 0.925-2.166 2.096-2.245L4.25 4h12.5c1.19 0 2.166 0.925 2.245 2.096L19 6.25V7h0.75c1.19 0 2.166 0.925 2.245 2.096L22 9.25v7.5c0 1.733-1.357 3.15-3.066 3.245L18.75 20H5.25h13.5zm-13.5-1.5h13.5c0.918 0 1.671-0.707 1.744-1.607L20.5 16.75v-7.5c0-0.38-0.282-0.694-0.648-0.743L19.75 8.5H19v7.75c0 0.38-0.282 0.694-0.648 0.743L18.25 17c-0.38 0-0.694-0.282-0.743-0.648L17.5 16.25v-10c0-0.38-0.282-0.694-0.648-0.743L16.75 5.5H4.25c-0.38 0-0.693 0.282-0.743 0.648L3.5 6.25v10.5c0 0.918 0.707 1.671 1.606 1.744L5.25 18.5h13.5-13.5zm6.996-4h3.006c0.414 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.743L15.252 16h-3.006c-0.414 0-0.75-0.336-0.75-0.75 0-0.38 0.282-0.694 0.648-0.743l0.102-0.007h3.006-3.006zm-3.003-3.495c0.415 0 0.75 0.335 0.75 0.75v3.495c0 0.414-0.335 0.75-0.75 0.75H5.748c-0.415 0-0.75-0.336-0.75-0.75v-3.495c0-0.415 0.335-0.75 0.75-0.75h3.495zm-0.75 1.5H6.498V14.5h1.995v-1.995zm3.753-1.5h3.006c0.414 0 0.75 0.335 0.75 0.75 0 0.38-0.282 0.693-0.648 0.743l-0.102 0.007h-3.006c-0.414 0-0.75-0.336-0.75-0.75 0-0.38 0.282-0.694 0.648-0.744l0.102-0.006h3.006-3.006zM5.748 7.502h9.504c0.414 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.744l-0.102 0.006H5.748c-0.415 0-0.75-0.335-0.75-0.75 0-0.38 0.282-0.693 0.648-0.743l0.102-0.006h9.504-9.504z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||
<path android:pathData="M8.99 2.877C9.06 2.47 8.784 2.081 8.376 2.011 7.97 1.941 7.581 2.215 7.511 2.623l-0.668 3.88L3.75 6.504C3.335 6.504 3 6.84 3 7.254c0 0.415 0.336 0.75 0.75 0.75l2.835-0.001-0.688 3.996L2.75 12C2.335 12 2 12.336 2 12.75c0 0.415 0.336 0.75 0.75 0.75h2.888l-0.623 3.624c-0.07 0.408 0.203 0.796 0.612 0.866 0.408 0.07 0.796-0.203 0.866-0.612l0.668-3.879 4.477-0.002-0.625 3.627c-0.07 0.408 0.204 0.796 0.612 0.866 0.408 0.07 0.796-0.203 0.867-0.611l0.668-3.883 3.094-0.001c0.414 0 0.75-0.336 0.75-0.75 0-0.415-0.337-0.75-0.75-0.75l-2.835 0.001L14.107 8l3.143-0.001c0.415 0 0.75-0.336 0.75-0.75 0-0.415-0.336-0.75-0.75-0.75L14.365 6.5l0.624-3.621c0.07-0.409-0.204-0.797-0.612-0.867-0.408-0.07-0.796 0.204-0.866 0.612L12.843 6.5 8.365 6.502 8.99 2.877zM8.106 8.002L12.585 8l-0.689 3.996-4.477 0.002 0.688-3.996z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M2.5 6.75C2.5 5.231 3.731 4 5.25 4h15C20.664 4 21 4.336 21 4.75S20.664 5.5 20.25 5.5H17v11.453c0 1.21 1.199 2.055 2.339 1.648l0.159-0.057c0.39-0.14 0.819 0.064 0.958 0.454 0.14 0.39-0.064 0.819-0.454 0.958l-0.159 0.057C17.727 20.77 15.5 19.2 15.5 16.953V5.5H9.494C9.49 5.74 9.482 6.06 9.468 6.444c-0.031 0.897-0.095 2.153-0.22 3.59-0.252 2.862-0.759 6.498-1.79 9.462-0.136 0.392-0.563 0.598-0.954 0.462-0.392-0.136-0.598-0.563-0.462-0.954 0.969-2.787 1.462-6.275 1.71-9.1 0.125-1.407 0.186-2.636 0.217-3.512C7.982 6.03 7.99 5.729 7.994 5.5H5.25C4.56 5.5 4 6.06 4 6.75v0.5C4 7.664 3.664 8 3.25 8S2.5 7.664 2.5 7.25v-0.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M21.068 7.758l-4.826-4.826c-1.327-1.327-3.564-0.964-4.404 0.715l-2.435 4.87c-0.088 0.176-0.24 0.31-0.426 0.374l-4.166 1.44c-0.873 0.3-1.129 1.412-0.476 2.065L7.439 15.5 3 19.94V21h1.06l4.44-4.44 3.104 3.105c0.653 0.653 1.764 0.397 2.066-0.476l1.44-4.166c0.063-0.185 0.197-0.338 0.373-0.426l4.87-2.435c1.68-0.84 2.042-3.077 0.715-4.404z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm3.25 12.332l-0.039 0.072-0.063 0.091-4.757 5.853C10.912 20.448 11.45 20.5 12 20.5c2.171 0 4.152-0.814 5.654-2.153l-2.084-4.54c-0.093 0.183-0.2 0.359-0.32 0.525zM4.49 15.985c0.937 1.762 2.475 3.154 4.34 3.904L11.992 16l-0.19-0.005-0.132-0.008-7.179-0.002zm15.64-6.473h-4.998c0.082 0.102 0.159 0.21 0.23 0.32 0.024 0.027 0.047 0.057 0.067 0.089l0.049 0.09 0.039 0.082c0.086 0.158 0.162 0.323 0.226 0.493l3.016 6.57C19.85 15.725 20.5 13.937 20.5 12c0-0.866-0.13-1.701-0.37-2.488zM3.5 12c0 0.865 0.13 1.7 0.37 2.486h4.996c-0.082-0.103-0.158-0.21-0.23-0.32l-0.135-0.223-3.614-6.597C4.01 8.681 3.5 10.282 3.5 12zm6.52-1.526l-0.044 0.071c-0.022 0.035-0.047 0.066-0.073 0.096C9.648 11.03 9.5 11.499 9.5 12c0 1.294 0.983 2.359 2.244 2.487h0.512C13.516 14.359 14.5 13.294 14.5 12c0-1.302-0.995-2.37-2.265-2.49l-0.373 0.003-0.058-0.005c-0.726 0.056-1.364 0.422-1.784 0.966zM12 3.5c-2.391 0-4.552 0.987-6.097 2.577l2.402 4.387c0.127-0.304 0.29-0.59 0.485-0.851l3.904-6.085C12.465 3.509 12.234 3.5 12 3.5zm-0.406 4.52C11.728 8.007 11.863 8 12 8c0.103 0 0.204 0.004 0.305 0.011l7.204 0.002c-1.033-1.941-2.797-3.434-4.924-4.113l-0.292-0.087-2.699 4.207z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M6.25 3C4.455 3 3 4.455 3 6.25v2.12c0 0.414 0.336 0.75 0.75 0.75S4.5 8.784 4.5 8.37V6.25c0-0.966 0.784-1.75 1.75-1.75h2.12c0.414 0 0.75-0.336 0.75-0.75S8.784 3 8.37 3H6.25zm9.38 1.5c-0.414 0-0.75-0.336-0.75-0.75S15.216 3 15.63 3h2.12C19.545 3 21 4.455 21 6.25v2.12c0 0.414-0.336 0.75-0.75 0.75S19.5 8.784 19.5 8.37V6.25c0-0.966-0.784-1.75-1.75-1.75h-2.12zM3 15.63c0-0.414 0.336-0.75 0.75-0.75s0.75 0.336 0.75 0.75v2.12c0 0.906 0.689 1.651 1.571 1.741C6.13 19.497 6.19 19.5 6.25 19.5h2.12c0.414 0 0.75 0.336 0.75 0.75S8.784 21 8.37 21H6.25C4.455 21 3 19.545 3 17.75v-2.12zm16.5 0c0-0.414 0.336-0.75 0.75-0.75S21 15.216 21 15.63v2.12c0 1.683-1.279 3.067-2.918 3.233C17.973 20.994 17.862 21 17.75 21h-2.12c-0.414 0-0.75-0.336-0.75-0.75s0.336-0.75 0.75-0.75h2.12c0.906 0 1.651-0.689 1.741-1.571 0.006-0.059 0.009-0.119 0.009-0.179v-2.12zM7 7.75C7 7.336 7.336 7 7.75 7h8.5C16.664 7 17 7.336 17 7.75S16.664 8.5 16.25 8.5h-8.5C7.336 8.5 7 8.164 7 7.75zM7.75 11C7.336 11 7 11.336 7 11.75s0.336 0.75 0.75 0.75h8.5c0.414 0 0.75-0.336 0.75-0.75S16.664 11 16.25 11h-8.5zM7 15.75C7 15.336 7.336 15 7.75 15h4.5c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-4.5C7.336 16.5 7 16.164 7 15.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user