mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
show hint at the bottom of the Main Activity, update README.md, bump to 0.1.4
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "nodomain.freeyourgadget.gadgetbridge"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 21
|
||||
versionCode 4
|
||||
versionName "0.1.3"
|
||||
versionCode 5
|
||||
versionName "0.1.4"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
@@ -16,6 +16,7 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -33,6 +34,7 @@ public class ControlCenter extends Activity {
|
||||
public static final String ACTION_REFRESH_DEVICELIST
|
||||
= "nodomain.freeyourgadget.gadgetbride.controlcenter.action.set_version";
|
||||
|
||||
TextView hintTextView;
|
||||
ListView deviceListView;
|
||||
GBDeviceAdapter mGBDeviceAdapter;
|
||||
final List<GBDevice> deviceList = new ArrayList<>();
|
||||
@@ -57,6 +59,12 @@ public class ControlCenter extends Activity {
|
||||
device.setFirmwareVersion(firmwareVersion);
|
||||
device.setState(state);
|
||||
mGBDeviceAdapter.notifyDataSetChanged();
|
||||
if (state == GBDevice.State.CONNECTED) {
|
||||
hintTextView.setText("tap connected device for App Mananger");
|
||||
}
|
||||
else if (state == GBDevice.State.NOT_CONNECTED ) {
|
||||
hintTextView.setText("tap a device to connect");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +77,7 @@ public class ControlCenter extends Activity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_controlcenter);
|
||||
|
||||
hintTextView = (TextView) findViewById(R.id.hintTextView);
|
||||
deviceListView = (ListView) findViewById(R.id.deviceListView);
|
||||
mGBDeviceAdapter = new GBDeviceAdapter(this, deviceList);
|
||||
deviceListView.setAdapter(this.mGBDeviceAdapter);
|
||||
@@ -169,6 +177,9 @@ public class ControlCenter extends Activity {
|
||||
deviceList.add(new GBDevice(device.getAddress(), device.getName()));
|
||||
}
|
||||
}
|
||||
if (!deviceList.isEmpty()) {
|
||||
hintTextView.setText("tap a device to connect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/deviceListView"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_above="@+id/hintTextView" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:id="@+id/hintTextView"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textStyle="italic" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
Reference in New Issue
Block a user