Compare commits
191 Commits
v1.1.5+for
...
v1.1.5+for
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1053d2ac0c | ||
|
|
0123b17602 | ||
|
|
1dace6ead9 | ||
|
|
3287cf69c1 | ||
|
|
a2854524a9 | ||
|
|
71c06c0762 | ||
|
|
e30df6067d | ||
|
|
912a354b1c | ||
|
|
71f830ea82 | ||
|
|
bd109a9139 | ||
|
|
c82b4445ff | ||
|
|
9a7d149dae | ||
|
|
c66e576461 | ||
|
|
2a47d2fe77 | ||
|
|
331d490f4f | ||
|
|
8d722a2130 | ||
|
|
6863363452 | ||
|
|
10e66a58eb | ||
|
|
3a5c27eadc | ||
|
|
8c6bce4f73 | ||
|
|
17e1cd1fe9 | ||
|
|
d7aceffc8f | ||
|
|
bcb3e217cd | ||
|
|
229c19664c | ||
|
|
8bdbb2adef | ||
|
|
907c5a2ca1 | ||
|
|
2a2bfebf48 | ||
|
|
eba59549ec | ||
|
|
9478a71693 | ||
|
|
b01d7a417a | ||
|
|
80c77292ed | ||
|
|
488e6dda04 | ||
|
|
689f676668 | ||
|
|
a06db9a3ab | ||
|
|
a7283cbed8 | ||
|
|
bc70d5e212 | ||
|
|
441686740a | ||
|
|
ac0df083f2 | ||
|
|
e10762d5fa | ||
|
|
0ca4663c29 | ||
|
|
7efd9341b1 | ||
|
|
3d8693b2bd | ||
|
|
a3b5f3c926 | ||
|
|
f9f4a1d1ef | ||
|
|
dd536002d0 | ||
|
|
4f8e381c84 | ||
|
|
3b6b212c9e | ||
|
|
bf429ee263 | ||
|
|
e7b1301b71 | ||
|
|
6726e9523c | ||
|
|
3ffcc7cef2 | ||
|
|
e6232f6d3b | ||
|
|
5efc431192 | ||
|
|
c3b75782b1 | ||
|
|
ec6f3f0cc3 | ||
|
|
136c3cfb4a | ||
|
|
79d1dbd3b7 | ||
|
|
f2e1663c41 | ||
|
|
5c73f37599 | ||
|
|
7f239abf2f | ||
|
|
a07f7c232a | ||
|
|
4a60a5190f | ||
|
|
69986fd869 | ||
|
|
e2ca572d45 | ||
|
|
746e41fdbc | ||
|
|
091f1f1e8c | ||
|
|
844ec185a6 | ||
|
|
5622eaed83 | ||
|
|
dbf25da1db | ||
|
|
d35a416084 | ||
|
|
098acb85e4 | ||
|
|
9d67337913 | ||
|
|
914861775a | ||
|
|
c12a6eaee6 | ||
|
|
5de23581fe | ||
|
|
413141df1e | ||
|
|
5f48870a90 | ||
|
|
86e781cdea | ||
|
|
34ebd9219f | ||
|
|
41688c4670 | ||
|
|
0d30cd973e | ||
|
|
5ed80ca40a | ||
|
|
78958085c3 | ||
|
|
a1798b6666 | ||
|
|
baa7dd6302 | ||
|
|
ba93e5bac3 | ||
|
|
2358d3c602 | ||
|
|
cf61626901 | ||
|
|
349a1115a6 | ||
|
|
8fa4980ba5 | ||
|
|
099d0ccf94 | ||
|
|
35a1de7888 | ||
|
|
6fc850b5ba | ||
|
|
96f13defd4 | ||
|
|
36dd07aa38 | ||
|
|
6a831539ad | ||
|
|
c679f5529e | ||
|
|
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 | ||
|
|
87c743886e | ||
|
|
f3cde5441b | ||
|
|
7a9534772d | ||
|
|
42faa62a5f | ||
|
|
924affee14 | ||
|
|
0c5da34cd6 | ||
|
|
b44e6b9f0a | ||
|
|
9d3369f601 | ||
|
|
f607ed314d | ||
|
|
2cdf642ca3 | ||
|
|
5d278eb5aa | ||
|
|
860c2826e3 | ||
|
|
3060c36cca | ||
|
|
a1b0632c75 | ||
|
|
14cbb1107f | ||
|
|
dd5f352f5e | ||
|
|
d148883ab2 | ||
|
|
cfa93424cc | ||
|
|
ff575f75c7 | ||
|
|
6fec7a5205 | ||
|
|
0693495e12 | ||
|
|
04381d57f2 | ||
|
|
9f4adcab23 | ||
|
|
00dba5981c | ||
|
|
ae838fe4d7 |
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.
|
||||
|
||||
@@ -152,6 +152,8 @@ There's also a handful of custom strings exclusive to this projects that would n
|
||||
* [Display server announcements](https://github.com/sk22/megalodon/commit/84179bc207d6b69cc2a770a3c28fa0a39b0b54e8)
|
||||
* [Create](https://github.com/sk22/megalodon/commit/294595513a45037359b31377aafc25ae5b58d8e7), [edit](https://github.com/sk22/megalodon/commit/d47797bf7ac8cff3f9ba1cfee219a1bb2af21da6) and [delete](https://github.com/sk22/megalodon/commit/54c29fd787fc2cd0dfd2787ad796b8190f795973) lists
|
||||
* [Soft-blocking (by blocking and immediately unblocking)](https://github.com/sk22/megalodon/commit/e75d350b7a2709259e9fc5138e0e1f361bdb0972)
|
||||
* [Pinnable custom timelines](https://github.com/sk22/megalodon/pull/338/commits)
|
||||
* Support for local-only posts
|
||||
|
||||
|
||||
### Behavior
|
||||
@@ -175,6 +177,8 @@ There's also a handful of custom strings exclusive to this projects that would n
|
||||
* [Preserve whitespaces in HTML](https://github.com/sk22/megalodon/commit/7d876bddc7a07d98f0fecbf62b13bdb9fcce3412)
|
||||
* [Long-click to copy links](https://github.com/sk22/megalodon/commit/b32e32274923a94742a9926ef38785f746d41405)
|
||||
* Improved filtering using Mastodon 4.0 API: [#202](https://github.com/sk22/megalodon/pull/202), [#212](https://github.com/sk22/megalodon/pull/212), [#255](https://github.com/sk22/megalodon/pull/255) by [@thiagojedi](https://github.com/thiagojedi)
|
||||
* [Support admin notifications](https://github.com/sk22/megalodon/commit/c12a6eaee6b609bc53eb0a45d9199f37d5241801) and [notifications for edited reblogged posts](https://github.com/sk22/megalodon/commit/900e8fb2e9353002c16d15e06b78d2731e121601)
|
||||
* [Android file opener added back in addition to image picker](https://github.com/sk22/megalodon/commit/3a6ace53d5ab01e28077c9c930cb6ed487b78031)
|
||||
|
||||
|
||||
### Visual
|
||||
@@ -190,6 +194,8 @@ There's also a handful of custom strings exclusive to this projects that would n
|
||||
* [Animations for interaction buttons](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/animate-buttons)
|
||||
* [Dedicated icons for different notification types](https://github.com/sk22/megalodon/pull/178) by [@florian-obernberger](https://github.com/florian-obernberger)
|
||||
* Scale text according to system settings
|
||||
* Header in timeline for followed hashtags
|
||||
* [Indicator for missing alt texts](https://github.com/sk22/megalodon/commit/c0c276f03e793b78c478c17dfdef24a66ef7cedb)
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
@@ -9,8 +9,8 @@ android {
|
||||
applicationId "org.joinmastodon.android.sk"
|
||||
minSdk 23
|
||||
targetSdk 33
|
||||
versionCode 69
|
||||
versionName "1.1.5+fork.69"
|
||||
versionCode 73
|
||||
versionName "1.1.5+fork.73"
|
||||
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
|
||||
|
||||
|
@@ -12,8 +12,10 @@ import org.joinmastodon.android.model.TimelineDefinition;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class GlobalUserPreferences{
|
||||
public static boolean playGifs;
|
||||
@@ -22,6 +24,7 @@ public class GlobalUserPreferences{
|
||||
public static boolean showReplies;
|
||||
public static boolean showBoosts;
|
||||
public static boolean loadNewPosts;
|
||||
public static boolean showNewPostsButton;
|
||||
public static boolean showInteractionCounts;
|
||||
public static boolean alwaysExpandContentWarnings;
|
||||
public static boolean disableMarquee;
|
||||
@@ -33,6 +36,9 @@ public class GlobalUserPreferences{
|
||||
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;
|
||||
@@ -41,6 +47,8 @@ public class GlobalUserPreferences{
|
||||
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;
|
||||
public static Set<String> accountsWithLocalOnlySupport;
|
||||
public static Set<String> accountsInGlitchMode;
|
||||
|
||||
private static SharedPreferences getPrefs(){
|
||||
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
||||
@@ -60,6 +68,7 @@ public class GlobalUserPreferences{
|
||||
showReplies=prefs.getBoolean("showReplies", true);
|
||||
showBoosts=prefs.getBoolean("showBoosts", true);
|
||||
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
||||
showNewPostsButton=prefs.getBoolean("showNewPostsButton", true);
|
||||
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
||||
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
||||
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
||||
@@ -71,10 +80,15 @@ public class GlobalUserPreferences{
|
||||
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", null), recentLanguagesType, new HashMap<>());
|
||||
pinnedTimelines=fromJson(prefs.getString("pinnedTimelines", null), pinnedTimelinesType, new HashMap<>());
|
||||
accountsWithLocalOnlySupport=prefs.getStringSet("accountsWithLocalOnlySupport", new HashSet<>());
|
||||
accountsInGlitchMode=prefs.getStringSet("accountsInGlitchMode", new HashSet<>());
|
||||
|
||||
try {
|
||||
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.PINK.name()));
|
||||
@@ -91,6 +105,7 @@ public class GlobalUserPreferences{
|
||||
.putBoolean("showReplies", showReplies)
|
||||
.putBoolean("showBoosts", showBoosts)
|
||||
.putBoolean("loadNewPosts", loadNewPosts)
|
||||
.putBoolean("showNewPostsButton", showNewPostsButton)
|
||||
.putBoolean("trueBlackTheme", trueBlackTheme)
|
||||
.putBoolean("showInteractionCounts", showInteractionCounts)
|
||||
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
||||
@@ -102,11 +117,16 @@ public class GlobalUserPreferences{
|
||||
.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))
|
||||
.putStringSet("accountsWithLocalOnlySupport", accountsWithLocalOnlySupport)
|
||||
.putStringSet("accountsInGlitchMode", accountsInGlitchMode)
|
||||
.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,18 @@ 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;
|
||||
case REPORT -> R.drawable.ic_fluent_warning_24_filled;
|
||||
case SIGN_UP -> R.drawable.ic_fluent_person_available_24_filled;
|
||||
});
|
||||
}
|
||||
|
||||
if(avatar!=null){
|
||||
|
||||
@@ -39,6 +39,7 @@ public class CreateStatus extends MastodonAPIRequest<Status>{
|
||||
public Poll poll;
|
||||
public String inReplyToId;
|
||||
public boolean sensitive;
|
||||
public boolean localOnly;
|
||||
public String spoilerText;
|
||||
public StatusPrivacy visibility;
|
||||
public Instant scheduledAt;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -56,8 +56,7 @@ public class AccountTimelineFragment extends StatusListFragment{
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Status> result){
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if(getActivity()==null) return;
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
|
||||
@@ -97,11 +92,13 @@ public class AnnouncementsFragment extends BaseStatusListFragment<Announcement>
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Announcement> result){
|
||||
if (getActivity() == null) return;
|
||||
List<Announcement> unread = result.stream().filter(a -> !a.read).collect(toList());
|
||||
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);
|
||||
|
||||
@@ -25,6 +25,7 @@ public class BookmarkedStatusListFragment extends StatusListFragment{
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Status> result){
|
||||
if (getActivity() == null) return;
|
||||
if(result.nextPageUri!=null)
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
|
||||
@@ -151,6 +151,8 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
private static final int IMAGE_DESCRIPTION_RESULT=363;
|
||||
private static final int SCHEDULED_STATUS_OPENED_RESULT=161;
|
||||
private static final int MAX_ATTACHMENTS=4;
|
||||
private static final String GLITCH_LOCAL_ONLY_SUFFIX = "👁";
|
||||
private static final Pattern GLITCH_LOCAL_ONLY_PATTERN = Pattern.compile("[\\s\\S]*" + GLITCH_LOCAL_ONLY_SUFFIX + "[\uFE00-\uFE0F]*");
|
||||
private static final String TAG="ComposeFragment";
|
||||
|
||||
private static final Pattern MENTION_PATTERN=Pattern.compile("(^|[^\\/\\w])@(([a-z0-9_]+)@[a-z0-9\\.\\-]+[a-z0-9]+)", Pattern.CASE_INSENSITIVE);
|
||||
@@ -163,7 +165,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
private final BreakIterator breakIterator=BreakIterator.getCharacterInstance();
|
||||
|
||||
private SizeListenerLinearLayout contentView;
|
||||
private TextView selfName, selfUsername;
|
||||
private TextView selfName, selfUsername, selfExtraText, extraText;
|
||||
private ImageView selfAvatar;
|
||||
private Account self;
|
||||
private String instanceDomain;
|
||||
@@ -212,6 +214,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
private View sendingOverlay;
|
||||
private WindowManager wm;
|
||||
private StatusPrivacy statusVisibility=StatusPrivacy.PUBLIC;
|
||||
private boolean localOnly;
|
||||
private ComposeAutocompleteSpan currentAutocompleteSpan;
|
||||
private FrameLayout mainEditTextWrap;
|
||||
private ComposeAutocompleteViewController autocompleteViewController;
|
||||
@@ -242,9 +245,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
instance=AccountSessionManager.getInstance().getInstanceInfo(instanceDomain);
|
||||
languageResolver=new MastodonLanguage.LanguageResolver(instance);
|
||||
redraftStatus=getArguments().getBoolean("redraftStatus", false);
|
||||
if(getArguments().containsKey("editStatus")){
|
||||
if(getArguments().containsKey("editStatus"))
|
||||
editingStatus=Parcels.unwrap(getArguments().getParcelable("editStatus"));
|
||||
}
|
||||
if(getArguments().containsKey("replyTo"))
|
||||
replyTo=Parcels.unwrap(getArguments().getParcelable("replyTo"));
|
||||
if(instance==null){
|
||||
Nav.finish(this);
|
||||
return;
|
||||
@@ -302,6 +306,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
selfName=view.findViewById(R.id.self_name);
|
||||
selfUsername=view.findViewById(R.id.self_username);
|
||||
selfAvatar=view.findViewById(R.id.self_avatar);
|
||||
selfExtraText=view.findViewById(R.id.self_extra_text);
|
||||
HtmlParser.setTextWithCustomEmoji(selfName, self.displayName, self.emojis);
|
||||
selfUsername.setText('@'+self.username+'@'+instanceDomain);
|
||||
ViewImageLoader.load(selfAvatar, null, new UrlImageLoaderRequest(self.avatar));
|
||||
@@ -327,10 +332,26 @@ 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());
|
||||
|
||||
localOnly = savedInstanceState != null ? savedInstanceState.getBoolean("localOnly") :
|
||||
editingStatus != null ? editingStatus.localOnly : replyTo != null && replyTo.localOnly;
|
||||
|
||||
buildVisibilityPopup(visibilityBtn);
|
||||
visibilityBtn.setOnClickListener(v->visibilityPopup.show());
|
||||
visibilityBtn.setOnTouchListener(visibilityPopup.getDragToOpenListener());
|
||||
@@ -405,6 +426,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)){
|
||||
@@ -448,7 +470,9 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
case UNLISTED -> R.id.vis_unlisted;
|
||||
case PRIVATE -> R.id.vis_followers;
|
||||
case DIRECT -> R.id.vis_private;
|
||||
case LOCAL -> R.id.vis_local;
|
||||
}).setChecked(true);
|
||||
visibilityPopup.getMenu().findItem(R.id.local_only).setChecked(localOnly);
|
||||
|
||||
autocompleteViewController=new ComposeAutocompleteViewController(getActivity(), accountID);
|
||||
autocompleteViewController.setCompletionSelectedListener(this::onAutocompleteOptionSelected);
|
||||
@@ -475,6 +499,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
outState.putBoolean("pollAllowMultiple", pollAllowMultipleItem.isSelected());
|
||||
}
|
||||
outState.putBoolean("sensitive", sensitive);
|
||||
outState.putBoolean("localOnly", localOnly);
|
||||
outState.putBoolean("hasSpoiler", hasSpoiler);
|
||||
outState.putString("language", language);
|
||||
if(!attachments.isEmpty()){
|
||||
@@ -598,6 +623,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
}
|
||||
});
|
||||
View originalPost = view.findViewById(R.id.original_post);
|
||||
extraText = view.findViewById(R.id.extra_text);
|
||||
originalPost.setVisibility(View.VISIBLE);
|
||||
originalPost.setOnClickListener(v->{
|
||||
Bundle args=new Bundle();
|
||||
@@ -630,9 +656,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
view.findViewById(R.id.visibility).setVisibility(View.GONE);
|
||||
Drawable visibilityIcon = getActivity().getDrawable(switch(replyTo.visibility){
|
||||
case PUBLIC -> R.drawable.ic_fluent_earth_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_people_community_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_people_checkmark_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled;
|
||||
case DIRECT -> R.drawable.ic_fluent_mention_20_regular;
|
||||
case LOCAL -> R.drawable.ic_fluent_eye_20_regular;
|
||||
});
|
||||
ImageView moreBtn = view.findViewById(R.id.more);
|
||||
moreBtn.setImageDrawable(visibilityIcon);
|
||||
@@ -656,6 +683,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
case UNLISTED -> R.string.sk_visibility_unlisted;
|
||||
case PRIVATE -> R.string.visibility_followers_only;
|
||||
case DIRECT -> R.string.visibility_private;
|
||||
case LOCAL -> R.string.sk_local_only;
|
||||
};
|
||||
replyText.setContentDescription(getString(R.string.in_reply_to, replyTo.account.displayName) + ". " + getString(R.string.post_visibility) + ": " + getString(visibilityNameRes));
|
||||
replyText.setOnClickListener(v->{
|
||||
@@ -736,6 +764,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
}
|
||||
|
||||
updateSensitive();
|
||||
updateHeaders();
|
||||
|
||||
if(editingStatus!=null){
|
||||
updateCharCounter();
|
||||
@@ -778,6 +807,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 +847,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());
|
||||
|
||||
@@ -865,6 +900,9 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
if(hasSpoiler){
|
||||
charCount+=spoilerEdit.length();
|
||||
}
|
||||
if (localOnly && GlobalUserPreferences.accountsInGlitchMode.contains(accountID)) {
|
||||
charCount -= GLITCH_LOCAL_ONLY_SUFFIX.length();
|
||||
}
|
||||
charCounter.setText(String.valueOf(charLimit-charCount));
|
||||
trimmedCharCount=text.toString().trim().length();
|
||||
updatePublishButtonState();
|
||||
@@ -954,11 +992,17 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
publish(false);
|
||||
}
|
||||
|
||||
private void publish(boolean forceWithoutAltTexts){
|
||||
private void publish(boolean force){
|
||||
String text=mainEditText.getText().toString();
|
||||
CreateStatus.Request req=new CreateStatus.Request();
|
||||
if (localOnly &&
|
||||
GlobalUserPreferences.accountsInGlitchMode.contains(accountID) &&
|
||||
!GLITCH_LOCAL_ONLY_PATTERN.matcher(text).matches()) {
|
||||
text += " " + GLITCH_LOCAL_ONLY_SUFFIX;
|
||||
}
|
||||
req.status=text;
|
||||
req.visibility=statusVisibility;
|
||||
req.localOnly=localOnly;
|
||||
req.visibility=localOnly && instance.pleroma != null ? StatusPrivacy.LOCAL : statusVisibility;
|
||||
req.sensitive=sensitive;
|
||||
req.language=language;
|
||||
req.scheduledAt = scheduledAt;
|
||||
@@ -966,7 +1010,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
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 (!forceWithoutAltTexts && !GlobalUserPreferences.disableAltTextReminder && !isDraft && withoutAltText.isPresent()) {
|
||||
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)
|
||||
@@ -976,6 +1020,19 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
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;
|
||||
}
|
||||
@@ -1175,9 +1232,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());
|
||||
@@ -1619,18 +1676,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()));
|
||||
@@ -1724,12 +1783,33 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
return attachments.size();
|
||||
}
|
||||
|
||||
private void updateHeaders() {
|
||||
UiUtils.setExtraTextInfo(getContext(), selfExtraText, statusVisibility, localOnly);
|
||||
if (replyTo != null) UiUtils.setExtraTextInfo(getContext(), extraText, replyTo.visibility, replyTo.localOnly);
|
||||
}
|
||||
|
||||
private void buildVisibilityPopup(View v){
|
||||
visibilityPopup=new PopupMenu(getActivity(), v);
|
||||
visibilityPopup.inflate(R.menu.compose_visibility);
|
||||
Menu m=visibilityPopup.getMenu();
|
||||
MenuItem localOnlyItem = visibilityPopup.getMenu().findItem(R.id.local_only);
|
||||
boolean prefsSaysSupported = GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID);
|
||||
if (instance.pleroma != null) {
|
||||
m.findItem(R.id.vis_local).setVisible(true);
|
||||
} else if (localOnly || prefsSaysSupported) {
|
||||
localOnlyItem.setVisible(true);
|
||||
localOnlyItem.setChecked(localOnly);
|
||||
Status status = editingStatus != null ? editingStatus : replyTo;
|
||||
if (!prefsSaysSupported) {
|
||||
GlobalUserPreferences.accountsWithLocalOnlySupport.add(accountID);
|
||||
if (GLITCH_LOCAL_ONLY_PATTERN.matcher(status.getStrippedText()).matches()) {
|
||||
GlobalUserPreferences.accountsInGlitchMode.add(accountID);
|
||||
}
|
||||
GlobalUserPreferences.save();
|
||||
}
|
||||
}
|
||||
UiUtils.enablePopupMenuIcons(getActivity(), visibilityPopup);
|
||||
m.setGroupCheckable(0, true, true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) m.setGroupDividerEnabled(true);
|
||||
visibilityPopup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener(){
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item){
|
||||
@@ -1742,41 +1822,44 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
statusVisibility=StatusPrivacy.PRIVATE;
|
||||
}else if(id==R.id.vis_private){
|
||||
statusVisibility=StatusPrivacy.DIRECT;
|
||||
}else if(id==R.id.vis_local){
|
||||
statusVisibility=StatusPrivacy.LOCAL;
|
||||
}
|
||||
if (id == R.id.local_only) {
|
||||
localOnly = !item.isChecked();
|
||||
item.setChecked(localOnly);
|
||||
} else {
|
||||
item.setChecked(true);
|
||||
}
|
||||
item.setChecked(true);
|
||||
updateVisibilityIcon();
|
||||
updateHeaders();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadDefaultStatusVisibility(Bundle savedInstanceState) {
|
||||
if(getArguments().containsKey("replyTo")){
|
||||
replyTo=Parcels.unwrap(getArguments().getParcelable("replyTo"));
|
||||
statusVisibility = replyTo.visibility;
|
||||
}
|
||||
if(replyTo != null) statusVisibility = replyTo.visibility;
|
||||
|
||||
// A saved privacy setting from a previous compose session wins over the reply visibility
|
||||
if(savedInstanceState !=null){
|
||||
statusVisibility = (StatusPrivacy) savedInstanceState.getSerializable("visibility");
|
||||
}
|
||||
|
||||
Preferences prefs = AccountSessionManager.getInstance().getAccount(accountID).preferences;
|
||||
AccountSessionManager asm = AccountSessionManager.getInstance();
|
||||
Preferences prefs = asm.getAccount(accountID).preferences;
|
||||
if (prefs != null) {
|
||||
// Only override the reply visibility if our preference is more private
|
||||
if (prefs.postingDefaultVisibility.isLessVisibleThan(statusVisibility)) {
|
||||
statusVisibility = switch (prefs.postingDefaultVisibility) {
|
||||
case PUBLIC -> StatusPrivacy.PUBLIC;
|
||||
case UNLISTED -> StatusPrivacy.UNLISTED;
|
||||
case PRIVATE -> StatusPrivacy.PRIVATE;
|
||||
case DIRECT -> StatusPrivacy.DIRECT;
|
||||
};
|
||||
// (and we're not replying to ourselves, or not at all)
|
||||
if (prefs.postingDefaultVisibility.isLessVisibleThan(statusVisibility) &&
|
||||
(replyTo == null || !asm.isSelf(accountID, replyTo.account))) {
|
||||
statusVisibility = prefs.postingDefaultVisibility;
|
||||
}
|
||||
}
|
||||
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1786,9 +1869,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||
}
|
||||
visibilityBtn.setImageResource(switch(statusVisibility){
|
||||
case PUBLIC -> R.drawable.ic_fluent_earth_24_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_people_community_24_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_people_checkmark_24_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_lock_open_24_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_lock_closed_24_filled;
|
||||
case DIRECT -> R.drawable.ic_fluent_mention_24_regular;
|
||||
case LOCAL -> R.drawable.ic_fluent_eye_24_regular;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
|
||||
}
|
||||
|
||||
private void updateOptionsMenu() {
|
||||
if (getActivity() == null) return;
|
||||
optionsMenu.clear();
|
||||
timelineByMenuItem.clear();
|
||||
|
||||
@@ -156,7 +157,7 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
|
||||
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);
|
||||
listsMenu.getItem().setIcon(R.drawable.ic_fluent_people_24_regular);
|
||||
SubMenu hashtagsMenu = menu.addSubMenu(R.string.sk_hashtag);
|
||||
hashtagsMenu.getItem().setIcon(R.drawable.ic_fluent_number_symbol_24_regular);
|
||||
|
||||
@@ -306,7 +307,7 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
|
||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
||||
.show();
|
||||
|
||||
editText.requestFocus();
|
||||
btn.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ public class FavoritedStatusListFragment extends StatusListFragment{
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Status> result){
|
||||
if (getActivity() == null) return;
|
||||
if(result.nextPageUri!=null)
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
|
||||
@@ -80,6 +80,7 @@ public class FollowRequestsListFragment extends BaseRecyclerFragment<FollowReque
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Account> result){
|
||||
if (getActivity() == null) return;
|
||||
if(result.nextPageUri!=null)
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
|
||||
@@ -55,6 +55,7 @@ public class FollowedHashtagsFragment extends BaseRecyclerFragment<Hashtag> impl
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Hashtag> result){
|
||||
if (getActivity() == null) return;
|
||||
if(result.nextPageUri!=null)
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
|
||||
@@ -11,10 +11,12 @@ 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;
|
||||
@@ -55,6 +57,7 @@ public class HashtagTimelineFragment extends PinnableStatusListFragment {
|
||||
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
|
||||
@@ -67,6 +70,7 @@ public class HashtagTimelineFragment extends PinnableStatusListFragment {
|
||||
new GetHashtag(hashtag).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Hashtag hashtag) {
|
||||
if (getActivity() == null) return;
|
||||
updateTitle(hashtag.name);
|
||||
updateFollowingState(hashtag.following);
|
||||
}
|
||||
@@ -88,6 +92,7 @@ public class HashtagTimelineFragment extends PinnableStatusListFragment {
|
||||
new SetHashtagFollowed(hashtag, following).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Hashtag i) {
|
||||
if (getActivity() == null) return;
|
||||
if (i.following == following) Toast.makeText(getActivity(), getString(i.following ? R.string.followed_user : R.string.unfollowed_user, "#" + i.name), Toast.LENGTH_SHORT).show();
|
||||
updateFollowingState(i.following);
|
||||
}
|
||||
@@ -114,6 +119,7 @@ public class HashtagTimelineFragment extends PinnableStatusListFragment {
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Status> result){
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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,6 +41,9 @@ 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.model.Announcement;
|
||||
import org.joinmastodon.android.model.Hashtag;
|
||||
@@ -49,10 +54,13 @@ 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;
|
||||
@@ -64,10 +72,9 @@ import me.grishka.appkit.utils.V;
|
||||
|
||||
public class HomeTabFragment extends MastodonToolbarFragment implements ScrollableToTop, OnBackPressedListener {
|
||||
private static final int ANNOUNCEMENTS_RESULT = 654;
|
||||
private static final int PINNED_UPDATED_RESULT = 523;
|
||||
|
||||
private String accountID;
|
||||
private MenuItem announcements;
|
||||
private MenuItem announcements, announcementsAction, settings, settingsAction;
|
||||
// private ImageView toolbarLogo;
|
||||
private Button toolbarShowNewPostsBtn;
|
||||
private boolean newPostsBtnShown;
|
||||
@@ -86,11 +93,16 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
private Fragment[] fragments;
|
||||
private FrameLayout[] tabViews;
|
||||
private TimelineDefinition[] timelines;
|
||||
private Map<Integer, TimelineDefinition> timelinesByMenuItem = new HashMap<>();
|
||||
private final Map<Integer, TimelineDefinition> timelinesByMenuItem = new HashMap<>();
|
||||
private SubMenu hashtagsMenu, listsMenu;
|
||||
private PopupMenu overflowPopup;
|
||||
private View overflowActionView = null;
|
||||
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;
|
||||
@@ -141,6 +153,12 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
|
||||
view.addView(pager, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
|
||||
overflowActionView = UiUtils.makeOverflowActionView(getContext());
|
||||
overflowPopup = new PopupMenu(getContext(), overflowActionView);
|
||||
overflowPopup.setOnMenuItemClickListener(this::onOptionsItemSelected);
|
||||
overflowActionView.setOnClickListener(l -> overflowPopup.show());
|
||||
overflowActionView.setOnTouchListener(overflowPopup.getDragToOpenListener());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -156,22 +174,23 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
switcherPopup = new PopupMenu(getContext(), 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 (!timelines[position].equals(TimelineDefinition.HOME_TIMELINE)) hideNewPostsButton();
|
||||
if (fragments[position] instanceof BaseRecyclerFragment<?> page){
|
||||
@@ -180,9 +199,9 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
}
|
||||
});
|
||||
|
||||
if (!GlobalUserPreferences.reduceMotion) {
|
||||
if (!reduceMotion) {
|
||||
pager.setPageTransformer((v, pos) -> {
|
||||
if (tabViews[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);
|
||||
@@ -192,15 +211,37 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
|
||||
updateToolbarLogo();
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
if(GithubSelfUpdater.needSelfUpdating()){
|
||||
E.register(this);
|
||||
updateUpdateState(GithubSelfUpdater.getInstance().getState());
|
||||
}
|
||||
|
||||
new GetLists().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<ListTimeline> lists) {
|
||||
addItemsToMap(lists, listItems);
|
||||
updateList(lists, listItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -212,7 +253,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
new GetFollowedHashtags().setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Hashtag> hashtags) {
|
||||
addItemsToMap(hashtags, hashtagsItems);
|
||||
updateList(hashtags, hashtagsItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,6 +261,47 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
new GetAnnouncements(false).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<Announcement> result) {
|
||||
if (getActivity() == null) return;
|
||||
if (result.stream().anyMatch(a -> !a.read)) {
|
||||
announcementsBadged = true;
|
||||
announcements.setVisible(false);
|
||||
announcementsAction.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getActivity());
|
||||
}
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
||||
private void addListsToOverflowMenu() {
|
||||
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_24_regular);
|
||||
UiUtils.insetPopupMenuIcon(ctx, item);
|
||||
});
|
||||
}
|
||||
|
||||
private void addHashtagsToOverflowMenu() {
|
||||
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(){
|
||||
@@ -234,11 +316,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);
|
||||
@@ -259,73 +336,51 @@ 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 updateOverflowMenu() {
|
||||
if (getActivity() == null) return;
|
||||
Menu m = overflowPopup.getMenu();
|
||||
m.clear();
|
||||
overflowPopup.inflate(R.menu.home_overflow);
|
||||
announcements = m.findItem(R.id.announcements);
|
||||
settings = m.findItem(R.id.settings);
|
||||
hashtagsMenu = m.findItem(R.id.hashtags).getSubMenu();
|
||||
listsMenu = m.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.enablePopupMenuIcons(getContext(), overflowPopup);
|
||||
|
||||
addListsToOverflowMenu();
|
||||
addHashtagsToOverflowMenu();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
m.setGroupDividerEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
|
||||
inflater.inflate(R.menu.home, menu);
|
||||
announcements = menu.findItem(R.id.announcements);
|
||||
|
||||
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);
|
||||
updateBadgedOptionsItem(announcements, hasUnread);
|
||||
}
|
||||
menu.findItem(R.id.overflow).setActionView(overflowActionView);
|
||||
announcementsAction = menu.findItem(R.id.announcements_action);
|
||||
settingsAction = menu.findItem(R.id.settings_action);
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getActivity());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
UiUtils.enableOptionsMenuIcons(getContext(), menu);
|
||||
updateOverflowMenu();
|
||||
}
|
||||
|
||||
private void updateBadgedOptionsItem(MenuItem item, boolean asAction) {
|
||||
item.setShowAsAction(asAction ? MenuItem.SHOW_AS_ACTION_ALWAYS : MenuItem.SHOW_AS_ACTION_NEVER);
|
||||
if (asAction) {
|
||||
UiUtils.resetPopupItemTint(item);
|
||||
} else {
|
||||
UiUtils.insetPopupMenuIcon(getContext(), item);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
updateOverflowMenu();
|
||||
}
|
||||
|
||||
private void updateSwitcherMenu() {
|
||||
Context context = getContext();
|
||||
Menu switcherMenu = switcherPopup.getMenu();
|
||||
switcherMenu.clear();
|
||||
timelinesByMenuItem.clear();
|
||||
@@ -335,40 +390,13 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
timelinesByMenuItem.put(menuItemId, tl);
|
||||
MenuItem item = switcherMenu.add(0, menuItemId, 0, tl.getTitle(getContext()));
|
||||
item.setIcon(tl.getIcon().iconRes);
|
||||
UiUtils.insetPopupMenuIcon(getContext(), item);
|
||||
}
|
||||
|
||||
if (!listItems.isEmpty()) {
|
||||
SubMenu listsMenu = switcherMenu.addSubMenu(R.string.sk_list_timelines);
|
||||
UiUtils.insetPopupMenuIcon(context, listsMenu.getItem().setVisible(true)
|
||||
.setIcon(R.drawable.ic_fluent_people_list_24_regular));
|
||||
listsMenu.clear();
|
||||
UiUtils.insetPopupMenuIcon(context, 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(context, item);
|
||||
});
|
||||
}
|
||||
|
||||
if (!hashtagsItems.isEmpty()) {
|
||||
SubMenu hashtagsMenu = switcherMenu.addSubMenu(R.string.sk_hashtags_you_follow);
|
||||
UiUtils.insetPopupMenuIcon(context, hashtagsMenu.getItem().setVisible(true)
|
||||
.setIcon(R.drawable.ic_fluent_number_symbol_24_regular));
|
||||
hashtagsMenu.clear();
|
||||
UiUtils.insetPopupMenuIcon(context, 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(context, item);
|
||||
});
|
||||
}
|
||||
UiUtils.enablePopupMenuIcons(getContext(), switcherPopup);
|
||||
}
|
||||
|
||||
private boolean onSwitcherItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
ListTimeline list;
|
||||
Hashtag hashtag;
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("account", accountID);
|
||||
@@ -376,30 +404,22 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
if (id == R.id.menu_back) {
|
||||
switcher.post(() -> switcherPopup.show());
|
||||
return true;
|
||||
} else if ((list = listItems.get(id)) != null) {
|
||||
args.putString("listID", list.id);
|
||||
args.putString("listTitle", list.title);
|
||||
args.putInt("repliesPolicy", list.repliesPolicy.ordinal());
|
||||
Nav.goForResult(getActivity(), ListTimelineFragment.class, args, PINNED_UPDATED_RESULT, this);
|
||||
} else if ((hashtag = hashtagsItems.get(id)) != null) {
|
||||
args.putString("hashtag", hashtag.name);
|
||||
args.putBoolean("following", hashtag.following);
|
||||
Nav.goForResult(getActivity(), HashtagTimelineFragment.class, args, PINNED_UPDATED_RESULT, this);
|
||||
} else {
|
||||
TimelineDefinition tl = timelinesByMenuItem.get(id);
|
||||
if (tl != null) {
|
||||
for (int i = 0; i < timelines.length; i++) {
|
||||
if (timelines[i] == tl) {
|
||||
navigateTo(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -417,12 +437,27 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountID);
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.settings) {
|
||||
ListTimeline list;
|
||||
Hashtag hashtag;
|
||||
|
||||
if (item.getItemId() == R.id.menu_back) {
|
||||
getToolbar().post(() -> overflowPopup.show());
|
||||
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) {
|
||||
} 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;
|
||||
}
|
||||
@@ -450,7 +485,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
|
||||
@@ -483,7 +518,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
|
||||
@@ -510,19 +545,17 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
@Override
|
||||
public void onFragmentResult(int reqCode, boolean success, Bundle result){
|
||||
if (reqCode == ANNOUNCEMENTS_RESULT && success) {
|
||||
announcements.setIcon(R.drawable.ic_fluent_megaphone_24_regular);
|
||||
announcements.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
|
||||
UiUtils.insetPopupMenuIcon(getContext(), announcements);
|
||||
} else if (reqCode == PINNED_UPDATED_RESULT && result != null && result.getBoolean("pinnedUpdated", false)) {
|
||||
UiUtils.restartApp();
|
||||
announcementsBadged = false;
|
||||
announcements.setVisible(true);
|
||||
announcementsAction.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateUpdateState(GithubSelfUpdater.UpdateState state){
|
||||
if(state!=GithubSelfUpdater.UpdateState.NO_UPDATE && state!=GithubSelfUpdater.UpdateState.CHECKING) {
|
||||
MenuItem settings = getToolbar().getMenu().findItem(R.id.settings);
|
||||
settings.setIcon(R.drawable.ic_settings_24_badged);
|
||||
updateBadgedOptionsItem(settings, true);
|
||||
settingsBadged = true;
|
||||
settingsAction.setVisible(true);
|
||||
settings.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,11 +576,26 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
|
||||
@Override
|
||||
public void onDestroyView(){
|
||||
super.onDestroyView();
|
||||
if (overflowPopup != null) {
|
||||
overflowPopup.dismiss();
|
||||
overflowPopup = null;
|
||||
}
|
||||
if (switcherPopup != null) {
|
||||
switcherPopup.dismiss();
|
||||
switcherPopup = null;
|
||||
}
|
||||
if(GithubSelfUpdater.needSelfUpdating()){
|
||||
E.unregister(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
@@ -561,6 +609,54 @@ 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());
|
||||
updateOverflowMenu();
|
||||
} else if (existingThing.isPresent() && !shouldBeInList) {
|
||||
existingThings.remove(existingThing.get().getKey());
|
||||
updateOverflowMenu();
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<Hashtag> getHashtags() {
|
||||
return hashtagsItems.values();
|
||||
}
|
||||
|
||||
private class HomePagerAdapter extends RecyclerView.Adapter<SimpleViewHolder> {
|
||||
@NonNull
|
||||
@Override
|
||||
|
||||
@@ -58,8 +58,7 @@ public class HomeTimelineFragment extends FabStatusListFragment {
|
||||
.getHomeTimeline(offset>0 ? maxID : null, count, refreshing, new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(CacheablePaginatedResponse<List<Status>> result){
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if (getActivity() == null) return;
|
||||
List<Status> filteredItems = filterPosts(result.items);
|
||||
onDataLoaded(filteredItems, !result.items.isEmpty());
|
||||
maxID=result.maxID;
|
||||
@@ -99,7 +98,7 @@ public class HomeTimelineFragment extends FabStatusListFragment {
|
||||
protected void onHidden(){
|
||||
super.onHidden();
|
||||
if(!data.isEmpty()){
|
||||
String topPostID=displayItems.get(list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset()).parentID;
|
||||
String topPostID=displayItems.get(Math.max(0, list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset())).parentID;
|
||||
if(!topPostID.equals(lastSavedMarkerID)){
|
||||
lastSavedMarkerID=topPostID;
|
||||
new SaveMarkers(topPostID, null)
|
||||
@@ -150,7 +149,7 @@ public class HomeTimelineFragment extends FabStatusListFragment {
|
||||
toAdd=toAdd.stream().filter(filterPredicate).collect(Collectors.toList());
|
||||
if(!toAdd.isEmpty()){
|
||||
prependItems(toAdd, true);
|
||||
if (parent != null) parent.showNewPostsButton();
|
||||
if (parent != null && GlobalUserPreferences.showNewPostsButton) parent.showNewPostsButton();
|
||||
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().putHomeTimeline(toAdd, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,20 +2,22 @@ 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;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
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;
|
||||
@@ -23,7 +25,6 @@ import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.ui.views.ListTimelineEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.grishka.appkit.Nav;
|
||||
@@ -36,9 +37,9 @@ import me.grishka.appkit.utils.V;
|
||||
public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
private String listID;
|
||||
private String listTitle;
|
||||
@Nullable
|
||||
private ListTimeline.RepliesPolicy repliesPolicy;
|
||||
private ImageButton fab;
|
||||
private Bundle resultArgs = new Bundle();
|
||||
|
||||
public ListTimelineFragment() {
|
||||
setListLayoutId(R.layout.recycler_fragment_with_fab);
|
||||
@@ -51,7 +52,6 @@ public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
listID = args.getString("listID");
|
||||
listTitle = args.getString("listTitle");
|
||||
repliesPolicy = ListTimeline.RepliesPolicy.values()[args.getInt("repliesPolicy", 0)];
|
||||
resultArgs.putString("listID", listID);
|
||||
|
||||
setTitle(listTitle);
|
||||
setHasOptionsMenu(true);
|
||||
@@ -59,9 +59,12 @@ public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
new GetList(listID).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(ListTimeline listTimeline) {
|
||||
if (getActivity() == null) return;
|
||||
// TODO: save updated info
|
||||
if (!listTimeline.title.equals(listTitle)) setTitle(listTimeline.title);
|
||||
if (!listTimeline.repliesPolicy.equals(repliesPolicy)) repliesPolicy = listTimeline.repliesPolicy;
|
||||
if (listTimeline.repliesPolicy != null && !listTimeline.repliesPolicy.equals(repliesPolicy)) {
|
||||
repliesPolicy = listTimeline.repliesPolicy;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,22 +89,24 @@ public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
editor.applyList(listTitle, repliesPolicy);
|
||||
new M3AlertDialogBuilder(getActivity())
|
||||
.setTitle(R.string.sk_edit_list_title)
|
||||
.setIcon(R.drawable.ic_fluent_people_list_28_regular)
|
||||
.setIcon(R.drawable.ic_fluent_people_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) {
|
||||
if (getActivity() == null) return;
|
||||
setTitle(list.title);
|
||||
listTitle = list.title;
|
||||
repliesPolicy = list.repliesPolicy;
|
||||
resultArgs.putString("listTitle", listTitle);
|
||||
resultArgs.putInt("repliesPolicy", repliesPolicy.ordinal());
|
||||
setResult(true, resultArgs);
|
||||
E.post(new ListUpdatedCreatedEvent(listID, listTitle, repliesPolicy));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
setTitle(listTitle);
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
@@ -110,19 +115,13 @@ public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
.show();
|
||||
} else if (item.getItemId() == R.id.delete) {
|
||||
UiUtils.confirmDeleteList(getActivity(), accountID, listID, listTitle, () -> {
|
||||
resultArgs.putBoolean("deleted", true);
|
||||
setResult(true, resultArgs);
|
||||
E.post(new ListDeletedEvent(listID));
|
||||
Nav.finish(this);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle getResultArgs() {
|
||||
return resultArgs;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TimelineDefinition makeTimelineDefinition() {
|
||||
return TimelineDefinition.ofList(listID, listTitle);
|
||||
@@ -134,6 +133,7 @@ public class ListTimelineFragment extends PinnableStatusListFragment {
|
||||
.setCallback(new SimpleCallback<>(this) {
|
||||
@Override
|
||||
public void onSuccess(List<Status> result) {
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,16 +12,20 @@ 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;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.ui.views.ListTimelineEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -38,218 +42,219 @@ 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;
|
||||
private boolean pinnedUpdated;
|
||||
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 onDestroy() {
|
||||
super.onDestroy();
|
||||
if (pinnedUpdated) UiUtils.restartApp();
|
||||
}
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.menu_list, menu);
|
||||
}
|
||||
|
||||
@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 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 void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.menu_list, menu);
|
||||
}
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountId)
|
||||
)
|
||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
||||
.show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
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) {}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
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
|
||||
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) {
|
||||
if (getActivity() == null) return;
|
||||
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) {
|
||||
if (getActivity() == null) return;
|
||||
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);
|
||||
}
|
||||
@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
|
||||
public void onFragmentResult(int reqCode, boolean listChanged, Bundle result){
|
||||
if (reqCode == LIST_CHANGED_RESULT && listChanged) {
|
||||
if (result.getBoolean("pinnedUpdated")) pinnedUpdated = true;
|
||||
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 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
|
||||
protected RecyclerView.Adapter<ListViewHolder> getAdapter() {
|
||||
return adapter = new ListsAdapter();
|
||||
}
|
||||
@Override
|
||||
protected RecyclerView.Adapter<ListViewHolder> getAdapter() {
|
||||
return adapter = new ListsAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
smoothScrollRecyclerViewToTop(list);
|
||||
}
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
smoothScrollRecyclerViewToTop(list);
|
||||
}
|
||||
|
||||
private class ListsAdapter extends RecyclerView.Adapter<ListViewHolder>{
|
||||
@NonNull
|
||||
@Override
|
||||
public ListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||
return new ListViewHolder();
|
||||
}
|
||||
private class ListsAdapter extends RecyclerView.Adapter<ListViewHolder>{
|
||||
@NonNull
|
||||
@Override
|
||||
public ListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||
return new ListViewHolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ListViewHolder holder, int position) {
|
||||
holder.bind(data.get(position));
|
||||
}
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ListViewHolder holder, int position) {
|
||||
holder.bind(data.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
}
|
||||
|
||||
private class ListViewHolder extends BindableViewHolder<ListTimeline> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final CheckBox listToggle;
|
||||
private class ListViewHolder extends BindableViewHolder<ListTimeline> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final CheckBox listToggle;
|
||||
|
||||
public ListViewHolder(){
|
||||
super(getActivity(), R.layout.item_text, list);
|
||||
title=findViewById(R.id.title);
|
||||
listToggle=findViewById(R.id.list_toggle);
|
||||
}
|
||||
public ListViewHolder(){
|
||||
super(getActivity(), R.layout.item_text, list);
|
||||
title=findViewById(R.id.title);
|
||||
listToggle=findViewById(R.id.list_toggle);
|
||||
}
|
||||
|
||||
@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 onBind(ListTimeline item) {
|
||||
title.setText(item.title);
|
||||
title.setCompoundDrawablesRelativeWithIntrinsicBounds(itemView.getContext().getDrawable(R.drawable.ic_fluent_people_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);
|
||||
}
|
||||
}
|
||||
|
||||
private void onClickToggle(View view) {
|
||||
saveListMembership(item.id, listToggle.isChecked());
|
||||
}
|
||||
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);
|
||||
args.putInt("repliesPolicy", item.repliesPolicy.ordinal());
|
||||
Nav.goForResult(getActivity(), ListTimelineFragment.class, args, LIST_CHANGED_RESULT, ListTimelinesFragment.this);
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,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);
|
||||
@@ -175,6 +187,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
new GetFollowRequests(null, 1).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(HeaderPaginationList<Account> accounts) {
|
||||
if (getActivity() == null) return;
|
||||
getToolbar().getMenu().findItem(R.id.follow_requests).setVisible(!accounts.isEmpty());
|
||||
}
|
||||
|
||||
@@ -203,6 +216,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
||||
protected void updateToolbar(){
|
||||
super.updateToolbar();
|
||||
getToolbar().setOutlineProvider(null);
|
||||
getToolbar().setOnClickListener(v->scrollToTop());
|
||||
}
|
||||
|
||||
private NotificationsListFragment getFragmentForPage(int page){
|
||||
|
||||
@@ -2,8 +2,7 @@ package org.joinmastodon.android.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
@@ -14,15 +13,19 @@ import org.joinmastodon.android.api.requests.markers.SaveMarkers;
|
||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||
import org.joinmastodon.android.events.PollUpdatedEvent;
|
||||
import org.joinmastodon.android.events.RemoveAccountPostsEvent;
|
||||
import org.joinmastodon.android.model.Account;
|
||||
import org.joinmastodon.android.model.Notification;
|
||||
import org.joinmastodon.android.model.PaginatedResponse;
|
||||
import org.joinmastodon.android.model.Status;
|
||||
import org.joinmastodon.android.ui.displayitems.AccountCardStatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.displayitems.AccountStatusDisplayItem;
|
||||
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.displayitems.TextStatusDisplayItem;
|
||||
import org.joinmastodon.android.ui.utils.DiscoverInfoBannerHelper;
|
||||
import org.joinmastodon.android.ui.utils.InsetStatusItemDecoration;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.parceler.Parcels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -73,6 +76,8 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
|
||||
@Override
|
||||
protected List<StatusDisplayItem> buildDisplayItems(Notification n){
|
||||
Account reportTarget = n.report == null ? null : n.report.targetAccount == null ? null :
|
||||
n.report.targetAccount;
|
||||
String extraText=switch(n.type){
|
||||
case FOLLOW -> getString(R.string.user_followed_you);
|
||||
case FOLLOW_REQUEST -> getString(R.string.user_sent_follow_request);
|
||||
@@ -80,8 +85,11 @@ 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);
|
||||
case SIGN_UP -> getString(R.string.sk_signed_up);
|
||||
case REPORT -> getString(R.string.sk_reported);
|
||||
};
|
||||
HeaderStatusDisplayItem titleItem=extraText!=null ? new HeaderStatusDisplayItem(n.id, n.account, n.createdAt, this, accountID, null, extraText, n, null) : null;
|
||||
HeaderStatusDisplayItem titleItem=extraText!=null ? new HeaderStatusDisplayItem(n.id, n.account, n.createdAt, this, accountID, n.status, extraText, n, null) : null;
|
||||
if(n.status!=null){
|
||||
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, titleItem!=null, titleItem==null, n);
|
||||
if(titleItem!=null){
|
||||
@@ -95,8 +103,13 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
items.add(0, titleItem);
|
||||
return items;
|
||||
}else if(titleItem!=null){
|
||||
AccountCardStatusDisplayItem card=new AccountCardStatusDisplayItem(n.id, this, n.account, n);
|
||||
return Arrays.asList(titleItem, card);
|
||||
AccountCardStatusDisplayItem card=new AccountCardStatusDisplayItem(n.id, this,
|
||||
reportTarget != null ? reportTarget : n.account, n);
|
||||
TextStatusDisplayItem text = n.report != null && !TextUtils.isEmpty(n.report.comment) ?
|
||||
new TextStatusDisplayItem(n.id, n.report.comment, this,
|
||||
Status.ofFake(n.id, n.report.comment, n.createdAt), true) :
|
||||
null;
|
||||
return text == null ? Arrays.asList(titleItem, card) : Arrays.asList(titleItem, text, card);
|
||||
}else{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -117,8 +130,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
.getNotifications(offset>0 ? maxID : null, count, onlyMentions, onlyPosts, refreshing, new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(PaginatedResponse<List<Notification>> result){
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if (getActivity() == null) return;
|
||||
if(refreshing)
|
||||
relationships.clear();
|
||||
onDataLoaded(result.items.stream().filter(n->n.type!=null).collect(Collectors.toList()), !result.items.isEmpty());
|
||||
@@ -165,6 +177,9 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||
if(status.inReplyToAccountId!=null && knownAccounts.containsKey(status.inReplyToAccountId))
|
||||
args.putParcelable("inReplyToAccount", Parcels.wrap(knownAccounts.get(status.inReplyToAccountId)));
|
||||
Nav.go(getActivity(), ThreadFragment.class, args);
|
||||
}else if(n.report != null){
|
||||
String domain = AccountSessionManager.getInstance().getAccount(accountID).domain;
|
||||
UiUtils.launchWebBrowser(getActivity(), "https://"+domain+"/admin/reports/"+n.report.id);
|
||||
}else{
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", accountID);
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class PinnableStatusListFragment extends StatusListFragment {
|
||||
protected boolean pinnedUpdated;
|
||||
protected List<TimelineDefinition> pinnedTimelines;
|
||||
|
||||
@Override
|
||||
@@ -54,7 +53,7 @@ public abstract class PinnableStatusListFragment extends StatusListFragment {
|
||||
}
|
||||
|
||||
protected void togglePin(MenuItem pin) {
|
||||
pinnedUpdated = true;
|
||||
onPinnedUpdated(true);
|
||||
getToolbar().performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
||||
TimelineDefinition def = makeTimelineDefinition();
|
||||
boolean pinned = isPinned();
|
||||
@@ -66,17 +65,5 @@ public abstract class PinnableStatusListFragment extends StatusListFragment {
|
||||
updatePinButton(pin);
|
||||
}
|
||||
|
||||
protected Bundle getResultArgs() {
|
||||
return new Bundle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bundle resultArgs = getResultArgs();
|
||||
if (pinnedUpdated) {
|
||||
resultArgs.putBoolean("pinnedUpdated", true);
|
||||
setResult(true, resultArgs);
|
||||
}
|
||||
}
|
||||
public void onPinnedUpdated(boolean pinned) {}
|
||||
}
|
||||
|
||||
@@ -312,6 +312,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(Account result){
|
||||
if (getActivity() == null) return;
|
||||
account=result;
|
||||
isOwnProfile=AccountSessionManager.getInstance().isSelf(accountID, account);
|
||||
bindHeaderView();
|
||||
@@ -679,6 +680,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
}
|
||||
|
||||
private void updateRelationship(){
|
||||
if (getActivity() == null) return;
|
||||
invalidateOptionsMenu();
|
||||
actionButton.setVisibility(View.VISIBLE);
|
||||
notifyButton.setVisibility(relationship.following ? View.VISIBLE : View.GONE);
|
||||
@@ -688,7 +690,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
notifyProgress.setIndeterminateTintList(notifyButton.getTextColors());
|
||||
followsYouView.setVisibility(relationship.followedBy ? View.VISIBLE : View.GONE);
|
||||
notifyButton.setSelected(relationship.notifying);
|
||||
if (getActivity() != null) notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
||||
notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
||||
}
|
||||
|
||||
private void onScrollChanged(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
||||
@@ -771,8 +773,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
@Override
|
||||
public void onSuccess(Account result){
|
||||
editModeLoading=false;
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if (getActivity() == null) return;
|
||||
enterEditMode(result);
|
||||
setActionProgressVisible(false);
|
||||
}
|
||||
@@ -780,8 +781,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
@Override
|
||||
public void onError(ErrorResponse error){
|
||||
editModeLoading=false;
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if (getActivity() == null) return;
|
||||
error.showToast(getActivity());
|
||||
setActionProgressVisible(false);
|
||||
}
|
||||
@@ -884,6 +884,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||
public void onSuccess(Account result){
|
||||
account=result;
|
||||
AccountSessionManager.getInstance().updateAccountInfo(accountID, account);
|
||||
if (getActivity() == null) return;
|
||||
exitEditMode();
|
||||
setActionProgressVisible(false);
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ public class ScheduledStatusListFragment extends BaseStatusListFragment<Schedule
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
nextMaxID=null;
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, nextMaxID!=null);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.LruCache;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -77,6 +78,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
private ArrayList<Item> items=new ArrayList<>();
|
||||
private ThemeItem themeItem;
|
||||
private NotificationPolicyItem notificationPolicyItem;
|
||||
private SwitchItem showNewPostsButtonItem, glitchModeItem;
|
||||
private String accountID;
|
||||
private boolean needUpdateNotificationSettings;
|
||||
private boolean needAppRestart;
|
||||
@@ -163,6 +165,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;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
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;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
|
||||
items.add(new HeaderItem(R.string.settings_behavior));
|
||||
items.add(new SwitchItem(R.string.settings_gif, R.drawable.ic_fluent_gif_24_regular, GlobalUserPreferences.playGifs, i->{
|
||||
@@ -195,6 +205,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
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();
|
||||
@@ -214,8 +228,18 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
GlobalUserPreferences.showBoosts=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
items.add(new SwitchItem(R.string.sk_settings_load_new_posts, R.drawable.ic_fluent_arrow_up_24_regular, GlobalUserPreferences.loadNewPosts, i->{
|
||||
items.add(new SwitchItem(R.string.sk_settings_load_new_posts, R.drawable.ic_fluent_arrow_sync_24_regular, GlobalUserPreferences.loadNewPosts, i->{
|
||||
GlobalUserPreferences.loadNewPosts=i.checked;
|
||||
showNewPostsButtonItem.enabled = i.checked;
|
||||
if (!i.checked) {
|
||||
GlobalUserPreferences.showNewPostsButton = false;
|
||||
showNewPostsButtonItem.checked = false;
|
||||
}
|
||||
if (list.findViewHolderForAdapterPosition(items.indexOf(showNewPostsButtonItem)) instanceof SwitchViewHolder svh) svh.rebind();
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
items.add(showNewPostsButtonItem = new SwitchItem(R.string.sk_settings_see_new_posts_button, R.drawable.ic_fluent_arrow_up_24_regular, GlobalUserPreferences.showNewPostsButton, i->{
|
||||
GlobalUserPreferences.showNewPostsButton=i.checked;
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
|
||||
@@ -226,11 +250,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_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 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_chat_24_regular, pushSubscription.alerts.status, i->onNotificationsChanged(PushNotification.Type.STATUS, i.checked)));
|
||||
|
||||
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));
|
||||
@@ -249,19 +270,50 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
items.add(new TextItem(R.string.settings_privacy_policy, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/terms"), R.drawable.ic_fluent_open_24_regular));
|
||||
items.add(new TextItem(R.string.log_out, this::confirmLogOut, R.drawable.ic_fluent_sign_out_24_regular));
|
||||
|
||||
items.add(new HeaderItem(R.string.sk_instance_features));
|
||||
items.add(new SwitchItem(R.string.sk_settings_support_local_only, 0, GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID), i->{
|
||||
glitchModeItem.enabled = i.checked;
|
||||
if (i.checked) {
|
||||
GlobalUserPreferences.accountsWithLocalOnlySupport.add(accountID);
|
||||
if (instance.pleroma == null) GlobalUserPreferences.accountsInGlitchMode.add(accountID);
|
||||
} else {
|
||||
GlobalUserPreferences.accountsWithLocalOnlySupport.remove(accountID);
|
||||
GlobalUserPreferences.accountsInGlitchMode.remove(accountID);
|
||||
}
|
||||
glitchModeItem.checked = GlobalUserPreferences.accountsInGlitchMode.contains(accountID);
|
||||
if (list.findViewHolderForAdapterPosition(items.indexOf(glitchModeItem)) instanceof SwitchViewHolder svh) svh.rebind();
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
items.add(new SmallTextItem(getString(R.string.sk_settings_local_only_explanation)));
|
||||
items.add(glitchModeItem = new SwitchItem(R.string.sk_settings_glitch_instance, 0, GlobalUserPreferences.accountsInGlitchMode.contains(accountID), i->{
|
||||
if (i.checked) {
|
||||
GlobalUserPreferences.accountsInGlitchMode.add(accountID);
|
||||
} else {
|
||||
GlobalUserPreferences.accountsInGlitchMode.remove(accountID);
|
||||
}
|
||||
GlobalUserPreferences.save();
|
||||
}));
|
||||
glitchModeItem.enabled = GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID);
|
||||
items.add(new SmallTextItem(getString(R.string.sk_settings_glitch_mode_explanation)));
|
||||
|
||||
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);
|
||||
LruCache<?, ?> cache = imageCache == null ? null : imageCache.getLruCache();
|
||||
clearImageCacheItem = new TextItem(R.string.settings_clear_cache, UiUtils.formatFileSize(getContext(), cache != null ? cache.size() : 0, 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)));
|
||||
}
|
||||
@@ -420,6 +472,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;
|
||||
}
|
||||
@@ -480,6 +533,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
}
|
||||
|
||||
private void onLoggedOut(){
|
||||
if (getActivity() == null) return;
|
||||
AccountSessionManager.getInstance().removeAccount(accountID);
|
||||
getActivity().finish();
|
||||
Intent intent=new Intent(getActivity(), MainActivity.class);
|
||||
@@ -749,7 +803,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);
|
||||
}
|
||||
@@ -923,19 +982,19 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
|
||||
private class SmallTextViewHolder extends BindableViewHolder<SmallTextItem> {
|
||||
private final TextView text;
|
||||
;
|
||||
|
||||
public SmallTextViewHolder(){
|
||||
super(getActivity(), R.layout.item_settings_text, list);
|
||||
text = itemView.findViewById(R.id.text);
|
||||
text.setTextColor(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorSecondary));
|
||||
text.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
text.setPaddingRelative(text.getPaddingStart(), 0, text.getPaddingEnd(), text.getPaddingBottom());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind(SmallTextItem item){
|
||||
text.setText(item.text);
|
||||
text.setTextColor(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorSecondary));
|
||||
text.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,16 +173,7 @@ public class SplashFragment extends AppKitFragment{
|
||||
TextView title=new TextView(getActivity());
|
||||
title.setTextAppearance(R.style.m3_headline_medium);
|
||||
title.setText(switch(page){
|
||||
case 0 -> {
|
||||
String src=getString(R.string.welcome_page1_title);
|
||||
SpannableString ss=new SpannableString(src);
|
||||
int start=src.indexOf("{logo}");
|
||||
if(start!=-1){
|
||||
LogoSpan span=new LogoSpan(getResources().getDrawable(R.drawable.splash_logo, getActivity().getTheme()));
|
||||
ss.setSpan(span, start, start+6, 0);
|
||||
}
|
||||
yield ss;
|
||||
}
|
||||
case 0 -> getString(R.string.welcome_page1_title);
|
||||
case 1 -> getString(R.string.welcome_page2_title);
|
||||
case 2 -> getString(R.string.welcome_page3_title);
|
||||
default -> throw new IllegalStateException("Unexpected value: "+page);
|
||||
@@ -204,26 +195,4 @@ public class SplashFragment extends AppKitFragment{
|
||||
ll.addView(text, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
}
|
||||
|
||||
private class LogoSpan extends ReplacementSpan{
|
||||
private final Drawable drawable;
|
||||
|
||||
private LogoSpan(Drawable drawable){
|
||||
this.drawable=drawable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize(@NonNull Paint paint, CharSequence text, int start, int end, @Nullable Paint.FontMetricsInt fm){
|
||||
return drawable.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, @NonNull Paint paint){
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
canvas.save();
|
||||
canvas.translate(x, y-V.dp(20));
|
||||
drawable.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class StatusEditHistoryFragment extends StatusListFragment{
|
||||
@Override
|
||||
public void onSuccess(List<Status> result){
|
||||
Collections.sort(result, Comparator.comparing((Status s)->s.createdAt).reversed());
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, false);
|
||||
}
|
||||
})
|
||||
@@ -139,7 +140,8 @@ public class StatusEditHistoryFragment extends StatusListFragment{
|
||||
action=getString(R.string.edit_multiple_changed);
|
||||
}
|
||||
}
|
||||
items.add(0, new ReblogOrReplyLineStatusDisplayItem(s.id, this, action+" · "+date, Collections.emptyList(), 0, null, null));
|
||||
String sep = getString(R.string.sk_separator);
|
||||
items.add(0, new ReblogOrReplyLineStatusDisplayItem(s.id, this, action+" "+sep+" "+date, Collections.emptyList(), 0, null, null));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ public class ThreadFragment extends StatusListFragment{
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(StatusContext result){
|
||||
if(getActivity()==null)
|
||||
return;
|
||||
if (getActivity() == null) return;
|
||||
if(refreshing){
|
||||
data.clear();
|
||||
displayItems.clear();
|
||||
@@ -126,4 +125,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public abstract class BaseAccountListFragment extends BaseRecyclerFragment<BaseA
|
||||
for(Relationship rel:result){
|
||||
relationships.put(rel.id, rel);
|
||||
}
|
||||
if (getActivity() == null) return;
|
||||
if(list==null)
|
||||
return;
|
||||
for(int i=0;i<list.getChildCount();i++){
|
||||
@@ -370,6 +371,7 @@ public abstract class BaseAccountListFragment extends BaseRecyclerFragment<BaseA
|
||||
@Override
|
||||
public void onSuccess(Relationship result){
|
||||
relationships.put(AccountViewHolder.this.item.account.id, result);
|
||||
if (getActivity() == null) return;
|
||||
bindRelationship();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ public abstract class PaginatedAccountListFragment extends BaseAccountListFragme
|
||||
nextMaxID=result.nextPageUri.getQueryParameter("max_id");
|
||||
else
|
||||
nextMaxID=null;
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), nextMaxID!=null);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -74,6 +74,7 @@ public class DiscoverAccountsFragment extends BaseRecyclerFragment<DiscoverAccou
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<FollowSuggestion> result){
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result.stream().map(fs->new AccountWrapper(fs.account)).collect(Collectors.toList()), false);
|
||||
loadRelationships();
|
||||
}
|
||||
@@ -108,6 +109,7 @@ public class DiscoverAccountsFragment extends BaseRecyclerFragment<DiscoverAccou
|
||||
public void onSuccess(List<Relationship> result){
|
||||
relationshipsRequest=null;
|
||||
relationships=result.stream().collect(Collectors.toMap(rel->rel.id, Function.identity()));
|
||||
if (getActivity() == null) return;
|
||||
if(list==null)
|
||||
return;
|
||||
for(int i=0;i<list.getChildCount();i++){
|
||||
|
||||
@@ -59,6 +59,7 @@ public class DiscoverNewsFragment extends BaseRecyclerFragment<Card> implements
|
||||
imageRequests=result.stream()
|
||||
.map(card->TextUtils.isEmpty(card.image) ? null : new UrlImageLoaderRequest(card.image, V.dp(150), V.dp(150)))
|
||||
.collect(Collectors.toList());
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, false);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -22,6 +22,7 @@ public class DiscoverPostsFragment extends StatusListFragment implements IsOnTop
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Status> result){
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
}).exec(accountID);
|
||||
|
||||
@@ -29,6 +29,7 @@ public class FederatedTimelineFragment extends FabStatusListFragment {
|
||||
public void onSuccess(List<Status> result){
|
||||
if(!result.isEmpty())
|
||||
maxID=result.get(result.size()-1).id;
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result.stream().filter(new StatusFilterPredicate(accountID, Filter.FilterContext.PUBLIC)).collect(Collectors.toList()), !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -29,6 +29,7 @@ public class LocalTimelineFragment extends FabStatusListFragment {
|
||||
public void onSuccess(List<Status> result){
|
||||
if(!result.isEmpty())
|
||||
maxID=result.get(result.size()-1).id;
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result.stream().filter(new StatusFilterPredicate(accountID, Filter.FilterContext.PUBLIC)).collect(Collectors.toList()), !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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,8 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
|
||||
@Override
|
||||
protected void doLoadData(int offset, int count){
|
||||
if (getActivity() == null) return;
|
||||
resetEmptyText();
|
||||
if(isInRecentMode()){
|
||||
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().getRecentSearches(sr->{
|
||||
if(getActivity()==null)
|
||||
@@ -129,11 +135,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)
|
||||
@@ -149,11 +157,13 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
||||
}
|
||||
prevDisplayItems=new ArrayList<>(displayItems);
|
||||
unfilteredResults=results;
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(filterSearchResults(results), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error){
|
||||
resetEmptyText();
|
||||
currentRequest=null;
|
||||
Activity a=getActivity();
|
||||
if(a==null)
|
||||
|
||||
@@ -44,6 +44,7 @@ public class TrendingHashtagsFragment extends BaseRecyclerFragment<Hashtag> impl
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Hashtag> result){
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, false);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,6 +20,7 @@ import org.joinmastodon.android.model.Instance;
|
||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||
import org.joinmastodon.android.ui.OutlineProviders;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.utils.ElevationOnScrollListener;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.parceler.Parcels;
|
||||
@@ -42,6 +44,7 @@ import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.SingleViewRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.V;
|
||||
import me.grishka.appkit.views.FragmentRootLinearLayout;
|
||||
import me.grishka.appkit.views.UsableRecyclerView;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
@@ -58,6 +61,7 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
private ArrayList<Item> items=new ArrayList<>();
|
||||
private Call currentRequest;
|
||||
private ItemsAdapter itemsAdapter;
|
||||
private ElevationOnScrollListener onScrollListener;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState){
|
||||
@@ -72,7 +76,7 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
setNavigationBarColor(UiUtils.getThemeColor(activity, R.attr.colorWindowBackground));
|
||||
instance=Parcels.unwrap(getArguments().getParcelable("instance"));
|
||||
|
||||
items.add(new Item("Mastodon for Android Privacy Policy", "joinmastodon.org", "https://joinmastodon.org/android/privacy", "https://joinmastodon.org/favicon-32x32.png"));
|
||||
items.add(new Item("Mastodon for Android Privacy Policy", getString(R.string.privacy_policy_explanation), "joinmastodon.org", "https://joinmastodon.org/android/privacy", "https://joinmastodon.org/favicon-32x32.png"));
|
||||
loadServerPrivacyPolicy();
|
||||
}
|
||||
|
||||
@@ -93,18 +97,24 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
View headerView=inflater.inflate(R.layout.item_list_header_simple, list, false);
|
||||
TextView text=headerView.findViewById(R.id.text);
|
||||
text.setText(R.string.privacy_policy_subtitle);
|
||||
text.setText(getString(R.string.privacy_policy_subtitle, instance.uri));
|
||||
|
||||
adapter=new MergeRecyclerAdapter();
|
||||
adapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
||||
adapter.addAdapter(itemsAdapter=new ItemsAdapter());
|
||||
list.setAdapter(adapter);
|
||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorM3SurfaceVariant, 1, 56, 0, DividerItemDecoration.NOT_FIRST));
|
||||
|
||||
btn=view.findViewById(R.id.btn_next);
|
||||
btn.setOnClickListener(v->onButtonClick());
|
||||
buttonBar=view.findViewById(R.id.button_bar);
|
||||
|
||||
Button backBtn=view.findViewById(R.id.btn_back);
|
||||
backBtn.setText(getString(R.string.server_policy_disagree, instance.uri));
|
||||
backBtn.setOnClickListener(v->{
|
||||
setResult(false, null);
|
||||
Nav.finish(this);
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -113,13 +123,17 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||
list.addOnScrollListener(onScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, buttonBar, getToolbar()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUpdateToolbar(){
|
||||
super.onUpdateToolbar();
|
||||
getToolbar().setBackground(null);
|
||||
getToolbar().setBackgroundResource(R.drawable.bg_onboarding_panel);
|
||||
getToolbar().setElevation(0);
|
||||
if(onScrollListener!=null){
|
||||
onScrollListener.setViews(buttonBar, getToolbar());
|
||||
}
|
||||
}
|
||||
|
||||
protected void onButtonClick(){
|
||||
@@ -158,7 +172,7 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
if(!response.isSuccessful())
|
||||
return;
|
||||
Document doc=Jsoup.parse(Objects.requireNonNull(body).byteStream(), Objects.requireNonNull(body.contentType()).charset(StandardCharsets.UTF_8).name(), req.url().toString());
|
||||
final Item item=new Item(doc.title(), instance.uri, req.url().toString(), "https://"+instance.uri+"/favicon.ico");
|
||||
final Item item=new Item(doc.title(), null, instance.uri, req.url().toString(), "https://"+instance.uri+"/favicon.ico");
|
||||
Activity activity=getActivity();
|
||||
if(activity!=null){
|
||||
activity.runOnUiThread(()->{
|
||||
@@ -192,16 +206,23 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
|
||||
private class ItemViewHolder extends BindableViewHolder<Item> implements UsableRecyclerView.Clickable{
|
||||
private final TextView title;
|
||||
private final TextView subtitle;
|
||||
|
||||
public ItemViewHolder(){
|
||||
super(getActivity(), R.layout.item_privacy_policy_link, list);
|
||||
title=findViewById(R.id.title);
|
||||
title.setPaintFlags(title.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
subtitle=findViewById(R.id.subtitle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind(Item item){
|
||||
title.setText(item.title);
|
||||
if(TextUtils.isEmpty(item.subtitle)){
|
||||
subtitle.setVisibility(View.GONE);
|
||||
}else{
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
subtitle.setText(item.subtitle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,10 +232,11 @@ public class GoogleMadeMeAddThisFragment extends ToolbarFragment{
|
||||
}
|
||||
|
||||
private static class Item{
|
||||
public String title, domain, url, faviconUrl;
|
||||
public String title, subtitle, domain, url, faviconUrl;
|
||||
|
||||
public Item(String title, String domain, String url, String faviconUrl){
|
||||
public Item(String title, String subtitle, String domain, String url, String faviconUrl){
|
||||
this.title=title;
|
||||
this.subtitle=subtitle;
|
||||
this.domain=domain;
|
||||
this.url=url;
|
||||
this.faviconUrl=faviconUrl;
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
package org.joinmastodon.android.fragments.onboarding;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
@@ -20,7 +14,6 @@ import android.view.WindowInsets;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.RadioButton;
|
||||
@@ -38,6 +31,7 @@ import org.joinmastodon.android.ui.BetterItemAnimator;
|
||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.ui.views.FilterChipView;
|
||||
import org.joinmastodon.android.utils.ElevationOnScrollListener;
|
||||
import org.parceler.Parcels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -56,11 +50,7 @@ import me.grishka.appkit.Nav;
|
||||
import me.grishka.appkit.api.Callback;
|
||||
import me.grishka.appkit.api.ErrorResponse;
|
||||
import me.grishka.appkit.fragments.OnBackPressedListener;
|
||||
import me.grishka.appkit.imageloader.ImageLoaderRecyclerAdapter;
|
||||
import me.grishka.appkit.imageloader.ImageLoaderViewHolder;
|
||||
import me.grishka.appkit.imageloader.requests.ImageLoaderRequest;
|
||||
import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.utils.CubicBezierInterpolator;
|
||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.SingleViewRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.V;
|
||||
@@ -215,47 +205,7 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
setStatusBarColor(0);
|
||||
topBar=view.findViewById(R.id.top_bar);
|
||||
|
||||
LayerDrawable topBg=(LayerDrawable) topBar.getBackground().mutate();
|
||||
topBar.setBackground(topBg);
|
||||
Drawable topOverlay=topBg.findDrawableByLayerId(R.id.color_overlay);
|
||||
topOverlay.setAlpha(0);
|
||||
|
||||
LayerDrawable btmBg=(LayerDrawable) buttonBar.getBackground().mutate();
|
||||
buttonBar.setBackground(btmBg);
|
||||
Drawable btmOverlay=btmBg.findDrawableByLayerId(R.id.color_overlay);
|
||||
btmOverlay.setAlpha(0);
|
||||
|
||||
list.addOnScrollListener(new RecyclerView.OnScrollListener(){
|
||||
private boolean isAtTop=true;
|
||||
private Animator currentPanelsAnim;
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy){
|
||||
boolean newAtTop=recyclerView.getChildCount()==0 || (recyclerView.getChildAdapterPosition(recyclerView.getChildAt(0))==0 && recyclerView.getChildAt(0).getTop()==recyclerView.getPaddingTop());
|
||||
if(newAtTop!=isAtTop){
|
||||
isAtTop=newAtTop;
|
||||
if(currentPanelsAnim!=null)
|
||||
currentPanelsAnim.cancel();
|
||||
|
||||
AnimatorSet set=new AnimatorSet();
|
||||
set.playTogether(
|
||||
ObjectAnimator.ofInt(topOverlay, "alpha", isAtTop ? 0 : 20),
|
||||
ObjectAnimator.ofInt(btmOverlay, "alpha", isAtTop ? 0 : 20),
|
||||
ObjectAnimator.ofFloat(topBar, View.TRANSLATION_Z, isAtTop ? 0 : V.dp(3)),
|
||||
ObjectAnimator.ofFloat(buttonBar, View.TRANSLATION_Z, isAtTop ? 0 : V.dp(3))
|
||||
);
|
||||
set.setDuration(150);
|
||||
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||
set.addListener(new AnimatorListenerAdapter(){
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation){
|
||||
currentPanelsAnim=null;
|
||||
}
|
||||
});
|
||||
set.start();
|
||||
currentPanelsAnim=set;
|
||||
}
|
||||
}
|
||||
});
|
||||
list.addOnScrollListener(new ElevationOnScrollListener(null, topBar, buttonBar));
|
||||
|
||||
searchEdit=view.findViewById(R.id.search_edit);
|
||||
searchEdit.setOnEditorActionListener(this::onSearchEnterPressed);
|
||||
@@ -366,6 +316,9 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
}).collect(Collectors.toList());
|
||||
focusThing=view.findViewById(R.id.focus_thing);
|
||||
focusThing.requestFocus();
|
||||
|
||||
view.findViewById(R.id.btn_random_instance).setOnClickListener(this::onPickRandomInstanceClick);
|
||||
nextButton.setEnabled(chosenInstance!=null);
|
||||
}
|
||||
|
||||
private void onRegionFilterClick(View v){
|
||||
@@ -396,22 +349,6 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
updateFilteredList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNextClick(View v){
|
||||
if(chosenInstance==null){
|
||||
String lang=Locale.getDefault().getLanguage();
|
||||
List<CatalogInstance> instances=data.stream().filter(ci->!ci.approvalRequired && ("general".equals(ci.category) || (ci.categories!=null && ci.categories.contains("general"))) && (lang.equals(ci.language) || (ci.languages!=null && ci.languages.contains(lang)))).collect(Collectors.toList());
|
||||
if(instances.isEmpty()){
|
||||
instances=data.stream().filter(ci->!ci.approvalRequired && ("general".equals(ci.category) || (ci.categories!=null && ci.categories.contains("general")))).collect(Collectors.toList());
|
||||
}
|
||||
if(instances.isEmpty()){
|
||||
return;
|
||||
}
|
||||
chosenInstance=instances.get(new Random().nextInt(instances.size()));
|
||||
}
|
||||
super.onNextClick(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void proceedWithAuthOrSignup(Instance instance){
|
||||
getActivity().getSystemService(InputMethodManager.class).hideSoftInputFromWindow(contentView.getWindowToken(), 0);
|
||||
@@ -428,6 +365,19 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
Nav.go(getActivity(), InstanceRulesFragment.class, args);
|
||||
}
|
||||
|
||||
private void onPickRandomInstanceClick(View v){
|
||||
String lang=Locale.getDefault().getLanguage();
|
||||
List<CatalogInstance> instances=data.stream().filter(ci->!ci.approvalRequired && ("general".equals(ci.category) || (ci.categories!=null && ci.categories.contains("general"))) && (lang.equals(ci.language) || (ci.languages!=null && ci.languages.contains(lang)))).collect(Collectors.toList());
|
||||
if(instances.isEmpty()){
|
||||
instances=data.stream().filter(ci->!ci.approvalRequired && ("general".equals(ci.category) || (ci.categories!=null && ci.categories.contains("general")))).collect(Collectors.toList());
|
||||
}
|
||||
if(instances.isEmpty()){
|
||||
return;
|
||||
}
|
||||
chosenInstance=instances.get(new Random().nextInt(instances.size()));
|
||||
onNextClick(v);
|
||||
}
|
||||
|
||||
// private String getEmojiForCategory(String category){
|
||||
// return switch(category){
|
||||
// case "all" -> "💬";
|
||||
@@ -577,7 +527,7 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
updateFilteredList();
|
||||
}
|
||||
|
||||
private class InstancesAdapter extends UsableRecyclerView.Adapter<InstanceCatalogSignupFragment.InstanceViewHolder> implements ImageLoaderRecyclerAdapter{
|
||||
private class InstancesAdapter extends UsableRecyclerView.Adapter<InstanceCatalogSignupFragment.InstanceViewHolder>{
|
||||
public InstancesAdapter(){
|
||||
super(imgLoader);
|
||||
}
|
||||
@@ -603,22 +553,11 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
public int getItemViewType(int position){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getImageCountForItem(int position){
|
||||
return filteredData.get(position).thumbnailRequest!=null ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageLoaderRequest getImageRequest(int position, int image){
|
||||
return filteredData.get(position).thumbnailRequest;
|
||||
}
|
||||
}
|
||||
|
||||
private class InstanceViewHolder extends BindableViewHolder<CatalogInstance> implements UsableRecyclerView.DisableableClickable, ImageLoaderViewHolder{
|
||||
private class InstanceViewHolder extends BindableViewHolder<CatalogInstance> implements UsableRecyclerView.DisableableClickable{
|
||||
private final TextView title, description;
|
||||
private final RadioButton radioButton;
|
||||
private final ImageView thumbnail;
|
||||
private boolean enabled;
|
||||
|
||||
public InstanceViewHolder(){
|
||||
@@ -626,15 +565,12 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
title=findViewById(R.id.title);
|
||||
description=findViewById(R.id.description);
|
||||
radioButton=findViewById(R.id.radiobtn);
|
||||
thumbnail=findViewById(R.id.image);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind(CatalogInstance item){
|
||||
title.setText(item.normalizedDomain);
|
||||
radioButton.setChecked(chosenInstance==item);
|
||||
if(item.thumbnailRequest==null)
|
||||
thumbnail.setImageDrawable(null);
|
||||
Instance realInstance=instancesCache.get(item.normalizedDomain);
|
||||
float alpha;
|
||||
if(realInstance!=null && !realInstance.registrations){
|
||||
@@ -649,7 +585,6 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
title.setAlpha(alpha);
|
||||
description.setAlpha(alpha);
|
||||
radioButton.setAlpha(alpha);
|
||||
thumbnail.setAlpha(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -672,6 +607,9 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
adapter.notifyItemChanged(idx);
|
||||
}
|
||||
}
|
||||
if(!nextButton.isEnabled()){
|
||||
nextButton.setEnabled(true);
|
||||
}
|
||||
radioButton.setChecked(true);
|
||||
if(chosenInstance==null)
|
||||
nextButton.setEnabled(true);
|
||||
@@ -679,16 +617,6 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
loadInstanceInfo(chosenInstance.domain, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(int index, Drawable image){
|
||||
thumbnail.setImageDrawable(image);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearImage(int index){
|
||||
setImage(index, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(){
|
||||
return enabled;
|
||||
@@ -710,4 +638,5 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment imple
|
||||
return (this==GENERAL)==isGeneral;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.joinmastodon.android.model.Instance;
|
||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||
import org.joinmastodon.android.ui.text.HtmlParser;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
import org.joinmastodon.android.utils.ElevationOnScrollListener;
|
||||
import org.parceler.Parcels;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -28,6 +29,7 @@ import me.grishka.appkit.utils.BindableViewHolder;
|
||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.SingleViewRecyclerAdapter;
|
||||
import me.grishka.appkit.utils.V;
|
||||
import me.grishka.appkit.views.FragmentRootLinearLayout;
|
||||
import me.grishka.appkit.views.UsableRecyclerView;
|
||||
|
||||
public class InstanceRulesFragment extends ToolbarFragment{
|
||||
@@ -36,6 +38,9 @@ public class InstanceRulesFragment extends ToolbarFragment{
|
||||
private Button btn;
|
||||
private View buttonBar;
|
||||
private Instance instance;
|
||||
private ElevationOnScrollListener onScrollListener;
|
||||
|
||||
private static final int RULES_REQUEST=376;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState){
|
||||
@@ -71,6 +76,8 @@ public class InstanceRulesFragment extends ToolbarFragment{
|
||||
btn.setOnClickListener(v->onButtonClick());
|
||||
buttonBar=view.findViewById(R.id.button_bar);
|
||||
|
||||
view.findViewById(R.id.btn_back).setOnClickListener(v->Nav.finish(this));
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -79,19 +86,31 @@ public class InstanceRulesFragment extends ToolbarFragment{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
// setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||
// view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||
list.addOnScrollListener(onScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, buttonBar, getToolbar()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUpdateToolbar(){
|
||||
super.onUpdateToolbar();
|
||||
getToolbar().setBackground(null);
|
||||
getToolbar().setBackgroundResource(R.drawable.bg_onboarding_panel);
|
||||
getToolbar().setElevation(0);
|
||||
if(onScrollListener!=null){
|
||||
onScrollListener.setViews(buttonBar, getToolbar());
|
||||
}
|
||||
}
|
||||
|
||||
protected void onButtonClick(){
|
||||
Bundle args=new Bundle();
|
||||
args.putParcelable("instance", Parcels.wrap(instance));
|
||||
Nav.go(getActivity(), GoogleMadeMeAddThisFragment.class, args);
|
||||
Nav.goForResult(getActivity(), GoogleMadeMeAddThisFragment.class, args, RULES_REQUEST, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentResult(int reqCode, boolean success, Bundle result){
|
||||
super.onFragmentResult(reqCode, success, result);
|
||||
if(reqCode==RULES_REQUEST && !success){
|
||||
Nav.finish(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,6 +89,7 @@ public class ReportAddPostsChoiceFragment extends StatusListFragment{
|
||||
.setCallback(new SimpleCallback<>(this){
|
||||
@Override
|
||||
public void onSuccess(List<Status> result){
|
||||
if (getActivity() == null) return;
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -42,17 +42,9 @@ public class Announcement extends BaseModel implements DisplayItemsParent {
|
||||
}
|
||||
|
||||
public Status toStatus() {
|
||||
Status s = new Status();
|
||||
s.id = id;
|
||||
s.mediaAttachments = List.of();
|
||||
Status s = Status.ofFake(id, content, publishedAt);
|
||||
s.createdAt = startsAt != null ? startsAt : publishedAt;
|
||||
if (updatedAt != null) s.editedAt = updatedAt;
|
||||
s.content = s.text = content;
|
||||
s.spoilerText = "";
|
||||
s.visibility = StatusPrivacy.PUBLIC;
|
||||
s.mentions = List.of();
|
||||
s.tags = List.of();
|
||||
s.emojis = List.of();
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -84,6 +84,8 @@ public class Instance extends BaseModel{
|
||||
|
||||
public V2 v2;
|
||||
|
||||
public Pleroma pleroma;
|
||||
|
||||
@Override
|
||||
public void postprocess() throws ObjectValidationException{
|
||||
super.postprocess();
|
||||
@@ -193,4 +195,9 @@ public class Instance extends BaseModel{
|
||||
public boolean enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@Parcel
|
||||
public static class Pleroma extends BaseModel {
|
||||
// metadata etc
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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{" +
|
||||
|
||||
@@ -18,8 +18,8 @@ public class Notification extends BaseModel implements DisplayItemsParent{
|
||||
public Instant createdAt;
|
||||
@RequiredField
|
||||
public Account account;
|
||||
|
||||
public Status status;
|
||||
public Report report;
|
||||
|
||||
@Override
|
||||
public void postprocess() throws ObjectValidationException{
|
||||
@@ -48,6 +48,19 @@ public class Notification extends BaseModel implements DisplayItemsParent{
|
||||
@SerializedName("poll")
|
||||
POLL,
|
||||
@SerializedName("status")
|
||||
STATUS
|
||||
STATUS,
|
||||
@SerializedName("update")
|
||||
UPDATE,
|
||||
@SerializedName("admin.sign_up")
|
||||
SIGN_UP,
|
||||
@SerializedName("admin.report")
|
||||
REPORT
|
||||
}
|
||||
|
||||
@Parcel
|
||||
public static class Report {
|
||||
public String id;
|
||||
public String comment;
|
||||
public Account targetAccount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,13 @@ 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),
|
||||
@SerializedName("admin.sign_up")
|
||||
SIGN_UP(R.string.sk_sign_ups),
|
||||
@SerializedName("admin.report")
|
||||
REPORT(R.string.sk_new_reports);
|
||||
|
||||
@StringRes
|
||||
public final int localizedName;
|
||||
|
||||
@@ -45,10 +45,19 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
public boolean mention;
|
||||
public boolean poll;
|
||||
public boolean status;
|
||||
public boolean update;
|
||||
|
||||
// set to true here because i didn't add any items for those to the settings
|
||||
// (so i don't have to determine whether the user is an admin to show the items or not, and
|
||||
// admins can still disable those through the android notifications settings)
|
||||
@SerializedName("admin.sign_up")
|
||||
public boolean adminSignUp = true;
|
||||
@SerializedName("admin.report")
|
||||
public boolean adminReport = true;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -61,6 +70,9 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
||||
", mention="+mention+
|
||||
", poll="+poll+
|
||||
", status="+status+
|
||||
", update="+update+
|
||||
", adminSignUp="+adminSignUp+
|
||||
", adminReport="+adminReport+
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public class Status extends BaseModel implements DisplayItemsParent{
|
||||
public Card card;
|
||||
public String language;
|
||||
public String text;
|
||||
public boolean localOnly;
|
||||
|
||||
public boolean favourited;
|
||||
public boolean reblogged;
|
||||
@@ -83,6 +84,7 @@ public class Status extends BaseModel implements DisplayItemsParent{
|
||||
reblog.postprocess();
|
||||
|
||||
spoilerRevealed=GlobalUserPreferences.alwaysExpandContentWarnings || !sensitive;
|
||||
if (visibility.equals(StatusPrivacy.LOCAL)) localOnly = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,4 +146,18 @@ public class Status extends BaseModel implements DisplayItemsParent{
|
||||
strippedText=HtmlParser.strip(content);
|
||||
return strippedText;
|
||||
}
|
||||
|
||||
public static Status ofFake(String id, String text, Instant createdAt) {
|
||||
Status s = new Status();
|
||||
s.id = id;
|
||||
s.mediaAttachments = List.of();
|
||||
s.createdAt = createdAt;
|
||||
s.content = s.text = text;
|
||||
s.spoilerText = "";
|
||||
s.visibility = StatusPrivacy.PUBLIC;
|
||||
s.mentions = List.of();
|
||||
s.tags = List.of();
|
||||
s.emojis = List.of();
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ public enum StatusPrivacy{
|
||||
@SerializedName("private")
|
||||
PRIVATE(2),
|
||||
@SerializedName("direct")
|
||||
DIRECT(3);
|
||||
DIRECT(3),
|
||||
@SerializedName("local")
|
||||
LOCAL(4); // akkoma
|
||||
|
||||
private int privacy;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class TimelineDefinition {
|
||||
private @Nullable String hashtagName;
|
||||
|
||||
public static TimelineDefinition ofList(String listId, String listTitle) {
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.LIST, listTitle);
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.LIST);
|
||||
def.listId = listId;
|
||||
def.listTitle = listTitle;
|
||||
return def;
|
||||
@@ -42,7 +42,7 @@ public class TimelineDefinition {
|
||||
}
|
||||
|
||||
public static TimelineDefinition ofHashtag(String hashtag) {
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.HASHTAG, hashtag);
|
||||
TimelineDefinition def = new TimelineDefinition(TimelineType.HASHTAG);
|
||||
def.hashtagName = hashtag;
|
||||
return def;
|
||||
}
|
||||
@@ -58,11 +58,6 @@ public class TimelineDefinition {
|
||||
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);
|
||||
}
|
||||
@@ -142,7 +137,8 @@ public class TimelineDefinition {
|
||||
}
|
||||
|
||||
public TimelineDefinition copy() {
|
||||
TimelineDefinition def = new TimelineDefinition(type, title);
|
||||
TimelineDefinition def = new TimelineDefinition(type);
|
||||
def.title = title;
|
||||
def.listId = listId;
|
||||
def.listTitle = listTitle;
|
||||
def.hashtagName = hashtagName;
|
||||
@@ -165,12 +161,64 @@ public class TimelineDefinition {
|
||||
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_alert_24_regular, R.string.sk_timeline_posts, true),
|
||||
LIST(R.drawable.ic_fluent_people_list_24_regular, R.string.sk_list, true),
|
||||
POST_NOTIFICATIONS(R.drawable.ic_fluent_chat_24_regular, R.string.sk_timeline_posts, true),
|
||||
LIST(R.drawable.ic_fluent_people_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;
|
||||
|
||||
@@ -96,9 +96,10 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
||||
|
||||
visibility.setImageResource(switch (s.visibility) {
|
||||
case PUBLIC -> R.drawable.ic_fluent_earth_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_people_community_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_people_checkmark_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled;
|
||||
case DIRECT -> R.drawable.ic_fluent_mention_20_regular;
|
||||
case LOCAL -> R.drawable.ic_fluent_eye_20_regular;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
||||
boost.setSelected(item.status.reblogged);
|
||||
favorite.setSelected(item.status.favourited);
|
||||
bookmark.setSelected(item.status.bookmarked);
|
||||
boost.setEnabled(item.status.visibility==StatusPrivacy.PUBLIC || item.status.visibility==StatusPrivacy.UNLISTED
|
||||
boost.setEnabled(item.status.visibility==StatusPrivacy.PUBLIC || item.status.visibility==StatusPrivacy.UNLISTED || item.status.visibility==StatusPrivacy.LOCAL
|
||||
|| (item.status.visibility==StatusPrivacy.PRIVATE && item.status.account.id.equals(AccountSessionManager.getInstance().getAccount(item.accountID).self.id)));
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
||||
|
||||
Drawable checkMark = ctx.getDrawable(R.drawable.ic_fluent_checkmark_circle_20_regular);
|
||||
Drawable publicDrawable = ctx.getDrawable(R.drawable.ic_fluent_earth_24_regular);
|
||||
Drawable unlistedDrawable = ctx.getDrawable(R.drawable.ic_fluent_people_community_24_regular);
|
||||
Drawable followersDrawable = ctx.getDrawable(R.drawable.ic_fluent_people_checkmark_24_regular);
|
||||
Drawable unlistedDrawable = ctx.getDrawable(R.drawable.ic_fluent_lock_open_24_regular);
|
||||
Drawable followersDrawable = ctx.getDrawable(R.drawable.ic_fluent_lock_closed_24_filled);
|
||||
|
||||
StatusPrivacy defaultVisibility = session.preferences != null ? session.preferences.postingDefaultVisibility : null;
|
||||
// e.g. post visibility is unlisted, but default is public
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
@@ -31,6 +30,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;
|
||||
@@ -42,6 +42,7 @@ import org.joinmastodon.android.model.Notification;
|
||||
import org.joinmastodon.android.model.Relationship;
|
||||
import org.joinmastodon.android.model.ScheduledStatus;
|
||||
import org.joinmastodon.android.model.Status;
|
||||
import org.joinmastodon.android.model.StatusPrivacy;
|
||||
import org.joinmastodon.android.ui.text.HtmlParser;
|
||||
import org.joinmastodon.android.ui.utils.CustomEmojiHelper;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
@@ -51,6 +52,7 @@ import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -180,7 +182,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 +191,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 +206,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 +264,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;
|
||||
});
|
||||
@@ -310,12 +319,15 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
}
|
||||
itemView.setPadding(itemView.getPaddingLeft(), itemView.getPaddingTop(), itemView.getPaddingRight(), item.needBottomPadding ? V.dp(16) : 0);
|
||||
if(TextUtils.isEmpty(item.extraText)){
|
||||
extraText.setVisibility(View.GONE);
|
||||
if (item.status != null) {
|
||||
UiUtils.setExtraTextInfo(item.parentFragment.getContext(), extraText, item.status.visibility, item.status.localOnly);
|
||||
}
|
||||
}else{
|
||||
extraText.setVisibility(View.VISIBLE);
|
||||
extraText.setText(item.extraText);
|
||||
}
|
||||
more.setVisibility(item.inset ? View.GONE : View.VISIBLE);
|
||||
more.setVisibility(item.inset || (item.notification != null && item.notification.report != null)
|
||||
? View.GONE : View.VISIBLE);
|
||||
avatar.setClickable(!item.inset);
|
||||
avatar.setContentDescription(item.parentFragment.getString(R.string.avatar_description, item.user.acct));
|
||||
if(currentRelationshipRequest!=null){
|
||||
@@ -343,6 +355,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
public void onSuccess(Object o) {
|
||||
item.consumeReadAnnouncement.accept(item.announcement.id);
|
||||
item.announcement.read = true;
|
||||
if (item.parentFragment.getActivity() == null) return;
|
||||
rebind();
|
||||
}
|
||||
|
||||
@@ -415,6 +428,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
}
|
||||
|
||||
private void updateOptionsMenu(){
|
||||
if (item.parentFragment.getActivity() == null) return;
|
||||
if (item.announcement != null) return;
|
||||
boolean hasMultipleAccounts = AccountSessionManager.getInstance().getLoggedInAccounts().size() > 1;
|
||||
Menu menu=optionsMenu.getMenu();
|
||||
@@ -445,6 +459,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 +476,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 +497,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
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;
|
||||
@@ -22,6 +24,7 @@ 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){
|
||||
@@ -37,10 +40,12 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
public static class Holder extends ImageStatusDisplayItem.Holder<PhotoStatusDisplayItem>{
|
||||
private final FrameLayout altTextWrapper;
|
||||
private final TextView altTextButton;
|
||||
private final ImageView noAltTextButton;
|
||||
private final View altTextScroller;
|
||||
private final ImageButton altTextClose;
|
||||
private final TextView altText;
|
||||
private final TextView altText, noAltText;
|
||||
|
||||
private View altOrNoAltButton;
|
||||
private boolean altTextShown;
|
||||
private AnimatorSet currentAnim;
|
||||
|
||||
@@ -48,11 +53,14 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
super(activity, R.layout.display_item_photo, parent);
|
||||
altTextWrapper=findViewById(R.id.alt_text_wrapper);
|
||||
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);
|
||||
noAltText=findViewById(R.id.no_alt_text);
|
||||
|
||||
altTextButton.setOnClickListener(this::onShowHideClick);
|
||||
noAltTextButton.setOnClickListener(this::onShowHideClick);
|
||||
altTextClose.setOnClickListener(this::onShowHideClick);
|
||||
// altTextScroller.setNestedScrollingEnabled(true);
|
||||
}
|
||||
@@ -60,22 +68,48 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
@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);
|
||||
if(TextUtils.isEmpty(item.attachment.description)){
|
||||
altTextWrapper.setVisibility(View.GONE);
|
||||
noAltTextButton.setVisibility(View.VISIBLE);
|
||||
altTextButton.setAlpha(1f);
|
||||
noAltTextButton.setAlpha(1f);
|
||||
altTextWrapper.setVisibility(View.VISIBLE);
|
||||
|
||||
if (altTextMissing){
|
||||
if (GlobalUserPreferences.showNoAltIndicator) {
|
||||
noAltTextButton.setVisibility(View.VISIBLE);
|
||||
noAltText.setVisibility(View.VISIBLE);
|
||||
altTextWrapper.setBackgroundResource(R.drawable.bg_image_no_alt_overlay);
|
||||
altTextButton.setVisibility(View.GONE);
|
||||
altText.setVisibility(View.GONE);
|
||||
} else {
|
||||
altTextWrapper.setVisibility(View.GONE);
|
||||
}
|
||||
}else{
|
||||
altTextWrapper.setVisibility(View.VISIBLE);
|
||||
altText.setText(item.attachment.description);
|
||||
if (GlobalUserPreferences.showAltIndicator) {
|
||||
noAltTextButton.setVisibility(View.GONE);
|
||||
noAltText.setVisibility(View.GONE);
|
||||
altTextWrapper.setBackgroundResource(R.drawable.bg_image_alt_overlay);
|
||||
altTextButton.setVisibility(View.VISIBLE);
|
||||
altTextButton.setText(R.string.sk_alt_button);
|
||||
altText.setVisibility(View.VISIBLE);
|
||||
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_button;
|
||||
boolean show=v.getId()==R.id.alt_button || v.getId()==R.id.no_alt_button;
|
||||
|
||||
if(altTextShown==show)
|
||||
return;
|
||||
@@ -87,7 +121,7 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
altTextScroller.setVisibility(View.VISIBLE);
|
||||
altTextClose.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
altTextButton.setVisibility(View.VISIBLE);
|
||||
altOrNoAltButton.setVisibility(View.VISIBLE);
|
||||
// Hide these views temporarily so FrameLayout measures correctly
|
||||
altTextScroller.setVisibility(View.GONE);
|
||||
altTextClose.setVisibility(View.GONE);
|
||||
@@ -114,7 +148,7 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
ObjectAnimator.ofInt(altTextWrapper, "left", prevLeft, altTextWrapper.getLeft()),
|
||||
ObjectAnimator.ofInt(altTextWrapper, "right", prevRight, altTextWrapper.getRight()),
|
||||
ObjectAnimator.ofInt(altTextWrapper, "top", prevTop, altTextWrapper.getTop()),
|
||||
ObjectAnimator.ofFloat(altTextButton, View.ALPHA, show ? 1f : 0f, show ? 0f : 1f),
|
||||
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)
|
||||
);
|
||||
@@ -124,7 +158,7 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation){
|
||||
if(show){
|
||||
altTextButton.setVisibility(View.GONE);
|
||||
altOrNoAltButton.setVisibility(View.GONE);
|
||||
}else{
|
||||
altTextScroller.setVisibility(View.GONE);
|
||||
altTextClose.setVisibility(View.GONE);
|
||||
|
||||
@@ -39,10 +39,11 @@ public class PollFooterStatusDisplayItem extends StatusDisplayItem{
|
||||
@Override
|
||||
public void onBind(PollFooterStatusDisplayItem item){
|
||||
String text=item.parentFragment.getResources().getQuantityString(R.plurals.x_voters, item.poll.votersCount, item.poll.votersCount);
|
||||
String sep=item.parentFragment.getString(R.string.sk_separator);
|
||||
if(item.poll.expiresAt!=null && !item.poll.isExpired()){
|
||||
text+=" · "+UiUtils.formatTimeLeft(itemView.getContext(), item.poll.expiresAt);
|
||||
text+=" "+sep+" "+UiUtils.formatTimeLeft(itemView.getContext(), item.poll.expiresAt);
|
||||
}else if(item.poll.isExpired()){
|
||||
text+=" · "+item.parentFragment.getString(R.string.poll_closed);
|
||||
text+=" "+sep+" "+item.parentFragment.getString(R.string.poll_closed);
|
||||
}
|
||||
this.text.setText(text);
|
||||
button.setVisibility(item.poll.isExpired() || item.poll.voted || (!item.poll.multiple && !GlobalUserPreferences.voteButtonForSingleChoice) ? View.GONE : View.VISIBLE);
|
||||
|
||||
@@ -55,8 +55,8 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
|
||||
this.visibility = visibility;
|
||||
this.iconEnd = visibility != null ? switch (visibility) {
|
||||
case PUBLIC -> R.drawable.ic_fluent_earth_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_people_community_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_people_checkmark_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled;
|
||||
default -> 0;
|
||||
} : 0;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,16 @@ 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.ListTimelineFragment;
|
||||
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 +32,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;
|
||||
@@ -100,6 +106,25 @@ 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 instanceof ListTimelineFragment
|
||||
) && 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));
|
||||
|
||||
@@ -141,8 +141,9 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
||||
}
|
||||
|
||||
Instance instanceInfo = AccountSessionManager.getInstance().getInstanceInfo(item.session.domain);
|
||||
boolean translateEnabled = !item.disableTranslate && instanceInfo.v2 != null &&
|
||||
instanceInfo.v2.configuration.translation != null && instanceInfo.v2.configuration.translation.enabled;
|
||||
boolean translateEnabled = !item.disableTranslate && instanceInfo != null &&
|
||||
instanceInfo.v2 != null && instanceInfo.v2.configuration.translation != null &&
|
||||
instanceInfo.v2.configuration.translation.enabled;
|
||||
|
||||
translateWrap.setVisibility(
|
||||
(!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable) &&
|
||||
@@ -163,6 +164,7 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
||||
public void onSuccess(TranslatedStatus translatedStatus) {
|
||||
item.translation = translatedStatus;
|
||||
item.translated = true;
|
||||
if (item.parentFragment.getActivity() == null) return;
|
||||
translateProgress.setVisibility(View.GONE);
|
||||
translateButton.setClickable(true);
|
||||
translateButton.animate().alpha(1).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(50).start();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,116 @@
|
||||
package org.joinmastodon.android.utils;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.view.View;
|
||||
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import me.grishka.appkit.utils.CubicBezierInterpolator;
|
||||
import me.grishka.appkit.utils.V;
|
||||
import me.grishka.appkit.views.FragmentRootLinearLayout;
|
||||
|
||||
public class ElevationOnScrollListener extends RecyclerView.OnScrollListener implements View.OnScrollChangeListener{
|
||||
private boolean isAtTop;
|
||||
private Animator currentPanelsAnim;
|
||||
private View[] views;
|
||||
private FragmentRootLinearLayout fragmentRootLayout;
|
||||
|
||||
public ElevationOnScrollListener(FragmentRootLinearLayout fragmentRootLayout, View... views){
|
||||
isAtTop=true;
|
||||
this.fragmentRootLayout=fragmentRootLayout;
|
||||
this.views=views;
|
||||
for(View v:views){
|
||||
Drawable bg=v.getBackground().mutate();
|
||||
v.setBackground(bg);
|
||||
if(bg instanceof LayerDrawable ld){
|
||||
Drawable overlay=ld.findDrawableByLayerId(R.id.color_overlay);
|
||||
if(overlay!=null){
|
||||
overlay.setAlpha(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setViews(View... views){
|
||||
List<View> oldViews=Arrays.asList(this.views);
|
||||
this.views=views;
|
||||
for(View v:views){
|
||||
if(oldViews.contains(v))
|
||||
continue;
|
||||
Drawable bg=v.getBackground().mutate();
|
||||
v.setBackground(bg);
|
||||
if(bg instanceof LayerDrawable ld){
|
||||
Drawable overlay=ld.findDrawableByLayerId(R.id.color_overlay);
|
||||
if(overlay!=null){
|
||||
overlay.setAlpha(isAtTop ? 0 : 20);
|
||||
}
|
||||
}
|
||||
v.setTranslationZ(isAtTop ? 0 : V.dp(3));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy){
|
||||
boolean newAtTop=recyclerView.getChildCount()==0 || (recyclerView.getChildAdapterPosition(recyclerView.getChildAt(0))==0 && recyclerView.getChildAt(0).getTop()==recyclerView.getPaddingTop());
|
||||
handleScroll(recyclerView.getContext(), newAtTop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
||||
handleScroll(v.getContext(), scrollY==0);
|
||||
}
|
||||
|
||||
private void handleScroll(Context context, boolean newAtTop){
|
||||
if(newAtTop!=isAtTop){
|
||||
isAtTop=newAtTop;
|
||||
if(currentPanelsAnim!=null)
|
||||
currentPanelsAnim.cancel();
|
||||
|
||||
AnimatorSet set=new AnimatorSet();
|
||||
ArrayList<Animator> anims=new ArrayList<>();
|
||||
for(View v:views){
|
||||
if(v.getBackground() instanceof LayerDrawable ld){
|
||||
Drawable overlay=ld.findDrawableByLayerId(R.id.color_overlay);
|
||||
if(overlay!=null){
|
||||
anims.add(ObjectAnimator.ofInt(overlay, "alpha", isAtTop ? 0 : 20));
|
||||
}
|
||||
}
|
||||
anims.add(ObjectAnimator.ofFloat(v, View.TRANSLATION_Z, isAtTop ? 0 : V.dp(3)));
|
||||
}
|
||||
if(fragmentRootLayout!=null){
|
||||
int color;
|
||||
if(isAtTop){
|
||||
color=UiUtils.getThemeColor(context, R.attr.toolbarBackground);
|
||||
}else{
|
||||
color=UiUtils.alphaBlendColors(UiUtils.getThemeColor(context, R.attr.toolbarBackground), UiUtils.getThemeColor(context, R.attr.colorWindowBackground), 0.07843137f);
|
||||
}
|
||||
anims.add(ObjectAnimator.ofArgb(fragmentRootLayout, "statusBarColor", color));
|
||||
}
|
||||
set.playTogether(anims);
|
||||
set.setDuration(150);
|
||||
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||
set.addListener(new AnimatorListenerAdapter(){
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation){
|
||||
currentPanelsAnim=null;
|
||||
}
|
||||
});
|
||||
set.start();
|
||||
currentPanelsAnim=set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#D49E050A"/>
|
||||
<corners android:radius="20dp"/>
|
||||
</shape>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<color android:color="?colorM3Background"/>
|
||||
<color android:color="?colorWindowBackground"/>
|
||||
</item>
|
||||
<item android:id="@+id/color_overlay">
|
||||
<color android:color="?colorM3Primary"/>
|
||||
<color android:color="?toolbarBackground"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -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="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="M16.25 5.18c-0.25 0.33-0.187 0.8 0.142 1.051C18.18 7.595 19.25 9.708 19.25 12c0 3.736-2.826 6.812-6.457 7.207l0.677-0.677c0.293-0.293 0.293-0.767 0-1.06-0.267-0.267-0.683-0.29-0.977-0.073L12.41 17.47l-2 2c-0.266 0.266-0.29 0.683-0.073 0.976l0.073 0.084 2 2c0.293 0.293 0.768 0.293 1.06 0 0.267-0.266 0.291-0.683 0.073-0.976L13.47 21.47l-0.75-0.75c4.495-0.365 8.03-4.13 8.03-8.72 0-2.765-1.292-5.317-3.448-6.961-0.33-0.252-0.8-0.188-1.051 0.141zm-5.72-3.71c-0.293 0.293-0.293 0.767 0 1.06l0.75 0.75C6.784 3.645 3.25 7.41 3.25 12c0 2.645 1.181 5.097 3.18 6.75 0.32 0.263 0.793 0.218 1.057-0.102 0.263-0.319 0.218-0.792-0.1-1.055-1.66-1.37-2.637-3.4-2.637-5.593 0-3.736 2.825-6.811 6.456-7.207L10.53 5.47c-0.293 0.293-0.293 0.767 0 1.06 0.293 0.293 0.768 0.293 1.061 0l2-2c0.293-0.293 0.293-0.767 0-1.06l-2-2c-0.293-0.293-0.768-0.293-1.06 0z" 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="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||
<path android:pathData="M3.26 11.602C3.942 8.327 6.793 6 10 6c3.206 0 6.057 2.327 6.74 5.602 0.057 0.27 0.322 0.444 0.593 0.387 0.27-0.056 0.443-0.32 0.387-0.591C16.943 7.673 13.693 5 10 5c-3.693 0-6.943 2.673-7.72 6.398-0.056 0.27 0.117 0.535 0.388 0.591 0.27 0.057 0.535-0.117 0.591-0.387zM10 8c-1.933 0-3.5 1.567-3.5 3.5S8.067 15 10 15s3.5-1.567 3.5-3.5S11.933 8 10 8zm-2.5 3.5C7.5 10.12 8.62 9 10 9s2.5 1.12 2.5 2.5S11.38 14 10 14s-2.5-1.12-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="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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user