File tree Expand file tree Collapse file tree 8 files changed +61
-9
lines changed
java/com/appleobject/notekeeper Expand file tree Collapse file tree 8 files changed +61
-9
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ android {
1313 versionCode 1
1414 versionName " 1.0"
1515
16+ vectorDrawables. useSupportLibrary = true
1617 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
1718 }
1819
Original file line number Diff line number Diff line change 1010 android : supportsRtl =" true"
1111 android : theme =" @style/AppTheme" >
1212 <activity
13- android : name =" .MainActivity "
14- android : label =" @string/app_name "
13+ android : name =" .NoteListActivity "
14+ android : label =" @string/title_activity_note_list "
1515 android : theme =" @style/AppTheme.NoActionBar" >
1616 <intent-filter >
1717 <action android : name =" android.intent.action.MAIN" />
1818
1919 <category android : name =" android.intent.category.LAUNCHER" />
2020 </intent-filter >
2121 </activity >
22+ <activity
23+ android : name =" .MainActivity"
24+ android : label =" @string/edit_note_activity"
25+ android : theme =" @style/AppTheme.NoActionBar" />
2226 </application >
2327
2428</manifest >
Original file line number Diff line number Diff line change @@ -17,9 +17,8 @@ class MainActivity : AppCompatActivity() {
1717 setContentView(R .layout.activity_main)
1818 setSupportActionBar(findViewById(R .id.toolbar))
1919
20- val dm = DataManager ()
2120 val adapterCourses = ArrayAdapter <CourseInfo >(this ,
22- android.R .layout.simple_spinner_item, dm .courses.values.toList())
21+ android.R .layout.simple_spinner_item, DataManager .courses.values.toList())
2322 adapterCourses.setDropDownViewResource(android.R .layout.simple_spinner_dropdown_item)
2423 spinnerCourses.adapter = adapterCourses
2524
Original file line number Diff line number Diff line change 1+ package com.appleobject.notekeeper
2+
3+ import android.content.Intent
4+ import android.os.Bundle
5+ import com.google.android.material.floatingactionbutton.FloatingActionButton
6+ import com.google.android.material.snackbar.Snackbar
7+ import androidx.appcompat.app.AppCompatActivity
8+ import kotlinx.android.synthetic.main.activity_note_list.*
9+
10+ class NoteListActivity : AppCompatActivity () {
11+
12+ override fun onCreate (savedInstanceState : Bundle ? ) {
13+ super .onCreate(savedInstanceState)
14+ setContentView(R .layout.activity_note_list)
15+ setSupportActionBar(findViewById(R .id.toolbar))
16+
17+ fabNoteList.setOnClickListener { view ->
18+ val activityIntent = Intent (this , MainActivity ::class .java)
19+ startActivity(activityIntent)
20+ }
21+ }
22+ }
Original file line number Diff line number Diff line change 11package com.appleobject.notekeeper.model
22
3- class DataManager {
3+ object DataManager {
44 val courses = HashMap <String , CourseInfo >()
55 val notes = ArrayList <NoteInfo >()
66
77 init {
88 initializeCourses()
9+ initializeNotes()
910 }
1011
1112 private fun initializeCourses (){
@@ -21,4 +22,8 @@ class DataManager {
2122 course = CourseInfo (" java_core" , " Java Fundamentals: The Core Platform" )
2223 courses.set(course.courseId, course)
2324 }
25+
26+ private fun initializeNotes (){
27+
28+ }
2429}
Original file line number Diff line number Diff line change 1+ <vector android : height =" 24dp" android : tint =" #FFFFFF"
2+ android : viewportHeight =" 24" android : viewportWidth =" 24"
3+ android : width =" 24dp" xmlns : android =" http://schemas.android.com/apk/res/android" >
4+ <path android : fillColor =" @android:color/white" android : pathData =" M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
5+ </vector >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <androidx .constraintlayout.widget.ConstraintLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3+ xmlns : app =" http://schemas.android.com/apk/res-auto"
4+ xmlns : tools =" http://schemas.android.com/tools"
5+ android : layout_width =" match_parent"
6+ android : layout_height =" match_parent"
7+ app : layout_behavior =" @string/appbar_scrolling_view_behavior" >
8+
9+ <ListView
10+ android : id =" @+id/listNote"
11+ android : layout_width =" 0dp"
12+ android : layout_height =" 0dp"
13+ app : layout_constraintBottom_toBottomOf =" parent"
14+ app : layout_constraintEnd_toEndOf =" parent"
15+ app : layout_constraintStart_toStartOf =" parent"
16+ app : layout_constraintTop_toTopOf =" parent" />
17+ </androidx .constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change 22 <string name =" app_name" >NoteKeeper</string >
33 <string name =" action_settings" >Settings</string >
44 <!-- Strings used for fragments for navigation -->
5- <string name =" first_fragment_label" >First Fragment</string >
6- <string name =" second_fragment_label" >Second Fragment</string >
75 <string name =" next" >Next</string >
86 <string name =" previous" >Previous</string >
97
10- <string name =" hello_first_fragment" >Hello first fragment</string >
11- <string name =" hello_second_fragment" >Hello second fragment. Arg: %1$s</string >
8+
129 <string name =" note_title" >Note title</string >
1310 <string name =" note_text" >Note text</string >
11+ <string name =" title_activity_note_list" >NoteKeeper</string >
12+ <string name =" edit_note_activity" >Edit Note</string >
1413</resources >
You can’t perform that action at this time.
0 commit comments