| | |
| | | import com.lotaai.canguiayw.common.HttpLoggerInterceptor; |
| | | import com.lotaai.canguiayw.common.HttpUrlDefine; |
| | | import com.lotaai.canguiayw.common.SettingConfig; |
| | | import com.lotaai.canguiayw.device.CanGuiCommand; |
| | | import com.lotaai.canguiayw.device.DeviceMessage; |
| | | import com.lotaai.canguiayw.device.DeviceType; |
| | | import com.lotaai.canguiayw.device.MessageType; |
| | | import com.lotaai.canguiayw.device.service.CanGuiService; |
| | | import com.lotaai.canguiayw.mqtt.MyMQTTService; |
| | | import com.pranavpandey.android.dynamic.toasts.DynamicToast; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | import okhttp3.RequestBody; |
| | | import okhttp3.Response; |
| | | |
| | | /* 262743 员工号*/ |
| | | public class MainActivity extends AppCompatActivity { |
| | | private Context context; |
| | | private ImageView logoView; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | |
| | | LogUtils.i("VERSION.SDK_INT:" +VERSION.SDK_INT); |
| | | logoView = findViewById(R.id.logo); |
| | | context = MainActivity.this; |
| | | |
| | | /*new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | while (true){ |
| | | |
| | | try { |
| | | Thread.sleep(2000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | |
| | | } |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | DynamicToast.makeSuccess(getApplicationContext(), "测试!", 3).show(); |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }).start();*/ |
| | | |
| | | Intent startIntent = new Intent(context, CanGuiService.class); |
| | | startService(startIntent); |
| | | Intent startMqttIntent = new Intent(context, MyMQTTService.class); |
| | | startService(startMqttIntent); |
| | | |
| | | login(); |
| | | |
| | | logoView.setOnLongClickListener(new View.OnLongClickListener() { |
| | | /* */ |
| | | /* Intent startMqttIntent = new Intent(context, MyMQTTService.class); |
| | | startService(startMqttIntent);*/ |
| | | // login(); |
| | | /* logoView.setOnLongClickListener(new View.OnLongClickListener() { |
| | | @Override |
| | | public boolean onLongClick(View view) { |
| | | Intent intent = new Intent(); |
| | |
| | | startActivity(intent); |
| | | return true; |
| | | } |
| | | }); |
| | | });*/ |
| | | // testData(); |
| | | } |
| | | |
| | |
| | | // startActivity(intent); |
| | | } |
| | | |
| | | |
| | | public void putIn(View view) { |
| | | Intent intent = new Intent(); |
| | | intent.putExtra("type",1); |
| | | intent.setClass(MainActivity.this, CheckUserIdActivity.class); |
| | | startActivity(intent); |
| | | } |
| | | |
| | | public void take(View view){ |
| | | Intent intent = new Intent(); |
| | | intent.setClass(MainActivity.this, TakeActivity.class); |
| | | startActivity(intent); |
| | | } |
| | | |
| | | public void putIn(View view){ |
| | | Intent intent = new Intent(); |
| | | intent.setClass(MainActivity.this, ManageActivity.class); |
| | | startActivity(intent); |
| | | } |
| | | |
| | | public void login() { |
| | |
| | | } |
| | | }; |
| | | |
| | | public void toset(View view) { |
| | | Intent intent = new Intent(); |
| | | intent.setClass(MainActivity.this, ManageActivity.class); |
| | | startActivity(intent); |
| | | } |
| | | } |