1 package com.example.lede2;
\r
3 import android.content.Context;
\r
4 import android.content.Intent;
\r
5 import android.os.Bundle;
\r
6 import android.support.v7.app.AppCompatActivity;
\r
7 import android.util.Log;
\r
8 import android.view.View;
\r
9 import android.view.inputmethod.InputMethodManager;
\r
10 import android.widget.Button;
\r
13 * Created by Brian on 2/16/2018.
\r
16 public class AllInstallOptions extends AppCompatActivity implements View.OnClickListener,
\r
17 View.OnFocusChangeListener {
\r
18 Button installOneDeviceButton;
\r
19 Button installCommPatternButton;
\r
20 Button installTwoDevicesAndCommPattern;
\r
21 Button installAddress;
\r
22 Button installDeviceAddress;
\r
23 Button installZigbeeDeviceAddress;
\r
27 protected void onCreate(Bundle savedInstanceState) {
\r
28 super.onCreate(savedInstanceState);
\r
29 setContentView(R.layout.install_options);
\r
31 installOneDeviceButton = (Button) findViewById(R.id.doneDrivers);
\r
32 installZigbeeDeviceAddress = (Button) findViewById(R.id.install_zigbee_device_address);
\r
33 installOneDeviceButton.setOnClickListener(this);
\r
34 installZigbeeDeviceAddress.setOnClickListener(this);
\r
39 public void onClick(View view) {
\r
40 if (view == installOneDeviceButton) {
\r
41 Log.d("CLICKING", "Clicking on add device!");
\r
42 startActivity(new Intent(this, AddDeviceActivity.class));
\r
44 if (view == installZigbeeDeviceAddress) {
\r
45 Log.d("CLICKING", "Clicking on install zigbee!");
\r
46 startActivity(new Intent(this, InstallZigbeeDeviceAddress.class));
\r
51 public void onFocusChange(View view, boolean hasFocus) {
\r
52 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
\r
54 imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
\r
56 imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
\r