diff --git a/Labs/Lab5_UILabs/.gitignore b/Labs/Lab5_UILabs/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ceff37eff0e621e8f96607f26a6bced4727fb5a5 --- /dev/null +++ b/Labs/Lab5_UILabs/.gitignore @@ -0,0 +1,39 @@ +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/ +gen/ + +# Local configuration file (sdk path, etc) +local.properties + +# Eclipse project files +.classpath +.settings + +# Proguard folder generated by Eclipse +proguard/ + +# Intellij project files +*.iml +*.ipr +*.iws +.idea +.idea/workspace.xml +.gradle +build/ +captures/ + +# Mac files +.DS_Store + +# Windows thumbnail db +Thumbs.db diff --git a/Labs/Lab5_UILabs/Lab-UserInterface.pdf b/Labs/Lab5_UILabs/Lab-UserInterface.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8ab36f1025a4193fc1291d32175cd053262248d3 Binary files /dev/null and b/Labs/Lab5_UILabs/Lab-UserInterface.pdf differ diff --git a/Labs/Lab5_UILabs/UILabs.mp4 b/Labs/Lab5_UILabs/UILabs.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..fc2fff2a351ffffdb46aac00f207b41e93085e58 Binary files /dev/null and b/Labs/Lab5_UILabs/UILabs.mp4 differ diff --git a/Labs/Lab5_UILabs/app/build.gradle b/Labs/Lab5_UILabs/app/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..e4f43cfccddfd25afb1804bfdbd0cc56430f4fc2 --- /dev/null +++ b/Labs/Lab5_UILabs/app/build.gradle @@ -0,0 +1,40 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +android { + compileSdkVersion 31 +// buildToolsVersion '27.0.3' + + defaultConfig { + applicationId "course.labs.todomanager" + minSdkVersion 26 + targetSdkVersion 31 + + testApplicationId "course.labs.todomanager.tests" + testInstrumentationRunner "android.test.InstrumentationTestRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} + +dependencies { + implementation 'androidx.recyclerview:recyclerview:1.2.1' + androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3' + androidTestImplementation 'androidx.test:rules:1.4.1-alpha04' + androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' + implementation 'com.android.support:support-annotations:28.0.0' + implementation 'androidx.annotation:annotation:1.3.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha04' + androidTestImplementation 'androidx.test:rules:1.4.1-alpha04' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha04' +} +repositories { + mavenCentral() +} diff --git a/Labs/Lab5_UILabs/app/src/androidTest/res/drawable/.gitignore b/Labs/Lab5_UILabs/app/src/androidTest/res/drawable/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Labs/Lab5_UILabs/app/src/main/AndroidManifest.xml b/Labs/Lab5_UILabs/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..e6ac4a4f38ed7403a4c7dc30c62dd48226f86d34 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="course.labs.todomanager" + android:versionCode="1" + android:versionName="1.0" > + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" > + <activity + android:name=".ToDoManagerActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity android:name=".AddToDoActivity" > + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/AddToDoActivity.kt b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/AddToDoActivity.kt new file mode 100644 index 0000000000000000000000000000000000000000..18b79468417c0eed331ae19e2cf0f6c3f15992a9 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/AddToDoActivity.kt @@ -0,0 +1,250 @@ +package course.labs.todomanager + +import java.util.Calendar +import java.util.Date + +import android.app.DatePickerDialog +import android.app.Dialog +import androidx.fragment.app.DialogFragment +import android.app.TimePickerDialog +import android.content.Intent +import android.os.Bundle +import android.util.Log +import android.view.View +import android.widget.Button +import android.widget.DatePicker +import android.widget.EditText +import android.widget.RadioButton +import android.widget.RadioGroup +import android.widget.TextView +import android.widget.TimePicker + +import androidx.fragment.app.FragmentActivity +import course.labs.todomanager.ToDoItem.Priority +import course.labs.todomanager.ToDoItem.Status + +class AddToDoActivity : FragmentActivity() { + + private lateinit var mDate: Date + private lateinit var mPriorityRadioGroup: RadioGroup + private lateinit var mStatusRadioGroup: RadioGroup + private lateinit var mTitleText: EditText + private lateinit var mDefaultStatusButton: RadioButton + private lateinit var mDefaultPriorityButton: RadioButton + private lateinit var dateView: TextView + private lateinit var timeView: TextView + + private val priority: Priority + get() { + + return when (mPriorityRadioGroup.checkedRadioButtonId) { + R.id.lowPriority -> { + Priority.LOW + } + R.id.highPriority -> { + Priority.HIGH + } + else -> { + Priority.MED + } + } + } + + private val status: Status + get() { + + return when (mStatusRadioGroup.checkedRadioButtonId) { + R.id.statusDone -> { + Status.DONE + } + else -> { + Status.NOTDONE + } + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.add_todo) + + mTitleText = findViewById<View>(R.id.title) as EditText + mDefaultStatusButton = findViewById<View>(R.id.statusNotDone) as RadioButton + mDefaultPriorityButton = findViewById<View>(R.id.medPriority) as RadioButton + mPriorityRadioGroup = findViewById<View>(R.id.priorityGroup) as RadioGroup + mStatusRadioGroup = findViewById<View>(R.id.statusGroup) as RadioGroup + dateView = findViewById<View>(R.id.date) as TextView + timeView = findViewById<View>(R.id.time) as TextView + + // Set the default date and time + + setDefaultDateTime() + + // OnClickListener for the Date button, calls showDatePickerDialog() to + // show + // the Date dialog + + val datePickerButton = findViewById<View>(R.id.date_picker_button) as Button + datePickerButton.setOnClickListener { showDatePickerDialog() } + + // OnClickListener for the Time button, calls showTimePickerDialog() to + // show + // the Time Dialog + + val timePickerButton = findViewById<View>(R.id.time_picker_button) as Button + timePickerButton.setOnClickListener { showTimePickerDialog() } + + // OnClickListener for the Cancel Button, + + val cancelButton = findViewById<View>(R.id.cancelButton) as Button + cancelButton.setOnClickListener { + Log.i(TAG, "Entered cancelButton.OnClickListener.onClick()") + + // TODO - Indicate result and finish + } + + // TODO - Set up OnClickListener for the Reset Button + val resetButton = findViewById<View>(R.id.resetButton) as Button + resetButton.setOnClickListener { + Log.i(TAG, "Entered resetButton.OnClickListener.onClick()") + + // TODO - Reset data to default values + + } + + // Set up OnClickListener for the Submit Button + + val submitButton = findViewById<View>(R.id.submitButton) as Button + submitButton.setOnClickListener { + Log.i(TAG, "Entered submitButton.OnClickListener.onClick()") + + // TODO - gather ToDoItem data + + // Get Priority + + // Get Status + + // Title + + // Date + + // Package ToDoItem data into an Intent + + // TODO - return data Intent and finish + + } + } + + private fun setDefaultDateTime() { + + // Default is current time + 7 days + mDate = Date() + mDate = Date(mDate.time + SEVEN_DAYS) + + val c = Calendar.getInstance() + c.time = mDate + + setDateString(c.get(Calendar.YEAR), c.get(Calendar.MONTH), + c.get(Calendar.DAY_OF_MONTH)) + + dateView.text = dateString + + setTimeString(c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE)) + + timeView.text = timeString + } + + // DialogFragment used to pick a ToDoItem deadline date + + class DatePickerFragment : DialogFragment(), DatePickerDialog.OnDateSetListener { + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + + // Use the current date as the default date in the picker + val c = Calendar.getInstance() + val year = c.get(Calendar.YEAR) + val month = c.get(Calendar.MONTH) + val day = c.get(Calendar.DAY_OF_MONTH) + + // Create a new instance of DatePickerDialog and return it + return DatePickerDialog(requireActivity(), this, year, month, day) + } + + override fun onDateSet(view: DatePicker, year: Int, monthOfYear: Int, + dayOfMonth: Int) { + setDateString(year, monthOfYear, dayOfMonth) + val dateView: TextView = requireActivity().findViewById(R.id.date) + dateView.text = dateString + } + } + + // DialogFragment used to pick a ToDoItem deadline time + + class TimePickerFragment : DialogFragment(), TimePickerDialog.OnTimeSetListener { + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + + // Use the current time as the default values for the picker + val c = Calendar.getInstance() + val hour = c.get(Calendar.HOUR_OF_DAY) + val minute = c.get(Calendar.MINUTE) + + // Create a new instance of TimePickerDialog and return + return TimePickerDialog(activity, this, hour, minute, true) + } + + override fun onTimeSet(view: TimePicker, hourOfDay: Int, minute: Int) { + setTimeString(hourOfDay, minute) + val timeView: TextView = requireActivity().findViewById(R.id.time) + timeView.text = timeString + } + } + + private fun showDatePickerDialog() { + val newFragment = DatePickerFragment() + newFragment.show(supportFragmentManager, "datePicker") + } + + private fun showTimePickerDialog() { + val newFragment = TimePickerFragment() + newFragment.show(supportFragmentManager, "timePicker") + } + + companion object { + + // 7 days in milliseconds - 7 * 24 * 60 * 60 * 1000 + private const val SEVEN_DAYS = 604800000 + + private const val TAG = "Lab-UserInterface" + + private var timeString: String? = null + private var dateString: String? = null + + private fun setDateString(year: Int, monthOfYear: Int, dayOfMonth: Int) { + var localMonthOfYear = monthOfYear + + // Increment monthOfYear for Calendar/Date -> Time Format setting + localMonthOfYear++ + var mon = "" + localMonthOfYear + var day = "" + dayOfMonth + + if (localMonthOfYear < 10) + mon = "0$localMonthOfYear" + if (dayOfMonth < 10) + day = "0$dayOfMonth" + + dateString = "$year-$mon-$day" + } + + private fun setTimeString(hourOfDay: Int, minute: Int) { + var hour = "" + hourOfDay + var min = "" + minute + + if (hourOfDay < 10) + hour = "0$hourOfDay" + if (minute < 10) + min = "0$minute" + + timeString = "$hour:$min:00" + } + } +} diff --git a/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoItem.kt b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoItem.kt new file mode 100644 index 0000000000000000000000000000000000000000..77b7a42c9bf4e5d7c26bec4706aab133baba7a5a --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoItem.kt @@ -0,0 +1,86 @@ +package course.labs.todomanager + +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +import android.content.Intent + +class ToDoItem { + + var title : String? = String() + var priority : Priority = Priority.LOW + var status = Status.NOTDONE + var date = Date() + + enum class Priority { + LOW, MED, HIGH + } + + enum class Status { + NOTDONE, DONE + } + + internal constructor(title: String, priority: Priority, status: Status, date: Date) { + this.title = title + this.priority = priority + this.status = status + this.date = date + } + + // Create a new ToDoItem from data packaged in an Intent + + internal constructor(intent: Intent) { + + title = intent.getStringExtra(TITLE) + priority = Priority.valueOf(intent.getStringExtra(PRIORITY)!!) + status = Status.valueOf(intent.getStringExtra(STATUS)!!) + + date = try { + FORMAT.parse(intent.getStringExtra(DATE)!!)!! + } catch (e: ParseException) { + Date() + } + + } + + override fun toString(): String { + return (title + ITEM_SEP + priority + ITEM_SEP + status + ITEM_SEP + + FORMAT.format(date)) + } + + fun toLog(): String { + return ("Title:" + title + ITEM_SEP + "Priority:" + priority + + ITEM_SEP + "Status:" + status + ITEM_SEP + "Date:" + + FORMAT.format(date) + "\n") + } + + companion object { + + val ITEM_SEP: String? = System.getProperty("line.separator") + + const val TITLE = "title" + const val PRIORITY = "priority" + const val STATUS = "status" + const val DATE = "date" +// val FILENAME = "filename" + + val FORMAT = SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss", Locale.US) + + // Take a set of String data values and + // package them for transport in an Intent + + fun packageIntent(intent: Intent, title: String, + priority: Priority, status: Status, date: String) { + + intent.putExtra(TITLE, title) + intent.putExtra(PRIORITY, priority.toString()) + intent.putExtra(STATUS, status.toString()) + intent.putExtra(DATE, date) + + } + } + +} diff --git a/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoListAdapter.kt b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoListAdapter.kt new file mode 100644 index 0000000000000000000000000000000000000000..a13ad85a39752621ce292a4d3b7047f53c8da1da --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoListAdapter.kt @@ -0,0 +1,123 @@ +package course.labs.todomanager + + +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.* +import androidx.core.app.ActivityCompat.startActivityForResult +import androidx.recyclerview.widget.RecyclerView +import course.labs.todomanager.ToDoItem.Status + +class ToDoListAdapter(private val mContext: Context) : + RecyclerView.Adapter<ToDoListAdapter.ViewHolder>() { + + private val mItems = ArrayList<ToDoItem>() + + // Add a ToDoItem to the adapter + // Notify observers that the data set has changed + + fun add(item: ToDoItem) { + mItems.add(item) + notifyItemChanged(mItems.size) + } + + // Clears the list adapter of all items. + fun clear() { + mItems.clear() + notifyDataSetChanged() + } + + fun getItem(pos: Int): Any { + return mItems[pos - 1] + } + + // Returns the number of ToDoItems + + override fun getItemCount(): Int { + return mItems.size + 1 + } + + override fun getItemViewType(position: Int): Int { + return if (position==0) HEADER_VIEW_TYPE else TODO_VIEW_TYPE + } + + // Retrieve the number of ToDoItems + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + if (viewType == HEADER_VIEW_TYPE) { + val v = LayoutInflater.from(parent.context).inflate(R.layout.header_view, parent, false) + return ViewHolder(v) + } else { + val v = LayoutInflater.from(parent.context).inflate(R.layout.todo_item, parent, false) + val viewHolder = ViewHolder(v) + + // TODO - Inflate the View (defined in todo_item.xml) for this ToDoItem and store references in ViewHolder + + + return viewHolder + } + } + + override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) { + + if (position == 0) { + viewHolder.itemView.setOnClickListener { + Log.i(ToDoManagerActivity.TAG, "Entered footerView.OnClickListener.onClick()") + val options: Bundle? = null + startActivityForResult( + mContext as Activity, + Intent( + mContext, + AddToDoActivity::class.java + ), + ToDoManagerActivity.ADD_TODO_ITEM_REQUEST, + options + ) + } + } else { + val toDoItem = mItems[position - 1] + + Log.i(TAG, "onBindViewHolder " + viewHolder.mTitleView.toString()) + + viewHolder.mTitleView!!.text = toDoItem.title + + // Todo - Initialize statusView's isChecked property + + // TODO - Set up OnCheckedChangeListener CheckBox + + // TODO - Display Priority in a TextView + + + // TODO - Display Time and Date + + } + } + + // Get the ID for the ToDoItem + // In this case it's just the position + + override fun getItemId(pos: Int): Long { + return pos.toLong() - 1 + } + + class ViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) { + var mItemLayout: View = itemView + var mTitleView: TextView? = null + var mStatusView: CheckBox? = null + var mPriorityView: TextView? = null + var mDateView: TextView? = null + } + + companion object { + private const val TAG = "Lab-UserInterface" + private const val HEADER_VIEW_TYPE = R.layout.header_view + private const val TODO_VIEW_TYPE = R.layout.todo_item + } + + +} diff --git a/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoManagerActivity.kt b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoManagerActivity.kt new file mode 100644 index 0000000000000000000000000000000000000000..c6222c52f7e0ba4ca26e7609f77a5a99d27a172f --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/java/course/labs/todomanager/ToDoManagerActivity.kt @@ -0,0 +1,171 @@ +package course.labs.todomanager + +import android.app.Activity +import java.io.BufferedReader +import java.io.BufferedWriter +import java.io.FileNotFoundException +import java.io.IOException +import java.io.InputStreamReader +import java.io.OutputStreamWriter +import java.io.PrintWriter +import java.text.ParseException +import java.util.Date + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.util.Log +import android.view.Menu +import android.view.MenuItem +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import course.labs.todomanager.ToDoItem.Priority +import course.labs.todomanager.ToDoItem.Status + +class ToDoManagerActivity : Activity() { + + private lateinit var mAdapter: ToDoListAdapter + + public override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.recycle_view) + Log.i(TAG, "Entered onCreate()") + + // Todo - Create a new TodoListAdapter for this Activity's RecyclerView + + // Load saved ToDoItems + loadItemsFromFile() + + // TODO - Attach the adapter to this Activity's RecyclerView + + + + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + + Log.i(TAG, "Entered onActivityResult()") + + // TODO - Check result code and request code + // if user submitted a new ToDoItem + // Create a new ToDoItem from the data Intent + // and then add it to the adapter + + } + + // Do not modify below here + + public override fun onResume() { + super.onResume() + } + + override fun onPause() { + super.onPause() + // Save ToDoItems to file + saveItemsToFile() + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + super.onCreateOptionsMenu(menu) + + menu.add(Menu.NONE, MENU_DELETE, Menu.NONE, "Delete all") + menu.add(Menu.NONE, MENU_DUMP, Menu.NONE, "Dump to log") + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + MENU_DELETE -> { + mAdapter.clear() + true + } + MENU_DUMP -> { + dump() + true + } + else -> super.onOptionsItemSelected(item) + } + } + + private fun dump() { + for (i in 1 until mAdapter.itemCount) { + val data = (mAdapter.getItem(i) as ToDoItem).toLog() + Log.i(TAG, + "Item " + i + ": " + data.replace(ToDoItem.ITEM_SEP!!, ",")) + } + } + + // Load stored ToDoItems + private fun loadItemsFromFile() { + var reader: BufferedReader? = null + try { + val fis = openFileInput(FILE_NAME) + reader = BufferedReader(InputStreamReader(fis)) + + var title: String? + var priority: String? + var status: String? + var date: Date? + + do { + title = reader.readLine() + if (title == null) + break + priority = reader.readLine() + status = reader.readLine() + date = ToDoItem.FORMAT.parse(reader.readLine()) + mAdapter.add(ToDoItem(title, Priority.valueOf(priority), + Status.valueOf(status), date)) + + } + while (true) + + } catch (e: FileNotFoundException) { + e.printStackTrace() + } catch (e: IOException) { + e.printStackTrace() + } catch (e: ParseException) { + e.printStackTrace() + } finally { + if (null != reader) { + try { + reader.close() + } catch (e: IOException) { + e.printStackTrace() + } + + } + } + } + + // Save ToDoItems to file + private fun saveItemsToFile() { + var writer: PrintWriter? = null + try { + val fos = openFileOutput(FILE_NAME, Context.MODE_PRIVATE) + writer = PrintWriter(BufferedWriter(OutputStreamWriter( + fos))) + + for (idx in 1 until mAdapter.itemCount) { + + writer.println(mAdapter.getItem(idx)) + + } + } catch (e: IOException) { + e.printStackTrace() + } finally { + writer?.close() + } + } + + companion object { + + const val ADD_TODO_ITEM_REQUEST = 0 + private const val FILE_NAME = "TodoManagerActivityData.txt" + const val TAG = "Lab-UserInterface" + + // IDs for menu items + private const val MENU_DELETE = Menu.FIRST + private const val MENU_DUMP = Menu.FIRST + 1 + } +} \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/res/drawable-hdpi/ic_launcher.png b/Labs/Lab5_UILabs/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..0e79b184fcf8cc47dede6d7ccde00d1a1e2d9c23 Binary files /dev/null and b/Labs/Lab5_UILabs/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/Labs/Lab5_UILabs/app/src/main/res/drawable-ldpi/ic_launcher.png b/Labs/Lab5_UILabs/app/src/main/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..ebfac7d78b9e17c113f734d10af74bd2b100beba Binary files /dev/null and b/Labs/Lab5_UILabs/app/src/main/res/drawable-ldpi/ic_launcher.png differ diff --git a/Labs/Lab5_UILabs/app/src/main/res/drawable-mdpi/ic_launcher.png b/Labs/Lab5_UILabs/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..1183441937efcae0151b75099bec444d034886e9 Binary files /dev/null and b/Labs/Lab5_UILabs/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/Labs/Lab5_UILabs/app/src/main/res/drawable-xhdpi/ic_launcher.png b/Labs/Lab5_UILabs/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..c8ab2a114716b712ec0c5122f9e9524afaa60b52 Binary files /dev/null and b/Labs/Lab5_UILabs/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/Labs/Lab5_UILabs/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/Labs/Lab5_UILabs/app/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..c8ab2a114716b712ec0c5122f9e9524afaa60b52 Binary files /dev/null and b/Labs/Lab5_UILabs/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/Labs/Lab5_UILabs/app/src/main/res/layout/add_todo.xml b/Labs/Lab5_UILabs/app/src/main/res/layout/add_todo.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d4b7226bcf2e86120afc4a217b38dd803be61e3 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/layout/add_todo.xml @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + <TextView + android:id="@+id/TitleLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/title_string" + android:textAppearance="?android:attr/textAppearanceLarge" > + </TextView> + + <EditText + android:id="@+id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/TitleLabel" + android:ems="10" + android:hint="@string/enter_title_string" + android:inputType="textShortMessage" + android:importantForAutofill="no"> + + <requestFocus /> + </EditText> + + <!-- Status --> + + <TextView + android:id="@+id/status" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/title" + android:layout_marginTop="8dp" + android:text="@string/status_string" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <RadioGroup + android:id="@+id/statusGroup" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@id/status" + android:orientation="horizontal" > + + <RadioButton + android:id="@+id/statusDone" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/done_string" /> + + <RadioButton + android:id="@+id/statusNotDone" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:checked="true" + android:text="@string/not_done_string" /> + </RadioGroup> + + <!-- Priority --> + + <TextView + android:id="@+id/priority" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@id/statusGroup" + android:layout_marginTop="8dp" + android:text="@string/priority_string" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <RadioGroup + android:id="@+id/priorityGroup" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@id/priority" + android:orientation="horizontal" + android:text="@string/priority_string" > + + <RadioButton + android:id="@+id/lowPriority" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/priority_low_string" /> + + <RadioButton + android:id="@+id/medPriority" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:checked="true" + android:text="@string/priority_medium_string" /> + + <RadioButton + android:id="@+id/highPriority" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/priority_high_string" /> + </RadioGroup> + + <!-- Time and Date --> + + <TextView + android:id="@+id/time_and_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@id/priorityGroup" + android:layout_marginTop="8dp" + android:text="@string/time_and_date_string" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/time_and_date" + android:layout_marginTop="8dp" + android:text="@string/no_date_set_string" /> + + <TextView + android:id="@+id/time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_below="@+id/time_and_date" + android:layout_marginTop="8dp" + android:text="@string/no_time_set_string" /> + + <Button + android:id="@+id/date_picker_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_marginTop="8dp" + android:layout_below="@id/date" + android:text="@string/choose_date_string" /> + + <Button + android:id="@+id/time_picker_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_alignTop="@id/date_picker_button" + android:layout_below="@id/time" + android:layout_marginTop="8dp" + android:text="@string/choose_time_string" /> + + <!-- Buttons --> + + <Button + android:id="@+id/cancelButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignParentStart="true" + android:text="@string/cancel_string" /> + + <Button + android:id="@+id/resetButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:text="@string/reset_string" /> + + <Button + android:id="@+id/submitButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:text="@string/submit_string" /> + +</RelativeLayout> \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/res/layout/header_view.xml b/Labs/Lab5_UILabs/app/src/main/res/layout/header_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..2f32f172b06c5fb905852f6da84ff1c78b6a2f82 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/layout/header_view.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/footerView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:text="@string/add_new_todo_item_string" + android:textSize="24sp" > + +</TextView> \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/res/layout/recycle_view.xml b/Labs/Lab5_UILabs/app/src/main/res/layout/recycle_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..7c4c538df46b91f3767412c8aea60896c056dd2e --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/layout/recycle_view.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/list" + android:layout_width="match_parent" + android:layout_height="match_parent"> + +</androidx.recyclerview.widget.RecyclerView> \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/res/layout/todo_item.xml b/Labs/Lab5_UILabs/app/src/main/res/layout/todo_item.xml new file mode 100644 index 0000000000000000000000000000000000000000..96883d45536c85ef0bfbacf6e2f0d96791fa57b3 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/layout/todo_item.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/RelativeLayout1" + android:layout_width="match_parent" + android:layout_height="100dp" + android:orientation="vertical" > + + <TextView + android:id="@+id/titleView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/StatusLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/statusCheckBox" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginTop="17dp" + android:text="@string/done_string" > + </TextView> + + <CheckBox + android:id="@+id/statusCheckBox" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginStart="0dp" + android:layout_marginTop="26dp" + android:layout_toEndOf="@+id/StatusLabel" /> + + <TextView + android:id="@+id/PriorityLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/statusCheckBox" + android:layout_alignTop="@+id/StatusLabel" + android:layout_toStartOf="@+id/priorityView" + android:text="@string/priority_string" > + </TextView> + + <TextView + android:id="@+id/priorityView" + android:layout_width="50dip" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/statusCheckBox" + android:layout_alignParentEnd="true" + android:layout_alignTop="@+id/StatusLabel" > + </TextView> + + <TextView + android:id="@+id/DateLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/statusCheckBox" + android:text="@string/date_string" > + </TextView> + + <TextView + android:id="@+id/dateView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/DateLabel" + android:layout_toEndOf="@+id/DateLabel" > + </TextView> + +</RelativeLayout> \ No newline at end of file diff --git a/Labs/Lab5_UILabs/app/src/main/res/values-sw600dp/dimens.xml b/Labs/Lab5_UILabs/app/src/main/res/values-sw600dp/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..44f01db75f0fef18081132a9e86517f8d5efa8f6 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/values-sw600dp/dimens.xml @@ -0,0 +1,8 @@ +<resources> + + <!-- + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw600dp devices (e.g. 7" tablets) here. + --> + +</resources> diff --git a/Labs/Lab5_UILabs/app/src/main/res/values-sw720dp-land/dimens.xml b/Labs/Lab5_UILabs/app/src/main/res/values-sw720dp-land/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3a17b7ac019232caa63d0b0849f42f43be32646 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/values-sw720dp-land/dimens.xml @@ -0,0 +1,8 @@ +<resources> + + <!-- + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. + --> + +</resources> diff --git a/Labs/Lab5_UILabs/app/src/main/res/values/dimens.xml b/Labs/Lab5_UILabs/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e9ce62a515ae5d1c761ff9bbad6b8291a65da36 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ +<resources> + + <!-- Default screen margins, per the Android Design guidelines. --> + +</resources> diff --git a/Labs/Lab5_UILabs/app/src/main/res/values/strings.xml b/Labs/Lab5_UILabs/app/src/main/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6e324c6d983b4ff744f859a1fdeced4bd1b6897 --- /dev/null +++ b/Labs/Lab5_UILabs/app/src/main/res/values/strings.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">UILabs</string> + <string name="done_string">Done:</string> + <string name="priority_string">Priority:</string> + <string name="date_string">Date:</string> + <string name="add_new_todo_item_string">Add New ToDo Item</string> + <string name="title_string">Title</string> + <string name="status_string">Status</string> + <string name="not_done_string">Not Done</string> + <string name="priority_low_string">Low</string> + <string name="priority_medium_string">Medium</string> + <string name="priority_high_string">High</string> + <string name="time_and_date_string">Time and Date</string> + <string name="no_date_set_string">0000–00–00</string> + <string name="no_time_set_string">00:00:00</string> + <string name="choose_date_string">Choose Date</string> + <string name="choose_time_string">Choose Time</string> + <string name="cancel_string">Cancel</string> + <string name="reset_string">Reset</string> + <string name="submit_string">Submit</string> + <string name="enter_title_string">Enter Title</string> + +</resources> diff --git a/Labs/Lab5_UILabs/build.gradle b/Labs/Lab5_UILabs/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..3631141b2bff4c8def27daa4a47b58e875589759 --- /dev/null +++ b/Labs/Lab5_UILabs/build.gradle @@ -0,0 +1,29 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + mavenCentral() + google() + } + dependencies { + classpath 'com.android.tools.build:gradle:7.1.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + + + +allprojects { + repositories { + mavenCentral() + google() + } +} diff --git a/Labs/Lab5_UILabs/gradle.properties b/Labs/Lab5_UILabs/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..5465fec0ecadbf086fce0db92293c8f1d5f720ff --- /dev/null +++ b/Labs/Lab5_UILabs/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.jar b/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..13372aef5e24af05341d49695ee84e5f9b594659 Binary files /dev/null and b/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.properties b/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..2e85710c28c2071e280f5dd642afaba70378fd4a --- /dev/null +++ b/Labs/Lab5_UILabs/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Feb 25 02:41:38 EST 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/Labs/Lab5_UILabs/gradlew b/Labs/Lab5_UILabs/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..9d82f78915133e1c35a6ea51252590fb38efac2f --- /dev/null +++ b/Labs/Lab5_UILabs/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/Labs/Lab5_UILabs/gradlew.bat b/Labs/Lab5_UILabs/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..8a0b282aa6885fb573c106b3551f7275c5f17e8e --- /dev/null +++ b/Labs/Lab5_UILabs/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/Labs/Lab5_UILabs/settings.gradle b/Labs/Lab5_UILabs/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..e7b4def49cb53d9aa04228dd3edb14c9e635e003 --- /dev/null +++ b/Labs/Lab5_UILabs/settings.gradle @@ -0,0 +1 @@ +include ':app'