mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 10:54:36 -06:00
Merge pull request #69 from szkolny-eu/hotfix/message-attachments
[Messages] Fix downloading and displaying attachment on API 30+.
This commit is contained in:
commit
e902352a4b
@ -37,9 +37,7 @@ class AttachmentsView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private val storageDir by lazy {
|
||||
val storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu")
|
||||
storageDir.mkdirs()
|
||||
storageDir
|
||||
Utils.getStorageDir()
|
||||
}
|
||||
|
||||
fun init(arguments: Bundle, owner: Any) {
|
||||
@ -82,6 +80,7 @@ class AttachmentsView @JvmOverloads constructor(
|
||||
list.adapter = adapter
|
||||
list.apply {
|
||||
setHasFixedSize(false)
|
||||
isNestedScrollingEnabled = false
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
addItemDecoration(SimpleDividerItemDecoration(context))
|
||||
}
|
||||
|
@ -776,7 +776,8 @@ public class Utils {
|
||||
public static File getStorageDir() {
|
||||
if (storageDir != null)
|
||||
return storageDir;
|
||||
storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu");
|
||||
storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||
storageDir = new File(storageDir, "Szkolny.eu");
|
||||
storageDir.mkdirs();
|
||||
return storageDir;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@ -306,6 +306,6 @@
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user