Skip to content

Commit 003c3bd

Browse files
committed
Merge branch 'feature/avs-ble-cosmetic-changes' into 'versions/avs-ble'
UI Improvements See merge request idf/esp-idf-provisioning-android!17
2 parents 5659b12 + 0bca406 commit 003c3bd

11 files changed

+44
-29
lines changed

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
applicationId "com.espressif.provbleavs"
1717
minSdkVersion 21
1818
targetSdkVersion 27
19-
versionCode 7
20-
versionName "1.3.2"
19+
versionCode 8
20+
versionName "1.3.3"
2121
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2222
signingConfig signingConfigs.config
2323
}

app/src/main/java/com/espressif/ble_scanner/BleScanListener.java app/src/main/java/com/espressif/ble_scanner/BLEScanListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Interface for BLE device scanning.
88
*/
9-
public interface BleScanListener {
9+
public interface BLEScanListener {
1010

1111
/**
1212
* Called when any BLE peripheral will be found.

app/src/main/java/com/espressif/ble_scanner/BleScanner.java app/src/main/java/com/espressif/ble_scanner/BLEScanner.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
import java.util.ArrayList;
1616
import java.util.List;
1717

18-
public class BleScanner {
18+
public class BLEScanner {
1919

20-
private static final String TAG = BleScanner.class.getSimpleName();
20+
private static final String TAG = BLEScanner.class.getSimpleName();
2121

2222
private Context context;
23-
private BleScanListener bleScanListener;
23+
private BLEScanListener bleScanListener;
2424
private BluetoothAdapter bluetoothAdapter;
2525
private BluetoothLeScanner bluetoothLeScanner;
2626

2727
private long scanTimeout;
2828
private boolean isScanning = false;
2929

30-
public BleScanner(Context context, long scanTimeoutInMillis, BleScanListener bleScannerListener) {
30+
public BLEScanner(Context context, long scanTimeoutInMillis, BLEScanListener bleScannerListener) {
3131

3232
this.context = context;
3333
this.scanTimeout = scanTimeoutInMillis;

app/src/main/java/com/espressif/ui/activities/BLEProvisionLanding.java

+6-11
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
import com.espressif.AppConstants;
4343
import com.espressif.avs.ConfigureAVS;
44-
import com.espressif.ble_scanner.BleScanListener;
45-
import com.espressif.ble_scanner.BleScanner;
44+
import com.espressif.ble_scanner.BLEScanListener;
45+
import com.espressif.ble_scanner.BLEScanner;
4646
import com.espressif.provision.Provision;
4747
import com.espressif.provision.R;
4848
import com.espressif.provision.security.Security;
@@ -100,7 +100,7 @@ public class BLEProvisionLanding extends AppCompatActivity {
100100

101101
private BleDeviceListAdapter adapter;
102102
private BluetoothAdapter bleAdapter;
103-
private BleScanner bleScanner;
103+
private BLEScanner bleScanner;
104104
private ArrayList<BluetoothDevice> deviceList;
105105
private HashMap<BluetoothDevice, String> bluetoothDevices;
106106
private Handler handler;
@@ -145,7 +145,7 @@ protected void onCreate(Bundle savedInstanceState) {
145145
deviceList = new ArrayList<>(keySet);
146146

147147
initViews();
148-
bleScanner = new BleScanner(this, SCAN_TIMEOUT, bleScanListener);
148+
bleScanner = new BLEScanner(this, SCAN_TIMEOUT, bleScanListener);
149149

150150
transportListener = new BLETransport.BLETransportListener() {
151151

@@ -382,17 +382,12 @@ private void updateProgressAndScanBtn() {
382382

383383
if (bleScanner.isScanning()) {
384384

385-
// btnScan.setEnabled(false);
386-
// btnScan.setAlpha(0.5f);
387-
// btnScan.setTextColor(Color.WHITE);
388385
btnScan.setVisibility(View.GONE);
389386
progressBar.setVisibility(View.VISIBLE);
390387
listView.setVisibility(View.GONE);
391388

392389
} else {
393390

394-
// btnScan.setEnabled(true);
395-
// btnScan.setAlpha(1f);
396391
btnScan.setVisibility(View.VISIBLE);
397392
progressBar.setVisibility(View.GONE);
398393
listView.setVisibility(View.VISIBLE);
@@ -534,7 +529,7 @@ public void onClick(DialogInterface dialog, int which) {
534529
builder.show();
535530
}
536531

537-
private BleScanListener bleScanListener = new BleScanListener() {
532+
private BLEScanListener bleScanListener = new BLEScanListener() {
538533

539534
@Override
540535
public void onPeripheralFound(BluetoothDevice device, ScanResult scanResult) {
@@ -596,10 +591,10 @@ public void onItemClick(AdapterView<?> adapterView, View view, int position, lon
596591
isDeviceConnected = false;
597592
btnScan.setVisibility(View.GONE);
598593
listView.setVisibility(View.GONE);
599-
progressBar.setVisibility(View.VISIBLE);
600594
BluetoothDevice device = adapter.getItem(position);
601595
deviceName = device.getName();
602596
Log.d(TAG, "=================== Connect to device : " + deviceName);
597+
progressBar.setVisibility(View.VISIBLE);
603598
bleTransport.connect(device);
604599
handler.postDelayed(disconnectDeviceTask, DEVICE_CONNECT_TIMEOUT);
605600
}

app/src/main/java/com/espressif/ui/adapters/WiFiListAdapter.java

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public View getView(int position, View convertView, ViewGroup parent) {
4646
// lockImage.setVisibility(View.VISIBLE);
4747
// }
4848

49+
if (wiFiAccessPoint.getWifiName().equals(context.getString(R.string.join_other_network))) {
50+
51+
rssiImage.setVisibility(View.VISIBLE);
52+
rssiImage.setImageResource(R.drawable.ic_right_arrow);
53+
}
54+
4955
return view;
5056
}
5157

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
<vector android:height="24dp" android:viewportHeight="512"
2-
android:viewportWidth="512" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
3-
<path android:fillColor="#FF000000" android:pathData="M384,352l96,-109.3h-66.1C407.1,141.8 325,64 223.2,64C117.8,64 32,150.1 32,256s85.8,192 191.2,192c43.1,0 83.8,-14.1 117.7,-40.7l7.5,-5.9l-43.2,-46.2l-6.2,4.6c-22.1,16.3 -48.3,24.9 -75.8,24.9C152.6,384.7 95.1,327 95.1,256c0,-71 57.5,-128.7 128.1,-128.7c66.4,0 120.7,50 127.4,115.3h-74.1L384,352z"/>
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="27.125"
5+
android:viewportHeight="27.43">
6+
<path
7+
android:fillColor="#FF000000"
8+
android:pathData="M27.094,12.945c-1.511,0.013 -3.021,0.021 -4.531,0.034c0.254,2.6 -0.603,5.287 -2.594,7.275c-3.535,3.534 -9.263,3.534 -12.796,0c-3.534,-3.531 -3.534,-9.26 0,-12.794c3.015,-3.016 7.625,-3.445 11.109,-1.313c-1.181,1.167 -2.57,2.549 -2.57,2.549c-1,1.062 0.017,1.766 0.69,1.77h8.828c0.338,0 0.61,-0.273 0.611,-0.611V1.099c0.041,-0.825 -0.865,-1.592 -1.756,-0.7c0,0 -1.495,1.479 -2.533,2.509C16.246,-0.97 8.768,-0.53 3.975,4.262c-5.3,5.3 -5.3,13.893 0,19.192c5.299,5.298 13.892,5.298 19.191,0C26.05,20.572 27.35,16.714 27.094,12.945z" />
49
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="512"
5+
android:viewportHeight="512">
6+
<path
7+
android:fillColor="#FF000000"
8+
android:pathData="M160,115.4l20.7,-19.4l171.3,160l-171.3,160l-20.7,-19.3l150.5,-140.7z" />
9+
</vector>

app/src/main/res/layout/content_bleprovision_landing.xml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
android:layout_height="wrap_content"
3636
android:text="@string/devices_title"
3737
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
38+
android:textSize="20sp"
3839
android:textStyle="bold" />
3940

4041
<ImageView

app/src/main/res/layout/content_manage_devices.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
android:layout_height="wrap_content"
3636
android:text="@string/devices_title"
3737
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
38+
android:textSize="20sp"
3839
android:textStyle="bold" />
3940

4041
<ImageView
@@ -57,11 +58,7 @@
5758
android:id="@+id/connected_devices_list"
5859
android:layout_width="match_parent"
5960
android:layout_height="match_parent"
60-
android:layout_alignParentBottom="true"
61-
android:layout_marginTop="16dp"
62-
android:layout_marginBottom="0dp"
63-
app:layout_constraintEnd_toEndOf="parent"
64-
app:layout_constraintStart_toStartOf="parent" />
61+
android:layout_alignParentBottom="true" />
6562

6663
<LinearLayout
6764
android:layout_width="wrap_content"

app/src/main/res/layout/content_wifi_scan_list.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
android:layout_width="wrap_content"
3434
android:layout_height="wrap_content"
3535
android:text="@string/networks"
36-
android:textSize="20sp" />
36+
android:textSize="20sp"
37+
android:textStyle="bold" />
3738

3839
<ImageView
3940
android:id="@+id/btn_refresh"

app/src/main/res/layout/item_wifi_access_point.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
android:layout_width="match_parent"
88
android:layout_height="wrap_content"
99
android:layout_centerInParent="true"
10-
android:padding="10dp">
10+
android:padding="15dp">
1111

1212
<TextView
1313
android:id="@+id/tv_wifi_name"
1414
android:layout_width="wrap_content"
1515
android:layout_height="wrap_content"
1616
android:layout_centerVertical="true"
17-
android:layout_marginStart="10dp" />
17+
android:layout_marginStart="10dp"
18+
android:textSize="18sp" />
1819

1920
<ImageView
2021
android:id="@+id/iv_wifi_rssi"

0 commit comments

Comments
 (0)