Skip to content

Commit

Permalink
fixed bug: null in context menu of top fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzmitry-Lakisau committed Sep 29, 2018
1 parent 292f552 commit 3da7b5c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {

defaultConfig {
applicationId "by.d1makrat.library_fm"
versionCode 11
versionName "2.2.1"
versionCode 12
versionName "2.2.2"
minSdkVersion 15
targetSdkVersion 27
buildConfigField("String", "API_KEY", API_KEY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import by.d1makrat.library_fm.ui.CenteredToast

class TopArtistsFragment : TopItemsFragment<TopArtist>() {

override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo) {
override fun onCreateContextMenu(menu: ContextMenu?, v: View?, menuInfo: ContextMenu.ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo)

menu.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_ARTIST, 0, R.string.scrobbles_of_artist)
menu?.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_ARTIST, 0, R.string.scrobbles_of_artist)
}

override fun onContextItemSelected(item: MenuItem?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import by.d1makrat.library_fm.ui.CenteredToast

class TopTracksFragment : TopItemsFragment<TopTrack>() {

override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo) {
override fun onCreateContextMenu(menu: ContextMenu?, v: View?, menuInfo: ContextMenu.ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo)

menu.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_ARTIST, 0, R.string.scrobbles_of_artist)
menu.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_TRACK, 1, R.string.scrobbles_of_track)
menu?.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_ARTIST, 0, R.string.scrobbles_of_artist)
menu?.add(mPeriod.hashCode(), TopItemsFragment.MENU_SCROBBLES_OF_TRACK, 1, R.string.scrobbles_of_track)
}

override fun onContextItemSelected(item: MenuItem?): Boolean {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.2'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
classpath 'io.fabric.tools:gradle:1.25.4'
Expand Down

0 comments on commit 3da7b5c

Please sign in to comment.