2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 13:17:43 +00:00

Enable vector drawable support and override some layouts for higher API levels.

This commit is contained in:
Isira Seneviratne 2020-07-08 11:03:04 +05:30 committed by Nicolas Fella
parent 80121a7951
commit 45b2ac263f
10 changed files with 61 additions and 33 deletions

View File

@ -22,6 +22,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexEnabled true
vectorDrawables.useSupportLibrary true
}
dexOptions {
javaMaxHeapSize "2g"

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="false"
android:drawableStart="@drawable/ic_warning"
android:drawablePadding="8dp"
android:drawableTint="?attr/colorControlNormal"
android:paddingTop="16dp"
android:paddingBottom="12dp"
android:text="@string/on_non_trusted_message">
</TextView>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawableStart="@drawable/ic_wifi"
android:drawablePadding="8dp"
android:drawableTint="?attr/colorControlNormal"
android:paddingTop="16dp"
android:paddingBottom="12dp"
android:text="@string/no_wifi">
</TextView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.gridlayout.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:grid="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -12,7 +13,7 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_home"
android:src="@drawable/ic_home_black_24dp"
app:srcCompat="@drawable/ic_home_black_24dp"
android:theme="@style/DisableableButton" />
<ImageButton
@ -22,7 +23,7 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_up"
android:src="@drawable/ic_arrow_upward_black_24dp"
app:srcCompat="@drawable/ic_arrow_upward_black_24dp"
android:theme="@style/DisableableButton" />
<ImageButton
@ -32,7 +33,7 @@
grid:layout_row="0"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_mic"
android:src="@drawable/ic_mic_black"
app:srcCompat="@drawable/ic_mic_black"
android:theme="@style/DisableableButton" />
<ImageButton
@ -42,7 +43,7 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_left"
android:src="@drawable/ic_arrow_back_black_24dp"
app:srcCompat="@drawable/ic_arrow_back_black_24dp"
android:theme="@style/DisableableButton" />
<ImageButton
@ -52,7 +53,7 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_select"
android:src="@drawable/ic_keyboard_return_black_24dp"
app:srcCompat="@drawable/ic_keyboard_return_black_24dp"
android:theme="@style/DisableableButton" />
<ImageButton
@ -62,7 +63,7 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_right"
android:src="@drawable/ic_arrow_forward_black_24dp"
app:srcCompat="@drawable/ic_arrow_forward_black_24dp"
android:theme="@style/DisableableButton" />
<ImageButton
@ -72,6 +73,6 @@
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:contentDescription="@string/bigscreen_down"
android:src="@drawable/ic_arrow_downward_black_24dp"
app:srcCompat="@drawable/ic_arrow_downward_black_24dp"
android:theme="@style/DisableableButton" />
</androidx.gridlayout.widget.GridLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/mpris_control_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -32,7 +33,7 @@
android:layout_weight="0.25"
android:layout_marginRight="3dp"
android:layout_marginEnd="3dp"
android:src="@drawable/ic_previous_black"
app:srcCompat="@drawable/ic_previous_black"
android:theme="@style/DisableableButton" />
<ImageButton
@ -43,7 +44,7 @@
android:layout_marginStart="3dp"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_ff"
android:src="@drawable/ic_next_black"
app:srcCompat="@drawable/ic_next_black"
android:theme="@style/DisableableButton" />
</LinearLayout>

View File

@ -27,7 +27,7 @@
android:background="@android:color/transparent"
android:contentDescription="@string/mute"
android:scaleType="fitXY"
android:src="@drawable/ic_volume_black"
app:srcCompat="@drawable/ic_volume_black"
app:tint="?attr/colorHighContrast" />
<SeekBar

View File

@ -46,7 +46,7 @@
android:baselineAlignBottom="true"
android:clickable="false"
android:contentDescription="@string/mpris_play"
android:src="@drawable/ic_play_black"
app:srcCompat="@drawable/ic_play_black"
android:theme="@style/DisableableButton" />
<LinearLayout
@ -61,7 +61,7 @@
android:layout_height="fill_parent"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_previous"
android:src="@drawable/ic_previous_black"
app:srcCompat="@drawable/ic_previous_black"
android:theme="@style/DisableableButton" />
<ImageButton
@ -70,7 +70,7 @@
android:layout_height="fill_parent"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_rew"
android:src="@drawable/ic_rewind_black"
app:srcCompat="@drawable/ic_rewind_black"
android:theme="@style/DisableableButton" />
<ImageButton
@ -79,7 +79,7 @@
android:layout_height="fill_parent"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_stop"
android:src="@drawable/ic_stop"
app:srcCompat="@drawable/ic_stop"
android:theme="@style/DisableableButton" />
@ -89,7 +89,7 @@
android:layout_height="fill_parent"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_ff"
android:src="@drawable/ic_fast_forward_black"
app:srcCompat="@drawable/ic_fast_forward_black"
android:theme="@style/DisableableButton" />
<ImageButton
@ -98,7 +98,7 @@
android:layout_height="fill_parent"
android:layout_weight="0.25"
android:contentDescription="@string/mpris_next"
android:src="@drawable/ic_next_black"
app:srcCompat="@drawable/ic_next_black"
android:theme="@style/DisableableButton" />
</LinearLayout>
@ -155,7 +155,7 @@
android:layout_weight="0"
android:contentDescription="@string/mpris_volume"
android:maxWidth="30dip"
android:src="@drawable/ic_volume_black"
app:srcCompat="@drawable/ic_volume_black"
app:tint="?attr/colorHighContrast" />

View File

@ -1,16 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="false"
android:drawableStart="@drawable/ic_warning"
android:drawableLeft="@drawable/ic_warning"
android:drawablePadding="8dp"
android:paddingTop="16dp"
android:paddingBottom="12dp"
android:text="@string/on_non_trusted_message"
android:drawableStart="@drawable/ic_warning"
android:drawableTint="?attr/colorControlNormal"
android:clickable="false"
>
android:text="@string/on_non_trusted_message">
</TextView>

View File

@ -1,16 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawableStart="@drawable/ic_wifi"
android:drawableLeft="@drawable/ic_wifi"
android:drawablePadding="8dp"
android:paddingTop="16dp"
android:paddingBottom="12dp"
android:text="@string/no_wifi"
android:drawableLeft="@drawable/ic_wifi"
android:drawableTint="?attr/colorControlNormal"
android:clickable="true"
>
android:text="@string/no_wifi">
</TextView>

View File

@ -41,11 +41,12 @@
android:id="@+id/not_reachable_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableStart="@drawable/ic_error_outline_black_48dp"
android:drawableLeft="@drawable/ic_error_outline_black_48dp"
android:drawablePadding="8dip"
android:paddingLeft="8dip"
android:drawableStart="@drawable/ic_error_outline_black_48dp"
android:gravity="center_vertical"
android:paddingStart="8dip"
android:paddingLeft="8dip"
android:text="@string/unreachable_description"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>