Added Accept Alarm button to main screen as it is hard to find in the menu.
This commit is contained in:
@@ -57,6 +57,7 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@@ -130,6 +131,19 @@ public class MainActivity extends Activity
|
|||||||
Log.v(TAG,"menubar fiddle exception: "+e.toString());
|
Log.v(TAG,"menubar fiddle exception: "+e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force the screen to stay on when the app is running
|
||||||
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
|
||||||
|
// Deal with the 'AcceptAlarm Button'
|
||||||
|
Button button = (Button) findViewById(R.id.acceptAlarmButton);
|
||||||
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.v(TAG, "acceptAlarmButton.onClick()");
|
||||||
|
if (mBound) {
|
||||||
|
mSdServer.acceptAlarm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// start timer to refresh user interface every second.
|
// start timer to refresh user interface every second.
|
||||||
Timer uiTimer = new Timer();
|
Timer uiTimer = new Timer();
|
||||||
|
|||||||
@@ -94,6 +94,12 @@
|
|||||||
android:text="battTv"
|
android:text="battTv"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Accept Alarm"
|
||||||
|
android:id="@+id/acceptAlarmButton" />
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
android:id="@+id/chart1"
|
android:id="@+id/chart1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user