Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Fix #358 #362

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.annotation.NonNull;
Expand All @@ -24,6 +25,7 @@
import static android.bluetooth.BluetoothDevice.BOND_NONE;

/**
* //llllll
* BluetoothListAdapter: {@link RecyclerView.Adapter} for {@link BluetoothDevice}.
*
* @author huangyz0918 ([email protected])
Expand Down Expand Up @@ -73,8 +75,13 @@ public void onBindViewHolder(@NonNull final ViewHolder viewHolder, int position)
if (deviceBondState == BOND_BONDED) {
viewHolder.deviceLogo.setImageResource(R.drawable.ic_smart_phone_yellow);
}


}




@Override
public int getItemCount() {
return bluetoothDeviceList.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

initEvents();
setupDialogs();
// setupDialogs();
}

/**
Expand Down Expand Up @@ -281,14 +281,14 @@ public void onDeviceFound(BluetoothDevice device) {

@Override
public void onDiscoveryStarted() {
scanningDialog.show();
// scanningDialog.show();
checkEmptyList();
bluetoothListAdapter.clearBluetoothDeviceList();
}

@Override
public void onDiscoveryFinished() {
scanningDialog.dismiss();
// scanningDialog.dismiss();
checkEmptyList();
}

Expand Down
28 changes: 28 additions & 0 deletions skunkworks_crow/src/main/res/layout/activity_bt_receive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
<!-- Toolbar -->
<include layout="@layout/toolbar" />


<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp"
android:layout_marginTop="?attr/actionBarSize">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Available Device"
android:textSize="20sp"/>

<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"


/>
</RelativeLayout>



<LinearLayout
android:id="@+id/no_devices_view"
style="@style/MatchParent"
Expand All @@ -31,10 +56,13 @@

</LinearLayout>



<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_bt_device"
style="@style/MatchParent"
android:layout_above="@id/btn_refresh"
android:layout_marginTop="45dp"
android:layout_below="@id/toolbar" />

<Button
Expand Down