-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/janady/device/BluetoothOperatorFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.janady.device; | ||
|
||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
|
||
import com.example.funsdkdemo.MyApplication; | ||
import com.example.funsdkdemo.R; | ||
import com.janady.base.JBaseSegmentFragment; | ||
import com.janady.database.model.Bluetooth; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class BluetoothOperatorFragment extends JBaseSegmentFragment implements View.OnClickListener { | ||
@Override | ||
protected String title() { | ||
return "蓝牙控制"; | ||
} | ||
|
||
@Override | ||
protected List<View> createPageViews() { | ||
List<View> viewList = new ArrayList<>(); | ||
ArrayList<Bluetooth> blists = MyApplication.liteOrm.query(Bluetooth.class); | ||
for (Bluetooth bluetooth : blists) { | ||
View view = LayoutInflater.from(getActivity()).inflate(R.layout.jbluetooth_operator_layout, null); | ||
view.findViewById(R.id.open).setOnClickListener(this); | ||
view.findViewById(R.id.close).setOnClickListener(this); | ||
view.findViewById(R.id.lock).setOnClickListener(this); | ||
view.findViewById(R.id.unlock).setOnClickListener(this); | ||
viewList.add(view); | ||
} | ||
return viewList; | ||
} | ||
|
||
@Override | ||
protected void tabSelected(int index) { | ||
|
||
} | ||
|
||
@Override | ||
protected void tabUnSelected(int index) { | ||
|
||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<RelativeLayout style="@style/button_wrapper_style"> | ||
<FrameLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_centerInParent="true"> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/open" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:gravity="center" | ||
android:text="开" | ||
app:qmui_radiusTopLeft="8dp"/> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/close" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginLeft="64dp" | ||
android:gravity="center" | ||
android:text="关" | ||
app:qmui_radiusTopRight="8dp"/> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/lock" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginTop="64dp" | ||
android:gravity="center" | ||
android:text="锁" | ||
app:qmui_radiusBottomLeft="8dp"/> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/unlock" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginLeft="64dp" | ||
android:layout_marginTop="64dp" | ||
android:gravity="center" | ||
android:text="停" | ||
app:qmui_radiusBottomRight="8dp"/> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/connect" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginTop="128dp" | ||
android:gravity="center" | ||
android:text="连接" | ||
app:qmui_radiusBottomRight="8dp" | ||
tools:visibility="gone" /> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/disconnect" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginLeft="64dp" | ||
android:layout_marginTop="128dp" | ||
android:gravity="center" | ||
android:text="断开" | ||
app:qmui_radiusBottomRight="8dp" | ||
tools:visibility="gone" /> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/password" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginTop="192dp" | ||
android:gravity="center" | ||
android:text="修改密码" | ||
app:qmui_radiusBottomRight="8dp" | ||
tools:visibility="gone" /> | ||
|
||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||
android:id="@+id/scan" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_marginLeft="64dp" | ||
android:layout_marginTop="192dp" | ||
android:gravity="center" | ||
android:text="搜索设备" | ||
app:qmui_radiusBottomRight="8dp" | ||
tools:visibility="gone" /> | ||
</FrameLayout> | ||
</RelativeLayout> | ||
</LinearLayout> |