forked from upstream-mirrors/quik
improve attachment icon fetch from other apps. make compose box attachment text background a little less tranparent so icon 'pops' a bit more. make same icon text always black so it can be seen properly.
This commit is contained in:
@@ -26,4 +26,11 @@
|
|||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
</provider>
|
</provider>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<data android:scheme="*" android:mimeType="*/*" />
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -136,21 +136,25 @@ fun Uri.contactToVCard(context: Context): Uri =
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Uri.getDefaultActivityIconForMimeType(context: Context): Drawable? =
|
fun Uri.getDefaultActivityIconForMimeType(context: Context): Drawable? =
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
context.packageManager
|
context.packageManager
|
||||||
.queryIntentActivities(
|
.queryIntentActivities(
|
||||||
Intent(Intent.ACTION_VIEW).setDataAndType(this, getType(context)),
|
Intent(Intent.ACTION_VIEW).setDataAndType(this, getType(context)),
|
||||||
PackageManager.ResolveInfoFlags.of(
|
PackageManager.ResolveInfoFlags.of(
|
||||||
PackageManager.MATCH_DEFAULT_ONLY.toLong()
|
PackageManager.MATCH_DEFAULT_ONLY.toLong()
|
||||||
)
|
)
|
||||||
).let {
|
).let {
|
||||||
if (it.size > 0) it[0].loadIcon(context.packageManager)
|
if (it.size > 0) it[0].loadIcon(context.packageManager)
|
||||||
else null
|
else null
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
context.packageManager
|
// else, pre-tiramisu versions
|
||||||
.resolveActivity(
|
context.packageManager
|
||||||
Intent(Intent.ACTION_VIEW).setDataAndType(this, getType(context)),
|
.queryIntentActivities(
|
||||||
PackageManager.MATCH_DEFAULT_ONLY)
|
Intent(Intent.ACTION_VIEW).setDataAndType(this, getType(context)),
|
||||||
?.loadIcon(context.packageManager)
|
PackageManager.MATCH_DEFAULT_ONLY
|
||||||
}
|
).let {
|
||||||
|
if (it.size > 0) it[0].loadIcon(context.packageManager)
|
||||||
|
else null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/fileName"
|
android:id="@+id/fileName"
|
||||||
style="@style/TextPrimary"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#ddffffff"
|
android:background="#a7ffffff"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user