Tiim / Android-Markdown-Widget

Small widget app to display a markdown file on the home screen
GNU General Public License v3.0
83 stars 10 forks source link

Can't select .md files to add the widget #14

Closed guihasparyk closed 10 months ago

guihasparyk commented 1 year ago

I've installed the app trough F-Droid and none of whatever '.md' files are clickable when selecting the files to create the widget.

Is it just me an and my phone or everyone else is experimenting the same issue?

teodor-a commented 1 year ago

Following because I experience this too. The files are all grayed out in the file browser.

Tiim commented 1 year ago

Please share what phone you are using and what version of Android. This may relate to storage permissions not being properly requested for some Android versions.

teodor-a commented 1 year ago

Please share what phone you are using and what version of Android. This may relate to storage permissions not being properly requested for some Android versions.

Samsung galaxy S8 Android 9 App downloaded from F-droid

guihasparyk commented 12 months ago

Huawei P20 Lite ANE-LX1 (Android 9.1.0.368) Download from F-Droid.

evergreenbear commented 11 months ago

Seeing this as well on a OnePlus 8T running Android 13 (LMODroid), both downloaded from F-Droid and the release from github.

daschfg commented 11 months ago

Same issue on Android 8 here.

I poked around a bit... My guess is that older Android SDKs are missing the MIME-type "text/markdown". What worked for me was changing type on this line: https://github.com/Tiim/Android-Markdown-Widget/blob/bf9849d79ca48171ce700b758f26da3b92416b71/app/src/main/java/ch/tiim/markdown_widget/MarkdownFileWidgetConfigureActivity.kt#L40 from "text/markdown" to "*/*".

Unfortunately, other stricter variants like "text/*" don't work for *.md-files for me as well.

Downside: Now a user can select any file type, which leads to funny results when displaying these files.

guihasparyk commented 11 months ago

That's good to hear you find a workaround @daschfg .

Can you tell how do you did that? How you managed to view and edit code inside the app already installed?

daschfg commented 11 months ago

Sorry, no, I didn't modify the installed app. I cloned the code from here, recompiled it in Android Studio with my modification and installed the resulting new APK.

@Tiim: Would you be willing to accept a pull request on this? I would further research how this could maybe get detected in advance, so that the workaround would hopefully not affect newer Android versions.

Tiim commented 11 months ago

Hi @daschfg thanks for looking into this. I will definitely have a look at your pull request!