feat: open profile links
This commit is contained in:
parent
3d187a01ec
commit
94ffc2595c
5 changed files with 90 additions and 52 deletions
|
@ -18,8 +18,8 @@ android {
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode((System.currentTimeMillis() / 60000).toInteger())
|
versionCode((System.currentTimeMillis() / 60000).toInteger())
|
||||||
versionName "3.0.0"
|
versionName "3.1.0"
|
||||||
versionCode 300000000
|
versionCode 300100000
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ android {
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
applicationIdSuffix ".beta"
|
applicationIdSuffix ".beta"
|
||||||
versionNameSuffix "-beta04"
|
versionNameSuffix "-beta01"
|
||||||
manifestPlaceholders.icon_placeholder = "@mipmap/ic_launcher_beta"
|
manifestPlaceholders.icon_placeholder = "@mipmap/ic_launcher_beta"
|
||||||
manifestPlaceholders.icon_placeholder_round = "@mipmap/ic_launcher_beta_round"
|
manifestPlaceholders.icon_placeholder_round = "@mipmap/ic_launcher_beta_round"
|
||||||
debuggable false
|
debuggable false
|
||||||
|
|
|
@ -1409,6 +1409,49 @@ fun ImageView.openImage(title: String, image: String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to open the link in the app, otherwise copies it to the clipboard
|
||||||
|
* @param link the link to open
|
||||||
|
*/
|
||||||
|
fun openOrCopyAnilistLink(link: String) {
|
||||||
|
if (link.startsWith("https://anilist.co/anime/") || link.startsWith("https://anilist.co/manga/")) {
|
||||||
|
val mangaAnime = link.substringAfter("https://anilist.co/").substringBefore("/")
|
||||||
|
val id =
|
||||||
|
link.substringAfter("https://anilist.co/$mangaAnime/").substringBefore("/")
|
||||||
|
.toIntOrNull()
|
||||||
|
if (id != null && currContext() != null) {
|
||||||
|
ContextCompat.startActivity(
|
||||||
|
currContext()!!,
|
||||||
|
Intent(currContext()!!, MediaDetailsActivity::class.java)
|
||||||
|
.putExtra("mediaId", id),
|
||||||
|
null
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
copyToClipboard(link, true)
|
||||||
|
}
|
||||||
|
} else if (link.startsWith("https://anilist.co/user/")) {
|
||||||
|
val username = link.substringAfter("https://anilist.co/user/").substringBefore("/")
|
||||||
|
val id = username.toIntOrNull()
|
||||||
|
if (currContext() != null) {
|
||||||
|
val intent = Intent(currContext()!!, ProfileActivity::class.java)
|
||||||
|
if (id != null) {
|
||||||
|
intent.putExtra("userId", id)
|
||||||
|
} else {
|
||||||
|
intent.putExtra("username", username)
|
||||||
|
}
|
||||||
|
ContextCompat.startActivity(
|
||||||
|
currContext()!!,
|
||||||
|
intent,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
copyToClipboard(link, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copyToClipboard(link, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the markwon instance with all the plugins
|
* Builds the markwon instance with all the plugins
|
||||||
* @return the markwon instance
|
* @return the markwon instance
|
||||||
|
@ -1424,36 +1467,7 @@ fun buildMarkwon(
|
||||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
.usePlugin(object : AbstractMarkwonPlugin() {
|
||||||
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
||||||
builder.linkResolver { _, link ->
|
builder.linkResolver { _, link ->
|
||||||
if (link.startsWith("https://anilist.co/anime/") || link.startsWith("https://anilist.co/manga/")) {
|
openOrCopyAnilistLink(link)
|
||||||
val mangaAnime = link.substringAfter("https://anilist.co/").substringBefore("/")
|
|
||||||
val id =
|
|
||||||
link.substringAfter("https://anilist.co/$mangaAnime/").substringBefore("/")
|
|
||||||
.toIntOrNull()
|
|
||||||
if (id != null && currContext() != null) {
|
|
||||||
ContextCompat.startActivity(
|
|
||||||
currContext()!!,
|
|
||||||
Intent(currContext()!!, MediaDetailsActivity::class.java)
|
|
||||||
.putExtra("mediaId", id),
|
|
||||||
null
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
copyToClipboard(link, true)
|
|
||||||
}
|
|
||||||
} else if (link.startsWith("https://anilist.co/user/")) {
|
|
||||||
val username = link.substringAfter("https://anilist.co/user/").substringBefore("/")
|
|
||||||
if (currContext() != null) {
|
|
||||||
ContextCompat.startActivity(
|
|
||||||
currContext()!!,
|
|
||||||
Intent(currContext()!!, ProfileActivity::class.java)
|
|
||||||
.putExtra("username", username),
|
|
||||||
null
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
copyToClipboard(link, true)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
copyToClipboard(link, true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -35,6 +35,6 @@ interface DownloadAddonApiV2 {
|
||||||
fun getStackTrace(sessionId: Long): String?
|
fun getStackTrace(sessionId: Long): String?
|
||||||
|
|
||||||
fun hadError(sessionId: Long): Boolean
|
fun hadError(sessionId: Long): Boolean
|
||||||
|
|
||||||
fun getFileExtension(): Pair<String, String> = Pair("mkv", "video/x-matroska")
|
fun getFileExtension(): Pair<String, String> = Pair("mkv", "video/x-matroska")
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import ani.dantotsu.media.Character
|
||||||
import ani.dantotsu.media.CharacterAdapter
|
import ani.dantotsu.media.CharacterAdapter
|
||||||
import ani.dantotsu.media.Media
|
import ani.dantotsu.media.Media
|
||||||
import ani.dantotsu.media.MediaAdaptor
|
import ani.dantotsu.media.MediaAdaptor
|
||||||
|
import ani.dantotsu.openOrCopyAnilistLink
|
||||||
import ani.dantotsu.setBaseline
|
import ani.dantotsu.setBaseline
|
||||||
import ani.dantotsu.setSlideIn
|
import ani.dantotsu.setSlideIn
|
||||||
import ani.dantotsu.setSlideUp
|
import ani.dantotsu.setSlideUp
|
||||||
|
@ -97,6 +98,7 @@ class ProfileFragment : Fragment() {
|
||||||
view: WebView?,
|
view: WebView?,
|
||||||
request: WebResourceRequest?
|
request: WebResourceRequest?
|
||||||
): Boolean {
|
): Boolean {
|
||||||
|
openOrCopyAnilistLink(request?.url.toString())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
58
stable.md
58
stable.md
|
@ -1,29 +1,51 @@
|
||||||
# 2.2.0
|
# 3.1.0
|
||||||
|
|
||||||
- **Important:**
|
|
||||||
- All settings will be reset due to the new settings system. Sorry for the inconvenience!
|
|
||||||
|
|
||||||
- **New Features:**
|
- **New Features:**
|
||||||
- Import/Export settings
|
- Addons
|
||||||
- New source organization system in extension settings
|
- Torrent support addon
|
||||||
- Filter sources by language
|
- Anime downloading addon (mkv files pog)
|
||||||
- Defaulting to the external casting system (internal cast can be enabled in settings)
|
- Available in app settings
|
||||||
- sub/dub toggle for some sources (requires source settings page to be opened at least once)
|
- Anilist reviews in app
|
||||||
- SoftSub downloads (when available)
|
- Media subscriptions added to notification tab
|
||||||
|
- Notification filtering
|
||||||
|
- Ability to post activitys
|
||||||
|
- Ability to reply to activities
|
||||||
|
- Extension tester
|
||||||
|
- Media subscription Viewer
|
||||||
|
- Instagram-style stories
|
||||||
|
- More audio options for some extensions
|
||||||
|
- Ability to hide items on the home screen
|
||||||
|
- Ability to set a downloads directory
|
||||||
|
- 2 functioning widgets
|
||||||
|
- App lock ( ͡° ͜ʖ ͡°)
|
||||||
|
- More manga and anime feeds on the home page
|
||||||
|
- Settings page redesign
|
||||||
|
- New app crash notifier
|
||||||
|
- Voice actors
|
||||||
|
- Additional repo support
|
||||||
- Various UI uplifts
|
- Various UI uplifts
|
||||||
- Many small features (see beta changelogs)
|
|
||||||
- New easter egg :3
|
|
||||||
|
|
||||||
- **Bugfixes:**
|
- **Bugfixes:**
|
||||||
- Many source fixes
|
- Scanlator/language not saving after leaving app
|
||||||
- Better information on Anilist rate limiting
|
- notification red dot not hiding on home pages
|
||||||
- User will get a notification when rate limited
|
- comment/activity scrolling not working on some parts of the screen
|
||||||
- Rate limiting less likely to occur (especially on app startup)
|
- comment notifications falling to the bottom of the list
|
||||||
|
- Fixed some sources without audio
|
||||||
|
- Initial app loading time reduced
|
||||||
|
- activity text more visible
|
||||||
|
- novel extensions not installing
|
||||||
|
- Many sources not working
|
||||||
|
- Subscription notifications not using the correct source
|
||||||
|
- Notification red dot showing with no new notifications
|
||||||
- Various bug/crash fixes
|
- Various bug/crash fixes
|
||||||
- General theme tweaks
|
- General theme tweaks
|
||||||
- Popups will now follow OLED mode
|
- Fixed some network-related crashes
|
||||||
|
- Subscription notifications not working for some people
|
||||||
- Fix for file permissions on older Android versions
|
- Fix for file permissions on older Android versions
|
||||||
- Many small bug fixes (see beta changelogs)
|
- Search list view not working
|
||||||
|
- Media page opening twice on notification click
|
||||||
|
|
||||||
|
- A Special Thanks to all those who contributed :heart:
|
||||||
|
|
||||||
- **Like what you see?**
|
- **Like what you see?**
|
||||||
- Consider supporting me on [Github](https://github.com/sponsors/rebelonion) or [Buy Me a Coffee](https://www.buymeacoffee.com/rebelonion)!
|
- Consider supporting me on [Github](https://github.com/sponsors/rebelonion) or [Buy Me a Coffee](https://www.buymeacoffee.com/rebelonion)!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue