lzh
3 days ago 9e3ee0fb3332f604000c20863cece6a09ad23f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.nodka.zysjtest;
 
import android.content.Intent;
import android.os.Bundle;
 
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
 
import java.util.Arrays;
import java.util.List;
 
public class MainActivity extends AppCompatActivity {
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        RecyclerView menuRecyclerView = findViewById(R.id.menu_recycler_view);
        menuRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        menuRecyclerView.setAdapter(new MenuAdapter(getMenuItems(), item ->
                startActivity(new Intent(this, item.activityClass))));
    }
 
    private List<MenuItem> getMenuItems() {
        return Arrays.asList(
                new MenuItem("显示控制接口测试", "Display API Test", DisplayActivity.class),
                new MenuItem("网络控制接口测试", "Network API Test", NetworkActivity.class),
                new MenuItem("WiFi控制接口测试", "WiFi API Test", WifiActivity.class),
                new MenuItem("GPIO控制接口测试", "GPIO API Test", GpioActivity.class),
                new MenuItem("系统控制接口测试", "System API Test", SystemActivity.class),
                new MenuItem("应用管理接口测试", "App Management API Test", AppControlActivity.class),
                new MenuItem("热点控制接口测试", "Hotspot API Test", HotspotActivity.class),
                new MenuItem("白名单接口测试", "White List API Test", WhiteListActivity.class),
                new MenuItem("开机自启接口测试", "Launcher API Test", LauncherActivity.class),
                new MenuItem("应用保活接口测试", "Keep Alive API Test", KeepAliveActivity.class),
                new MenuItem("看门狗接口测试", "Watch Dog API Test", WatchDogActivity.class)
        );
    }
}