[optimization]清理无用资源
This commit is contained in:
parent
e1494e6ece
commit
122d75ebf1
|
|
@ -16,18 +16,6 @@
|
|||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activity.MainActivity"></activity>
|
||||
<activity
|
||||
android:name=".activity.MainActivity2"
|
||||
android:exported="true" />
|
||||
<activity android:name=".activity.HostActivity" >
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity android:name=".activity.NetActivity" />
|
||||
<activity
|
||||
android:name=".activity.splash.SplashActivity"
|
||||
android:theme="@style/AppTheme.SplashTheme">
|
||||
|
|
@ -37,16 +25,6 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.grade.GradeActivity">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity android:name=".activity.clasz.ClassActivity" />
|
||||
<activity android:name=".activity.list.ListActivity" />
|
||||
<activity android:name=".activity.detail.DetailActivity" />
|
||||
<activity
|
||||
android:name=".activity.home.HomeActivity"
|
||||
android:launchMode="singleTask"
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package com.skipping;
|
||||
|
||||
import com.libs.fragment.BaseApplication;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/14/22
|
||||
*/
|
||||
public class MainPresenter extends BaseApplication {
|
||||
}
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
package com.skipping.activity;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.utils.LogUtil;
|
||||
import com.libs.utils.ToastUtil;
|
||||
import com.loop.loopminisdk.LoopDevice;
|
||||
import com.loop.loopminisdk.LoopHost;
|
||||
import com.loop.loopminisdk.LoopMessage;
|
||||
import com.loop.loopminisdk.LoopMini;
|
||||
import com.skipping.R;
|
||||
import com.skipping.utils.ThreadPoolUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/15/22
|
||||
*/
|
||||
public class HostActivity extends BaseActivity {
|
||||
private LoopMini loopMax;
|
||||
private Set<LoopDevice> loopDeviceSet = new HashSet<>();
|
||||
private LoopDevice loopDevice;
|
||||
private EditText editText;
|
||||
private LoopHost loopHost;
|
||||
private MyHandler mHandler;
|
||||
private int position;
|
||||
private ScheduledFuture scheduledFuture;
|
||||
private Button btn, btn2, btn3, btn4, btn5;
|
||||
private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case LoopMini.ACTION_USB_PERMISSION_GRANTED:
|
||||
ToastUtil.longToast("确认设备权限");
|
||||
break;
|
||||
case LoopMini.ACTION_USB_PERMISSION_NOT_GRANTED:
|
||||
ToastUtil.longToast("取消设备权限");
|
||||
break;
|
||||
case LoopMini.ACTION_NO_USB:
|
||||
ToastUtil.longToast("没有插入设备");
|
||||
break;
|
||||
case LoopMini.ACTION_USB_DISCONNECTED:
|
||||
ToastUtil.longToast("拔出设备");
|
||||
break;
|
||||
case LoopMini.ACTION_USB_NOT_SUPPORTED:
|
||||
ToastUtil.longToast("设备无法识别");
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
private final ServiceConnection usbConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName arg0, IBinder arg1) {
|
||||
loopMax = ((LoopMini.UsbBinder) arg1).getService();
|
||||
loopMax.setHandler(mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName arg0) {
|
||||
loopMax = null;
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_host;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
btn = findViewById(R.id.btn);
|
||||
btn2 = findViewById(R.id.btn2);
|
||||
btn3 = findViewById(R.id.btn3);
|
||||
btn4 = findViewById(R.id.btn4);
|
||||
btn5 = findViewById(R.id.btn5);
|
||||
editText = findViewById(R.id.edittext);
|
||||
btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getHostInfo();
|
||||
openPairMode();
|
||||
}
|
||||
});
|
||||
btn2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
pairDevice(Integer.valueOf(editText.getText().toString()));
|
||||
}
|
||||
});
|
||||
btn3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LogUtil.e("设备数据", loopDeviceSet);
|
||||
}
|
||||
});
|
||||
btn4.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
closePairMode();
|
||||
connectDevice();
|
||||
}
|
||||
});
|
||||
btn5.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
closePairMode();
|
||||
disconnectDevice();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mHandler = new MyHandler();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 连接主机
|
||||
*/
|
||||
private void getHostInfo() {
|
||||
loopMax.getHostInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启配对模式
|
||||
*/
|
||||
private void openPairMode() {
|
||||
loopMax.openPairMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭配对模式
|
||||
*/
|
||||
private void closePairMode() {
|
||||
loopMax.closePairMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配设备到指定id
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private void pairDevice(int id) {
|
||||
loopMax.pairDevice(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接设备
|
||||
*/
|
||||
private void connectDevice() {
|
||||
connectDeviceInner(loopDevice -> loopMax.connectDevice(loopDevice));
|
||||
}
|
||||
|
||||
private void disconnectDevice() {
|
||||
connectDeviceInner(loopDevice -> loopMax.disconnectDevice(loopDevice));
|
||||
}
|
||||
|
||||
|
||||
private void connectDeviceInner(ConnectInterface connectInterface) {
|
||||
if (loopDeviceSet.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (scheduledFuture != null) {
|
||||
scheduledFuture.cancel(false);
|
||||
}
|
||||
List<LoopDevice> deviceList = loopDeviceSet.stream().collect(Collectors.toList());
|
||||
position = 0;
|
||||
scheduledFuture = ThreadPoolUtil.getSingleton().scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (position > deviceList.size()) {
|
||||
scheduledFuture.cancel(false);
|
||||
}
|
||||
connectInterface.connect(deviceList.get(position));
|
||||
position++;
|
||||
}
|
||||
}, 0, 10);
|
||||
}
|
||||
|
||||
public interface ConnectInterface {
|
||||
void connect(LoopDevice loopDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
setFilters();
|
||||
startService(usbConnection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
unregisterReceiver(mUsbReceiver);
|
||||
unbindService(usbConnection);
|
||||
}
|
||||
|
||||
private void startService(ServiceConnection serviceConnection) {
|
||||
if (!LoopMini.SERVICE_CONNECTED) {
|
||||
Intent startService = new Intent(this, LoopMini.class);
|
||||
startService(startService);
|
||||
}
|
||||
Intent bindingIntent = new Intent(this, LoopMini.class);
|
||||
bindService(bindingIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
private void setFilters() {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(LoopMini.ACTION_USB_PERMISSION_GRANTED);
|
||||
filter.addAction(LoopMini.ACTION_NO_USB);
|
||||
filter.addAction(LoopMini.ACTION_USB_DISCONNECTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_NOT_SUPPORTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_PERMISSION_NOT_GRANTED);
|
||||
registerReceiver(mUsbReceiver, filter);
|
||||
}
|
||||
|
||||
|
||||
private class MyHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case LoopMini.LOOP_PAIR_DEVICE_INFO:
|
||||
loopDevice = (LoopDevice) msg.obj;
|
||||
addDevice(loopDevice);
|
||||
LogUtil.e("连接LoopDevice", loopDevice.toString());
|
||||
break;
|
||||
case LoopMini.Loop_GET_HOST_INFO:
|
||||
loopHost = (LoopHost) msg.obj;
|
||||
LogUtil.e("LoopHost", loopHost.toString());
|
||||
break;
|
||||
case LoopMini.LOOP_GET_DEVICE_INFO:
|
||||
loopDevice = (LoopDevice) msg.obj;
|
||||
addDevice(loopDevice);
|
||||
LogUtil.e("获取LoopDevice", loopDevice.toString());
|
||||
break;
|
||||
case LoopMini.LOOP_MESSAGE:
|
||||
LoopMessage loopMessage = (LoopMessage) msg.obj;
|
||||
LogUtil.e("LoopMessage", loopMessage.toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addDevice(LoopDevice loopDevice) {
|
||||
loopDeviceSet.add(loopDevice);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.skipping.activity;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.TokenBean;
|
||||
import com.skipping.net.TokenReqBean;
|
||||
|
||||
public class MainActivity extends BaseActivity {
|
||||
private Concise<API> concise;
|
||||
private Button btn, btn2;
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
btn = findViewById(R.id.btn);
|
||||
btn2 = findViewById(R.id.btn2);
|
||||
btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(MainActivity.this, HostActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
btn2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(MainActivity.this, NetActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
private void login() {
|
||||
TokenReqBean tokenReqBean = new TokenReqBean();
|
||||
concise.request(this, concise.api.token(tokenReqBean), new CallBack<BaseBean<TokenBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<TokenBean> tokenBeanBaseBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
package com.skipping.activity;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.loop.loopminisdk.LoopDevice;
|
||||
import com.loop.loopminisdk.LoopHost;
|
||||
import com.loop.loopminisdk.LoopMessage;
|
||||
import com.loop.loopminisdk.LoopMini;
|
||||
import com.skipping.R;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/14/22
|
||||
*/
|
||||
public class MainActivity2 extends AppCompatActivity {
|
||||
private LoopMini loopMax;
|
||||
private LoopDevice loopDevice;
|
||||
private EditText editText;
|
||||
private LoopHost loopHost;
|
||||
private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case LoopMini.ACTION_USB_PERMISSION_GRANTED: // USB PERMISSION GRANTED
|
||||
Toast.makeText(context, "USB Ready", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case LoopMini.ACTION_USB_PERMISSION_NOT_GRANTED: // USB PERMISSION NOT GRANTED
|
||||
Toast.makeText(context, "USB Permission not granted", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case LoopMini.ACTION_NO_USB: // NO USB CONNECTED
|
||||
Toast.makeText(context, "No USB connected", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case LoopMini.ACTION_USB_DISCONNECTED: // USB DISCONNECTED
|
||||
Toast.makeText(context, "USB disconnected", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case LoopMini.ACTION_USB_NOT_SUPPORTED: // USB NOT SUPPORTED
|
||||
Toast.makeText(context, "USB device not supported", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
private MyHandler mHandler;
|
||||
private final ServiceConnection usbConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName arg0, IBinder arg1) {
|
||||
loopMax = ((LoopMini.UsbBinder) arg1).getService();
|
||||
loopMax.setHandler(mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName arg0) {
|
||||
loopMax = null;
|
||||
}
|
||||
};
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main2);
|
||||
mHandler = new MyHandler();
|
||||
editText = findViewById(R.id.edittext);
|
||||
Button button1 = findViewById(R.id.button);
|
||||
Button button2 = findViewById(R.id.button2);
|
||||
Button button3 = findViewById(R.id.button3);
|
||||
Button button4 = findViewById(R.id.button4);
|
||||
Button button5 = findViewById(R.id.button5);
|
||||
Button button6 = findViewById(R.id.button6);
|
||||
Button button7 = findViewById(R.id.button7);
|
||||
Button button8 = findViewById(R.id.button8);
|
||||
Button button9 = findViewById(R.id.button9);
|
||||
Button button10 = findViewById(R.id.button10);
|
||||
button1.setOnClickListener(v -> loopMax.getHostInfo());
|
||||
button2.setOnClickListener(v -> loopMax.openPairMode());
|
||||
button3.setOnClickListener(v -> loopMax.closePairMode());
|
||||
button4.setOnClickListener(v -> loopMax.pairDevice(Integer.valueOf(editText.getText().toString())));
|
||||
button5.setOnClickListener(v -> {
|
||||
if (loopDevice != null) {
|
||||
loopMax.connectDevice(loopDevice);
|
||||
}
|
||||
});
|
||||
button6.setOnClickListener(v -> {
|
||||
if (loopDevice != null) {
|
||||
loopMax.disconnectDevice(loopDevice);
|
||||
}
|
||||
});
|
||||
button7.setOnClickListener(v -> loopMax.getPower());
|
||||
button8.setOnClickListener(v -> loopMax.getCount());
|
||||
button9.setOnClickListener(v -> loopMax.startJumpLimitTime(30));
|
||||
button10.setOnClickListener(v -> loopMax.stopJump());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
setFilters(); // Start listening notifications from UsbService
|
||||
startService(usbConnection); // Start UsbService(if it was not started before) and Bind it
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
unregisterReceiver(mUsbReceiver);
|
||||
unbindService(usbConnection);
|
||||
}
|
||||
|
||||
private void startService(ServiceConnection serviceConnection) {
|
||||
if (!LoopMini.SERVICE_CONNECTED) {
|
||||
Intent startService = new Intent(this, LoopMini.class);
|
||||
startService(startService);
|
||||
}
|
||||
Intent bindingIntent = new Intent(this, LoopMini.class);
|
||||
bindService(bindingIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
private void setFilters() {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(LoopMini.ACTION_USB_PERMISSION_GRANTED);
|
||||
filter.addAction(LoopMini.ACTION_NO_USB);
|
||||
filter.addAction(LoopMini.ACTION_USB_DISCONNECTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_NOT_SUPPORTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_PERMISSION_NOT_GRANTED);
|
||||
registerReceiver(mUsbReceiver, filter);
|
||||
}
|
||||
|
||||
private class MyHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case LoopMini.LOOP_PAIR_DEVICE_INFO:
|
||||
loopDevice = (LoopDevice) msg.obj;
|
||||
Log.d("LoopDevice", loopDevice.toString());
|
||||
break;
|
||||
case LoopMini.Loop_GET_HOST_INFO:
|
||||
loopHost = (LoopHost) msg.obj;
|
||||
Log.d("LoopHost", loopHost.toString());
|
||||
break;
|
||||
case LoopMini.LOOP_GET_DEVICE_INFO:
|
||||
LoopDevice loopDevice = (LoopDevice) msg.obj;
|
||||
Log.d("LoopDevice", loopDevice.toString());
|
||||
break;
|
||||
case LoopMini.LOOP_MESSAGE:
|
||||
LoopMessage loopMessage = (LoopMessage) msg.obj;
|
||||
Log.d("LoopMessage", loopMessage.toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,234 +0,0 @@
|
|||
package com.skipping.activity;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.libs.utils.LogUtil;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.ActivityBean;
|
||||
import com.skipping.net.ActivityReqBean;
|
||||
import com.skipping.net.AddActivityBean;
|
||||
import com.skipping.net.AddActivityReqBean;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.DetailActivityBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
import com.skipping.net.ScoreReqBean;
|
||||
import com.skipping.net.TokenBean;
|
||||
import com.skipping.net.TokenReqBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/15/22
|
||||
*/
|
||||
public class NetActivity extends BaseActivity {
|
||||
private RecyclerView recyclerview;
|
||||
private Button btn, btn2, btn3, btn4, btn5, btn6, btn7;
|
||||
private Concise<API> tokenConcise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.build();
|
||||
private Concise<API> concise;
|
||||
private NetRecyclerAdapter adapter;
|
||||
private LinearLayoutManager linearLayoutManager;
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_net;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
btn = findViewById(R.id.btn);
|
||||
btn2 = findViewById(R.id.btn2);
|
||||
btn3 = findViewById(R.id.btn3);
|
||||
btn4 = findViewById(R.id.btn4);
|
||||
btn5 = findViewById(R.id.btn5);
|
||||
btn6 = findViewById(R.id.btn6);
|
||||
btn7 = findViewById(R.id.btn7);
|
||||
recyclerview = findViewById(R.id.recyclerview);
|
||||
linearLayoutManager = new LinearLayoutManager(this);
|
||||
recyclerview.setLayoutManager(linearLayoutManager);
|
||||
adapter = new NetRecyclerAdapter(recyclerview);
|
||||
recyclerview.setAdapter(adapter);
|
||||
recyclerview.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
LogUtil.e("最后一个可见",linearLayoutManager.findLastCompletelyVisibleItemPosition());
|
||||
}
|
||||
});
|
||||
|
||||
btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
TokenReqBean tokenReqBean = new TokenReqBean();
|
||||
tokenReqBean.setDeviceID("466e9c");
|
||||
tokenReqBean.setLogName("loop");
|
||||
tokenReqBean.setLogPwd("123456");
|
||||
tokenConcise.request(NetActivity.this, tokenConcise.api.token(tokenReqBean), new CallBack<BaseBean<TokenBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<TokenBean> tokenBeanBaseBean) {
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.addHeader("Token", tokenBeanBaseBean.getData().getToken()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
concise.request(NetActivity.this, concise.api.getGrade(), new CallBack<BaseBean<List<GradleBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<GradleBean>> listBaseBean) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
concise.request(NetActivity.this, concise.api.getClass("6b76e9770a4eafbcee213121d4ad6b"), new CallBack<BaseBean<List<GradleBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<GradleBean>> listBaseBean) {
|
||||
LogUtil.e("数据",listBaseBean.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn4.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ActivityReqBean bean = new ActivityReqBean();
|
||||
bean.setGenre(Contants.CLASS);
|
||||
bean.setActivityType("timing");
|
||||
bean.setGroupID("77bba9124a4281bc9f92f965561cd5");
|
||||
bean.setIndex(1);
|
||||
bean.setPageSize(5);
|
||||
bean.setStatus(Contants.UNFINISHED);
|
||||
concise.request(NetActivity.this, concise.api.getActivityList(bean), new CallBack<BaseBean<List<ActivityBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<ActivityBean>> listBaseBean) {
|
||||
adapter.setData(listBaseBean.getData());
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn5.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AddActivityReqBean bean = new AddActivityReqBean();
|
||||
bean.setName("test001");
|
||||
bean.setActivityType("timing");
|
||||
// bean.setValue(60);
|
||||
bean.setGroupID("77bba9124a4281bc9f92f965561cd5");
|
||||
// bean.setPersonNumber(6);
|
||||
bean.setStep(2);
|
||||
concise.request(NetActivity.this, concise.api.addActivity(bean), new CallBack<BaseBean<AddActivityBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<AddActivityBean> listBaseBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn6.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
concise.request(NetActivity.this, concise.api.detailActivity("15"), new CallBack<BaseBean<DetailActivityBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<DetailActivityBean> listBaseBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
btn7.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ScoreReqBean bean = new ScoreReqBean();
|
||||
bean.setId(15);
|
||||
bean.setStep(2);
|
||||
List<ScoreReqBean.CandidatesBean> candidatesBeanList = new ArrayList<>();
|
||||
ScoreReqBean.CandidatesBean candidatesBean = new ScoreReqBean.CandidatesBean();
|
||||
candidatesBean.setComplateTime(1646975055);
|
||||
ScoreReqBean.CandidatesBean.InfoBean infoBean = new ScoreReqBean.CandidatesBean.InfoBean();
|
||||
List<Integer> list = new ArrayList<>();
|
||||
list.add(1);
|
||||
list.add(1);
|
||||
list.add(1);
|
||||
list.add(1);
|
||||
infoBean.setDetail(list);
|
||||
infoBean.setPersonID("a12e6f5a4383855caa2bd36958a2");
|
||||
infoBean.setScore(10);
|
||||
List<ScoreReqBean.CandidatesBean.InfoBean> infoBeans = new ArrayList<>();
|
||||
infoBeans.add(infoBean);
|
||||
candidatesBean.setInfo(infoBeans);
|
||||
candidatesBeanList.add(new ScoreReqBean.CandidatesBean());
|
||||
bean.setCandidates(candidatesBeanList);
|
||||
concise.request(NetActivity.this, concise.api.score(bean), new CallBack<BaseBean>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean baseBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
package com.skipping.activity;
import android.content.Context;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.skipping.R;
import com.skipping.net.ActivityBean;
import java.util.ArrayList;
import java.util.List;
/**
* @author Ming
* 1/6/22
*/
public class NetRecyclerAdapter extends RecyclerView.Adapter<NetRecyclerAdapter.RecyclerHolder> {
private Context mContext;
private List<ActivityBean> list = new ArrayList<>();
public NetRecyclerAdapter(RecyclerView recyclerView) {
this.mContext = recyclerView.getContext();
}
public void setData(List<ActivityBean> list) {
this.list = list;
}
@Override
public RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.net_item, parent, false);
return new RecyclerHolder(view);
}
@Override
public void onBindViewHolder(RecyclerHolder holder, int position) {
holder.textView.setText(list.get(position).toString());
}
@Override
public int getItemCount() {
return list.size();
}
class RecyclerHolder extends RecyclerView.ViewHolder {
TextView textView;
private RecyclerHolder(View itemView) {
super(itemView);
textView = itemView.findViewById(R.id.text);
}
}
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
package com.skipping.activity.clasz;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.libs.utils.LogUtil;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.activity.list.ListActivity;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
import com.skipping.utils.ErrorToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class ClassActivity extends BaseActivity {
|
||||
private RecyclerView recyclerview;
|
||||
private Concise<API> concise;
|
||||
private ClassAdapter classAdapter;
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_show;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
recyclerview = findViewById(R.id.recyclerview);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
String id = (String) getIntent().getBundleExtra("id").get("id");
|
||||
recyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
classAdapter = new ClassAdapter(recyclerview);
|
||||
classAdapter.setOnClickListener(new ClassAdapter.OnClick() {
|
||||
@Override
|
||||
public void click(String id) {
|
||||
Intent intent = new Intent(ClassActivity.this, ListActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("id", id);
|
||||
intent.putExtra("id", bundle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
recyclerview.setAdapter(classAdapter);
|
||||
|
||||
MMKV kv = MMKV.defaultMMKV();
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.addHeader("Token", kv.decodeString(Contants.TOKEN));
|
||||
ErrorToken.intercept(this, concise);
|
||||
concise.request(ClassActivity.this, concise.api.getClass(id), new CallBack<BaseBean<List<GradleBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<GradleBean>> listBaseBean) {
|
||||
classAdapter.setData(listBaseBean.getData());
|
||||
classAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package com.skipping.activity.clasz;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.GradleBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class ClassAdapter extends RecyclerView.Adapter<ClassAdapter.RecyclerHolder> {
|
||||
private OnClick onClick;
|
||||
private Context mContext;
|
||||
private List<GradleBean> list = new ArrayList<>();
|
||||
|
||||
public ClassAdapter(RecyclerView recyclerView) {
|
||||
this.mContext = recyclerView.getContext();
|
||||
}
|
||||
|
||||
public void setData(List<GradleBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassAdapter.RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.grade_item, parent, false);
|
||||
return new ClassAdapter.RecyclerHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ClassAdapter.RecyclerHolder holder, int position) {
|
||||
holder.title.setText("班级名称:" + list.get(position).getGroupName());
|
||||
holder.name.setText("班级ID:" + list.get(position).getGroupID());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onClick.click(list.get(position).getGroupID());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class RecyclerHolder extends RecyclerView.ViewHolder {
|
||||
TextView title;
|
||||
TextView name;
|
||||
|
||||
private RecyclerHolder(View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClick onClick){
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
public interface OnClick{
|
||||
void click(String id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
package com.skipping.activity.detail;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.DetailActivityBean;
|
||||
import com.skipping.utils.ConnectManager;
|
||||
import com.skipping.utils.ErrorToken;
|
||||
import com.skipping.utils.ThreadPoolUtil;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class DetailActivity extends BaseActivity {
|
||||
private Concise<API> concise;
|
||||
private TextView name, idTV;
|
||||
private RecyclerView recyclerview;
|
||||
private DetailAdapter adapter;
|
||||
private Button open, connect, msg;
|
||||
private ConnectManager connectManager;
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
idTV = findViewById(R.id.id);
|
||||
name = findViewById(R.id.name);
|
||||
recyclerview = findViewById(R.id.recyclerview);
|
||||
open = findViewById(R.id.open);
|
||||
connect = findViewById(R.id.connect);
|
||||
msg = findViewById(R.id.msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// connectManager = new ConnectManager(this,new ConnectManager.DeviceHandler());
|
||||
String id = (String) getIntent().getBundleExtra("id").get("id");
|
||||
recyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
adapter = new DetailAdapter(recyclerview);
|
||||
recyclerview.setAdapter(adapter);
|
||||
adapter.setOnClickListener(new DetailAdapter.OnClick() {
|
||||
@Override
|
||||
public void click(int position) {
|
||||
// connectManager.pairDevice(position);
|
||||
}
|
||||
});
|
||||
MMKV kv = MMKV.defaultMMKV();
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.addHeader("Token", kv.decodeString(Contants.TOKEN));
|
||||
ErrorToken.intercept(this, concise);
|
||||
concise.request(DetailActivity.this, concise.api.detailActivity(id), new CallBack<BaseBean<DetailActivityBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<DetailActivityBean> listBaseBean) {
|
||||
idTV.setText(listBaseBean.getData().getId() + "");
|
||||
name.setText(listBaseBean.getData().getActivityName() + "");
|
||||
adapter.setData(listBaseBean.getData().getCandidates().get(0));
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
List<DetailActivityBean.CandidatesBean> list = new ArrayList<>();
|
||||
DetailActivityBean.CandidatesBean bean1 = new DetailActivityBean.CandidatesBean();
|
||||
bean1.setName("1111");
|
||||
bean1.setPersonID("11111");
|
||||
bean1.setScore(1);
|
||||
bean1.setStudentID("111");
|
||||
list.add(bean1);
|
||||
DetailActivityBean.CandidatesBean bean2 = new DetailActivityBean.CandidatesBean();
|
||||
bean2.setName("1111");
|
||||
bean2.setPersonID("11111");
|
||||
bean2.setScore(1);
|
||||
bean2.setStudentID("111");
|
||||
list.add(bean2);
|
||||
adapter.setData(list);
|
||||
adapter.notifyDataSetChanged();
|
||||
open.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
connectManager.getHostInfo();
|
||||
connectManager.openPairMode();
|
||||
}
|
||||
});
|
||||
|
||||
connect.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
connectManager.closePairMode();
|
||||
connectManager.connectDevice();
|
||||
}
|
||||
});
|
||||
|
||||
msg.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ThreadPoolUtil.getSingleton().scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
connectManager.getpower();
|
||||
}
|
||||
}, 0, 20);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
connectManager.resume();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
connectManager.pause();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package com.skipping.activity.detail;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.DetailActivityBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class DetailAdapter extends RecyclerView.Adapter<DetailAdapter.RecyclerHolder> {
|
||||
private OnClick onClick;
|
||||
private Context mContext;
|
||||
private List<DetailActivityBean.CandidatesBean> list = new ArrayList<>();
|
||||
|
||||
public DetailAdapter(RecyclerView recyclerView) {
|
||||
this.mContext = recyclerView.getContext();
|
||||
}
|
||||
|
||||
public void setData(List<DetailActivityBean.CandidatesBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailAdapter.RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.detail_item, parent, false);
|
||||
return new DetailAdapter.RecyclerHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(DetailAdapter.RecyclerHolder holder, int position) {
|
||||
holder.name.setText("学生名称:" + list.get(position).getName());
|
||||
holder.id.setText("ID:" + list.get(position).getPersonID());
|
||||
holder.studentid.setText("学生ID:" + list.get(position).getStudentID());
|
||||
holder.score.setText("分数:" + list.get(position).getScore());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onClick.click(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class RecyclerHolder extends RecyclerView.ViewHolder {
|
||||
TextView name, id, studentid, score;
|
||||
|
||||
private RecyclerHolder(View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
id = itemView.findViewById(R.id.id);
|
||||
studentid = itemView.findViewById(R.id.studentid);
|
||||
score = itemView.findViewById(R.id.score);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClick onClick) {
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
public interface OnClick {
|
||||
void click(int position);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package com.skipping.activity.grade;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.activity.clasz.ClassActivity;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
import com.skipping.utils.ErrorToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class GradeActivity extends BaseActivity {
|
||||
private RecyclerView recyclerview;
|
||||
private Concise<API> concise;
|
||||
private GradeAdapter gradeAdapter;
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_show;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
recyclerview = findViewById(R.id.recyclerview);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
recyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
gradeAdapter = new GradeAdapter(recyclerview);
|
||||
gradeAdapter.setOnClickListener(new GradeAdapter.OnClick() {
|
||||
@Override
|
||||
public void click(String id) {
|
||||
Intent intent = new Intent(GradeActivity.this, ClassActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("id", id);
|
||||
intent.putExtra("id", bundle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
recyclerview.setAdapter(gradeAdapter);
|
||||
|
||||
MMKV kv = MMKV.defaultMMKV();
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.addHeader("Token", kv.decodeString(Contants.TOKEN));
|
||||
ErrorToken.intercept(this, concise);
|
||||
concise.request(GradeActivity.this, concise.api.getGrade(), new CallBack<BaseBean<List<GradleBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<GradleBean>> listBaseBean) {
|
||||
gradeAdapter.setData(listBaseBean.getData());
|
||||
gradeAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package com.skipping.activity.grade;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.GradleBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class GradeAdapter extends RecyclerView.Adapter<GradeAdapter.RecyclerHolder> {
|
||||
private OnClick onClick;
|
||||
private Context mContext;
|
||||
private List<GradleBean> list = new ArrayList<>();
|
||||
|
||||
public GradeAdapter(RecyclerView recyclerView) {
|
||||
this.mContext = recyclerView.getContext();
|
||||
}
|
||||
|
||||
public void setData(List<GradleBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GradeAdapter.RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.grade_item, parent, false);
|
||||
return new GradeAdapter.RecyclerHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(GradeAdapter.RecyclerHolder holder, int position) {
|
||||
holder.title.setText("年级名称:" + list.get(position).getGroupName());
|
||||
holder.name.setText("年级ID:" + list.get(position).getGroupID());
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onClick.click(list.get(position).getGroupID());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class RecyclerHolder extends RecyclerView.ViewHolder {
|
||||
TextView title;
|
||||
TextView name;
|
||||
|
||||
private RecyclerHolder(View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClick onClick){
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
public interface OnClick{
|
||||
void click(String id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
package com.skipping.activity.list;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.libs.fragment.BaseActivity;
|
||||
import com.libs.network.CallBack;
|
||||
import com.libs.network.Concise;
|
||||
import com.libs.utils.LogUtil;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.activity.NetActivity;
|
||||
import com.skipping.activity.clasz.ClassActivity;
|
||||
import com.skipping.activity.detail.DetailActivity;
|
||||
import com.skipping.activity.grade.GradeAdapter;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.ActivityBean;
|
||||
import com.skipping.net.ActivityReqBean;
|
||||
import com.skipping.net.BaseBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
import com.skipping.utils.ErrorToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class ListActivity extends BaseActivity {
|
||||
private RecyclerView recyclerview;
|
||||
private Concise<API> concise;
|
||||
private ListAdapter listAdapter;
|
||||
|
||||
@Override
|
||||
protected Integer getContentViewResId() {
|
||||
return R.layout.activity_show;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
recyclerview = findViewById(R.id.recyclerview);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
String id = (String) getIntent().getBundleExtra("id").get("id");
|
||||
recyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
listAdapter = new ListAdapter(recyclerview);
|
||||
listAdapter.setOnClickListener(new ListAdapter.OnClick() {
|
||||
@Override
|
||||
public void click(String id) {
|
||||
Intent intent = new Intent(ListActivity.this, DetailActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("id", id);
|
||||
intent.putExtra("id", bundle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
recyclerview.setAdapter(listAdapter);
|
||||
|
||||
MMKV kv = MMKV.defaultMMKV();
|
||||
concise = new Concise<API>(Contants.BASE_URL) {
|
||||
}.addHeader("Token", kv.decodeString(Contants.TOKEN));
|
||||
ErrorToken.intercept(this, concise);
|
||||
ActivityReqBean bean = new ActivityReqBean();
|
||||
bean.setGenre(Contants.CLASS);
|
||||
bean.setActivityType("timing");
|
||||
bean.setGroupID(id);
|
||||
bean.setIndex(1);
|
||||
bean.setPageSize(10);
|
||||
bean.setStatus(Contants.UNFINISHED);
|
||||
LogUtil.e("提交",bean);
|
||||
concise.request(ListActivity.this, concise.api.getActivityList(bean), new CallBack<BaseBean<List<ActivityBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseBean<List<ActivityBean>> listBaseBean) {
|
||||
listAdapter.setData(listBaseBean.getData());
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package com.skipping.activity.list;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.skipping.R;
|
||||
import com.skipping.net.ActivityBean;
|
||||
import com.skipping.net.GradleBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/18/22
|
||||
*/
|
||||
public class ListAdapter extends RecyclerView.Adapter<ListAdapter.RecyclerHolder> {
|
||||
private OnClick onClick;
|
||||
private Context mContext;
|
||||
private List<ActivityBean> list = new ArrayList<>();
|
||||
|
||||
public ListAdapter(RecyclerView recyclerView) {
|
||||
this.mContext = recyclerView.getContext();
|
||||
}
|
||||
|
||||
public void setData(List<ActivityBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListAdapter.RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.list_item, parent, false);
|
||||
return new ListAdapter.RecyclerHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ListAdapter.RecyclerHolder holder, int position) {
|
||||
holder.title.setText("活动ID:" + list.get(position).getId() + "");
|
||||
holder.name.setText("活动名称:" + list.get(position).getName() + "");
|
||||
holder.orgid.setText("OrgID:" + list.get(position).getOrgID() + "");
|
||||
// holder.greadid.setText("GreadID:" + list.get(position).getGreadID() + "");
|
||||
holder.classid.setText("ClassID:" + list.get(position).getClassID() + "");
|
||||
holder.preson.setText("人数:" + list.get(position).getPersonNumber() + "");
|
||||
holder.status.setText("状态:" + list.get(position).getStatus() + "");
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onClick.click(list.get(position).getId() + "");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class RecyclerHolder extends RecyclerView.ViewHolder {
|
||||
TextView title, name, orgid, greadid, classid, preson, status;
|
||||
|
||||
private RecyclerHolder(View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
orgid = itemView.findViewById(R.id.orgid);
|
||||
greadid = itemView.findViewById(R.id.greadid);
|
||||
classid = itemView.findViewById(R.id.classid);
|
||||
preson = itemView.findViewById(R.id.preson);
|
||||
status = itemView.findViewById(R.id.status);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClick onClick) {
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
public interface OnClick {
|
||||
void click(String id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -10,9 +10,6 @@ import android.content.ServiceConnection;
|
|||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.libs.fragment.BaseApplication;
|
||||
import com.libs.network.CallBack;
|
||||
|
|
@ -23,10 +20,7 @@ import com.loop.loopminisdk.LoopDevice;
|
|||
import com.loop.loopminisdk.LoopHost;
|
||||
import com.loop.loopminisdk.LoopMessage;
|
||||
import com.loop.loopminisdk.LoopMini;
|
||||
import com.skipping.APP;
|
||||
import com.skipping.Contants;
|
||||
import com.skipping.R;
|
||||
import com.skipping.activity.HostActivity;
|
||||
import com.skipping.fragment.pair.DeviceBean;
|
||||
import com.skipping.net.API;
|
||||
import com.skipping.net.BaseBean;
|
||||
|
|
@ -37,11 +31,8 @@ import com.tencent.mmkv.MMKV;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MainActivity">
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/open"
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
<?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"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edittext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/button6" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="连接" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="连接" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获取数据" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="设备连接" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="设备断开连接" />
|
||||
</LinearLayout>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button5"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="156dp"
|
||||
android:text="连接手柄"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button6"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="224dp"
|
||||
android:text="断开手柄"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button7"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="46dp"
|
||||
android:text="获取电量"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button8"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="68dp"
|
||||
android:text="获取个数"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button9"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="136dp"
|
||||
android:text="定时计数"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button10"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="204dp"
|
||||
android:text="停止跳绳"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="121dp"
|
||||
android:layout_height="47dp"
|
||||
android:text="连接主机"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="打开配对模式"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button3"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="关闭配对模式"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button4"
|
||||
android:layout_width="141dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="88dp"
|
||||
android:text="配对手柄"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button2" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edittext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/button6" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<?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"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="登录" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="组织下对应年级map" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="年级下对应班级map" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="活动列表接口" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="活动创建接口" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="活动详情接口" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="活动成绩上传接口" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -3,8 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
tools:context=".activity.MainActivity">
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
<?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"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -6,8 +6,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp"
|
||||
tools:context=".activity.MainActivity">
|
||||
android:padding="20dp">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
Loading…
Reference in New Issue