Commit f24032fb authored by alaskalinuxuser's avatar alaskalinuxuser

Added continuous alarm option.

parent bb1ebbf0
This diff is collapsed.
......@@ -7,8 +7,8 @@ android {
applicationId "com.alaskalinuxuser.hourglass"
minSdkVersion 15
targetSdkVersion 24
versionCode 7
versionName "1.7"
versionCode 8
versionName "1.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
......@@ -41,7 +41,7 @@ public class MainActivity extends AppCompatActivity {
// Define the imageView.
ImageView myHourGlass;
ImageView vibe, recure;
ImageView vibe, recure, alre;
// Define the sound choice button.
Button soundChoices;
// Define the media player.
......@@ -57,7 +57,7 @@ public class MainActivity extends AppCompatActivity {
// Define the strings.
String minutes, seconds, mi, se, theButton;
// Declare our boolean.
boolean vibrateYes, recureYes;
boolean vibrateYes, recureYes, alreYes;
// Declare the manual time string and edittext box.
String manualTime;
EditText manualText;
......@@ -204,11 +204,18 @@ public class MainActivity extends AppCompatActivity {
startCount(recureTime, countBy);
} else {
// Cancel the notification.
mNotificationManager.cancel(0);
// Set the time bar back to usable.
timeBar.setEnabled(true);
if (alreYes) {
startCount(2000,1000);
} else {
// Cancel the notification.
mNotificationManager.cancel(0);
// Set the time bar back to usable.
timeBar.setEnabled(true);
}
// Set the time.
timeGoing.setText("00:00");
......@@ -217,6 +224,7 @@ public class MainActivity extends AppCompatActivity {
Toast timeUp = Toast.makeText(getApplicationContext(), "Time is up!",
Toast.LENGTH_LONG);
timeUp.show();
}
}
};
......@@ -268,6 +276,9 @@ public class MainActivity extends AppCompatActivity {
recureYes = false;
recure = (ImageView) findViewById(R.id.recurView);
recure.setImageResource(R.drawable.notrecur);
alreYes = false;
alre = (ImageView) findViewById(R.id.alreView);
alre.setImageResource(R.drawable.noalarmrecur);
// Define the manual entry layout view.
manualEntryLayout = (LinearLayout) findViewById(R.id.manEntryLayout);
......@@ -399,6 +410,26 @@ public class MainActivity extends AppCompatActivity {
}
public void alreChoice (View alreView) {
if (alreYes) {
// Set the boolean.
alreYes = false;
// Set the image.
alre.setImageResource(R.drawable.noalarmrecur);
} else {
// Set the boolean.
alreYes = true;
// Set the image.
alre.setImageResource(R.drawable.alarmrecur);
}
}
// When we click on the text for manual entry.
public void manualEntry (View manView) {
......
......@@ -89,6 +89,15 @@
android:layout_alignRight="@+id/timerView"
android:layout_alignEnd="@+id/timerView" />
<ImageView
android:id="@+id/alreView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/vibView"
android:onClick="alreChoice"
android:layout_centerHorizontal="true"
app:srcCompat="@drawable/noalarmrecur" />
<ImageView
android:id="@+id/recurView"
android:layout_width="wrap_content"
......@@ -105,7 +114,8 @@
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
android:gravity="top|center"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/textView"
......@@ -142,4 +152,5 @@
android:text="@string/explain"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment