Commit 8107def7 authored by Schoumi's avatar Schoumi

Add no device pluggued message in the Browse Device Fragment

Fixes #3
parent 45468f64
......@@ -26,6 +26,7 @@ import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;
......@@ -82,6 +83,12 @@ public class BrowseDeviceFragment extends Fragment {
if(v == null)
v = getView();
assert v != null;
TextView nodevice = v.findViewById(R.id.no_device);
if(devices.size() == 0) {
nodevice.setVisibility(View.VISIBLE);
} else {
nodevice.setVisibility(View.GONE);
}
DeviceAdapter adapter = new DeviceAdapter(devices,listener);
RecyclerView view = v.findViewById(R.id.device_list);
view.setAdapter(adapter);
......
......@@ -9,7 +9,15 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<TextView
android:layout_alignParentTop="true"
android:id="@+id/no_device"
android:text="@string/no_device"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<android.support.v4.widget.SwipeRefreshLayout
android:layout_below="@+id/no_device"
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
......
......@@ -87,6 +87,7 @@
<string name="retry_download">Retry Download Binary</string>
<string name="download_binary">Download Binary</string>
<string name="informations">Informations</string>
<string name="no_device">No Device Pluggued, please plug one to be able to flash a binary on it.</string>
<array name="uuencode_array">
<item>Yes</item>
<item>No</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment