Replace Bluetooth PNGs with a vector drawable.

This commit is contained in:
Isira Seneviratne 2020-09-25 15:28:18 +05:30
parent 5bf7a33903
commit 607d27a139
10 changed files with 20 additions and 9 deletions

View File

@ -7,9 +7,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration;
import androidx.annotation.Nullable;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.appcompat.widget.SwitchCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -22,7 +19,12 @@ import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import cc.mvdan.accesspoint.WifiApControl;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.fdroid.fdroid.FDroidApp; import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
@ -30,6 +32,8 @@ import org.fdroid.fdroid.nearby.peers.Peer;
import java.util.ArrayList; import java.util.ArrayList;
import cc.mvdan.accesspoint.WifiApControl;
@SuppressWarnings("LineLength") @SuppressWarnings("LineLength")
public class StartSwapView extends SwapView { public class StartSwapView extends SwapView {
private static final String TAG = "StartSwapView"; private static final String TAG = "StartSwapView";
@ -67,7 +71,7 @@ public class StartSwapView extends SwapView {
Peer peer = getItem(position); Peer peer = getItem(position);
((TextView) convertView.findViewById(R.id.peer_name)).setText(peer.getName()); ((TextView) convertView.findViewById(R.id.peer_name)).setText(peer.getName());
((ImageView) convertView.findViewById(R.id.icon)) ((ImageView) convertView.findViewById(R.id.icon))
.setImageDrawable(getResources().getDrawable(peer.getIcon())); .setImageDrawable(ContextCompat.getDrawable(getContext(), peer.getIcon()));
return convertView; return convertView;
} }

View File

@ -3,8 +3,10 @@ package org.fdroid.fdroid.nearby.peers;
import android.bluetooth.BluetoothClass.Device; import android.bluetooth.BluetoothClass.Device;
import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothDevice;
import android.os.Parcel; import android.os.Parcel;
import androidx.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.Nullable;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
public class BluetoothPeer implements Peer { public class BluetoothPeer implements Peer {
@ -44,7 +46,7 @@ public class BluetoothPeer implements Peer {
@Override @Override
public int getIcon() { public int getIcon() {
return R.drawable.ic_bluetooth_white; return R.drawable.ic_bluetooth;
} }
@Override @Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
</vector>

View File

@ -27,7 +27,7 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
tools:src="@drawable/ic_bluetooth_white"/> tools:src="@drawable/ic_bluetooth"/>
</RelativeLayout> </RelativeLayout>

View File

@ -27,7 +27,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:tint="@color/swap_grey_icon" android:tint="@color/swap_grey_icon"
android:contentDescription="@string/use_bluetooth" android:contentDescription="@string/use_bluetooth"
android:src="@drawable/ic_bluetooth_white"/> android:src="@drawable/ic_bluetooth"/>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"