Compare commits
42 Commits
v1.1.4+for
...
1.1.4+fork
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e15dd6024f | ||
|
|
e52dffeece | ||
|
|
5b85bb427d | ||
|
|
4d62388617 | ||
|
|
04b8055474 | ||
|
|
3c34b6a7d2 | ||
|
|
de4964c2cd | ||
|
|
fbcaa05c03 | ||
|
|
883f28696e | ||
|
|
df52230837 | ||
|
|
a90f26a37a | ||
|
|
8c1f76d7fa | ||
|
|
f384d44f8f | ||
|
|
4ab6ed55f5 | ||
|
|
cf99bf5152 | ||
|
|
10779717cf | ||
|
|
db4c1bfe47 | ||
|
|
27afba1cf2 | ||
|
|
4895425b40 | ||
|
|
004c414fba | ||
|
|
c8e38b134c | ||
|
|
de5a911286 | ||
|
|
606cd7442e | ||
|
|
3ebc972268 | ||
|
|
4e39bb381c | ||
|
|
b6178681b0 | ||
|
|
29abf70cec | ||
|
|
8d63be513d | ||
|
|
e63b9d0dd6 | ||
|
|
b1fda17ac7 | ||
|
|
bad44b145c | ||
|
|
77669cedf6 | ||
|
|
19238c389f | ||
|
|
1747ff98b5 | ||
|
|
8fa5824e3e | ||
|
|
6a674d7a7e | ||
|
|
dad3b8cd6b | ||
|
|
9179d2198d | ||
|
|
d096bef234 | ||
|
|
f2c47a1b84 | ||
|
|
bc2ac4e915 | ||
|
|
ff215412c8 |
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**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.
|
|
||||||
20
.github/ISSUE_TEMPLATE/feature-ui-request.md
vendored
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature/UI request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: feature
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
If applicable: a clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
10
.github/ISSUE_TEMPLATE/something-else.md
vendored
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
name: It's something else…
|
|
||||||
about: Issues that can't be categorized as feature requests or bug reports
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
65
README.md
@@ -1,17 +1,12 @@
|
|||||||

|

|
||||||
|
|
||||||
# Megalodon
|
# Moshidon
|
||||||
|
|
||||||
[](https://translate.codeberg.org/engage/megalodon/)
|
> A fork of [megalodon](https://github.com/sk22/megalodon) which is a fork of [official Mastodon Android app](https://github.com/mastodon/mastodon-android) adding important features that are missing in the official app and possibly won’t ever be implemented, such as the federated timeline, unlisted posting, bookmarks and an image description viewer.
|
||||||
|
|
||||||
[](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk)
|
|
||||||
|
|
||||||
<a href="https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk"><img height="50" alt="Get it on Google Play" src="img/google-play-badge.png"></a>
|
**Warning! [The last version's integrated updater was broken](https://github.com/sk22/megalodon/issues/106) – I already published a fixed version! If you're not updating through Izzy's F-Droid repository (more sources to come, hopefully!), you'll have to download the current release manually. Sorry about that!**
|
||||||
|
|
||||||
<a href="https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk"><img height="50" alt="Get it on F-Droid" src="img/f-droid-badge.png"></a>
|
|
||||||
|
|
||||||
> A fork of the [official Mastodon Android app](https://github.com/mastodon/mastodon-android) adding important features that are missing in the official app and possibly won’t ever be implemented, such as the federated timeline, unlisted posting and an image description viewer.
|
|
||||||
|
|
||||||
|
[](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -46,32 +41,24 @@ This is important to **ensure the content you’re sharing is as accessible as p
|
|||||||
|
|
||||||
On the Fediverse, it’s quite common for people to pin posts they want others to read before following them. You can pin/unpin posts yourself by clicking the `⋯` button in the top right corner of your posts.
|
On the Fediverse, it’s quite common for people to pin posts they want others to read before following them. You can pin/unpin posts yourself by clicking the `⋯` button in the top right corner of your posts.
|
||||||
|
|
||||||
|
### **Bookmarks**
|
||||||
|
|
||||||
|
**They allow for quickly saving posts and viewing them through the Bookmarks button on the top right of your profile.**
|
||||||
|
|
||||||
|
To bookmark a post, press the button between the Favorite and Share buttons on the bottom of the post. Bookmarks are saved privately, so the post authors won’t know you saved their post – the list of bookmarked posts is only visible to you.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### From app stores
|
**Press the download button above to download the APK. Open the downloaded file on your Android device to install it. Megalodon will automatically notify you about new updates inside the app.**
|
||||||
|
|
||||||
* **[Izzy's F-Droid repository](https://apt.izzysoft.de/fdroid/repo)**: [apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk](https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk)
|
To install this app on your Android device, download the [latest release from GitHub](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk) and open it. You might have to accept installing APK files from your browser when trying to install it. You can also take a look at all releases on the [Releases](https://github.com/sk22/megalodon/releases) page.
|
||||||
|
|
||||||
Note that you'll need to add Izzy's F-Droid repository to your F-Droid app first:
|
|
||||||
|
|
||||||
`https://apt.izzysoft.de/fdroid/repo`
|
|
||||||
|
|
||||||
* **[Google Play Store](https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk)**: [play.google.com/store/apps/details?id=org.joinmastodon.android.sk](https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk)
|
|
||||||
|
|
||||||
* **[F-Droid.org](https://f-droid.org)?** Not yet, sorry!
|
|
||||||
|
|
||||||
If you want, you can help me figure out if something's missing in the [Issue #47: F-Droid.org](https://github.com/sk22/megalodon/issues/47)
|
|
||||||
|
|
||||||
### Directly from GitHub
|
|
||||||
|
|
||||||
Press the download button to download the APK. Open the downloaded file on your Android device to install it. Megalodon will automatically notify you about new updates inside the app.
|
|
||||||
|
|
||||||
[](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk)
|
|
||||||
|
|
||||||
You might have to accept installing APK files from your browser when trying to install it. You can also take a look at all releases on the [Releases](https://github.com/sk22/megalodon/releases) page.
|
|
||||||
|
|
||||||
Megalodon makes use of [Mastodon for Android](https://github.com/mastodon/mastodon-android)’s automatic update checker. Megalodon will check for new updates available on GitHub and offer to download and install them. You can also manually press “Check for updates” at the bottom of the settings page!
|
Megalodon makes use of [Mastodon for Android](https://github.com/mastodon/mastodon-android)’s automatic update checker. Megalodon will check for new updates available on GitHub and offer to download and install them. You can also manually press “Check for updates” at the bottom of the settings page!
|
||||||
|
|
||||||
|
### Other sources
|
||||||
|
|
||||||
|
* **[Izzy's F-Droid repository](https://apt.izzysoft.de/fdroid/repo)**: https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -91,19 +78,6 @@ This is an **unmodified version** of the official [Mastodon for Android](https:/
|
|||||||
|
|
||||||
Variant without the integrated updater. This is the variant to be published to F-Droid.org where an integrated updater is not necessary. -->
|
Variant without the integrated updater. This is the variant to be published to F-Droid.org where an integrated updater is not necessary. -->
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Contribution
|
|
||||||
|
|
||||||
### Translation
|
|
||||||
|
|
||||||
As with the source code, the translation is sourced from the official project, which you can contribute to on the official “**Mastodon for Android**” Crowdin project: https://crowdin.com/project/mastodon-for-android
|
|
||||||
|
|
||||||
There's also a handful of custom strings exclusive to this projects that would need to be translated. You can help translate **Megalodon** on Weblate: https://translate.codeberg.org/projects/megalodon/
|
|
||||||
|
|
||||||
[](https://translate.codeberg.org/engage/megalodon/)
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -131,7 +105,6 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Show visibility of original post when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-reply-visibility)
|
* [Show visibility of original post when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-reply-visibility)
|
||||||
* [Clickable reply/boost line above posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:clickable-boost-reply-line)
|
* [Clickable reply/boost line above posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:clickable-boost-reply-line)
|
||||||
* [Clickable reply line while replying to open original post](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/clickable-reply-line-compose)
|
* [Clickable reply line while replying to open original post](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/clickable-reply-line-compose)
|
||||||
* [Add push notification setting for post notifications](https://github.com/sk22/megalodon/commit/b190480d7739be47f23543d9e7644660f9b4b4ee)
|
|
||||||
|
|
||||||
|
|
||||||
### Behavior
|
### Behavior
|
||||||
@@ -143,11 +116,6 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Option to hide interaction numbers](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/hide-interaction-numbers)
|
* [Option to hide interaction numbers](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/hide-interaction-numbers)
|
||||||
* [Option to always reveal content warnings](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/cw-above-text)
|
* [Option to always reveal content warnings](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/cw-above-text)
|
||||||
* [Option to disable scrolling title bars](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/disable-marquee)
|
* [Option to disable scrolling title bars](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/disable-marquee)
|
||||||
* [No ellipsis for long poll answers](https://github.com/mastodon/mastodon-android/commit/c9aae828e2518adccdc092e41f8d1f0489636271)
|
|
||||||
* [Show poll vote button for multiple and single answer polls](https://github.com/mastodon/mastodon-android/commit/e14dfda2fdf32f0fa3043504ac5831683a87559a)
|
|
||||||
* [Show own vote after voting](https://github.com/mastodon/mastodon-android/commit/4ab9e25fec4fd9c10b7a8ddd1be522b3cc12cf28) ([Closes issue](https://github.com/mastodon/mastodon-android/commit/4ab9e25fec4fd9c10b7a8ddd1be522b3cc12cf28))
|
|
||||||
* [Make inline emoji search case-insensitive and don't only search from start of emoji names](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:better-inline-emoji-search) ([Pull request](https://github.com/mastodon/mastodon-android/pull/445))
|
|
||||||
* [Include subject line when sharing e.g. a website to Megalodon](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:external-share-include-subject)
|
|
||||||
|
|
||||||
|
|
||||||
### Visual
|
### Visual
|
||||||
@@ -155,7 +123,6 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Custom extended footer redesign](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:compact-extended-footer)
|
* [Custom extended footer redesign](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:compact-extended-footer)
|
||||||
* [Improvements to the true black mode](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:true-black-improvements)
|
* [Improvements to the true black mode](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:true-black-improvements)
|
||||||
* [Profile header tweaks](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:ui/profile-header-tweaks)
|
* [Profile header tweaks](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:ui/profile-header-tweaks)
|
||||||
* [Custom color themes](https://github.com/sk22/megalodon/pull/124) by [@LucasGGamerM](https://github.com/LucasGGamerM)
|
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 17 KiB |
@@ -5,12 +5,12 @@ plugins {
|
|||||||
android {
|
android {
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
archivesBaseName = "megalodon"
|
archivesBaseName = "moshidon"
|
||||||
applicationId "org.joinmastodon.android.sk"
|
applicationId "org.joinmastodon.android.moshinda"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 56
|
versionCode 56
|
||||||
versionName "1.1.4+fork.56"
|
versionName "1.1.4+fork.56.moshinda"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
resConfigs "en", "ar-rSA", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES",
|
resConfigs "en", "ar-rSA", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES",
|
||||||
"eu-rES", "fi-rFI", "fr-rFR", "gl-rES", "hr-rHR", "hy-rAM", "it-rIT", "iw-rIL",
|
"eu-rES", "fi-rFI", "fr-rFR", "gl-rES", "hr-rHR", "hy-rAM", "it-rIT", "iw-rIL",
|
||||||
@@ -32,11 +32,9 @@ android {
|
|||||||
githubRelease{
|
githubRelease{
|
||||||
initWith release
|
initWith release
|
||||||
}
|
}
|
||||||
playRelease{
|
noFederatedRelease{
|
||||||
initWith release
|
initWith release
|
||||||
minifyEnabled true
|
versionNameSuffix '-nofederated'
|
||||||
shrinkResources true
|
|
||||||
versionNameSuffix '-play'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|||||||
BIN
mastodon/src/github/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -111,7 +111,7 @@ public class GithubSelfUpdaterImpl extends GithubSelfUpdater{
|
|||||||
|
|
||||||
private void actuallyCheckForUpdates(){
|
private void actuallyCheckForUpdates(){
|
||||||
Request req=new Request.Builder()
|
Request req=new Request.Builder()
|
||||||
.url("https://api.github.com/repos/sk22/megalodon/releases/latest")
|
.url("https://api.github.com/repos/LucasGGamerM/moshidon/releases/latest")
|
||||||
.build();
|
.build();
|
||||||
Call call=MastodonAPIController.getHttpClient().newCall(req);
|
Call call=MastodonAPIController.getHttpClient().newCall(req);
|
||||||
try(Response resp=call.execute()){
|
try(Response resp=call.execute()){
|
||||||
@@ -144,7 +144,7 @@ public class GithubSelfUpdaterImpl extends GithubSelfUpdater{
|
|||||||
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
||||||
for(JsonElement el:obj.getAsJsonArray("assets")){
|
for(JsonElement el:obj.getAsJsonArray("assets")){
|
||||||
JsonObject asset=el.getAsJsonObject();
|
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())){
|
if("moshidon.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();
|
long size=asset.get("size").getAsLong();
|
||||||
String url=asset.get("browser_download_url").getAsString();
|
String url=asset.get("browser_download_url").getAsString();
|
||||||
|
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
<application
|
<application
|
||||||
android:name=".MastodonApp"
|
android:name=".MastodonApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:label="@string/sk_app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:localeConfig="@xml/locales_config"
|
android:localeConfig="@xml/locales_config"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:theme="@style/Theme.Mastodon.AutoLightDark"
|
android:theme="@style/Theme.Mastodon.AutoLightDark.Original"
|
||||||
android:largeHeap="true">
|
android:largeHeap="true">
|
||||||
|
|
||||||
<activity android:name=".MainActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask">
|
<activity android:name=".MainActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask">
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 15 KiB |
@@ -51,10 +51,7 @@ public class ExternalShareActivity extends FragmentStackActivity{
|
|||||||
getWindow().setBackgroundDrawable(null);
|
getWindow().setBackgroundDrawable(null);
|
||||||
|
|
||||||
Intent intent=getIntent();
|
Intent intent=getIntent();
|
||||||
StringBuilder builder=new StringBuilder();
|
String text=intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
if (intent.hasExtra(Intent.EXTRA_SUBJECT)) builder.append(intent.getStringExtra(Intent.EXTRA_SUBJECT)).append("\n");
|
|
||||||
if (intent.hasExtra(Intent.EXTRA_TEXT)) builder.append(intent.getStringExtra(Intent.EXTRA_TEXT)).append("\n");
|
|
||||||
String text=builder.toString();
|
|
||||||
List<Uri> mediaUris;
|
List<Uri> mediaUris;
|
||||||
if(Intent.ACTION_SEND.equals(intent.getAction())){
|
if(Intent.ACTION_SEND.equals(intent.getAction())){
|
||||||
Uri singleUri=intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
Uri singleUri=intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||||
|
|||||||
@@ -10,11 +10,9 @@ public class GlobalUserPreferences{
|
|||||||
public static boolean showReplies;
|
public static boolean showReplies;
|
||||||
public static boolean showBoosts;
|
public static boolean showBoosts;
|
||||||
public static boolean loadNewPosts;
|
public static boolean loadNewPosts;
|
||||||
public static boolean showFederatedTimeline;
|
|
||||||
public static boolean showInteractionCounts;
|
public static boolean showInteractionCounts;
|
||||||
public static boolean alwaysExpandContentWarnings;
|
public static boolean alwaysExpandContentWarnings;
|
||||||
public static boolean disableMarquee;
|
public static boolean disableMarquee;
|
||||||
public static boolean voteButtonForSingleChoice;
|
|
||||||
public static ThemePreference theme;
|
public static ThemePreference theme;
|
||||||
public static ColorPreference color;
|
public static ColorPreference color;
|
||||||
|
|
||||||
@@ -30,13 +28,11 @@ public class GlobalUserPreferences{
|
|||||||
showReplies=prefs.getBoolean("showReplies", true);
|
showReplies=prefs.getBoolean("showReplies", true);
|
||||||
showBoosts=prefs.getBoolean("showBoosts", true);
|
showBoosts=prefs.getBoolean("showBoosts", true);
|
||||||
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
||||||
showFederatedTimeline=prefs.getBoolean("showFederatedTimeline", !BuildConfig.BUILD_TYPE.equals("playRelease"));
|
|
||||||
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
||||||
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
||||||
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
||||||
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
|
|
||||||
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
||||||
color=ColorPreference.values()[prefs.getInt("color", 0)];
|
color=ColorPreference.values()[prefs.getInt("color", 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save(){
|
public static void save(){
|
||||||
@@ -46,7 +42,6 @@ public class GlobalUserPreferences{
|
|||||||
.putBoolean("showReplies", showReplies)
|
.putBoolean("showReplies", showReplies)
|
||||||
.putBoolean("showBoosts", showBoosts)
|
.putBoolean("showBoosts", showBoosts)
|
||||||
.putBoolean("loadNewPosts", loadNewPosts)
|
.putBoolean("loadNewPosts", loadNewPosts)
|
||||||
.putBoolean("showFederatedTimeline", showFederatedTimeline)
|
|
||||||
.putBoolean("trueBlackTheme", trueBlackTheme)
|
.putBoolean("trueBlackTheme", trueBlackTheme)
|
||||||
.putBoolean("showInteractionCounts", showInteractionCounts)
|
.putBoolean("showInteractionCounts", showInteractionCounts)
|
||||||
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
||||||
@@ -61,7 +56,7 @@ public class GlobalUserPreferences{
|
|||||||
PURPLE,
|
PURPLE,
|
||||||
GREEN,
|
GREEN,
|
||||||
BLUE,
|
BLUE,
|
||||||
BROWN,
|
ORANGE,
|
||||||
YELLOW
|
YELLOW
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -400,12 +400,10 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
public void onPollOptionClick(PollOptionStatusDisplayItem.Holder holder){
|
public void onPollOptionClick(PollOptionStatusDisplayItem.Holder holder){
|
||||||
Poll poll=holder.getItem().poll;
|
Poll poll=holder.getItem().poll;
|
||||||
Poll.Option option=holder.getItem().option;
|
Poll.Option option=holder.getItem().option;
|
||||||
if(poll.multiple || GlobalUserPreferences.voteButtonForSingleChoice){
|
if(poll.multiple){
|
||||||
if(poll.selectedOptions==null)
|
if(poll.selectedOptions==null)
|
||||||
poll.selectedOptions=new ArrayList<>();
|
poll.selectedOptions=new ArrayList<>();
|
||||||
boolean optionContained=poll.selectedOptions.contains(option);
|
if(poll.selectedOptions.contains(option)){
|
||||||
if(!poll.multiple) poll.selectedOptions.clear();
|
|
||||||
if(optionContained){
|
|
||||||
poll.selectedOptions.remove(option);
|
poll.selectedOptions.remove(option);
|
||||||
holder.itemView.setSelected(false);
|
holder.itemView.setSelected(false);
|
||||||
}else{
|
}else{
|
||||||
@@ -414,9 +412,6 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
}
|
}
|
||||||
for(int i=0;i<list.getChildCount();i++){
|
for(int i=0;i<list.getChildCount();i++){
|
||||||
RecyclerView.ViewHolder vh=list.getChildViewHolder(list.getChildAt(i));
|
RecyclerView.ViewHolder vh=list.getChildViewHolder(list.getChildAt(i));
|
||||||
if(!poll.multiple && vh instanceof PollOptionStatusDisplayItem.Holder item){
|
|
||||||
if (item != holder) item.itemView.setSelected(false);
|
|
||||||
}
|
|
||||||
if(vh instanceof PollFooterStatusDisplayItem.Holder footer){
|
if(vh instanceof PollFooterStatusDisplayItem.Holder footer){
|
||||||
if(footer.getItemID().equals(holder.getItemID())){
|
if(footer.getItemID().equals(holder.getItemID())){
|
||||||
footer.rebind();
|
footer.rebind();
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
replyText.setText(getString(R.string.in_reply_to, replyTo.account.displayName));
|
replyText.setText(getString(R.string.in_reply_to, replyTo.account.displayName));
|
||||||
int visibilityNameRes = switch (statusVisibility) {
|
int visibilityNameRes = switch (statusVisibility) {
|
||||||
case PUBLIC -> R.string.visibility_public;
|
case PUBLIC -> R.string.visibility_public;
|
||||||
case UNLISTED -> R.string.sk_visibility_unlisted;
|
case UNLISTED -> R.string.visibility_unlisted;
|
||||||
case PRIVATE -> R.string.visibility_followers_only;
|
case PRIVATE -> R.string.visibility_followers_only;
|
||||||
case DIRECT -> R.string.visibility_private;
|
case DIRECT -> R.string.visibility_private;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class FollowRequestsListFragment extends BaseRecyclerFragment<FollowReque
|
|||||||
@Override
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Activity activity) {
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
setTitle(R.string.sk_follow_requests);
|
setTitle(R.string.follow_requests);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
accountID=getArguments().getString("account");
|
accountID=getArguments().getString("account");
|
||||||
setTitle(R.string.sk_app_name);
|
setTitle(R.string.app_name);
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N)
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N)
|
||||||
setRetainInstance(true);
|
setRetainInstance(true);
|
||||||
|
|||||||
@@ -321,6 +321,9 @@ public class HomeTimelineFragment extends StatusListFragment{
|
|||||||
toolbarLogo.setScaleType(ImageView.ScaleType.CENTER);
|
toolbarLogo.setScaleType(ImageView.ScaleType.CENTER);
|
||||||
toolbarLogo.setImageResource(R.drawable.logo);
|
toolbarLogo.setImageResource(R.drawable.logo);
|
||||||
toolbarLogo.setImageTintList(ColorStateList.valueOf(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary)));
|
toolbarLogo.setImageTintList(ColorStateList.valueOf(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary)));
|
||||||
|
// toolbarLogo =new TextView(getActivity());
|
||||||
|
// toolbarLogo.setText(getString(R.string.app_name).toLowerCase(Locale.getDefault()));
|
||||||
|
// toolbarLogo.setTextAppearance(R.style.app_title);
|
||||||
|
|
||||||
toolbarShowNewPostsBtn=new Button(getActivity());
|
toolbarShowNewPostsBtn=new Button(getActivity());
|
||||||
toolbarShowNewPostsBtn.setTextAppearance(R.style.m3_title_medium);
|
toolbarShowNewPostsBtn.setTextAppearance(R.style.m3_title_medium);
|
||||||
@@ -348,9 +351,7 @@ public class HomeTimelineFragment extends StatusListFragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FrameLayout logoWrap=new FrameLayout(getActivity());
|
FrameLayout logoWrap=new FrameLayout(getActivity());
|
||||||
FrameLayout.LayoutParams logoParams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
|
logoWrap.addView(toolbarLogo, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER));
|
||||||
logoParams.setMargins(0, V.dp(2), 0, 0);
|
|
||||||
logoWrap.addView(toolbarLogo, logoParams);
|
|
||||||
logoWrap.addView(toolbarShowNewPostsBtn, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, V.dp(32), Gravity.CENTER));
|
logoWrap.addView(toolbarShowNewPostsBtn, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, V.dp(32), Gravity.CENTER));
|
||||||
|
|
||||||
Toolbar toolbar=getToolbar();
|
Toolbar toolbar=getToolbar();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class ListTimelinesFragment extends BaseRecyclerFragment<ListTimeline> im
|
|||||||
if(args.containsKey("profileAccount")){
|
if(args.containsKey("profileAccount")){
|
||||||
profileAccountId=args.getString("profileAccount");
|
profileAccountId=args.getString("profileAccount");
|
||||||
profileDisplayUsername=args.getString("profileDisplayUsername");
|
profileDisplayUsername=args.getString("profileDisplayUsername");
|
||||||
setTitle(getString(R.string.sk_lists_with_user, profileDisplayUsername));
|
setTitle(getString(R.string.lists_with_user, profileDisplayUsername));
|
||||||
// setHasOptionsMenu(true);
|
// setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
tab.setText(switch(position){
|
tab.setText(switch(position){
|
||||||
case 0 -> R.string.posts;
|
case 0 -> R.string.posts;
|
||||||
case 1 -> R.string.posts_and_replies;
|
case 1 -> R.string.posts_and_replies;
|
||||||
case 2 -> R.string.sk_pinned_posts;
|
case 2 -> R.string.pinned_posts;
|
||||||
case 3 -> R.string.media;
|
case 3 -> R.string.media;
|
||||||
case 4 -> R.string.profile_about;
|
case 4 -> R.string.profile_about;
|
||||||
default -> throw new IllegalStateException();
|
default -> throw new IllegalStateException();
|
||||||
@@ -555,14 +555,11 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
menu.findItem(R.id.mute).setTitle(getString(relationship.muting ? R.string.unmute_user : R.string.mute_user, account.getDisplayUsername()));
|
menu.findItem(R.id.mute).setTitle(getString(relationship.muting ? R.string.unmute_user : R.string.mute_user, account.getDisplayUsername()));
|
||||||
menu.findItem(R.id.block).setTitle(getString(relationship.blocking ? R.string.unblock_user : R.string.block_user, account.getDisplayUsername()));
|
menu.findItem(R.id.block).setTitle(getString(relationship.blocking ? R.string.unblock_user : R.string.block_user, account.getDisplayUsername()));
|
||||||
menu.findItem(R.id.report).setTitle(getString(R.string.report_user, account.getDisplayUsername()));
|
menu.findItem(R.id.report).setTitle(getString(R.string.report_user, account.getDisplayUsername()));
|
||||||
MenuItem manageUserLists=menu.findItem(R.id.manage_user_lists);
|
|
||||||
if(relationship.following) {
|
if(relationship.following) {
|
||||||
menu.findItem(R.id.hide_boosts).setTitle(getString(relationship.showingReblogs ? R.string.hide_boosts_from_user : R.string.show_boosts_from_user, account.getDisplayUsername()));
|
menu.findItem(R.id.hide_boosts).setTitle(getString(relationship.showingReblogs ? R.string.hide_boosts_from_user : R.string.show_boosts_from_user, account.getDisplayUsername()));
|
||||||
manageUserLists.setTitle(getString(R.string.sk_lists_with_user, account.getDisplayUsername()));
|
|
||||||
manageUserLists.setVisible(true);
|
|
||||||
}else {
|
}else {
|
||||||
menu.findItem(R.id.hide_boosts).setVisible(false);
|
menu.findItem(R.id.hide_boosts).setVisible(false);
|
||||||
manageUserLists.setVisible(false);
|
menu.findItem(R.id.manage_user_lists).setVisible(false);
|
||||||
}
|
}
|
||||||
if(!account.isLocal())
|
if(!account.isLocal())
|
||||||
menu.findItem(R.id.block_domain).setTitle(getString(relationship.domainBlocking ? R.string.unblock_domain : R.string.block_domain, account.getDomain()));
|
menu.findItem(R.id.block_domain).setTitle(getString(relationship.domainBlocking ? R.string.unblock_domain : R.string.block_domain, account.getDomain()));
|
||||||
@@ -661,7 +658,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
notifyProgress.setIndeterminateTintList(notifyButton.getTextColors());
|
notifyProgress.setIndeterminateTintList(notifyButton.getTextColors());
|
||||||
followsYouView.setVisibility(relationship.followedBy ? View.VISIBLE : View.GONE);
|
followsYouView.setVisibility(relationship.followedBy ? View.VISIBLE : View.GONE);
|
||||||
notifyButton.setSelected(relationship.notifying);
|
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));
|
if (getActivity() != null) notifyButton.setContentDescription(getString(relationship.notifying ? R.string.user_post_notifications_on : R.string.user_post_notifications_off, '@'+account.username));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onScrollChanged(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
private void onScrollChanged(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ import android.graphics.Canvas;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.view.animation.AlphaAnimation;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
@@ -69,7 +71,6 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
private NotificationPolicyItem notificationPolicyItem;
|
private NotificationPolicyItem notificationPolicyItem;
|
||||||
private String accountID;
|
private String accountID;
|
||||||
private boolean needUpdateNotificationSettings;
|
private boolean needUpdateNotificationSettings;
|
||||||
private boolean needAppRestart;
|
|
||||||
private PushSubscription pushSubscription;
|
private PushSubscription pushSubscription;
|
||||||
|
|
||||||
private ImageView themeTransitionWindowView;
|
private ImageView themeTransitionWindowView;
|
||||||
@@ -95,7 +96,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
items.add(new HeaderItem(R.string.settings_theme));
|
items.add(new HeaderItem(R.string.settings_theme));
|
||||||
items.add(themeItem=new ThemeItem());
|
items.add(themeItem=new ThemeItem());
|
||||||
items.add(new SwitchItem(R.string.theme_true_black, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged));
|
items.add(new SwitchItem(R.string.theme_true_black, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged));
|
||||||
items.add(new SwitchItem(R.string.sk_disable_marquee, R.drawable.ic_fluent_text_more_24_regular, GlobalUserPreferences.disableMarquee, i->{
|
items.add(new SwitchItem(R.string.disable_marquee, R.drawable.ic_fluent_text_more_24_regular, GlobalUserPreferences.disableMarquee, i->{
|
||||||
GlobalUserPreferences.disableMarquee=i.checked;
|
GlobalUserPreferences.disableMarquee=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
@@ -110,33 +111,28 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.useCustomTabs=i.checked;
|
GlobalUserPreferences.useCustomTabs=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_interaction_counts, R.drawable.ic_fluent_number_row_24_regular, GlobalUserPreferences.showInteractionCounts, i->{
|
items.add(new SwitchItem(R.string.settings_show_interaction_counts, R.drawable.ic_fluent_number_row_24_regular, GlobalUserPreferences.showInteractionCounts, i->{
|
||||||
GlobalUserPreferences.showInteractionCounts=i.checked;
|
GlobalUserPreferences.showInteractionCounts=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_always_reveal_content_warnings, R.drawable.ic_fluent_chat_warning_24_regular, GlobalUserPreferences.alwaysExpandContentWarnings, i->{
|
items.add(new SwitchItem(R.string.settings_always_reveal_content_warnings, R.drawable.ic_fluent_chat_warning_24_regular, GlobalUserPreferences.alwaysExpandContentWarnings, i->{
|
||||||
GlobalUserPreferences.alwaysExpandContentWarnings=i.checked;
|
GlobalUserPreferences.alwaysExpandContentWarnings=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.home_timeline));
|
items.add(new HeaderItem(R.string.home_timeline));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_replies, R.drawable.ic_fluent_chat_multiple_24_regular, GlobalUserPreferences.showReplies, i->{
|
items.add(new SwitchItem(R.string.settings_show_replies, R.drawable.ic_fluent_chat_multiple_24_regular, GlobalUserPreferences.showReplies, i->{
|
||||||
GlobalUserPreferences.showReplies=i.checked;
|
GlobalUserPreferences.showReplies=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_boosts, R.drawable.ic_fluent_arrow_repeat_all_24_regular, GlobalUserPreferences.showBoosts, i->{
|
items.add(new SwitchItem(R.string.settings_show_boosts, R.drawable.ic_fluent_arrow_repeat_all_24_regular, GlobalUserPreferences.showBoosts, i->{
|
||||||
GlobalUserPreferences.showBoosts=i.checked;
|
GlobalUserPreferences.showBoosts=i.checked;
|
||||||
GlobalUserPreferences.save();
|
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.settings_load_new_posts, R.drawable.ic_fluent_arrow_up_24_regular, GlobalUserPreferences.loadNewPosts, i->{
|
||||||
GlobalUserPreferences.loadNewPosts=i.checked;
|
GlobalUserPreferences.loadNewPosts=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_federated_timeline, R.drawable.ic_fluent_earth_24_regular, GlobalUserPreferences.showFederatedTimeline, i->{
|
|
||||||
GlobalUserPreferences.showFederatedTimeline=i.checked;
|
|
||||||
GlobalUserPreferences.save();
|
|
||||||
needAppRestart=true;
|
|
||||||
}));
|
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.settings_notifications));
|
items.add(new HeaderItem(R.string.settings_notifications));
|
||||||
items.add(notificationPolicyItem=new NotificationPolicyItem());
|
items.add(notificationPolicyItem=new NotificationPolicyItem());
|
||||||
@@ -145,7 +141,6 @@ 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_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_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_at_symbol, pushSubscription.alerts.mention, i->onNotificationsChanged(PushNotification.Type.MENTION, i.checked)));
|
items.add(new SwitchItem(R.string.notify_mention, R.drawable.ic_at_symbol, 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 HeaderItem(R.string.settings_boring));
|
items.add(new HeaderItem(R.string.settings_boring));
|
||||||
items.add(new TextItem(R.string.settings_account, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/auth/edit")));
|
items.add(new TextItem(R.string.settings_account, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/auth/edit")));
|
||||||
@@ -154,14 +149,14 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
|
|
||||||
items.add(new RedHeaderItem(R.string.settings_spicy));
|
items.add(new RedHeaderItem(R.string.settings_spicy));
|
||||||
if (GithubSelfUpdater.needSelfUpdating()) {
|
if (GithubSelfUpdater.needSelfUpdating()) {
|
||||||
checkForUpdateItem = new TextItem(R.string.sk_check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
checkForUpdateItem = new TextItem(R.string.check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
||||||
items.add(checkForUpdateItem);
|
items.add(checkForUpdateItem);
|
||||||
}
|
}
|
||||||
items.add(new TextItem(R.string.sk_settings_contribute, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/sk22/megalodon")));
|
items.add(new TextItem(R.string.settings_contribute_fork, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/LucasGGamerM/moshidon")));
|
||||||
items.add(new TextItem(R.string.settings_clear_cache, this::clearImageCache));
|
items.add(new TextItem(R.string.settings_clear_cache, this::clearImageCache));
|
||||||
items.add(new TextItem(R.string.log_out, this::confirmLogOut));
|
items.add(new TextItem(R.string.log_out, this::confirmLogOut));
|
||||||
|
|
||||||
items.add(new FooterItem(getString(R.string.sk_settings_app_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)));
|
items.add(new FooterItem(getString(R.string.settings_app_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -209,11 +204,6 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){
|
if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){
|
||||||
AccountSessionManager.getInstance().getAccount(accountID).getPushSubscriptionManager().updatePushSettings(pushSubscription);
|
AccountSessionManager.getInstance().getAccount(accountID).getPushSubscriptionManager().updatePushSettings(pushSubscription);
|
||||||
}
|
}
|
||||||
if(needAppRestart){
|
|
||||||
Intent intent = Intent.makeRestartActivityTask(MastodonApp.context.getPackageManager().getLaunchIntentForPackage(MastodonApp.context.getPackageName()).getComponent());
|
|
||||||
MastodonApp.context.startActivity(intent);
|
|
||||||
Runtime.getRuntime().exit(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -301,7 +291,6 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
case FOLLOW -> subscription.alerts.follow=enabled;
|
case FOLLOW -> subscription.alerts.follow=enabled;
|
||||||
case REBLOG -> subscription.alerts.reblog=enabled;
|
case REBLOG -> subscription.alerts.reblog=enabled;
|
||||||
case MENTION -> subscription.alerts.mention=subscription.alerts.poll=enabled;
|
case MENTION -> subscription.alerts.mention=subscription.alerts.poll=enabled;
|
||||||
case STATUS -> subscription.alerts.status=enabled;
|
|
||||||
}
|
}
|
||||||
needUpdateNotificationSettings=true;
|
needUpdateNotificationSettings=true;
|
||||||
}
|
}
|
||||||
@@ -396,7 +385,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ev.state == GithubSelfUpdater.UpdateState.NO_UPDATE) {
|
if (ev.state == GithubSelfUpdater.UpdateState.NO_UPDATE) {
|
||||||
Toast.makeText(getActivity(), R.string.sk_no_update_available, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), R.string.no_update_available, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,8 +685,8 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
pref = GlobalUserPreferences.ColorPreference.BLUE;
|
pref = GlobalUserPreferences.ColorPreference.BLUE;
|
||||||
onColorPreferenceClick(pref);
|
onColorPreferenceClick(pref);
|
||||||
}
|
}
|
||||||
else if(id==R.id.brown_color) {
|
else if(id==R.id.orange_color) {
|
||||||
pref = GlobalUserPreferences.ColorPreference.BROWN;
|
pref = GlobalUserPreferences.ColorPreference.ORANGE;
|
||||||
onColorPreferenceClick(pref);
|
onColorPreferenceClick(pref);
|
||||||
}
|
}
|
||||||
else if(id==R.id.yellow_color) {
|
else if(id==R.id.yellow_color) {
|
||||||
@@ -715,14 +704,14 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBind(ColorPicker item){
|
public void onBind(ColorPicker item){
|
||||||
icon.setImageResource(R.drawable.ic_fluent_color_24_regular);
|
icon.setImageResource(R.drawable.ic_color_theme_preference);
|
||||||
button.setText(switch(GlobalUserPreferences.color){
|
button.setText(switch(GlobalUserPreferences.color){
|
||||||
case PINK -> R.string.sk_color_theme_pink;
|
case PINK -> R.string.pink_color;
|
||||||
case PURPLE -> R.string.sk_color_theme_purple;
|
case PURPLE -> R.string.purple_color;
|
||||||
case GREEN -> R.string.sk_color_theme_green;
|
case GREEN -> R.string.green_color;
|
||||||
case BLUE -> R.string.sk_color_theme_blue;
|
case BLUE -> R.string.blue_color;
|
||||||
case BROWN -> R.string.sk_color_theme_brown;
|
case ORANGE -> R.string.orange_color;
|
||||||
case YELLOW -> R.string.sk_color_theme_yellow;
|
case YELLOW -> R.string.yellow_color;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -842,10 +831,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
if (state == GithubSelfUpdater.UpdateState.CHECKING) return;
|
if (state == GithubSelfUpdater.UpdateState.CHECKING) return;
|
||||||
GithubSelfUpdater.UpdateInfo info=updater.getUpdateInfo();
|
GithubSelfUpdater.UpdateInfo info=updater.getUpdateInfo();
|
||||||
if(state!=GithubSelfUpdater.UpdateState.DOWNLOADED){
|
if(state!=GithubSelfUpdater.UpdateState.DOWNLOADED){
|
||||||
text.setText(getString(R.string.sk_update_available, info.version));
|
text.setText(getString(R.string.update_available, info.version));
|
||||||
button.setText(getString(R.string.download_update, UiUtils.formatFileSize(getActivity(), info.size, false)));
|
button.setText(getString(R.string.download_update, UiUtils.formatFileSize(getActivity(), info.size, false)));
|
||||||
}else{
|
}else{
|
||||||
text.setText(getString(R.string.sk_update_ready, info.version));
|
text.setText(getString(R.string.update_ready, info.version));
|
||||||
button.setText(R.string.install_update);
|
button.setText(R.string.install_update);
|
||||||
}
|
}
|
||||||
if(state==GithubSelfUpdater.UpdateState.DOWNLOADING){
|
if(state==GithubSelfUpdater.UpdateState.DOWNLOADING){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.joinmastodon.android.fragments;
|
package org.joinmastodon.android.fragments;
|
||||||
|
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -9,8 +10,7 @@ import android.view.WindowInsets;
|
|||||||
|
|
||||||
import org.joinmastodon.android.MastodonApp;
|
import org.joinmastodon.android.MastodonApp;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.onboarding.InstanceCatalogSignupFragment;
|
import org.joinmastodon.android.fragments.onboarding.InstanceCatalogFragment;
|
||||||
import org.joinmastodon.android.fragments.onboarding.InstanceChooserLoginFragment;
|
|
||||||
import org.joinmastodon.android.ui.InterpolatingMotionEffect;
|
import org.joinmastodon.android.ui.InterpolatingMotionEffect;
|
||||||
import org.joinmastodon.android.ui.views.SizeListenerFrameLayout;
|
import org.joinmastodon.android.ui.views.SizeListenerFrameLayout;
|
||||||
|
|
||||||
@@ -66,9 +66,8 @@ public class SplashFragment extends AppKitFragment{
|
|||||||
|
|
||||||
private void onButtonClick(View v){
|
private void onButtonClick(View v){
|
||||||
Bundle extras=new Bundle();
|
Bundle extras=new Bundle();
|
||||||
boolean isSignup=v.getId()==R.id.btn_get_started;
|
extras.putBoolean("signup", v.getId()==R.id.btn_get_started);
|
||||||
extras.putBoolean("signup", isSignup);
|
Nav.go(getActivity(), InstanceCatalogFragment.class, extras);
|
||||||
Nav.go(getActivity(), isSignup ? InstanceCatalogSignupFragment.class : InstanceChooserLoginFragment.class, extras);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateArtSize(int w, int h){
|
private void updateArtSize(int w, int h){
|
||||||
|
|||||||
@@ -286,16 +286,13 @@ public abstract class BaseAccountListFragment extends BaseRecyclerFragment<BaseA
|
|||||||
menu.findItem(R.id.mute).setTitle(getString(relationship.muting ? R.string.unmute_user : R.string.mute_user, account.getDisplayUsername()));
|
menu.findItem(R.id.mute).setTitle(getString(relationship.muting ? R.string.unmute_user : R.string.mute_user, account.getDisplayUsername()));
|
||||||
menu.findItem(R.id.block).setTitle(getString(relationship.blocking ? R.string.unblock_user : R.string.block_user, account.getDisplayUsername()));
|
menu.findItem(R.id.block).setTitle(getString(relationship.blocking ? R.string.unblock_user : R.string.block_user, account.getDisplayUsername()));
|
||||||
menu.findItem(R.id.report).setTitle(getString(R.string.report_user, account.getDisplayUsername()));
|
menu.findItem(R.id.report).setTitle(getString(R.string.report_user, account.getDisplayUsername()));
|
||||||
|
menu.findItem(R.id.manage_user_lists).setTitle(getString(R.string.lists_with_user, account.getDisplayUsername()));
|
||||||
MenuItem hideBoosts=menu.findItem(R.id.hide_boosts);
|
MenuItem hideBoosts=menu.findItem(R.id.hide_boosts);
|
||||||
MenuItem manageUserLists=menu.findItem(R.id.manage_user_lists);
|
|
||||||
if(relationship.following){
|
if(relationship.following){
|
||||||
hideBoosts.setTitle(getString(relationship.showingReblogs ? R.string.hide_boosts_from_user : R.string.show_boosts_from_user, account.getDisplayUsername()));
|
hideBoosts.setTitle(getString(relationship.showingReblogs ? R.string.hide_boosts_from_user : R.string.show_boosts_from_user, account.getDisplayUsername()));
|
||||||
hideBoosts.setVisible(true);
|
hideBoosts.setVisible(true);
|
||||||
manageUserLists.setTitle(getString(R.string.sk_lists_with_user, account.getDisplayUsername()));
|
|
||||||
manageUserLists.setVisible(true);
|
|
||||||
}else{
|
}else{
|
||||||
hideBoosts.setVisible(false);
|
hideBoosts.setVisible(false);
|
||||||
manageUserLists.setVisible(true);
|
|
||||||
}
|
}
|
||||||
MenuItem blockDomain=menu.findItem(R.id.block_domain);
|
MenuItem blockDomain=menu.findItem(R.id.block_domain);
|
||||||
if(!account.isLocal()){
|
if(!account.isLocal()){
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.joinmastodon.android.BuildConfig;
|
import org.joinmastodon.android.BuildConfig;
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.ScrollableToTop;
|
import org.joinmastodon.android.fragments.ScrollableToTop;
|
||||||
import org.joinmastodon.android.fragments.ListTimelinesFragment;
|
import org.joinmastodon.android.fragments.ListTimelinesFragment;
|
||||||
@@ -62,7 +61,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
private String accountID;
|
private String accountID;
|
||||||
private Runnable searchDebouncer=this::onSearchChangedDebounced;
|
private Runnable searchDebouncer=this::onSearchChangedDebounced;
|
||||||
|
|
||||||
private final boolean noFederated = !GlobalUserPreferences.showFederatedTimeline;
|
private static final boolean noFederated = BuildConfig.BUILD_TYPE.equals("noFederatedRelease");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
@@ -164,12 +163,12 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
if (noFederated && position > 0) position++;
|
if (noFederated && position > 0) position++;
|
||||||
tab.setText(switch(position){
|
tab.setText(switch(position){
|
||||||
case 0 -> R.string.local_timeline;
|
case 0 -> R.string.local_timeline;
|
||||||
case 1 -> R.string.sk_federated_timeline;
|
case 1 -> R.string.federated_timeline;
|
||||||
case 2 -> R.string.hashtags;
|
case 2 -> R.string.hashtags;
|
||||||
case 3 -> R.string.posts;
|
case 3 -> R.string.posts;
|
||||||
case 4 -> R.string.news;
|
case 4 -> R.string.news;
|
||||||
case 5 -> R.string.for_you;
|
case 5 -> R.string.for_you;
|
||||||
case 6 -> R.string.sk_list_timelines;
|
case 6 -> R.string.list_timelines;
|
||||||
default -> throw new IllegalStateException("Unexpected value: "+position);
|
default -> throw new IllegalStateException("Unexpected value: "+position);
|
||||||
});
|
});
|
||||||
tab.view.textView.setAllCaps(true);
|
tab.view.textView.setAllCaps(true);
|
||||||
|
|||||||
@@ -2,30 +2,46 @@ package org.joinmastodon.android.fragments.onboarding;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.LocaleList;
|
import android.os.LocaleList;
|
||||||
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.MastodonAPIController;
|
import org.joinmastodon.android.api.MastodonAPIController;
|
||||||
|
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||||
import org.joinmastodon.android.api.MastodonErrorResponse;
|
import org.joinmastodon.android.api.MastodonErrorResponse;
|
||||||
import org.joinmastodon.android.api.requests.instance.GetInstance;
|
import org.joinmastodon.android.api.requests.instance.GetInstance;
|
||||||
|
import org.joinmastodon.android.api.requests.catalog.GetCatalogCategories;
|
||||||
|
import org.joinmastodon.android.api.requests.catalog.GetCatalogInstances;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.model.Instance;
|
import org.joinmastodon.android.model.Instance;
|
||||||
|
import org.joinmastodon.android.model.catalog.CatalogCategory;
|
||||||
import org.joinmastodon.android.model.catalog.CatalogInstance;
|
import org.joinmastodon.android.model.catalog.CatalogInstance;
|
||||||
|
import org.joinmastodon.android.ui.BetterItemAnimator;
|
||||||
|
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
|
import org.joinmastodon.android.ui.tabs.TabLayout;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
|
import org.parceler.Parcels;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
|
||||||
@@ -43,42 +59,49 @@ import java.util.stream.Collectors;
|
|||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.DiffUtil;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import me.grishka.appkit.Nav;
|
||||||
import me.grishka.appkit.api.Callback;
|
import me.grishka.appkit.api.Callback;
|
||||||
import me.grishka.appkit.api.ErrorResponse;
|
import me.grishka.appkit.api.ErrorResponse;
|
||||||
import me.grishka.appkit.fragments.BaseRecyclerFragment;
|
import me.grishka.appkit.fragments.BaseRecyclerFragment;
|
||||||
import me.grishka.appkit.utils.BindableViewHolder;
|
import me.grishka.appkit.utils.BindableViewHolder;
|
||||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
||||||
|
import me.grishka.appkit.utils.SingleViewRecyclerAdapter;
|
||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
import me.grishka.appkit.views.UsableRecyclerView;
|
import me.grishka.appkit.views.UsableRecyclerView;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInstance>{
|
public class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInstance>{
|
||||||
protected RecyclerView.Adapter adapter;
|
private InstancesAdapter adapter;
|
||||||
protected MergeRecyclerAdapter mergeAdapter;
|
private MergeRecyclerAdapter mergeAdapter;
|
||||||
protected CatalogInstance chosenInstance;
|
private View headerView;
|
||||||
protected Button nextButton;
|
private CatalogInstance chosenInstance;
|
||||||
protected EditText searchEdit;
|
private List<CatalogInstance> filteredData=new ArrayList<>();
|
||||||
protected Runnable searchDebouncer=this::onSearchChangedDebounced;
|
private Button nextButton;
|
||||||
protected String currentSearchQuery;
|
private MastodonAPIRequest<?> getCategoriesRequest;
|
||||||
protected String loadingInstanceDomain;
|
private EditText searchEdit;
|
||||||
protected HashMap<String, Instance> instancesCache=new HashMap<>();
|
private TabLayout categoriesList;
|
||||||
protected View buttonBar;
|
private Runnable searchDebouncer=this::onSearchChangedDebounced;
|
||||||
protected List<CatalogInstance> filteredData=new ArrayList<>();
|
private String currentSearchQuery;
|
||||||
protected GetInstance loadingInstanceRequest;
|
private String currentCategory="all";
|
||||||
protected Call loadingInstanceRedirectRequest;
|
private List<CatalogCategory> categories=new ArrayList<>();
|
||||||
protected ProgressDialog instanceProgressDialog;
|
private String loadingInstanceDomain;
|
||||||
protected HashMap<String, String> redirects=new HashMap<>();
|
private GetInstance loadingInstanceRequest;
|
||||||
protected HashMap<String, String> redirectsInverse=new HashMap<>();
|
private Call loadingInstanceRedirectRequest;
|
||||||
protected boolean isSignup;
|
private HashMap<String, Instance> instancesCache=new HashMap<>();
|
||||||
protected CatalogInstance fakeInstance=new CatalogInstance();
|
private ProgressDialog instanceProgressDialog;
|
||||||
|
private View buttonBar;
|
||||||
|
private HashMap<String, String> redirects=new HashMap<>(), redirectsInverse=new HashMap<>();
|
||||||
|
|
||||||
|
private boolean isSignup;
|
||||||
|
|
||||||
private static final double DUNBAR=Math.log(800);
|
private static final double DUNBAR=Math.log(800);
|
||||||
|
|
||||||
public InstanceCatalogFragment(int layout, int perPage){
|
public InstanceCatalogFragment(){
|
||||||
super(layout, perPage);
|
super(R.layout.fragment_onboarding_common, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -87,9 +110,266 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
isSignup=getArguments().getBoolean("signup");
|
isSignup=getArguments().getBoolean("signup");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void proceedWithAuthOrSignup(Instance instance);
|
@Override
|
||||||
|
public void onAttach(Context context){
|
||||||
|
super.onAttach(context);
|
||||||
|
setRefreshEnabled(false);
|
||||||
|
loadData();
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean onSearchEnterPressed(TextView v, int actionId, KeyEvent event){
|
@Override
|
||||||
|
protected void doLoadData(int offset, int count){
|
||||||
|
currentRequest=new GetCatalogInstances(null, null)
|
||||||
|
.setCallback(new Callback<>(){
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<CatalogInstance> result){
|
||||||
|
if(getActivity()==null)
|
||||||
|
return;
|
||||||
|
Map<String, List<CatalogInstance>> byLang=result.stream().collect(Collectors.groupingBy(ci->ci.language));
|
||||||
|
for(List<CatalogInstance> group:byLang.values()){
|
||||||
|
Collections.sort(group, (a, b)->{
|
||||||
|
double aa=Math.abs(DUNBAR-Math.log(a.lastWeekUsers));
|
||||||
|
double bb=Math.abs(DUNBAR-Math.log(b.lastWeekUsers));
|
||||||
|
return Double.compare(aa, bb);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// get the list of user-configured system languages
|
||||||
|
List<String> userLangs;
|
||||||
|
if(Build.VERSION.SDK_INT<24){
|
||||||
|
userLangs=Collections.singletonList(getResources().getConfiguration().locale.getLanguage());
|
||||||
|
}else{
|
||||||
|
LocaleList ll=getResources().getConfiguration().getLocales();
|
||||||
|
userLangs=new ArrayList<>(ll.size());
|
||||||
|
for(int i=0;i<ll.size();i++){
|
||||||
|
userLangs.add(ll.get(i).getLanguage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// add instances in preferred languages to the top of the list, in the order of preference
|
||||||
|
ArrayList<CatalogInstance> sortedList=new ArrayList<>();
|
||||||
|
for(String lang:userLangs){
|
||||||
|
List<CatalogInstance> langInstances=byLang.remove(lang);
|
||||||
|
if(langInstances!=null){
|
||||||
|
sortedList.addAll(langInstances);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sort the remaining language groups by aggregate lastWeekUsers
|
||||||
|
class InstanceGroup{
|
||||||
|
public int activeUsers;
|
||||||
|
public List<CatalogInstance> instances;
|
||||||
|
}
|
||||||
|
byLang.values().stream().map(il->{
|
||||||
|
InstanceGroup group=new InstanceGroup();
|
||||||
|
group.instances=il;
|
||||||
|
for(CatalogInstance instance:il){
|
||||||
|
group.activeUsers+=instance.lastWeekUsers;
|
||||||
|
}
|
||||||
|
return group;
|
||||||
|
}).sorted(Comparator.comparingInt((InstanceGroup g)->g.activeUsers).reversed()).forEachOrdered(ig->sortedList.addAll(ig.instances));
|
||||||
|
onDataLoaded(sortedList, false);
|
||||||
|
updateFilteredList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(ErrorResponse error){
|
||||||
|
error.showToast(getActivity());
|
||||||
|
onDataLoaded(Collections.emptyList(), false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.execNoAuth("");
|
||||||
|
getCategoriesRequest=new GetCatalogCategories(null)
|
||||||
|
.setCallback(new Callback<>(){
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<CatalogCategory> result){
|
||||||
|
getCategoriesRequest=null;
|
||||||
|
CatalogCategory all=new CatalogCategory();
|
||||||
|
all.category="all";
|
||||||
|
categories.add(all);
|
||||||
|
result.stream().sorted(Comparator.comparingInt((CatalogCategory cc)->cc.serversCount).reversed()).forEach(categories::add);
|
||||||
|
updateCategories();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(ErrorResponse error){
|
||||||
|
getCategoriesRequest=null;
|
||||||
|
error.showToast(getActivity());
|
||||||
|
CatalogCategory all=new CatalogCategory();
|
||||||
|
all.category="all";
|
||||||
|
categories.add(all);
|
||||||
|
updateCategories();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.execNoAuth("");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCategories(){
|
||||||
|
categoriesList.removeAllTabs();
|
||||||
|
for(CatalogCategory cat:categories){
|
||||||
|
int titleRes=getTitleForCategory(cat.category);
|
||||||
|
TabLayout.Tab tab=categoriesList.newTab().setText(titleRes!=0 ? getString(titleRes) : cat.category).setCustomView(R.layout.item_instance_category);
|
||||||
|
ImageView emoji=tab.getCustomView().findViewById(R.id.emoji);
|
||||||
|
emoji.setImageResource(getEmojiForCategory(cat.category));
|
||||||
|
categoriesList.addTab(tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy(){
|
||||||
|
super.onDestroy();
|
||||||
|
if(getCategoriesRequest!=null)
|
||||||
|
getCategoriesRequest.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RecyclerView.Adapter getAdapter(){
|
||||||
|
headerView=getActivity().getLayoutInflater().inflate(R.layout.header_onboarding_instance_catalog, list, false);
|
||||||
|
searchEdit=headerView.findViewById(R.id.search_edit);
|
||||||
|
categoriesList=headerView.findViewById(R.id.categories_list);
|
||||||
|
categoriesList.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab){
|
||||||
|
CatalogCategory category=categories.get(tab.getPosition());
|
||||||
|
currentCategory=category.category;
|
||||||
|
updateFilteredList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
searchEdit.setOnEditorActionListener(this::onSearchEnterPressed);
|
||||||
|
searchEdit.addTextChangedListener(new TextWatcher(){
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count){
|
||||||
|
searchEdit.removeCallbacks(searchDebouncer);
|
||||||
|
searchEdit.postDelayed(searchDebouncer, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mergeAdapter=new MergeRecyclerAdapter();
|
||||||
|
mergeAdapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
||||||
|
mergeAdapter.addAdapter(adapter=new InstancesAdapter());
|
||||||
|
return mergeAdapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
nextButton=view.findViewById(R.id.btn_next);
|
||||||
|
nextButton.setOnClickListener(this::onNextClick);
|
||||||
|
nextButton.setEnabled(chosenInstance!=null);
|
||||||
|
view.findViewById(R.id.btn_back).setOnClickListener(v->Nav.finish(this));
|
||||||
|
list.setItemAnimator(new BetterItemAnimator());
|
||||||
|
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 1, 16, 16, DividerItemDecoration.NOT_FIRST));
|
||||||
|
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLight));
|
||||||
|
buttonBar=view.findViewById(R.id.button_bar);
|
||||||
|
setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLight));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onNextClick(View v){
|
||||||
|
String domain=chosenInstance.domain;
|
||||||
|
Instance instance=instancesCache.get(domain);
|
||||||
|
if(instance!=null){
|
||||||
|
proceedWithAuthOrSignup(instance);
|
||||||
|
}else{
|
||||||
|
showProgressDialog();
|
||||||
|
if(!domain.equals(loadingInstanceDomain)){
|
||||||
|
loadInstanceInfo(domain, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void proceedWithAuthOrSignup(Instance instance){
|
||||||
|
getActivity().getSystemService(InputMethodManager.class).hideSoftInputFromWindow(contentView.getWindowToken(), 0);
|
||||||
|
if(isSignup){
|
||||||
|
if(!instance.registrations){
|
||||||
|
new M3AlertDialogBuilder(getActivity())
|
||||||
|
.setTitle(R.string.error)
|
||||||
|
.setMessage(R.string.instance_signup_closed)
|
||||||
|
.setPositiveButton(R.string.ok, null)
|
||||||
|
.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bundle args=new Bundle();
|
||||||
|
args.putParcelable("instance", Parcels.wrap(instance));
|
||||||
|
Nav.go(getActivity(), InstanceRulesFragment.class, args);
|
||||||
|
}else{
|
||||||
|
AccountSessionManager.getInstance().authenticate(getActivity(), instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// private String getEmojiForCategory(String category){
|
||||||
|
// return switch(category){
|
||||||
|
// case "all" -> "💬";
|
||||||
|
// case "academia" -> "📚";
|
||||||
|
// case "activism" -> "✊";
|
||||||
|
// case "food" -> "🍕";
|
||||||
|
// case "furry" -> "🦁";
|
||||||
|
// case "games" -> "🕹";
|
||||||
|
// case "general" -> "🐘";
|
||||||
|
// case "journalism" -> "📰";
|
||||||
|
// case "lgbt" -> "🏳️🌈";
|
||||||
|
// case "regional" -> "📍";
|
||||||
|
// case "art" -> "🎨";
|
||||||
|
// case "music" -> "🎼";
|
||||||
|
// case "tech" -> "📱";
|
||||||
|
// default -> "❓";
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
|
private int getEmojiForCategory(String category){
|
||||||
|
return switch(category){
|
||||||
|
case "all" -> R.drawable.ic_category_all;
|
||||||
|
case "academia" -> R.drawable.ic_category_academia;
|
||||||
|
case "activism" -> R.drawable.ic_category_activism;
|
||||||
|
case "food" -> R.drawable.ic_category_food;
|
||||||
|
case "furry" -> R.drawable.ic_category_furry;
|
||||||
|
case "games" -> R.drawable.ic_category_games;
|
||||||
|
case "general" -> R.drawable.ic_category_general;
|
||||||
|
case "journalism" -> R.drawable.ic_category_journalism;
|
||||||
|
case "lgbt" -> R.drawable.ic_category_lgbt;
|
||||||
|
case "regional" -> R.drawable.ic_category_regional;
|
||||||
|
case "art" -> R.drawable.ic_category_art;
|
||||||
|
case "music" -> R.drawable.ic_category_music;
|
||||||
|
case "tech" -> R.drawable.ic_category_tech;
|
||||||
|
default -> R.drawable.ic_category_unknown;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getTitleForCategory(String category){
|
||||||
|
return switch(category){
|
||||||
|
case "all" -> R.string.category_all;
|
||||||
|
case "academia" -> R.string.category_academia;
|
||||||
|
case "activism" -> R.string.category_activism;
|
||||||
|
case "food" -> R.string.category_food;
|
||||||
|
case "furry" -> R.string.category_furry;
|
||||||
|
case "games" -> R.string.category_games;
|
||||||
|
case "general" -> R.string.category_general;
|
||||||
|
case "journalism" -> R.string.category_journalism;
|
||||||
|
case "lgbt" -> R.string.category_lgbt;
|
||||||
|
case "regional" -> R.string.category_regional;
|
||||||
|
case "art" -> R.string.category_art;
|
||||||
|
case "music" -> R.string.category_music;
|
||||||
|
case "tech" -> R.string.category_tech;
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean onSearchEnterPressed(TextView v, int actionId, KeyEvent event){
|
||||||
if(event!=null && event.getAction()!=KeyEvent.ACTION_DOWN)
|
if(event!=null && event.getAction()!=KeyEvent.ACTION_DOWN)
|
||||||
return true;
|
return true;
|
||||||
currentSearchQuery=searchEdit.getText().toString().toLowerCase();
|
currentSearchQuery=searchEdit.getText().toString().toLowerCase();
|
||||||
@@ -105,73 +385,60 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onSearchChangedDebounced(){
|
private void onSearchChangedDebounced(){
|
||||||
currentSearchQuery=searchEdit.getText().toString().toLowerCase();
|
currentSearchQuery=searchEdit.getText().toString().toLowerCase();
|
||||||
updateFilteredList();
|
updateFilteredList();
|
||||||
loadInstanceInfo(currentSearchQuery, false);
|
loadInstanceInfo(currentSearchQuery, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<CatalogInstance> sortInstances(List<CatalogInstance> result){
|
private void updateFilteredList(){
|
||||||
Map<String, List<CatalogInstance>> byLang=result.stream().collect(Collectors.groupingBy(ci->ci.language));
|
ArrayList<CatalogInstance> prevData=new ArrayList<>(filteredData);
|
||||||
for(List<CatalogInstance> group:byLang.values()){
|
filteredData.clear();
|
||||||
Collections.sort(group, (a, b)->{
|
for(CatalogInstance instance:data){
|
||||||
double aa=Math.abs(DUNBAR-Math.log(a.lastWeekUsers));
|
if(currentCategory.equals("all") || instance.categories.contains(currentCategory)){
|
||||||
double bb=Math.abs(DUNBAR-Math.log(b.lastWeekUsers));
|
if(TextUtils.isEmpty(currentSearchQuery) || instance.domain.contains(currentSearchQuery)){
|
||||||
return Double.compare(aa, bb);
|
if(instance.domain.equals(currentSearchQuery) || !isSignup || !instance.approvalRequired)
|
||||||
});
|
filteredData.add(instance);
|
||||||
}
|
}
|
||||||
// get the list of user-configured system languages
|
|
||||||
List<String> userLangs;
|
|
||||||
if(Build.VERSION.SDK_INT<24){
|
|
||||||
userLangs=Collections.singletonList(getResources().getConfiguration().locale.getLanguage());
|
|
||||||
}else{
|
|
||||||
LocaleList ll=getResources().getConfiguration().getLocales();
|
|
||||||
userLangs=new ArrayList<>(ll.size());
|
|
||||||
for(int i=0;i<ll.size();i++){
|
|
||||||
userLangs.add(ll.get(i).getLanguage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add instances in preferred languages to the top of the list, in the order of preference
|
DiffUtil.calculateDiff(new DiffUtil.Callback(){
|
||||||
ArrayList<CatalogInstance> sortedList=new ArrayList<>();
|
@Override
|
||||||
for(String lang:userLangs){
|
public int getOldListSize(){
|
||||||
List<CatalogInstance> langInstances=byLang.remove(lang);
|
return prevData.size();
|
||||||
if(langInstances!=null){
|
|
||||||
sortedList.addAll(langInstances);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// sort the remaining language groups by aggregate lastWeekUsers
|
@Override
|
||||||
class InstanceGroup{
|
public int getNewListSize(){
|
||||||
public int activeUsers;
|
return filteredData.size();
|
||||||
public List<CatalogInstance> instances;
|
|
||||||
}
|
|
||||||
byLang.values().stream().map(il->{
|
|
||||||
InstanceGroup group=new InstanceGroup();
|
|
||||||
group.instances=il;
|
|
||||||
for(CatalogInstance instance:il){
|
|
||||||
group.activeUsers+=instance.lastWeekUsers;
|
|
||||||
}
|
}
|
||||||
return group;
|
|
||||||
}).sorted(Comparator.comparingInt((InstanceGroup g)->g.activeUsers).reversed()).forEachOrdered(ig->sortedList.addAll(ig.instances));
|
@Override
|
||||||
return sortedList;
|
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition){
|
||||||
|
return prevData.get(oldItemPosition)==filteredData.get(newItemPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition){
|
||||||
|
return prevData.get(oldItemPosition)==filteredData.get(newItemPosition);
|
||||||
|
}
|
||||||
|
}).dispatchUpdatesTo(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void updateFilteredList();
|
private void showProgressDialog(){
|
||||||
|
|
||||||
protected void showProgressDialog(){
|
|
||||||
instanceProgressDialog=new ProgressDialog(getActivity());
|
instanceProgressDialog=new ProgressDialog(getActivity());
|
||||||
instanceProgressDialog.setMessage(getString(R.string.loading_instance));
|
instanceProgressDialog.setMessage(getString(R.string.loading_instance));
|
||||||
instanceProgressDialog.setOnCancelListener(dialog->cancelLoadingInstanceInfo());
|
instanceProgressDialog.setOnCancelListener(dialog->cancelLoadingInstanceInfo());
|
||||||
instanceProgressDialog.show();
|
instanceProgressDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String normalizeInstanceDomain(String _domain){
|
private String normalizeInstanceDomain(String _domain){
|
||||||
if(TextUtils.isEmpty(_domain))
|
if(TextUtils.isEmpty(_domain))
|
||||||
return null;
|
return null;
|
||||||
if(_domain.contains(":")){
|
if(_domain.contains(":")){
|
||||||
try{
|
try{
|
||||||
_domain=Uri.parse(_domain).getAuthority();
|
_domain=Uri.parse(_domain).getAuthority();
|
||||||
}catch(Exception ignore){
|
}catch(Exception ignore){}
|
||||||
}
|
|
||||||
if(TextUtils.isEmpty(_domain))
|
if(TextUtils.isEmpty(_domain))
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -186,12 +453,12 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadInstanceInfo(String _domain, boolean isFromRedirect){
|
private void loadInstanceInfo(String _domain, boolean isFromRedirect){
|
||||||
String domain=normalizeInstanceDomain(_domain);
|
String domain=normalizeInstanceDomain(_domain);
|
||||||
Instance cachedInstance=instancesCache.get(domain);
|
Instance cachedInstance=instancesCache.get(domain);
|
||||||
if(cachedInstance!=null){
|
if(cachedInstance!=null){
|
||||||
for(CatalogInstance ci : filteredData){
|
for(CatalogInstance ci:filteredData){
|
||||||
if(ci.domain.equals(domain) && ci!=fakeInstance)
|
if(ci.domain.equals(domain))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CatalogInstance ci=cachedInstance.toCatalogInstance();
|
CatalogInstance ci=cachedInstance.toCatalogInstance();
|
||||||
@@ -209,57 +476,44 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
loadingInstanceDomain=domain;
|
loadingInstanceDomain=domain;
|
||||||
loadingInstanceRequest=new GetInstance();
|
loadingInstanceRequest=new GetInstance();
|
||||||
loadingInstanceRequest.setCallback(new Callback<>(){
|
loadingInstanceRequest.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Instance result){
|
public void onSuccess(Instance result){
|
||||||
loadingInstanceRequest=null;
|
loadingInstanceRequest=null;
|
||||||
loadingInstanceDomain=null;
|
loadingInstanceDomain=null;
|
||||||
result.uri=domain; // needed for instances that use domain redirection
|
result.uri=domain; // needed for instances that use domain redirection
|
||||||
instancesCache.put(domain, result);
|
instancesCache.put(domain, result);
|
||||||
if(instanceProgressDialog!=null){
|
if(instanceProgressDialog!=null){
|
||||||
instanceProgressDialog.dismiss();
|
instanceProgressDialog.dismiss();
|
||||||
instanceProgressDialog=null;
|
instanceProgressDialog=null;
|
||||||
proceedWithAuthOrSignup(result);
|
proceedWithAuthOrSignup(result);
|
||||||
}
|
}
|
||||||
if(Objects.equals(domain, currentSearchQuery) || Objects.equals(currentSearchQuery, redirects.get(domain)) || Objects.equals(currentSearchQuery, redirectsInverse.get(domain))){
|
if(Objects.equals(domain, currentSearchQuery) || Objects.equals(currentSearchQuery, redirects.get(domain)) || Objects.equals(currentSearchQuery, redirectsInverse.get(domain))){
|
||||||
boolean found=false;
|
boolean found=false;
|
||||||
for(CatalogInstance ci : filteredData){
|
for(CatalogInstance ci:filteredData){
|
||||||
if(ci.domain.equals(domain) && ci!=fakeInstance){
|
if(ci.domain.equals(domain)){
|
||||||
found=true;
|
found=true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found){
|
||||||
|
CatalogInstance ci=result.toCatalogInstance();
|
||||||
|
filteredData.add(0, ci);
|
||||||
|
adapter.notifyItemInserted(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!found){
|
|
||||||
CatalogInstance ci=result.toCatalogInstance();
|
|
||||||
if(filteredData.size()==1 && filteredData.get(0)==fakeInstance){
|
|
||||||
filteredData.set(0, ci);
|
|
||||||
adapter.notifyItemChanged(0);
|
|
||||||
}else{
|
|
||||||
filteredData.add(0, ci);
|
|
||||||
adapter.notifyItemInserted(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error){
|
public void onError(ErrorResponse error){
|
||||||
loadingInstanceRequest=null;
|
loadingInstanceRequest=null;
|
||||||
if(!isFromRedirect && error instanceof MastodonErrorResponse me && me.httpStatus==404){
|
if(!isFromRedirect && error instanceof MastodonErrorResponse me && me.httpStatus==404){
|
||||||
fetchDomainFromHostMetaAndMaybeRetry(domain, error);
|
fetchDomainFromHostMetaAndMaybeRetry(domain, error);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
loadingInstanceDomain=null;
|
|
||||||
showInstanceInfoLoadError(domain, error);
|
|
||||||
if(fakeInstance!=null){
|
|
||||||
fakeInstance.description=getString(R.string.error);
|
|
||||||
if(filteredData.size()>0 && filteredData.get(0)==fakeInstance){
|
|
||||||
if(list.findViewHolderForAdapterPosition(1) instanceof BindableViewHolder<?> ivh){
|
|
||||||
ivh.rebind();
|
|
||||||
}
|
}
|
||||||
|
loadingInstanceDomain=null;
|
||||||
|
showInstanceInfoLoadError(domain, error);
|
||||||
}
|
}
|
||||||
}
|
}).execNoAuth(domain);
|
||||||
}
|
|
||||||
}).execNoAuth(domain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelLoadingInstanceInfo(){
|
private void cancelLoadingInstanceInfo(){
|
||||||
@@ -330,7 +584,7 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
InputSource source=new InputSource(response.body().charStream());
|
InputSource source=new InputSource(response.body().charStream());
|
||||||
Document doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(source);
|
Document doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(source);
|
||||||
NodeList list=doc.getElementsByTagName("Link");
|
NodeList list=doc.getElementsByTagName("Link");
|
||||||
for(int i=0; i<list.getLength(); i++){
|
for(int i=0;i<list.getLength();i++){
|
||||||
if(list.item(i) instanceof Element el){
|
if(list.item(i) instanceof Element el){
|
||||||
String template=el.getAttribute("template");
|
String template=el.getAttribute("template");
|
||||||
if("lrdd".equals(el.getAttribute("rel")) && !TextUtils.isEmpty(template) && template.contains("{uri}")){
|
if("lrdd".equals(el.getAttribute("rel")) && !TextUtils.isEmpty(template) && template.contains("{uri}")){
|
||||||
@@ -362,26 +616,78 @@ abstract class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInsta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private class InstancesAdapter extends UsableRecyclerView.Adapter<InstanceViewHolder>{
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
public InstancesAdapter(){
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super(imgLoader);
|
||||||
nextButton=view.findViewById(R.id.btn_next);
|
}
|
||||||
nextButton.setOnClickListener(this::onNextClick);
|
|
||||||
nextButton.setEnabled(chosenInstance!=null);
|
@NonNull
|
||||||
buttonBar=view.findViewById(R.id.button_bar);
|
@Override
|
||||||
setRefreshEnabled(false);
|
public InstanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||||
|
return new InstanceViewHolder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(InstanceViewHolder holder, int position){
|
||||||
|
holder.bind(filteredData.get(position));
|
||||||
|
super.onBindViewHolder(holder, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount(){
|
||||||
|
return filteredData.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onNextClick(View v){
|
private class InstanceViewHolder extends BindableViewHolder<CatalogInstance> implements UsableRecyclerView.Clickable{
|
||||||
String domain=chosenInstance.domain;
|
private final TextView title, description, userCount, lang;
|
||||||
Instance instance=instancesCache.get(domain);
|
private final RadioButton radioButton;
|
||||||
if(instance!=null){
|
|
||||||
proceedWithAuthOrSignup(instance);
|
public InstanceViewHolder(){
|
||||||
}else{
|
super(getActivity(), R.layout.item_instance_catalog, list);
|
||||||
showProgressDialog();
|
title=findViewById(R.id.title);
|
||||||
if(!domain.equals(loadingInstanceDomain)){
|
description=findViewById(R.id.description);
|
||||||
loadInstanceInfo(domain, false);
|
userCount=findViewById(R.id.user_count);
|
||||||
|
lang=findViewById(R.id.lang);
|
||||||
|
radioButton=findViewById(R.id.radiobtn);
|
||||||
|
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N){
|
||||||
|
UiUtils.fixCompoundDrawableTintOnAndroid6(userCount);
|
||||||
|
UiUtils.fixCompoundDrawableTintOnAndroid6(lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBind(CatalogInstance item){
|
||||||
|
title.setText(item.normalizedDomain);
|
||||||
|
description.setText(item.description);
|
||||||
|
userCount.setText(UiUtils.abbreviateNumber(item.totalUsers));
|
||||||
|
lang.setText(item.language.toUpperCase());
|
||||||
|
radioButton.setChecked(chosenInstance==item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(){
|
||||||
|
if(chosenInstance==item)
|
||||||
|
return;
|
||||||
|
if(chosenInstance!=null){
|
||||||
|
int idx=filteredData.indexOf(chosenInstance);
|
||||||
|
if(idx!=-1){
|
||||||
|
RecyclerView.ViewHolder holder=list.findViewHolderForAdapterPosition(mergeAdapter.getPositionForAdapter(adapter)+idx);
|
||||||
|
if(holder instanceof InstanceViewHolder ivh){
|
||||||
|
ivh.radioButton.setChecked(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radioButton.setChecked(true);
|
||||||
|
if(chosenInstance==null)
|
||||||
|
nextButton.setEnabled(true);
|
||||||
|
chosenInstance=item;
|
||||||
|
loadInstanceInfo(chosenInstance.domain, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,374 +0,0 @@
|
|||||||
package org.joinmastodon.android.fragments.onboarding;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.LocaleList;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.RadioButton;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
|
||||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
|
||||||
import org.joinmastodon.android.api.requests.catalog.GetCatalogCategories;
|
|
||||||
import org.joinmastodon.android.api.requests.catalog.GetCatalogInstances;
|
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
|
||||||
import org.joinmastodon.android.model.Instance;
|
|
||||||
import org.joinmastodon.android.model.catalog.CatalogCategory;
|
|
||||||
import org.joinmastodon.android.model.catalog.CatalogInstance;
|
|
||||||
import org.joinmastodon.android.ui.BetterItemAnimator;
|
|
||||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
|
||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
|
||||||
import org.joinmastodon.android.ui.tabs.TabLayout;
|
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
|
||||||
import org.parceler.Parcels;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.DiffUtil;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import me.grishka.appkit.Nav;
|
|
||||||
import me.grishka.appkit.api.Callback;
|
|
||||||
import me.grishka.appkit.api.ErrorResponse;
|
|
||||||
import me.grishka.appkit.utils.BindableViewHolder;
|
|
||||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
|
||||||
import me.grishka.appkit.utils.SingleViewRecyclerAdapter;
|
|
||||||
import me.grishka.appkit.views.UsableRecyclerView;
|
|
||||||
|
|
||||||
public class InstanceCatalogSignupFragment extends InstanceCatalogFragment{
|
|
||||||
private View headerView;
|
|
||||||
private MastodonAPIRequest<?> getCategoriesRequest;
|
|
||||||
private TabLayout categoriesList;
|
|
||||||
private String currentCategory="all";
|
|
||||||
private List<CatalogCategory> categories=new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
public InstanceCatalogSignupFragment(){
|
|
||||||
super(R.layout.fragment_onboarding_common, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Context context){
|
|
||||||
super.onAttach(context);
|
|
||||||
setRefreshEnabled(false);
|
|
||||||
loadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void doLoadData(int offset, int count){
|
|
||||||
currentRequest=new GetCatalogInstances(null, null)
|
|
||||||
.setCallback(new Callback<>(){
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<CatalogInstance> result){
|
|
||||||
if(getActivity()==null)
|
|
||||||
return;
|
|
||||||
onDataLoaded(sortInstances(result), false);
|
|
||||||
updateFilteredList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(ErrorResponse error){
|
|
||||||
error.showToast(getActivity());
|
|
||||||
onDataLoaded(Collections.emptyList(), false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.execNoAuth("");
|
|
||||||
getCategoriesRequest=new GetCatalogCategories(null)
|
|
||||||
.setCallback(new Callback<>(){
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<CatalogCategory> result){
|
|
||||||
getCategoriesRequest=null;
|
|
||||||
CatalogCategory all=new CatalogCategory();
|
|
||||||
all.category="all";
|
|
||||||
categories.add(all);
|
|
||||||
result.stream().sorted(Comparator.comparingInt((CatalogCategory cc)->cc.serversCount).reversed()).forEach(categories::add);
|
|
||||||
updateCategories();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(ErrorResponse error){
|
|
||||||
getCategoriesRequest=null;
|
|
||||||
error.showToast(getActivity());
|
|
||||||
CatalogCategory all=new CatalogCategory();
|
|
||||||
all.category="all";
|
|
||||||
categories.add(all);
|
|
||||||
updateCategories();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.execNoAuth("");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCategories(){
|
|
||||||
categoriesList.removeAllTabs();
|
|
||||||
for(CatalogCategory cat:categories){
|
|
||||||
int titleRes=getTitleForCategory(cat.category);
|
|
||||||
TabLayout.Tab tab=categoriesList.newTab().setText(titleRes!=0 ? getString(titleRes) : cat.category).setCustomView(R.layout.item_instance_category);
|
|
||||||
ImageView emoji=tab.getCustomView().findViewById(R.id.emoji);
|
|
||||||
emoji.setImageResource(getEmojiForCategory(cat.category));
|
|
||||||
categoriesList.addTab(tab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy(){
|
|
||||||
super.onDestroy();
|
|
||||||
if(getCategoriesRequest!=null)
|
|
||||||
getCategoriesRequest.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected RecyclerView.Adapter getAdapter(){
|
|
||||||
headerView=getActivity().getLayoutInflater().inflate(R.layout.header_onboarding_instance_catalog, list, false);
|
|
||||||
searchEdit=headerView.findViewById(R.id.search_edit);
|
|
||||||
categoriesList=headerView.findViewById(R.id.categories_list);
|
|
||||||
categoriesList.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(TabLayout.Tab tab){
|
|
||||||
CatalogCategory category=categories.get(tab.getPosition());
|
|
||||||
currentCategory=category.category;
|
|
||||||
updateFilteredList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(TabLayout.Tab tab){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(TabLayout.Tab tab){
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
searchEdit.setOnEditorActionListener(this::onSearchEnterPressed);
|
|
||||||
searchEdit.addTextChangedListener(new TextWatcher(){
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count){
|
|
||||||
searchEdit.removeCallbacks(searchDebouncer);
|
|
||||||
searchEdit.postDelayed(searchDebouncer, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s){
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mergeAdapter=new MergeRecyclerAdapter();
|
|
||||||
mergeAdapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
|
||||||
mergeAdapter.addAdapter(adapter=new InstancesAdapter());
|
|
||||||
return mergeAdapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
view.findViewById(R.id.btn_back).setOnClickListener(v->Nav.finish(this));
|
|
||||||
list.setItemAnimator(new BetterItemAnimator());
|
|
||||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 1, 16, 16, DividerItemDecoration.NOT_FIRST));
|
|
||||||
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLight));
|
|
||||||
setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLight));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void proceedWithAuthOrSignup(Instance instance){
|
|
||||||
getActivity().getSystemService(InputMethodManager.class).hideSoftInputFromWindow(contentView.getWindowToken(), 0);
|
|
||||||
if(isSignup){
|
|
||||||
if(!instance.registrations){
|
|
||||||
new M3AlertDialogBuilder(getActivity())
|
|
||||||
.setTitle(R.string.error)
|
|
||||||
.setMessage(R.string.instance_signup_closed)
|
|
||||||
.setPositiveButton(R.string.ok, null)
|
|
||||||
.show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Bundle args=new Bundle();
|
|
||||||
args.putParcelable("instance", Parcels.wrap(instance));
|
|
||||||
Nav.go(getActivity(), InstanceRulesFragment.class, args);
|
|
||||||
}else{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// private String getEmojiForCategory(String category){
|
|
||||||
// return switch(category){
|
|
||||||
// case "all" -> "💬";
|
|
||||||
// case "academia" -> "📚";
|
|
||||||
// case "activism" -> "✊";
|
|
||||||
// case "food" -> "🍕";
|
|
||||||
// case "furry" -> "🦁";
|
|
||||||
// case "games" -> "🕹";
|
|
||||||
// case "general" -> "🐘";
|
|
||||||
// case "journalism" -> "📰";
|
|
||||||
// case "lgbt" -> "🏳️🌈";
|
|
||||||
// case "regional" -> "📍";
|
|
||||||
// case "art" -> "🎨";
|
|
||||||
// case "music" -> "🎼";
|
|
||||||
// case "tech" -> "📱";
|
|
||||||
// default -> "❓";
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
private int getEmojiForCategory(String category){
|
|
||||||
return switch(category){
|
|
||||||
case "all" -> R.drawable.ic_category_all;
|
|
||||||
case "academia" -> R.drawable.ic_category_academia;
|
|
||||||
case "activism" -> R.drawable.ic_category_activism;
|
|
||||||
case "food" -> R.drawable.ic_category_food;
|
|
||||||
case "furry" -> R.drawable.ic_category_furry;
|
|
||||||
case "games" -> R.drawable.ic_category_games;
|
|
||||||
case "general" -> R.drawable.ic_category_general;
|
|
||||||
case "journalism" -> R.drawable.ic_category_journalism;
|
|
||||||
case "lgbt" -> R.drawable.ic_category_lgbt;
|
|
||||||
case "regional" -> R.drawable.ic_category_regional;
|
|
||||||
case "art" -> R.drawable.ic_category_art;
|
|
||||||
case "music" -> R.drawable.ic_category_music;
|
|
||||||
case "tech" -> R.drawable.ic_category_tech;
|
|
||||||
default -> R.drawable.ic_category_unknown;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getTitleForCategory(String category){
|
|
||||||
return switch(category){
|
|
||||||
case "all" -> R.string.category_all;
|
|
||||||
case "academia" -> R.string.category_academia;
|
|
||||||
case "activism" -> R.string.category_activism;
|
|
||||||
case "food" -> R.string.category_food;
|
|
||||||
case "furry" -> R.string.category_furry;
|
|
||||||
case "games" -> R.string.category_games;
|
|
||||||
case "general" -> R.string.category_general;
|
|
||||||
case "journalism" -> R.string.category_journalism;
|
|
||||||
case "lgbt" -> R.string.category_lgbt;
|
|
||||||
case "regional" -> R.string.category_regional;
|
|
||||||
case "art" -> R.string.category_art;
|
|
||||||
case "music" -> R.string.category_music;
|
|
||||||
case "tech" -> R.string.category_tech;
|
|
||||||
default -> 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateFilteredList(){
|
|
||||||
ArrayList<CatalogInstance> prevData=new ArrayList<>(filteredData);
|
|
||||||
filteredData.clear();
|
|
||||||
for(CatalogInstance instance:data){
|
|
||||||
if(currentCategory.equals("all") || instance.categories.contains(currentCategory)){
|
|
||||||
if(TextUtils.isEmpty(currentSearchQuery) || instance.domain.contains(currentSearchQuery)){
|
|
||||||
if(instance.domain.equals(currentSearchQuery) || !isSignup || !instance.approvalRequired)
|
|
||||||
filteredData.add(instance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DiffUtil.calculateDiff(new DiffUtil.Callback(){
|
|
||||||
@Override
|
|
||||||
public int getOldListSize(){
|
|
||||||
return prevData.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getNewListSize(){
|
|
||||||
return filteredData.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition){
|
|
||||||
return prevData.get(oldItemPosition)==filteredData.get(newItemPosition);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition){
|
|
||||||
return prevData.get(oldItemPosition)==filteredData.get(newItemPosition);
|
|
||||||
}
|
|
||||||
}).dispatchUpdatesTo(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private class InstancesAdapter extends UsableRecyclerView.Adapter<InstanceCatalogSignupFragment.InstanceViewHolder>{
|
|
||||||
public InstancesAdapter(){
|
|
||||||
super(imgLoader);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public InstanceCatalogSignupFragment.InstanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
|
||||||
return new InstanceCatalogSignupFragment.InstanceViewHolder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(InstanceCatalogSignupFragment.InstanceViewHolder holder, int position){
|
|
||||||
holder.bind(filteredData.get(position));
|
|
||||||
super.onBindViewHolder(holder, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount(){
|
|
||||||
return filteredData.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemViewType(int position){
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InstanceViewHolder extends BindableViewHolder<CatalogInstance> implements UsableRecyclerView.Clickable{
|
|
||||||
private final TextView title, description, userCount, lang;
|
|
||||||
private final RadioButton radioButton;
|
|
||||||
|
|
||||||
public InstanceViewHolder(){
|
|
||||||
super(getActivity(), R.layout.item_instance_catalog, list);
|
|
||||||
title=findViewById(R.id.title);
|
|
||||||
description=findViewById(R.id.description);
|
|
||||||
userCount=findViewById(R.id.user_count);
|
|
||||||
lang=findViewById(R.id.lang);
|
|
||||||
radioButton=findViewById(R.id.radiobtn);
|
|
||||||
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N){
|
|
||||||
UiUtils.fixCompoundDrawableTintOnAndroid6(userCount);
|
|
||||||
UiUtils.fixCompoundDrawableTintOnAndroid6(lang);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBind(CatalogInstance item){
|
|
||||||
title.setText(item.normalizedDomain);
|
|
||||||
description.setText(item.description);
|
|
||||||
userCount.setText(UiUtils.abbreviateNumber(item.totalUsers));
|
|
||||||
lang.setText(item.language.toUpperCase());
|
|
||||||
radioButton.setChecked(chosenInstance==item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(){
|
|
||||||
if(chosenInstance==item)
|
|
||||||
return;
|
|
||||||
if(chosenInstance!=null){
|
|
||||||
int idx=filteredData.indexOf(chosenInstance);
|
|
||||||
if(idx!=-1){
|
|
||||||
RecyclerView.ViewHolder holder=list.findViewHolderForAdapterPosition(mergeAdapter.getPositionForAdapter(adapter)+idx);
|
|
||||||
if(holder instanceof InstanceCatalogSignupFragment.InstanceViewHolder ivh){
|
|
||||||
ivh.radioButton.setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
radioButton.setChecked(true);
|
|
||||||
if(chosenInstance==null)
|
|
||||||
nextButton.setEnabled(true);
|
|
||||||
chosenInstance=item;
|
|
||||||
loadInstanceInfo(chosenInstance.domain, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
package org.joinmastodon.android.fragments.onboarding;
|
|
||||||
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Outline;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.graphics.RectF;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.ViewOutlineProvider;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
import android.widget.RadioButton;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toolbar;
|
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
|
||||||
import org.joinmastodon.android.api.requests.catalog.GetCatalogInstances;
|
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
|
||||||
import org.joinmastodon.android.model.Instance;
|
|
||||||
import org.joinmastodon.android.model.catalog.CatalogInstance;
|
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import me.grishka.appkit.api.Callback;
|
|
||||||
import me.grishka.appkit.api.ErrorResponse;
|
|
||||||
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.UsableRecyclerView;
|
|
||||||
|
|
||||||
public class InstanceChooserLoginFragment extends InstanceCatalogFragment{
|
|
||||||
private View headerView;
|
|
||||||
private boolean loadedAutocomplete;
|
|
||||||
private ImageButton clearBtn;
|
|
||||||
|
|
||||||
public InstanceChooserLoginFragment(){
|
|
||||||
super(R.layout.fragment_login, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState){
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
dataLoaded();
|
|
||||||
setTitle(R.string.login_title);
|
|
||||||
if(!loadedAutocomplete){
|
|
||||||
loadAutocompleteServers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void proceedWithAuthOrSignup(Instance instance){
|
|
||||||
AccountSessionManager.getInstance().authenticate(getActivity(), instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateFilteredList(){
|
|
||||||
ArrayList<CatalogInstance> prevData=new ArrayList<>(filteredData);
|
|
||||||
filteredData.clear();
|
|
||||||
if(currentSearchQuery.length()>0){
|
|
||||||
boolean foundExactMatch=false;
|
|
||||||
for(CatalogInstance inst:data){
|
|
||||||
if(inst.normalizedDomain.contains(currentSearchQuery)){
|
|
||||||
filteredData.add(inst);
|
|
||||||
if(inst.normalizedDomain.equals(currentSearchQuery))
|
|
||||||
foundExactMatch=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!foundExactMatch)
|
|
||||||
filteredData.add(0, fakeInstance);
|
|
||||||
}
|
|
||||||
UiUtils.updateList(prevData, filteredData, list, adapter, Objects::equals);
|
|
||||||
for(int i=0;i<list.getChildCount();i++){
|
|
||||||
list.getChildAt(i).invalidateOutline();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void doLoadData(int offset, int count){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadAutocompleteServers(){
|
|
||||||
loadedAutocomplete=true;
|
|
||||||
new GetCatalogInstances(null, null)
|
|
||||||
.setCallback(new Callback<>(){
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<CatalogInstance> result){
|
|
||||||
data.clear();
|
|
||||||
data.addAll(sortInstances(result));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(ErrorResponse error){
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.execNoAuth("");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onUpdateToolbar(){
|
|
||||||
super.onUpdateToolbar();
|
|
||||||
Toolbar toolbar=getToolbar();
|
|
||||||
toolbar.setElevation(0);
|
|
||||||
toolbar.setBackground(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected RecyclerView.Adapter getAdapter(){
|
|
||||||
headerView=getActivity().getLayoutInflater().inflate(R.layout.header_onboarding_login, list, false);
|
|
||||||
clearBtn=headerView.findViewById(R.id.search_clear);
|
|
||||||
searchEdit=headerView.findViewById(R.id.search_edit);
|
|
||||||
searchEdit.setOnEditorActionListener(this::onSearchEnterPressed);
|
|
||||||
searchEdit.addTextChangedListener(new TextWatcher(){
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count){
|
|
||||||
searchEdit.removeCallbacks(searchDebouncer);
|
|
||||||
searchEdit.postDelayed(searchDebouncer, 300);
|
|
||||||
|
|
||||||
if(s.length()>0){
|
|
||||||
fakeInstance.domain=fakeInstance.normalizedDomain=s.toString();
|
|
||||||
fakeInstance.description=getString(R.string.loading_instance);
|
|
||||||
if(filteredData.size()>0 && filteredData.get(0)==fakeInstance){
|
|
||||||
if(list.findViewHolderForAdapterPosition(1) instanceof InstanceViewHolder ivh){
|
|
||||||
ivh.rebind();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(filteredData.isEmpty()){
|
|
||||||
filteredData.add(fakeInstance);
|
|
||||||
adapter.notifyItemInserted(0);
|
|
||||||
}
|
|
||||||
clearBtn.setVisibility(View.VISIBLE);
|
|
||||||
}else{
|
|
||||||
clearBtn.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s){
|
|
||||||
}
|
|
||||||
});
|
|
||||||
clearBtn.setOnClickListener(v->searchEdit.setText(""));
|
|
||||||
|
|
||||||
mergeAdapter=new MergeRecyclerAdapter();
|
|
||||||
mergeAdapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
|
||||||
mergeAdapter.addAdapter(adapter=new InstancesAdapter());
|
|
||||||
return mergeAdapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
|
||||||
|
|
||||||
list.addItemDecoration(new RecyclerView.ItemDecoration(){
|
|
||||||
@Override
|
|
||||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state){
|
|
||||||
if(parent.getChildViewHolder(view) instanceof InstanceViewHolder){
|
|
||||||
outRect.left=outRect.right=V.dp(16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
((UsableRecyclerView)list).setDrawSelectorOnTop(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InstancesAdapter extends UsableRecyclerView.Adapter<InstanceViewHolder>{
|
|
||||||
public InstancesAdapter(){
|
|
||||||
super(imgLoader);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public InstanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
|
||||||
return new InstanceViewHolder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(InstanceViewHolder holder, int position){
|
|
||||||
holder.bind(filteredData.get(position));
|
|
||||||
super.onBindViewHolder(holder, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount(){
|
|
||||||
return filteredData.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemViewType(int position){
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InstanceViewHolder extends BindableViewHolder<CatalogInstance> implements UsableRecyclerView.Clickable{
|
|
||||||
private final TextView title, description;
|
|
||||||
private final RadioButton radioButton;
|
|
||||||
|
|
||||||
public InstanceViewHolder(){
|
|
||||||
super(getActivity(), R.layout.item_instance_login, list);
|
|
||||||
title=findViewById(R.id.title);
|
|
||||||
description=findViewById(R.id.description);
|
|
||||||
radioButton=findViewById(R.id.radiobtn);
|
|
||||||
radioButton.setMinWidth(0);
|
|
||||||
radioButton.setMinHeight(0);
|
|
||||||
|
|
||||||
itemView.setOutlineProvider(new ViewOutlineProvider(){
|
|
||||||
@Override
|
|
||||||
public void getOutline(View view, Outline outline){
|
|
||||||
outline.setRoundRect(0, getAbsoluteAdapterPosition()==1 ? 0 : V.dp(-4), view.getWidth(), view.getHeight()+(getAbsoluteAdapterPosition()==filteredData.size() ? 0 : V.dp(4)), V.dp(4));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
itemView.setClipToOutline(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBind(CatalogInstance item){
|
|
||||||
title.setText(item.normalizedDomain);
|
|
||||||
description.setText(item.description);
|
|
||||||
radioButton.setChecked(chosenInstance==item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(){
|
|
||||||
if(chosenInstance==item)
|
|
||||||
return;
|
|
||||||
if(chosenInstance!=null){
|
|
||||||
int idx=filteredData.indexOf(chosenInstance);
|
|
||||||
if(idx!=-1){
|
|
||||||
for(int i=0;i<list.getChildCount();i++){
|
|
||||||
RecyclerView.ViewHolder holder=list.getChildViewHolder(list.getChildAt(i));
|
|
||||||
if(holder.getAbsoluteAdapterPosition()==mergeAdapter.getPositionForAdapter(adapter)+idx && holder instanceof InstanceViewHolder ivh){
|
|
||||||
ivh.radioButton.setChecked(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
radioButton.setChecked(true);
|
|
||||||
if(chosenInstance==null)
|
|
||||||
nextButton.setEnabled(true);
|
|
||||||
chosenInstance=item;
|
|
||||||
loadInstanceInfo(chosenInstance.domain, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -43,9 +43,7 @@ public class PushNotification extends BaseModel{
|
|||||||
@SerializedName("follow")
|
@SerializedName("follow")
|
||||||
FOLLOW(R.string.notification_type_follow),
|
FOLLOW(R.string.notification_type_follow),
|
||||||
@SerializedName("poll")
|
@SerializedName("poll")
|
||||||
POLL(R.string.notification_type_poll),
|
POLL(R.string.notification_type_poll);
|
||||||
@SerializedName("status")
|
|
||||||
STATUS(R.string.sk_notification_type_status);
|
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
public final int localizedName;
|
public final int localizedName;
|
||||||
|
|||||||
@@ -43,11 +43,10 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
|||||||
public boolean reblog;
|
public boolean reblog;
|
||||||
public boolean mention;
|
public boolean mention;
|
||||||
public boolean poll;
|
public boolean poll;
|
||||||
public boolean status;
|
|
||||||
|
|
||||||
public static Alerts ofAll(){
|
public static Alerts ofAll(){
|
||||||
Alerts alerts=new Alerts();
|
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=true;
|
||||||
return alerts;
|
return alerts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +58,6 @@ public class PushSubscription extends BaseModel implements Cloneable{
|
|||||||
", reblog="+reblog+
|
", reblog="+reblog+
|
||||||
", mention="+mention+
|
", mention="+mention+
|
||||||
", poll="+poll+
|
", poll="+poll+
|
||||||
", status="+status+
|
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
@@ -155,16 +154,11 @@ public class ComposeAutocompleteViewController{
|
|||||||
}else if(mode==Mode.EMOJIS){
|
}else if(mode==Mode.EMOJIS){
|
||||||
String _text=text.substring(1); // remove ':'
|
String _text=text.substring(1); // remove ':'
|
||||||
List<WrappedEmoji> oldList=emojis;
|
List<WrappedEmoji> oldList=emojis;
|
||||||
List<Emoji> allEmojis = AccountSessionManager.getInstance()
|
emojis=AccountSessionManager.getInstance()
|
||||||
.getCustomEmojis(AccountSessionManager.getInstance().getAccount(accountID).domain)
|
.getCustomEmojis(AccountSessionManager.getInstance().getAccount(accountID).domain)
|
||||||
.stream()
|
.stream()
|
||||||
.flatMap(ec->ec.emojis.stream())
|
.flatMap(ec->ec.emojis.stream())
|
||||||
.filter(e->e.visibleInPicker)
|
.filter(e->e.visibleInPicker && e.shortcode.startsWith(_text))
|
||||||
.collect(Collectors.toList());
|
|
||||||
List<Emoji> startsWithSearch = allEmojis.stream().filter(e -> e.shortcode.toLowerCase().startsWith(_text.toLowerCase())).collect(Collectors.toList());
|
|
||||||
emojis=Stream.concat(startsWithSearch.stream(), allEmojis.stream()
|
|
||||||
.filter(e -> !startsWithSearch.contains(e))
|
|
||||||
.filter(e -> e.shortcode.toLowerCase().contains(_text.toLowerCase())))
|
|
||||||
.map(WrappedEmoji::new)
|
.map(WrappedEmoji::new)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
UiUtils.updateList(oldList, emojis, list, emojisAdapter, (e1, e2)->e1.emoji.shortcode.equals(e2.emoji.shortcode));
|
UiUtils.updateList(oldList, emojis, list, emojisAdapter, (e1, e2)->e1.emoji.shortcode.equals(e2.emoji.shortcode));
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class ImageDescriptionSheet extends BottomSheet{
|
|||||||
}
|
}
|
||||||
|
|
||||||
TextView heading=new TextView(activity);
|
TextView heading=new TextView(activity);
|
||||||
heading.setText(R.string.sk_image_description);
|
heading.setText(R.string.image_description);
|
||||||
heading.setAllCaps(true);
|
heading.setAllCaps(true);
|
||||||
heading.setTypeface(null, Typeface.BOLD);
|
heading.setTypeface(null, Typeface.BOLD);
|
||||||
heading.setPadding(0, V.dp(24), 0, V.dp(8));
|
heading.setPadding(0, V.dp(24), 0, V.dp(8));
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
if(id==R.id.favorite_btn)
|
if(id==R.id.favorite_btn)
|
||||||
return R.string.button_favorite;
|
return R.string.button_favorite;
|
||||||
if(id==R.id.bookmark_btn)
|
if(id==R.id.bookmark_btn)
|
||||||
return R.string.add_bookmark;
|
return R.string.button_bookmark;
|
||||||
if(id==R.id.share_btn)
|
if(id==R.id.share_btn)
|
||||||
return R.string.button_share;
|
return R.string.button_share;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.model.Poll;
|
import org.joinmastodon.android.model.Poll;
|
||||||
@@ -45,7 +44,7 @@ public class PollFooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
text+=" · "+item.parentFragment.getString(R.string.poll_closed);
|
text+=" · "+item.parentFragment.getString(R.string.poll_closed);
|
||||||
}
|
}
|
||||||
this.text.setText(text);
|
this.text.setText(text);
|
||||||
button.setVisibility(item.poll.isExpired() || item.poll.voted || (!item.poll.multiple && !GlobalUserPreferences.voteButtonForSingleChoice) ? View.GONE : View.VISIBLE);
|
button.setVisibility(item.poll.isExpired() || item.poll.voted || !item.poll.multiple ? View.GONE : View.VISIBLE);
|
||||||
button.setEnabled(item.poll.selectedOptions!=null && !item.poll.selectedOptions.isEmpty());
|
button.setEnabled(item.poll.selectedOptions!=null && !item.poll.selectedOptions.isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,11 +76,10 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{
|
|||||||
@Override
|
@Override
|
||||||
public void onBind(PollOptionStatusDisplayItem item){
|
public void onBind(PollOptionStatusDisplayItem item){
|
||||||
text.setText(item.text);
|
text.setText(item.text);
|
||||||
// icon.setVisibility(item.showResults ? View.GONE : View.VISIBLE);
|
icon.setVisibility(item.showResults ? View.GONE : View.VISIBLE);
|
||||||
percent.setVisibility(item.showResults ? View.VISIBLE : View.GONE);
|
percent.setVisibility(item.showResults ? View.VISIBLE : View.GONE);
|
||||||
itemView.setClickable(!item.showResults);
|
itemView.setClickable(!item.showResults);
|
||||||
if(item.showResults){
|
if(item.showResults){
|
||||||
icon.setSelected(item.poll.ownVotes.contains(item.poll.options.indexOf(item.option)));
|
|
||||||
progressBg.setLevel(Math.round(10000f*item.votesFraction));
|
progressBg.setLevel(Math.round(10000f*item.votesFraction));
|
||||||
button.setBackground(progressBg);
|
button.setBackground(progressBg);
|
||||||
itemView.setSelected(item.isMostVoted);
|
itemView.setSelected(item.isMostVoted);
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package org.joinmastodon.android.ui.displayitems;
|
package org.joinmastodon.android.ui.displayitems;
|
||||||
|
|
||||||
import static org.joinmastodon.android.MastodonApp.context;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -41,8 +38,6 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
|
|||||||
emojiHelper.setText(ssb);
|
emojiHelper.setText(ssb);
|
||||||
this.icon=icon;
|
this.icon=icon;
|
||||||
this.handleClick=handleClick;
|
this.handleClick=handleClick;
|
||||||
TypedValue outValue = new TypedValue();
|
|
||||||
context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,8 +67,6 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
|
|||||||
text.setText(item.text);
|
text.setText(item.text);
|
||||||
text.setCompoundDrawablesRelativeWithIntrinsicBounds(item.icon, 0, 0, 0);
|
text.setCompoundDrawablesRelativeWithIntrinsicBounds(item.icon, 0, 0, 0);
|
||||||
if(item.handleClick!=null) text.setOnClickListener(item.handleClick);
|
if(item.handleClick!=null) text.setOnClickListener(item.handleClick);
|
||||||
text.setEnabled(!item.inset);
|
|
||||||
text.setClickable(!item.inset);
|
|
||||||
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N)
|
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N)
|
||||||
UiUtils.fixCompoundDrawableTintOnAndroid6(text);
|
UiUtils.fixCompoundDrawableTintOnAndroid6(text);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
|
|||||||
toolbar=uiOverlay.findViewById(R.id.toolbar);
|
toolbar=uiOverlay.findViewById(R.id.toolbar);
|
||||||
toolbar.setNavigationOnClickListener(v->onStartSwipeToDismissTransition(0));
|
toolbar.setNavigationOnClickListener(v->onStartSwipeToDismissTransition(0));
|
||||||
imageDescriptionButton = toolbar.getMenu()
|
imageDescriptionButton = toolbar.getMenu()
|
||||||
.add(R.string.sk_image_description)
|
.add(R.string.image_description)
|
||||||
.setIcon(R.drawable.ic_fluent_image_alt_text_24_regular)
|
.setIcon(R.drawable.ic_fluent_image_alt_text_24_regular)
|
||||||
.setVisible(attachments.get(pager.getCurrentItem()).description != null
|
.setVisible(attachments.get(pager.getCurrentItem()).description != null
|
||||||
&& !attachments.get(pager.getCurrentItem()).description.isEmpty())
|
&& !attachments.get(pager.getCurrentItem()).description.isEmpty())
|
||||||
|
|||||||
@@ -1,29 +1,12 @@
|
|||||||
package org.joinmastodon.android.ui.text;
|
package org.joinmastodon.android.ui.text;
|
||||||
|
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.graphics.fonts.FontFamily;
|
|
||||||
import android.graphics.fonts.FontStyle;
|
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.style.BackgroundColorSpan;
|
|
||||||
import android.text.style.BulletSpan;
|
|
||||||
import android.text.style.ForegroundColorSpan;
|
|
||||||
import android.text.style.LeadingMarginSpan;
|
|
||||||
import android.text.style.RelativeSizeSpan;
|
|
||||||
import android.text.style.StrikethroughSpan;
|
|
||||||
import android.text.style.StyleSpan;
|
|
||||||
import android.text.style.SubscriptSpan;
|
|
||||||
import android.text.style.SuperscriptSpan;
|
|
||||||
import android.text.style.TypefaceSpan;
|
|
||||||
import android.text.style.UnderlineSpan;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.twitter.twittertext.Regex;
|
import com.twitter.twittertext.Regex;
|
||||||
|
|
||||||
import org.joinmastodon.android.MastodonApp;
|
|
||||||
import org.joinmastodon.android.R;
|
|
||||||
import org.joinmastodon.android.model.Emoji;
|
import org.joinmastodon.android.model.Emoji;
|
||||||
import org.joinmastodon.android.model.Hashtag;
|
import org.joinmastodon.android.model.Hashtag;
|
||||||
import org.joinmastodon.android.model.Mention;
|
import org.joinmastodon.android.model.Mention;
|
||||||
@@ -32,11 +15,11 @@ import org.jsoup.Jsoup;
|
|||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.nodes.Node;
|
import org.jsoup.nodes.Node;
|
||||||
import org.jsoup.nodes.TextNode;
|
import org.jsoup.nodes.TextNode;
|
||||||
|
import org.jsoup.safety.Cleaner;
|
||||||
import org.jsoup.safety.Safelist;
|
import org.jsoup.safety.Safelist;
|
||||||
import org.jsoup.select.NodeVisitor;
|
import org.jsoup.select.NodeVisitor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -46,8 +29,6 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import me.grishka.appkit.utils.V;
|
|
||||||
|
|
||||||
public class HtmlParser{
|
public class HtmlParser{
|
||||||
private static final String TAG="HtmlParser";
|
private static final String TAG="HtmlParser";
|
||||||
private static final String VALID_URL_PATTERN_STRING =
|
private static final String VALID_URL_PATTERN_STRING =
|
||||||
@@ -86,17 +67,11 @@ public class HtmlParser{
|
|||||||
public Object span;
|
public Object span;
|
||||||
public int start;
|
public int start;
|
||||||
public Element element;
|
public Element element;
|
||||||
public boolean more;
|
|
||||||
|
|
||||||
public SpanInfo(Object span, int start, Element element){
|
public SpanInfo(Object span, int start, Element element){
|
||||||
this(span, start, element, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpanInfo(Object span, int start, Element element, boolean more){
|
|
||||||
this.span=span;
|
this.span=span;
|
||||||
this.start=start;
|
this.start=start;
|
||||||
this.element=element;
|
this.element=element;
|
||||||
this.more=more;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,59 +119,24 @@ public class HtmlParser{
|
|||||||
openSpans.add(new SpanInfo(new InvisibleSpan(), ssb.length(), el));
|
openSpans.add(new SpanInfo(new InvisibleSpan(), ssb.length(), el));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "li" -> openSpans.add(new SpanInfo(new BulletSpan(V.dp(8)), ssb.length(), el));
|
|
||||||
case "em", "i" -> openSpans.add(new SpanInfo(new StyleSpan(Typeface.ITALIC), ssb.length(), el));
|
|
||||||
case "h1", "h2", "h3", "h4", "h5", "h6" -> {
|
|
||||||
// increase line height above heading (multiplying the margin)
|
|
||||||
if (node.previousSibling()!=null) ssb.setSpan(new RelativeSizeSpan(2), ssb.length() - 1, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
||||||
if (!node.nodeName().equals("h1")) {
|
|
||||||
openSpans.add(new SpanInfo(new StyleSpan(Typeface.BOLD), ssb.length(), el));
|
|
||||||
}
|
|
||||||
openSpans.add(new SpanInfo(new RelativeSizeSpan(switch(node.nodeName()) {
|
|
||||||
case "h1" -> 1.5f;
|
|
||||||
case "h2" -> 1.25f;
|
|
||||||
case "h3" -> 1.125f;
|
|
||||||
default -> 1;
|
|
||||||
}), ssb.length(), el, !node.nodeName().equals("h1")));
|
|
||||||
}
|
|
||||||
case "strong", "b" -> openSpans.add(new SpanInfo(new StyleSpan(Typeface.BOLD), ssb.length(), el));
|
|
||||||
case "u" -> openSpans.add(new SpanInfo(new UnderlineSpan(), ssb.length(), el));
|
|
||||||
case "s", "del" -> openSpans.add(new SpanInfo(new StrikethroughSpan(), ssb.length(), el));
|
|
||||||
case "sub", "sup" -> {
|
|
||||||
openSpans.add(new SpanInfo(node.nodeName().equals("sub") ? new SubscriptSpan() : new SuperscriptSpan(), ssb.length(), el));
|
|
||||||
openSpans.add(new SpanInfo(new RelativeSizeSpan(0.8f), ssb.length(), el, true));
|
|
||||||
}
|
|
||||||
case "code", "pre" -> openSpans.add(new SpanInfo(new TypefaceSpan("monospace"), ssb.length(), el));
|
|
||||||
case "blockquote" -> openSpans.add(new SpanInfo(new LeadingMarginSpan.Standard(V.dp(10)), ssb.length(), el));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final static List<String> blockElements = Arrays.asList("p", "ul", "ol", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tail(@NonNull Node node, int depth){
|
public void tail(@NonNull Node node, int depth){
|
||||||
if(node instanceof Element el){
|
if(node instanceof Element el){
|
||||||
processOpenSpan(el);
|
|
||||||
if("span".equals(el.nodeName()) && el.hasClass("ellipsis")){
|
if("span".equals(el.nodeName()) && el.hasClass("ellipsis")){
|
||||||
ssb.append("…", new DeleteWhenCopiedSpan(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
ssb.append("…", new DeleteWhenCopiedSpan(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
}else if(blockElements.contains(el.nodeName()) && node.nextSibling()!=null){
|
}else if("p".equals(el.nodeName())){
|
||||||
ssb.append("\n"); // line end
|
if(node.nextSibling()!=null)
|
||||||
ssb.append("\n", new RelativeSizeSpan(0.75f), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); // margin after block
|
ssb.append("\n\n");
|
||||||
}
|
}else if(!openSpans.isEmpty()){
|
||||||
}
|
SpanInfo si=openSpans.get(openSpans.size()-1);
|
||||||
}
|
if(si.element==el){
|
||||||
|
ssb.setSpan(si.span, si.start, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
private void processOpenSpan(Element el) {
|
openSpans.remove(openSpans.size()-1);
|
||||||
if(!openSpans.isEmpty()){
|
}
|
||||||
SpanInfo si=openSpans.get(openSpans.size()-1);
|
|
||||||
if(si.element==el){
|
|
||||||
ssb.setSpan(si.span, si.start, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
||||||
openSpans.remove(openSpans.size()-1);
|
|
||||||
if(si.more) processOpenSpan(el);
|
|
||||||
}
|
|
||||||
if("li".equals(el.nodeName()) && el.nextSibling()!=null) {
|
|
||||||
ssb.append('\n');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class DiscoverInfoBannerHelper{
|
|||||||
case TRENDING_HASHTAGS -> R.string.trending_hashtags_info_banner;
|
case TRENDING_HASHTAGS -> R.string.trending_hashtags_info_banner;
|
||||||
case TRENDING_LINKS -> R.string.trending_links_info_banner;
|
case TRENDING_LINKS -> R.string.trending_links_info_banner;
|
||||||
case LOCAL_TIMELINE -> R.string.local_timeline_info_banner;
|
case LOCAL_TIMELINE -> R.string.local_timeline_info_banner;
|
||||||
case FEDERATED_TIMELINE -> R.string.sk_federated_timeline_info_banner;
|
case FEDERATED_TIMELINE -> R.string.federated_timeline_info_banner;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ public class UiUtils{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback, boolean forRedraft){
|
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback, boolean forRedraft){
|
||||||
showConfirmationAlert(activity, forRedraft ? R.string.sk_confirm_delete_and_redraft_title : R.string.confirm_delete_title, forRedraft ? R.string.sk_confirm_delete_and_redraft : R.string.confirm_delete, forRedraft ? R.string.sk_delete_and_redraft : R.string.delete, ()->{
|
showConfirmationAlert(activity, forRedraft ? R.string.confirm_delete_and_redraft_title : R.string.confirm_delete_title, forRedraft ? R.string.confirm_delete_and_redraft : R.string.confirm_delete, forRedraft ? R.string.delete_and_redraft : R.string.delete, ()->{
|
||||||
new DeleteStatus(status.id)
|
new DeleteStatus(status.id)
|
||||||
.setCallback(new Callback<>(){
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
@@ -433,9 +433,9 @@ public class UiUtils{
|
|||||||
|
|
||||||
public static void confirmPinPost(Activity activity, String accountID, Status status, boolean pinned, Consumer<Status> resultCallback){
|
public static void confirmPinPost(Activity activity, String accountID, Status status, boolean pinned, Consumer<Status> resultCallback){
|
||||||
showConfirmationAlert(activity,
|
showConfirmationAlert(activity,
|
||||||
pinned ? R.string.sk_confirm_pin_post_title : R.string.sk_confirm_unpin_post_title,
|
pinned ? R.string.confirm_pin_post_title : R.string.confirm_unpin_post_title,
|
||||||
pinned ? R.string.sk_confirm_pin_post : R.string.sk_confirm_unpin_post,
|
pinned ? R.string.confirm_pin_post : R.string.confirm_unpin_post,
|
||||||
pinned ? R.string.sk_pin_post : R.string.sk_unpin_post,
|
pinned ? R.string.pin_post : R.string.unpin_post,
|
||||||
()->{
|
()->{
|
||||||
new SetStatusPinned(status.id, pinned)
|
new SetStatusPinned(status.id, pinned)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>() {
|
||||||
@@ -452,7 +452,7 @@ public class UiUtils{
|
|||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress(activity, pinned ? R.string.sk_pinning : R.string.sk_unpinning, false)
|
.wrapProgress(activity, pinned ? R.string.pinning : R.string.unpinning, false)
|
||||||
.exec(accountID);
|
.exec(accountID);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -508,7 +508,7 @@ public class UiUtils{
|
|||||||
public void onSuccess(Relationship result) {
|
public void onSuccess(Relationship result) {
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
progressCallback.accept(false);
|
progressCallback.accept(false);
|
||||||
Toast.makeText(activity, activity.getString(result.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username), Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, activity.getString(result.notifying ? R.string.user_post_notifications_on : R.string.user_post_notifications_off, '@'+account.username), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -698,14 +698,14 @@ public class UiUtils{
|
|||||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Blue : R.style.Theme_Mastodon_Dark_Blue;
|
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Blue : R.style.Theme_Mastodon_Dark_Blue;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case BROWN:
|
case ORANGE:
|
||||||
context.setTheme(switch(GlobalUserPreferences.theme){
|
context.setTheme(switch(GlobalUserPreferences.theme){
|
||||||
case AUTO ->
|
case AUTO ->
|
||||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Brown : R.style.Theme_Mastodon_AutoLightDark_Brown;
|
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Orange : R.style.Theme_Mastodon_AutoLightDark_Orange;
|
||||||
case LIGHT ->
|
case LIGHT ->
|
||||||
R.style.Theme_Mastodon_Light_Brown;
|
R.style.Theme_Mastodon_Light_Orange;
|
||||||
case DARK ->
|
case DARK ->
|
||||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Brown : R.style.Theme_Mastodon_Dark_Brown;
|
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Orange : R.style.Theme_Mastodon_Dark_Orange;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case YELLOW:
|
case YELLOW:
|
||||||
|
|||||||
@@ -1,124 +0,0 @@
|
|||||||
package org.joinmastodon.android.ui.views;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
|
||||||
import android.animation.AnimatorListenerAdapter;
|
|
||||||
import android.animation.AnimatorSet;
|
|
||||||
import android.animation.ObjectAnimator;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
|
||||||
import org.joinmastodon.android.ui.utils.SimpleTextWatcher;
|
|
||||||
|
|
||||||
import me.grishka.appkit.utils.CubicBezierInterpolator;
|
|
||||||
import me.grishka.appkit.utils.V;
|
|
||||||
|
|
||||||
public class FloatingHintEditTextLayout extends FrameLayout{
|
|
||||||
private EditText edit;
|
|
||||||
private TextView label;
|
|
||||||
private int labelTextSize;
|
|
||||||
private int offsetY;
|
|
||||||
private boolean hintVisible;
|
|
||||||
private Animator currentAnim;
|
|
||||||
|
|
||||||
public FloatingHintEditTextLayout(Context context){
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatingHintEditTextLayout(Context context, AttributeSet attrs){
|
|
||||||
this(context, attrs, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatingHintEditTextLayout(Context context, AttributeSet attrs, int defStyle){
|
|
||||||
super(context, attrs, defStyle);
|
|
||||||
if(isInEditMode())
|
|
||||||
V.setApplicationContext(context);
|
|
||||||
TypedArray ta=context.obtainStyledAttributes(attrs, R.styleable.FloatingHintEditTextLayout);
|
|
||||||
labelTextSize=ta.getDimensionPixelSize(R.styleable.FloatingHintEditTextLayout_android_labelTextSize, V.dp(12));
|
|
||||||
offsetY=ta.getDimensionPixelOffset(R.styleable.FloatingHintEditTextLayout_editTextOffsetY, 0);
|
|
||||||
ta.recycle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onFinishInflate(){
|
|
||||||
super.onFinishInflate();
|
|
||||||
if(getChildCount()>0 && getChildAt(0) instanceof EditText et){
|
|
||||||
edit=et;
|
|
||||||
}else{
|
|
||||||
throw new IllegalStateException("First child must be an EditText");
|
|
||||||
}
|
|
||||||
|
|
||||||
label=new TextView(getContext());
|
|
||||||
label.setTextSize(TypedValue.COMPLEX_UNIT_PX, labelTextSize);
|
|
||||||
label.setTextColor(edit.getHintTextColors());
|
|
||||||
label.setText(edit.getHint());
|
|
||||||
label.setSingleLine();
|
|
||||||
label.setPivotX(0f);
|
|
||||||
label.setPivotY(0f);
|
|
||||||
LayoutParams lp=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.START | Gravity.TOP);
|
|
||||||
lp.setMarginStart(edit.getPaddingStart());
|
|
||||||
addView(label, lp);
|
|
||||||
|
|
||||||
hintVisible=edit.getText().length()==0;
|
|
||||||
if(hintVisible)
|
|
||||||
label.setAlpha(0f);
|
|
||||||
|
|
||||||
edit.addTextChangedListener(new SimpleTextWatcher(this::onTextChanged));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onTextChanged(Editable text){
|
|
||||||
boolean newHintVisible=text.length()==0;
|
|
||||||
if(newHintVisible==hintVisible)
|
|
||||||
return;
|
|
||||||
if(currentAnim!=null)
|
|
||||||
currentAnim.cancel();
|
|
||||||
hintVisible=newHintVisible;
|
|
||||||
|
|
||||||
label.setAlpha(1);
|
|
||||||
float scale=edit.getLineHeight()/(float)label.getLineHeight();
|
|
||||||
float transY=edit.getHeight()/2f-edit.getLineHeight()/2f+(edit.getTop()-label.getTop())-(label.getHeight()/2f-label.getLineHeight()/2f);
|
|
||||||
|
|
||||||
AnimatorSet anim=new AnimatorSet();
|
|
||||||
if(hintVisible){
|
|
||||||
anim.playTogether(
|
|
||||||
ObjectAnimator.ofFloat(edit, TRANSLATION_Y, 0),
|
|
||||||
ObjectAnimator.ofFloat(label, SCALE_X, scale),
|
|
||||||
ObjectAnimator.ofFloat(label, SCALE_Y, scale),
|
|
||||||
ObjectAnimator.ofFloat(label, TRANSLATION_Y, transY)
|
|
||||||
);
|
|
||||||
edit.setHintTextColor(0);
|
|
||||||
}else{
|
|
||||||
label.setScaleX(scale);
|
|
||||||
label.setScaleY(scale);
|
|
||||||
label.setTranslationY(transY);
|
|
||||||
anim.playTogether(
|
|
||||||
ObjectAnimator.ofFloat(edit, TRANSLATION_Y, offsetY),
|
|
||||||
ObjectAnimator.ofFloat(label, SCALE_X, 1f),
|
|
||||||
ObjectAnimator.ofFloat(label, SCALE_Y, 1f),
|
|
||||||
ObjectAnimator.ofFloat(label, TRANSLATION_Y, 0f)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
anim.setDuration(150);
|
|
||||||
anim.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
|
||||||
anim.start();
|
|
||||||
anim.addListener(new AnimatorListenerAdapter(){
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation){
|
|
||||||
currentAnim=null;
|
|
||||||
if(hintVisible){
|
|
||||||
label.setAlpha(0);
|
|
||||||
edit.setHintTextColor(label.getTextColors());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
currentAnim=anim;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="@color/gray_25" android:state_enabled="true"/>
|
<item android:color="?colorBackgroundLightest" android:state_enabled="true"/>
|
||||||
<item android:color="@color/gray_100"/>
|
<item android:color="?android:colorBackground"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="?colorM3OnPrimary" android:state_enabled="true"/>
|
|
||||||
<item android:color="?colorM3OnSurface" android:alpha="0.38"/>
|
|
||||||
</selector>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="?colorButtonText" android:state_enabled="true"/>
|
<item android:color="@color/black" android:state_enabled="true"/>
|
||||||
<item android:color="?colorTabInactive"/>
|
<item android:color="?colorTabInactive"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="?colorM3PressedOverlay" android:alpha="0.12"/>
|
|
||||||
</selector>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="?colorM3Primary" android:state_checked="true"/>
|
|
||||||
<item android:color="?colorM3OnSurfaceVariant"/>
|
|
||||||
</selector>
|
|
||||||
22
mastodon/src/main/res/drawable-anydpi-v24/ic_ntf_logo.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="#FFFFFF">
|
||||||
|
<group android:scaleX="0.9699526"
|
||||||
|
android:scaleY="0.9699526"
|
||||||
|
android:translateX="0.96"
|
||||||
|
android:translateY="6.925208">
|
||||||
|
<path
|
||||||
|
android:pathData="m3.639,-0c-1.097,0 -1.983,0.387 -2.658,1.141 -0.655,0.754 -0.981,1.771 -0.981,3.053l0,6.27L2.482,10.464L2.482,4.378c0,-1.284 0.539,-1.935 1.618,-1.935 1.192,0 1.791,0.773 1.791,2.3l0,3.331l2.468,0l0,-3.331c0,-1.527 0.598,-2.3 1.791,-2.3 1.078,0 1.618,0.651 1.618,1.935l0,6.085l2.482,0l0,-6.27c0,-1.281 -0.326,-2.299 -0.981,-3.053 -0.676,-0.754 -1.56,-1.141 -2.658,-1.141 -1.27,0 -2.232,0.488 -2.868,1.466L7.125,2.504 6.506,1.466C5.87,0.488 4.909,-0 3.639,-0Z"
|
||||||
|
android:strokeWidth="0.796"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m18.947,10.464q-1.113,0 -1.986,-0.493 -0.873,-0.507 -1.366,-1.366 -0.479,-0.873 -0.479,-1.958 0,-1.07 0.479,-1.944 0.493,-0.873 1.366,-1.366 0.873,-0.507 1.986,-0.507 1.099,0 1.972,0.507 0.873,0.493 1.352,1.366 0.493,0.873 0.493,1.944 0,1.085 -0.493,1.958 -0.479,0.859 -1.352,1.366 -0.873,0.493 -1.972,0.493zM18.947,8.759q0.535,0 0.986,-0.254 0.451,-0.254 0.718,-0.732 0.268,-0.479 0.268,-1.127 0,-0.634 -0.268,-1.113 -0.268,-0.479 -0.718,-0.732 -0.451,-0.254 -0.986,-0.254 -0.535,0 -0.986,0.254 -0.451,0.254 -0.732,0.732 -0.268,0.479 -0.268,1.113 0,0.634 0.268,1.127 0.282,0.479 0.732,0.732 0.451,0.254 0.986,0.254z"
|
||||||
|
android:strokeWidth="0.687"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
BIN
mastodon/src/main/res/drawable-hdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
mastodon/src/main/res/drawable-mdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
mastodon/src/main/res/drawable-xhdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
mastodon/src/main/res/drawable-xxhdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 902 B |
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:state_enabled="true">
|
|
||||||
<ripple android:color="@color/m3_pressed_overlay">
|
|
||||||
<item>
|
|
||||||
<shape>
|
|
||||||
<solid android:color="?colorM3Primary"/>
|
|
||||||
<corners android:radius="20dp"/>
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
</ripple>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<shape>
|
|
||||||
<solid android:color="?colorM3DisabledBackground"/>
|
|
||||||
<corners android:radius="20dp"/>
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
</selector>
|
|
||||||
23
mastodon/src/main/res/drawable/ic_color_theme_preference.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,22C6.49,22 2,17.51 2,12S6.49,2 12,2s10,4.04 10,9c0,3.31 -2.69,6 -6,6h-1.77c-0.28,0 -0.5,0.22 -0.5,0.5 0,0.12 0.05,0.23 0.13,0.33 0.41,0.47 0.64,1.06 0.64,1.67 0,1.38 -1.12,2.5 -2.5,2.5zM12,4c-4.41,0 -8,3.59 -8,8s3.59,8 8,8c0.28,0 0.5,-0.22 0.5,-0.5 0,-0.16 -0.08,-0.28 -0.14,-0.35 -0.41,-0.46 -0.63,-1.05 -0.63,-1.65 0,-1.38 1.12,-2.5 2.5,-2.5L16,15c2.21,0 4,-1.79 4,-4 0,-3.86 -3.59,-7 -8,-7z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M6.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M9.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M14.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M17.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
|
||||||
|
</vector>
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<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.839 5.858c2.94-3.916 9.03-5.055 13.364-2.36 4.28 2.66 5.854 7.777 4.1 12.577-1.655 4.533-6.016 6.328-9.159 4.048-1.177-0.854-1.634-1.925-1.854-3.664l-0.106-0.987-0.045-0.398c-0.123-0.934-0.311-1.352-0.705-1.572C8.9 13.204 8.542 13.197 7.84 13.47l-0.351 0.146-0.179 0.078c-1.014 0.44-1.688 0.595-2.541 0.416l-0.2-0.047-0.164-0.047c-2.79-0.865-3.203-4.648-0.565-8.158zm0.984 6.716l0.123 0.037 0.134 0.03c0.439 0.087 0.814 0.015 1.437-0.242l0.602-0.257c1.202-0.493 1.985-0.54 3.046 0.05 0.917 0.512 1.275 1.298 1.457 2.66l0.053 0.459 0.055 0.532 0.047 0.422c0.172 1.361 0.485 2.09 1.248 2.644 2.275 1.65 5.534 0.309 6.87-3.349 1.516-4.152 0.174-8.514-3.484-10.789-3.675-2.284-8.899-1.306-11.373 1.987-2.075 2.763-1.82 5.28-0.215 5.816zm11.225-1.994c-0.18-0.667 0.217-1.353 0.883-1.531 0.667-0.179 1.353 0.217 1.531 0.884 0.18 0.667-0.217 1.352-0.884 1.53-0.666 0.18-1.352-0.216-1.53-0.883zm0.494 3.488c-0.179-0.666 0.217-1.352 0.884-1.53 0.667-0.18 1.352 0.216 1.531 0.883 0.179 0.667-0.217 1.353-0.884 1.531-0.667 0.179-1.352-0.217-1.53-0.884zM14.07 7.577c-0.179-0.667 0.217-1.352 0.884-1.53 0.667-0.18 1.352 0.216 1.53 0.883 0.18 0.667-0.216 1.352-0.883 1.53-0.667 0.18-1.352-0.216-1.53-0.883zm-0.028 8.998c-0.18-0.666 0.217-1.352 0.883-1.53 0.667-0.18 1.353 0.216 1.531 0.883 0.18 0.667-0.217 1.353-0.883 1.531-0.667 0.179-1.353-0.217-1.531-0.884zm-3.497-9.97c-0.179-0.666 0.217-1.352 0.883-1.53 0.667-0.18 1.353 0.217 1.532 0.883 0.178 0.667-0.218 1.353-0.884 1.531-0.667 0.179-1.353-0.217-1.531-0.884z" android:fillColor="@color/fluent_default_icon_tint"/>
|
|
||||||
</vector>
|
|
||||||
74
mastodon/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector
|
||||||
|
android:height="108dp"
|
||||||
|
android:width="108dp"
|
||||||
|
android:viewportHeight="108"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#3DDC84"
|
||||||
|
android:pathData="M0,0h108v108h-108z"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
</vector>
|
||||||
23
mastodon/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group android:scaleX="2.5091188"
|
||||||
|
android:scaleY="2.5091188">
|
||||||
|
<path
|
||||||
|
android:pathData="M0,0h43.043v43.043h-43.043z"
|
||||||
|
android:strokeWidth="1.53886"
|
||||||
|
android:fillColor="#282c37"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m13.779,16.29c-1.097,0 -1.983,0.387 -2.658,1.141 -0.655,0.754 -0.981,1.771 -0.981,3.053l0,6.27L12.622,26.754L12.622,20.668c0,-1.284 0.539,-1.935 1.618,-1.935 1.192,0 1.791,0.773 1.791,2.3l0,3.331l2.468,0l0,-3.331c0,-1.527 0.598,-2.3 1.791,-2.3 1.078,0 1.618,0.651 1.618,1.935l0,6.085l2.482,0l0,-6.27c0,-1.281 -0.326,-2.299 -0.981,-3.053 -0.676,-0.754 -1.56,-1.141 -2.658,-1.141 -1.27,0 -2.232,0.488 -2.868,1.466L17.265,18.794 16.646,17.756C16.01,16.778 15.049,16.29 13.779,16.29Z"
|
||||||
|
android:strokeWidth="0.796"
|
||||||
|
android:fillColor="#eed7f4"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m29.087,26.754q-1.113,0 -1.986,-0.493 -0.873,-0.507 -1.366,-1.366 -0.479,-0.873 -0.479,-1.958 0,-1.07 0.479,-1.944 0.493,-0.873 1.366,-1.366 0.873,-0.507 1.986,-0.507 1.099,0 1.972,0.507 0.873,0.493 1.352,1.366 0.493,0.873 0.493,1.944 0,1.085 -0.493,1.958 -0.479,0.859 -1.352,1.366 -0.873,0.493 -1.972,0.493zM29.087,25.049q0.535,0 0.986,-0.254 0.451,-0.254 0.718,-0.732 0.268,-0.479 0.268,-1.127 0,-0.634 -0.268,-1.113 -0.268,-0.479 -0.718,-0.732 -0.451,-0.254 -0.986,-0.254 -0.535,0 -0.986,0.254 -0.451,0.254 -0.732,0.732 -0.268,0.479 -0.268,1.113 0,0.634 0.268,1.127 0.282,0.479 0.732,0.732 0.451,0.254 0.986,0.254z"
|
||||||
|
android:strokeWidth="0.687"
|
||||||
|
android:fillColor="#eed7f4"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<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,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2ZM12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20ZM12,10.59L15.59,7L17,8.41L13.41,12L17,15.59L15.59,17L12,13.41L8.41,17L7,15.59L10.59,12L7,8.41L8.41,7L12,10.59Z"
|
|
||||||
android:fillColor="#49454F"/>
|
|
||||||
</vector>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<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="M12.3,11.058L17.075,15.833L15.833,17.075L11.058,12.3C10.167,12.942 9.092,13.333 7.917,13.333C4.925,13.333 2.5,10.908 2.5,7.917C2.5,4.925 4.925,2.5 7.917,2.5C10.908,2.5 13.333,4.925 13.333,7.917C13.333,9.092 12.942,10.167 12.3,11.058ZM7.917,4.167C5.842,4.167 4.167,5.842 4.167,7.917C4.167,9.992 5.842,11.667 7.917,11.667C9.992,11.667 11.667,9.992 11.667,7.917C11.667,5.842 9.992,4.167 7.917,4.167Z"
|
|
||||||
android:fillColor="#49454F"/>
|
|
||||||
</vector>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<vector android:height="24dp" android:viewportHeight="320"
|
|
||||||
android:viewportWidth="320" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<group android:rotation="90" android:translateX="304" android:translateY="16" android:scaleX=".9" android:scaleY=".9">
|
|
||||||
<clip-path android:pathData="M0,0 0,320 320,320 320,0">
|
|
||||||
<path android:fillColor="#fff" android:pathData="M331.17,455.15c-0.9,-16.19 -2.47,-32.4 -4,-48.56 -0.18,-1.83 -0.35,-3.66 -0.53,-5.49 0,-0.4 -0.07,-0.79 -0.11,-1.19 -0.23,-2.39 -0.45,-4.79 -0.67,-7.18q-1.17,-12.75 -2.2,-25.6c-1,-12.83 -2,-25.72 -3,-38.63q-0.5,-6.45 -1,-12.91c-1.36,-17.23 -2.81,-34.48 -4.56,-51.69 -2.47,-24.15 -5.54,-48.22 -9.8,-72a13.13,13.13 0,0 0,-2 1c-18.27,11.86 -31.15,63.65 -38.89,82.19a2.7,2.7 0,0 1,-5.18 -0.79c-0.53,-5.37 -0.76,-10.78 -0.77,-16.2v-1.05a303.5,303.5 0,0 1,7.59 -65.79c4.46,-19.78 9.28,-44 23.15,-59.59 0.23,-0.26 1.83,-1.9 1.83,-1.9 -3,-14.17 -14.66,-42.19 -14.67,-42.2a136.07,136.07 0,0 0,-12.61 -25.07C242.82,29.09 204.46,0 166.47,0a70.43,70.43 0,0 0,-16.56 1.94c-39.17,9.42 -70.55,53.52 -88.75,87C40.69,126.5 29.93,168.34 20.1,209.72 5.32,271.87 -2.82,335.37 -8.77,398.91 -13.67,451.32 -30.7,510 22.87,541.51c24.5,14.41 53.18,23.56 81.15,28.16a213.92,213.92 0,0 0,34.86 2.51c10.31,0 20.64,-0.47 30.93,-0.95l108.72,-5c1.57,-0.07 3.2,-0.12 4.83,-0.12 8.69,0 17.78,1.42 22.39,8.4 0.55,-5.81 -4.53,-15.25 -10.6,-25.33l12.44,-2.81c0.31,-10 1.32,-17.53 5.46,-11.76 2,2.84 4.78,6 8.24,5.55 4.06,-0.49 5.79,-5.35 6.52,-9.37C332.36,505.83 332.59,480.52 331.17,455.15ZM168.3,538.52c-9.72,0.45 -19.77,0.91 -29.42,0.91a180.1,180.1 0,0 1,-29.54 -2.07C83.06,533 58.9,524.71 39.48,513.28c-12.37,-7.27 -18.39,-16 -20.79,-30 -2.74,-16 -0.24,-36.07 2.41,-57.29 1,-7.83 2,-15.93 2.74,-24C30.92,326.23 39.59,269.28 52,217.29c9.57,-40.22 19.67,-79.12 38,-112.74 21.38,-39.27 46.67,-65.73 67.64,-70.77a37.8,37.8 0,0 1,8.91 -1c14.5,0 31.71,7.73 47.22,21.2C228.67,67 240.3,83.72 245,99c-11.69,29.46 -22.95,68.57 -27.31,96.85C206,271.74 198.13,413.31 201.13,537Z"/>
|
|
||||||
<path android:fillColor="#fff" android:pathData="M177.15,182.12a30.01,18.34 97.5,1 0,7.83 -59.51a30.01,18.34 97.5,1 0,-7.83 59.51z"/>
|
|
||||||
<path android:fillColor="#fff" android:pathData="M0,320 320,320 288,288 32,288"/>
|
|
||||||
</clip-path>
|
|
||||||
</group>
|
|
||||||
</vector>
|
|
||||||
@@ -1,34 +1,31 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="124.78dp"
|
android:width="109.08dp"
|
||||||
android:height="22.75dp"
|
android:height="18.02dp"
|
||||||
android:viewportWidth="124.78"
|
android:viewportWidth="109.08"
|
||||||
android:viewportHeight="22.75">
|
android:viewportHeight="18.02">
|
||||||
<path
|
<path
|
||||||
android:pathData="m26.16,17.57q-1.82,0 -3.29,-0.84 -1.46,-0.84 -2.3,-2.3 -0.82,-1.49 -0.82,-3.34 0,-1.75 0.82,-3.24 0.82,-1.51 2.26,-2.4 1.44,-0.89 3.22,-0.89 1.9,0 3.26,0.82 1.37,0.82 2.06,2.23 0.72,1.42 0.72,3.14 0,0.55 -0.07,1.06h-9.19q0.24,1.46 1.15,2.23 0.94,0.74 2.23,0.74 1.08,0 1.85,-0.46 0.79,-0.48 1.25,-1.27l2.54,1.25q-1.87,3.26 -5.69,3.26zM29.07,9.58q-0.05,-0.58 -0.43,-1.13 -0.36,-0.58 -1.03,-0.94 -0.65,-0.38 -1.54,-0.38 -1.13,0 -1.94,0.67 -0.79,0.65 -1.15,1.78z"
|
android:pathData="m26.28,18.02q-1.9,0 -3.38,-0.84 -1.49,-0.86 -2.33,-2.33 -0.82,-1.49 -0.82,-3.34 0,-1.82 0.82,-3.31 0.84,-1.49 2.33,-2.33 1.49,-0.86 3.38,-0.86 1.87,0 3.36,0.86 1.49,0.84 2.3,2.33 0.84,1.49 0.84,3.31 0,1.85 -0.84,3.34 -0.82,1.46 -2.3,2.33 -1.49,0.84 -3.36,0.84zM26.28,15.12q0.91,0 1.68,-0.43 0.77,-0.43 1.22,-1.25 0.46,-0.82 0.46,-1.92 0,-1.08 -0.46,-1.9 -0.46,-0.82 -1.22,-1.25 -0.77,-0.43 -1.68,-0.43 -0.91,0 -1.68,0.43 -0.77,0.43 -1.25,1.25 -0.46,0.82 -0.46,1.9 0,1.08 0.46,1.92 0.48,0.82 1.25,1.25 0.77,0.43 1.68,0.43z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m40.27,22.75q-2.33,0 -3.86,-1.06 -1.54,-1.03 -2.06,-2.5l2.95,-1.2q0.38,0.91 1.18,1.44 0.79,0.53 1.8,0.53 1.49,0 2.35,-0.91 0.89,-0.91 0.89,-2.59v-0.96h-0.19q-0.58,0.82 -1.51,1.25 -0.94,0.43 -2.14,0.43 -1.51,0 -2.83,-0.77 -1.3,-0.79 -2.09,-2.21 -0.79,-1.44 -0.79,-3.34 0,-1.9 0.79,-3.31 0.79,-1.44 2.09,-2.21 1.32,-0.79 2.83,-0.79 1.2,0 2.14,0.43 0.94,0.43 1.51,1.25h0.19v-1.3h3.02L46.54,16.34q0,1.97 -0.77,3.41 -0.77,1.44 -2.18,2.21 -1.42,0.79 -3.31,0.79zM40.32,14.33q1.32,0 2.26,-0.91 0.94,-0.94 0.94,-2.54 0,-1.66 -0.94,-2.54 -0.91,-0.91 -2.26,-0.91 -1.34,0 -2.28,0.91 -0.94,0.91 -0.94,2.54 0,1.63 0.94,2.54 0.94,0.91 2.28,0.91z"
|
android:pathData="m39.72,18.02q-2.23,0 -3.62,-0.91 -1.37,-0.91 -1.92,-2.38l2.81,-1.22q0.38,0.86 1.08,1.32 0.72,0.43 1.66,0.43 0.86,0 1.44,-0.26 0.58,-0.29 0.58,-0.91 0,-0.6 -0.53,-0.89 -0.53,-0.31 -1.58,-0.55l-1.44,-0.31q-1.49,-0.36 -2.47,-1.3 -0.98,-0.96 -0.98,-2.38 0,-1.06 0.62,-1.9 0.65,-0.84 1.73,-1.3 1.1,-0.46 2.42,-0.46 3.79,0 5.06,2.66l-2.69,1.18q-0.72,-1.3 -2.3,-1.3 -0.82,0 -1.3,0.31 -0.48,0.29 -0.48,0.74 0,0.86 1.63,1.3l1.8,0.43q1.82,0.46 2.74,1.39 0.94,0.94 0.94,2.3 0,1.18 -0.7,2.09 -0.67,0.89 -1.87,1.39 -1.18,0.5 -2.62,0.5z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m53.23,17.57q-1.94,0 -3.19,-1.13 -1.25,-1.15 -1.25,-3 0,-1.22 0.65,-2.16 0.65,-0.94 1.78,-1.44 1.13,-0.5 2.5,-0.5 1.9,0 3.24,0.55L56.95,9.36q0,-1.01 -0.77,-1.63 -0.74,-0.62 -2.02,-0.62 -0.86,0 -1.68,0.41 -0.79,0.38 -1.32,1.03l-2.02,-1.58q0.89,-1.15 2.23,-1.78 1.34,-0.62 2.93,-0.62 2.81,0 4.27,1.3 1.46,1.3 1.46,3.79v7.54h-3.1v-1.25h-0.19q-0.55,0.72 -1.46,1.18 -0.89,0.46 -2.06,0.46zM53.98,15.12q1.37,0 2.16,-0.86 0.82,-0.89 0.82,-2.06 -1.22,-0.58 -2.57,-0.58 -2.45,0 -2.45,1.82 0,0.74 0.53,1.22 0.53,0.46 1.51,0.46z"
|
android:pathData="m47.19,0.46h3.14L50.33,4.8l-0.19,2.14h0.19q0.53,-0.86 1.54,-1.39 1.01,-0.53 2.18,-0.53 2.23,0 3.41,1.34 1.2,1.32 1.2,3.67v7.61h-3.14v-7.22q0,-1.18 -0.65,-1.82 -0.62,-0.65 -1.68,-0.65 -1.25,0 -2.06,1.01 -0.79,1.01 -0.79,2.47v6.22h-3.14z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m62.95,0h3.14L66.1,17.18h-3.14z"
|
android:pathData="m63.41,4.06q-0.84,0 -1.44,-0.6 -0.6,-0.6 -0.6,-1.44 0,-0.84 0.6,-1.42 0.6,-0.6 1.44,-0.6 0.84,0 1.42,0.6 0.6,0.58 0.6,1.42 0,0.84 -0.6,1.44 -0.58,0.6 -1.42,0.6zM61.83,5.4h3.14L64.97,17.64h-3.14z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m74.93,17.57q-1.9,0 -3.38,-0.84 -1.49,-0.86 -2.33,-2.33 -0.82,-1.49 -0.82,-3.34 0,-1.82 0.82,-3.31 0.84,-1.49 2.33,-2.33 1.49,-0.86 3.38,-0.86 1.87,0 3.36,0.86 1.49,0.84 2.3,2.33 0.84,1.49 0.84,3.31 0,1.85 -0.84,3.34 -0.82,1.46 -2.3,2.33 -1.49,0.84 -3.36,0.84zM74.93,14.66q0.91,0 1.68,-0.43 0.77,-0.43 1.22,-1.25 0.46,-0.82 0.46,-1.92 0,-1.08 -0.46,-1.9 -0.46,-0.82 -1.22,-1.25 -0.77,-0.43 -1.68,-0.43 -0.91,0 -1.68,0.43 -0.77,0.43 -1.25,1.25 -0.46,0.82 -0.46,1.9 0,1.08 0.46,1.92 0.48,0.82 1.25,1.25 0.77,0.43 1.68,0.43z"
|
android:pathData="m73.39,18.02q-1.66,0 -3.02,-0.82 -1.34,-0.84 -2.14,-2.3 -0.77,-1.49 -0.77,-3.38 0,-1.87 0.77,-3.36 0.79,-1.49 2.14,-2.3 1.37,-0.84 3.02,-0.84 1.25,0 2.21,0.55 0.96,0.53 1.46,1.32h0.19l-0.19,-1.73L77.07,0.46h3.12L80.19,17.64h-2.93v-1.46h-0.19q-0.48,0.79 -1.46,1.32 -0.96,0.53 -2.21,0.53zM73.92,15.12q0.89,0 1.66,-0.46 0.77,-0.46 1.22,-1.27 0.46,-0.82 0.46,-1.87 0,-1.06 -0.46,-1.87 -0.46,-0.82 -1.22,-1.25 -0.77,-0.46 -1.66,-0.46 -0.86,0 -1.63,0.46 -0.77,0.43 -1.22,1.25 -0.46,0.82 -0.46,1.87 0,1.06 0.46,1.87 0.46,0.82 1.22,1.27 0.77,0.46 1.63,0.46z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m89.09,17.57q-1.66,0 -3.02,-0.82 -1.34,-0.84 -2.14,-2.3 -0.77,-1.49 -0.77,-3.38 0,-1.87 0.77,-3.36 0.79,-1.49 2.14,-2.3 1.37,-0.84 3.02,-0.84 1.25,0 2.21,0.55 0.96,0.53 1.46,1.32h0.19l-0.19,-1.73L92.76,0h3.12L95.88,17.18h-2.93v-1.46h-0.19q-0.48,0.79 -1.46,1.32 -0.96,0.53 -2.21,0.53zM89.62,14.66q0.89,0 1.66,-0.46 0.77,-0.46 1.22,-1.27 0.46,-0.82 0.46,-1.87 0,-1.06 -0.46,-1.87 -0.46,-0.82 -1.22,-1.25 -0.77,-0.46 -1.66,-0.46 -0.86,0 -1.63,0.46 -0.77,0.43 -1.22,1.25 -0.46,0.82 -0.46,1.87 0,1.06 0.46,1.87 0.46,0.82 1.22,1.27 0.77,0.46 1.63,0.46z"
|
android:pathData="m89.02,18.02q-1.9,0 -3.38,-0.84 -1.49,-0.86 -2.33,-2.33 -0.82,-1.49 -0.82,-3.34 0,-1.82 0.82,-3.31 0.84,-1.49 2.33,-2.33 1.49,-0.86 3.38,-0.86 1.87,0 3.36,0.86 1.49,0.84 2.3,2.33 0.84,1.49 0.84,3.31 0,1.85 -0.84,3.34 -0.82,1.46 -2.3,2.33 -1.49,0.84 -3.36,0.84zM89.02,15.12q0.91,0 1.68,-0.43 0.77,-0.43 1.22,-1.25 0.46,-0.82 0.46,-1.92 0,-1.08 -0.46,-1.9 -0.46,-0.82 -1.22,-1.25 -0.77,-0.43 -1.68,-0.43 -0.91,0 -1.68,0.43 -0.77,0.43 -1.25,1.25 -0.46,0.82 -0.46,1.9 0,1.08 0.46,1.92 0.48,0.82 1.25,1.25 0.77,0.43 1.68,0.43z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m104.72,17.57q-1.9,0 -3.38,-0.84 -1.49,-0.86 -2.33,-2.33 -0.82,-1.49 -0.82,-3.34 0,-1.82 0.82,-3.31 0.84,-1.49 2.33,-2.33 1.49,-0.86 3.38,-0.86 1.87,0 3.36,0.86 1.49,0.84 2.3,2.33 0.84,1.49 0.84,3.31 0,1.85 -0.84,3.34 -0.82,1.46 -2.3,2.33 -1.49,0.84 -3.36,0.84zM104.72,14.66q0.91,0 1.68,-0.43 0.77,-0.43 1.22,-1.25 0.46,-0.82 0.46,-1.92 0,-1.08 -0.46,-1.9 -0.46,-0.82 -1.22,-1.25 -0.77,-0.43 -1.68,-0.43 -0.91,0 -1.68,0.43 -0.77,0.43 -1.25,1.25 -0.46,0.82 -0.46,1.9 0,1.08 0.46,1.92 0.48,0.82 1.25,1.25 0.77,0.43 1.68,0.43z"
|
android:pathData="m97.68,5.4h2.95v1.54h0.19q0.55,-0.89 1.56,-1.39 1.01,-0.53 2.18,-0.53 2.21,0 3.36,1.34 1.15,1.34 1.15,3.67v7.61h-3.14v-7.22q0,-1.18 -0.6,-1.82 -0.6,-0.65 -1.68,-0.65 -1.27,0 -2.06,0.98 -0.77,0.98 -0.77,2.47v6.24h-3.14z"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="m113.38,4.94h2.95v1.54h0.19q0.55,-0.89 1.56,-1.39 1.01,-0.53 2.18,-0.53 2.21,0 3.36,1.34 1.15,1.34 1.15,3.67v7.61h-3.14v-7.22q0,-1.18 -0.6,-1.82 -0.6,-0.65 -1.68,-0.65 -1.27,0 -2.06,0.98 -0.77,0.98 -0.77,2.47v6.24h-3.14z"
|
android:pathData="m4.53,5c-1.37,0 -2.47,0.48 -3.31,1.42C0.41,7.35 0,8.62 0,10.21v7.8h3.09v-7.57c0,-1.6 0.67,-2.41 2.01,-2.41 1.48,0 2.23,0.96 2.23,2.86v4.14h3.07v-4.14c0,-1.9 0.74,-2.86 2.23,-2.86 1.34,0 2.01,0.81 2.01,2.41v7.57h3.09v-7.8c0,-1.59 -0.41,-2.86 -1.22,-3.8 -0.84,-0.94 -1.94,-1.42 -3.31,-1.42 -1.58,0 -2.78,0.61 -3.57,1.82l-0.77,1.29 -0.77,-1.29C7.3,5.6 6.11,5 4.53,5Z"
|
||||||
android:fillColor="#282c37"/>
|
|
||||||
<path
|
|
||||||
android:pathData="m4.53,4.54c-1.37,0 -2.47,0.48 -3.31,1.42C0.41,6.9 0,8.16 0,9.76v7.8h3.09v-7.57c0,-1.6 0.67,-2.41 2.01,-2.41 1.48,0 2.23,0.96 2.23,2.86v4.14h3.07v-4.14c0,-1.9 0.74,-2.86 2.23,-2.86 1.34,0 2.01,0.81 2.01,2.41v7.57h3.09v-7.8c0,-1.59 -0.41,-2.86 -1.22,-3.8 -0.84,-0.94 -1.94,-1.42 -3.31,-1.42 -1.58,0 -2.78,0.61 -3.57,1.82l-0.77,1.29 -0.77,-1.29C7.3,5.15 6.11,4.54 4.53,4.54Z"
|
|
||||||
android:strokeWidth="0.990258"
|
android:strokeWidth="0.990258"
|
||||||
android:fillColor="#282c37"/>
|
android:fillColor="#282c37"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<solid android:color="#000"/>
|
|
||||||
<corners android:radius="4dp"/>
|
|
||||||
</shape>
|
|
||||||
@@ -12,8 +12,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/button"
|
android:id="@+id/button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:paddingVertical="12dp"
|
|
||||||
android:outlineProvider="background"
|
android:outlineProvider="background"
|
||||||
android:elevation="2dp"
|
android:elevation="2dp"
|
||||||
android:background="@drawable/bg_poll_option_clickable"
|
android:background="@drawable/bg_poll_option_clickable"
|
||||||
@@ -49,7 +48,9 @@
|
|||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:textAppearance="@style/m3_title_medium"
|
android:textAppearance="@style/m3_title_medium"
|
||||||
tools:text="scream into void. like this: aaaaaaaaaaaaaaaaaaaa"/>
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
tools:text="scream into void"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/sk_mark_media_as_sensitive" />
|
android:text="@string/mark_media_as_sensitive" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<me.grishka.appkit.views.FragmentRootLinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/appkit_loader_root"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:background="?colorM3Background">
|
|
||||||
|
|
||||||
<include layout="@layout/appkit_toolbar"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/appkit_loader_content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0px"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<include layout="@layout/loading"
|
|
||||||
android:id="@+id/loading"/>
|
|
||||||
|
|
||||||
<ViewStub android:layout="?errorViewLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/error"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/content_stub"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/button_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_next"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:minWidth="145dp"
|
|
||||||
style="@style/Widget.Mastodon.M3.Button.Filled"
|
|
||||||
android:text="@string/next" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</me.grishka.appkit.views.FragmentRootLinearLayout>
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/m3_body_large"
|
|
||||||
android:paddingStart="56dp"
|
|
||||||
android:paddingEnd="24dp"
|
|
||||||
android:text="@string/login_subtitle"/>
|
|
||||||
|
|
||||||
<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
app:editTextOffsetY="8dp"
|
|
||||||
android:background="@drawable/rect_4dp"
|
|
||||||
android:backgroundTint="?colorM3SurfaceVariant">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/search_edit"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@null"
|
|
||||||
android:stateListAnimator="@null"
|
|
||||||
android:textColor="?colorM3OnSurfaceVariant"
|
|
||||||
android:textColorHint="?colorM3OnSurfaceVariant"
|
|
||||||
android:inputType="textUri"
|
|
||||||
android:importantForAutofill="no"
|
|
||||||
android:paddingStart="48dp"
|
|
||||||
android:layout_marginEnd="52dp"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:textAppearance="@style/m3_body_large"
|
|
||||||
android:hint="@string/server_url"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="44dp"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:importantForAccessibility="no"
|
|
||||||
android:tint="?colorM3OnSurfaceVariant"
|
|
||||||
android:src="@drawable/ic_m3_search"/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/search_clear"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginEnd="6dp"
|
|
||||||
android:background="?android:selectableItemBackgroundBorderless"
|
|
||||||
android:layout_gravity="center_vertical|end"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible"
|
|
||||||
android:contentDescription="@string/clear"
|
|
||||||
android:stateListAnimator="@null"
|
|
||||||
android:elevation="0dp"
|
|
||||||
android:src="@drawable/ic_m3_cancel"/>
|
|
||||||
|
|
||||||
</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
style="?secondaryButtonStyle"
|
style="?secondaryButtonStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/sk_reject_follow_request"
|
android:contentDescription="@string/reject_follow_request"
|
||||||
android:drawableStart="@drawable/ic_fluent_dismiss_24_filled"
|
android:drawableStart="@drawable/ic_fluent_dismiss_24_filled"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
android:id="@+id/accept_btn"
|
android:id="@+id/accept_btn"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/sk_accept_follow_request"
|
android:contentDescription="@string/accept_follow_request"
|
||||||
android:drawableStart="@drawable/ic_fluent_checkmark_24_filled"
|
android:drawableStart="@drawable/ic_fluent_checkmark_24_filled"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:paddingEnd="24dp"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:background="?colorM3SurfaceVariant">
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/radiobtn"
|
|
||||||
android:layout_width="28dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginEnd="23dp"
|
|
||||||
android:layout_marginStart="-3dp"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:buttonTint="@color/m3_radiobutton_tint"
|
|
||||||
android:background="@null"
|
|
||||||
android:focusable="false"
|
|
||||||
android:clickable="false"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toEndOf="@id/radiobtn"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:textAppearance="@style/m3_body_large"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:minHeight="24dp"
|
|
||||||
android:textColor="?colorM3OnSurface"
|
|
||||||
tools:text="mastodon.social"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/description"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toEndOf="@id/radiobtn"
|
|
||||||
android:layout_below="@id/title"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:textAppearance="@style/m3_body_medium"
|
|
||||||
android:textColor="?colorM3OnSurfaceVariant"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:lineSpacingExtra="4sp"
|
|
||||||
tools:text="General-purpose server run by the lead developer of Mastodon"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:text="@string/sk_settings_color_picker"/>
|
android:text="@string/settings_color_picker"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/color_picker_button"
|
android:id="@+id/color_picker_button"
|
||||||
@@ -41,6 +41,6 @@
|
|||||||
android:stateListAnimator="@null"
|
android:stateListAnimator="@null"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
tools:text="@string/sk_color_theme_pink" />
|
tools:text="@string/pink_color" />
|
||||||
|
|
||||||
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
|
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:textAppearance="@style/m3_body_medium"
|
android:textAppearance="@style/m3_body_medium"
|
||||||
tools:text="@string/sk_update_available"/>
|
tools:text="@string/update_available"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:id="@+id/pink_color" android:title="@string/sk_color_theme_pink"/>
|
<item android:id="@+id/purple_color" android:title="@string/purple_color"/>
|
||||||
<item android:id="@+id/purple_color" android:title="@string/sk_color_theme_purple"/>
|
<item android:id="@+id/pink_color" android:title="@string/pink_color"/>
|
||||||
<item android:id="@+id/green_color" android:title="@string/sk_color_theme_green"/>
|
<item android:id="@+id/green_color" android:title="@string/green_color"/>
|
||||||
<item android:id="@+id/blue_color" android:title="@string/sk_color_theme_blue"/>
|
<item android:id="@+id/blue_color" android:title="@string/blue_color"/>
|
||||||
<item android:id="@+id/brown_color" android:title="@string/sk_color_theme_brown"/>
|
<item android:id="@+id/orange_color" android:title="@string/orange_color"/>
|
||||||
<item android:id="@+id/yellow_color" android:title="@string/sk_color_theme_yellow"/>
|
<item android:id="@+id/yellow_color" android:title="@string/yellow_color"/>
|
||||||
</menu>
|
</menu>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
android:title="@string/visibility_public"/>
|
android:title="@string/visibility_public"/>
|
||||||
<item android:id="@+id/vis_unlisted"
|
<item android:id="@+id/vis_unlisted"
|
||||||
android:icon="@drawable/ic_fluent_people_community_24_regular"
|
android:icon="@drawable/ic_fluent_people_community_24_regular"
|
||||||
android:title="@string/sk_visibility_unlisted"/>
|
android:title="@string/visibility_unlisted"/>
|
||||||
<item android:id="@+id/vis_followers"
|
<item android:id="@+id/vis_followers"
|
||||||
android:icon="@drawable/ic_fluent_people_checkmark_24_regular"
|
android:icon="@drawable/ic_fluent_people_checkmark_24_regular"
|
||||||
android:title="@string/visibility_followers_only"/>
|
android:title="@string/visibility_followers_only"/>
|
||||||
|
|||||||
@@ -4,6 +4,5 @@
|
|||||||
android:id="@+id/follow_requests"
|
android:id="@+id/follow_requests"
|
||||||
android:icon="@drawable/ic_follow_requests_24_badged"
|
android:icon="@drawable/ic_follow_requests_24_badged"
|
||||||
android:showAsAction="always"
|
android:showAsAction="always"
|
||||||
android:visible="false"
|
android:title="@string/follow_requests" />
|
||||||
android:title="@string/sk_follow_requests" />
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:id="@+id/edit" android:title="@string/edit"/>
|
<item android:id="@+id/edit" android:title="@string/edit"/>
|
||||||
<item android:id="@+id/delete" android:title="@string/delete"/>
|
<item android:id="@+id/delete" android:title="@string/delete"/>
|
||||||
<item android:id="@+id/delete_and_redraft" android:title="@string/sk_delete_and_redraft"/>
|
<item android:id="@+id/delete_and_redraft" android:title="@string/delete_and_redraft"/>
|
||||||
<item android:id="@+id/pin" android:title="@string/sk_pin_post"/>
|
<item android:id="@+id/pin" android:title="@string/pin_post"/>
|
||||||
<item android:id="@+id/unpin" android:title="@string/sk_unpin_post"/>
|
<item android:id="@+id/unpin" android:title="@string/unpin_post"/>
|
||||||
<item android:id="@+id/mute" android:title="@string/mute_user"/>
|
<item android:id="@+id/mute" android:title="@string/mute_user"/>
|
||||||
<item android:id="@+id/block" android:title="@string/block_user"/>
|
<item android:id="@+id/block" android:title="@string/block_user"/>
|
||||||
<item android:id="@+id/block_domain" android:title="@string/block_domain"/>
|
<item android:id="@+id/block_domain" android:title="@string/block_domain"/>
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
<item android:id="@+id/report" android:title="@string/report_user"/>
|
<item android:id="@+id/report" android:title="@string/report_user"/>
|
||||||
<item android:id="@+id/block_domain" android:title="@string/block_domain"/>
|
<item android:id="@+id/block_domain" android:title="@string/block_domain"/>
|
||||||
<item android:id="@+id/hide_boosts" android:title="@string/hide_boosts_from_user"/>
|
<item android:id="@+id/hide_boosts" android:title="@string/hide_boosts_from_user"/>
|
||||||
<item android:id="@+id/manage_user_lists" android:title="@string/sk_lists_with_user"/>
|
<item android:id="@+id/manage_user_lists" android:title="@string/lists_with_user"/>
|
||||||
<item android:id="@+id/open_in_browser" android:title="@string/open_in_browser"/>
|
<item android:id="@+id/open_in_browser" android:title="@string/open_in_browser"/>
|
||||||
</menu>
|
</menu>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
<background android:drawable="@color/shortcut_icon_background"/>
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
|
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
<background android:drawable="@color/shortcut_icon_background"/>
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
|
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 11 KiB |
@@ -3,7 +3,9 @@
|
|||||||
<string name="get_started">الخطوات الأولى</string>
|
<string name="get_started">الخطوات الأولى</string>
|
||||||
<string name="log_in">تسجيلُ الدخول</string>
|
<string name="log_in">تسجيلُ الدخول</string>
|
||||||
<string name="next">التالي</string>
|
<string name="next">التالي</string>
|
||||||
|
<string name="loading_instance">يَجري الحُصُول على معلومات المَثيل…</string>
|
||||||
<string name="error">خطأ</string>
|
<string name="error">خطأ</string>
|
||||||
|
<string name="not_a_mastodon_instance">%s لا يبدو كمثيل ماستدون.</string>
|
||||||
<string name="ok">حسنًا</string>
|
<string name="ok">حسنًا</string>
|
||||||
<string name="preparing_auth">جَارٍ الإعدَادُ لِلمُصادَقَة…</string>
|
<string name="preparing_auth">جَارٍ الإعدَادُ لِلمُصادَقَة…</string>
|
||||||
<string name="finishing_auth">يُنهي المصادقة…</string>
|
<string name="finishing_auth">يُنهي المصادقة…</string>
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
</resources>
|
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="get_started">Пачаць</string>
|
|
||||||
<string name="log_in">Увайсці</string>
|
|
||||||
<string name="next">Далей</string>
|
|
||||||
<string name="error">Памылка</string>
|
|
||||||
<string name="ok">Добра</string>
|
|
||||||
<string name="notifications">Апавяшчэнні</string>
|
|
||||||
<string name="share_toot_title">Абагуліць</string>
|
|
||||||
<string name="settings">Налады</string>
|
|
||||||
<string name="cancel">Скасаваць</string>
|
|
||||||
<!-- translators: %,d is a valid placeholder, it formats the number with locale-dependent grouping separators -->
|
<!-- translators: %,d is a valid placeholder, it formats the number with locale-dependent grouping separators -->
|
||||||
<!-- %s is version like 1.2.3 -->
|
<!-- %s is version like 1.2.3 -->
|
||||||
<!-- %s is version like 1.2.3 -->
|
<!-- %s is version like 1.2.3 -->
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
</resources>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
</resources>
|
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
<string name="get_started">Kreni</string>
|
<string name="get_started">Kreni</string>
|
||||||
<string name="log_in">Loguj se</string>
|
<string name="log_in">Loguj se</string>
|
||||||
<string name="next">Dalje</string>
|
<string name="next">Dalje</string>
|
||||||
|
<string name="loading_instance">Čekamo potrebne informacije…</string>
|
||||||
<string name="error">Greška</string>
|
<string name="error">Greška</string>
|
||||||
|
<string name="not_a_mastodon_instance">%s ne izgleda kao Mastodon platforma.</string>
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="preparing_auth">Pripremamo autorizaciju…</string>
|
<string name="preparing_auth">Pripremamo autorizaciju…</string>
|
||||||
<string name="finishing_auth">Završavamo autorizaciju…</string>
|
<string name="finishing_auth">Završavamo autorizaciju…</string>
|
||||||
|
|||||||