mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-14 21:42:24 +00:00
Fix Polycentric profile file import in MainActivity
- Update handleUnknownText method to detect Polycentric profile data - Check for 'polycentric://' prefix in shared text files - Launch PolycentricImportProfileActivity when Polycentric profile is detected - Add logging for Polycentric profile detection - Fixes 'unknown url format' error when sharing Polycentric profile files to Grayjay This completes the file sharing workflow: users can now export Polycentric profiles to files and share them to Grayjay, which will automatically detect and import the profile data.
This commit is contained in:
parent
217d738dd1
commit
1ad3b7ae8f
1 changed files with 9 additions and 0 deletions
|
@ -994,6 +994,15 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
||||||
|
|
||||||
fun handleUnknownText(text: String): Boolean {
|
fun handleUnknownText(text: String): Boolean {
|
||||||
try {
|
try {
|
||||||
|
// Check for Polycentric profile data
|
||||||
|
if (text.startsWith("polycentric://")) {
|
||||||
|
Logger.i(TAG, "Detected Polycentric profile in shared text file")
|
||||||
|
startActivity(Intent(this, PolycentricImportProfileActivity::class.java).apply {
|
||||||
|
putExtra("url", text.trim())
|
||||||
|
})
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (text.startsWith("@/Subscription") || text.startsWith("Subscriptions")) {
|
if (text.startsWith("@/Subscription") || text.startsWith("Subscriptions")) {
|
||||||
val lines = text.split("\n").map { it.trim() }.drop(1).filter { it.isNotEmpty() };
|
val lines = text.split("\n").map { it.trim() }.drop(1).filter { it.isNotEmpty() };
|
||||||
navigate(_fragImportSubscriptions, lines);
|
navigate(_fragImportSubscriptions, lines);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue