Skip to content

Commit

Permalink
update: add source code item in nav drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal2376 committed Jun 21, 2023
1 parent 24dc27f commit e10ff2d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/src/main/java/com/vishal2376/gitcoach/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ class MainActivity : AppCompatActivity() {
R.id.itemShareApp -> {
shareApp()
}

R.id.itemSourceCode -> {
sourceCode()
}
}
true
}
Expand Down Expand Up @@ -140,8 +144,7 @@ class MainActivity : AppCompatActivity() {

notificationSwitch.text = getString(R.string.daily_notification, reminderTime)

Toast.makeText(this, "Notification Enabled", Toast.LENGTH_SHORT)
.show()
Toast.makeText(this, "Notification Enabled", Toast.LENGTH_SHORT).show()
}, currentHour, currentMinute, false
)

Expand Down Expand Up @@ -221,4 +224,11 @@ class MainActivity : AppCompatActivity() {

}

private fun sourceCode() {
val intent = Intent(
Intent.ACTION_VIEW, Uri.parse(Constants.GITHUB_LINK)
)
startActivity(intent)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ object Constants {
var shareMessage =
"Become a Git expert with Git Coach! Learn Git and GitHub commands with ease. Download now\n"

const val GITHUB_LINK = "https://github.com/vishal2376/git-coach"

// Daily Notification
const val NOTIFICATION = "Notification"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/menu/nav_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
android:icon="@drawable/ic_share"
android:title="@string/share_app" />

<item
android:id="@+id/itemSourceCode"
android:icon="@drawable/ic_code"
android:title="@string/source_code" />


</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
<string name="close">close</string>
<string name="example">Example</string>
<string name="daily_notification">Daily Notification (%1$s)</string>
<string name="source_code">Source Code</string>
</resources>

0 comments on commit e10ff2d

Please sign in to comment.