forked from github/szkolny
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 {
|
private val storageDir by lazy {
|
||||||
val storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu")
|
Utils.getStorageDir()
|
||||||
storageDir.mkdirs()
|
|
||||||
storageDir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun init(arguments: Bundle, owner: Any) {
|
fun init(arguments: Bundle, owner: Any) {
|
||||||
@ -82,6 +80,7 @@ class AttachmentsView @JvmOverloads constructor(
|
|||||||
list.adapter = adapter
|
list.adapter = adapter
|
||||||
list.apply {
|
list.apply {
|
||||||
setHasFixedSize(false)
|
setHasFixedSize(false)
|
||||||
|
isNestedScrollingEnabled = false
|
||||||
layoutManager = LinearLayoutManager(context)
|
layoutManager = LinearLayoutManager(context)
|
||||||
addItemDecoration(SimpleDividerItemDecoration(context))
|
addItemDecoration(SimpleDividerItemDecoration(context))
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,8 @@ public class Utils {
|
|||||||
public static File getStorageDir() {
|
public static File getStorageDir() {
|
||||||
if (storageDir != null)
|
if (storageDir != null)
|
||||||
return storageDir;
|
return storageDir;
|
||||||
storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu");
|
storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||||
|
storageDir = new File(storageDir, "Szkolny.eu");
|
||||||
storageDir.mkdirs();
|
storageDir.mkdirs();
|
||||||
return storageDir;
|
return storageDir;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:visibility="gone"/>
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
<ScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
@ -306,6 +306,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user