3/10/2024 0 Comments Android create sqlite databaseAdd another menu resource (in the same folder) called menu_deadlines_context.Within the newly added file add a single menu item with the title "Edit Modules" and the id "menu_edit_modules".Add a new menu resource file within that new folder called menu_settings.This will be the menu on the toolbar which allows the user to modify existing modules Next add a new resource directory called 'menu' to the res folder.Setup view binding for this activity also.Switch to the corresponding Kotlin file and add methods for both buttons' onClick values (each taking a parameter of type View), with no implementation.The final button should have an id of "btnAdd" and an onClick value of "addAssignment".Add an attribute named "android:datePickerMode" to the DatePicker and set its value to "spinner".The id of the DatePicker should be 'datePicker'.The Weight Edit text should be configured with the 'number' input type.The ids for the EditText elements should be 'etTitle' and 'etWeight' respectively.The first button does not need an id, but should have an onClick value of "addModule".The id for the Spinner should be 'spinner'.This will be used to add a new assignment deadlineĪdd the following elements to the screen, laying them out as shown: Spinner, Button, EditText, EditText, DatePicker, Button Add another empty activity called AssignmentDetailsActivity.In onCreate set an onClickListener for the button to it calls the addModule method.Switch to the corresponding Kotlin file for the activity, and add an empty function called addModule.Set the text view to the full with of the activity (Again with an 8dp margin).Set the text size for each of the edit text elements to 18sp, and set them to the full width of the activity (with a 8dp margin all round).An EditText with the id of 'etTitle', and the hint as "Module Name" (again make it a String resource). ![]() CO5225" (convert the String to a String resource) An EditText with the id of 'etCode', and the hint as "Module Code e.g.The layout for this should consist of the following elements, one below each other in the following order: Setup view binding, again naming the binding binding.This will be used to add and edit the details relating to an individual module Add a new empty activity named ModuleDetailActivity.Open the associated xml file and add a ListView so it fills the screen (set width and height to match_parent).Setup a view binding named binding for this in the usual way, note that the binding class will be called ActivityModuleListBinding.This will be used to display a list of modules which a used can select to edit Add a new empty activity named ModuleListActivity. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |