-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from ParkSangGwon/feature/context-application
Using application's context in ToastUtil
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tedimagepicker/src/main/java/gun0912/tedimagepicker/util/TedImagePickerContentProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package gun0912.tedimagepicker.util | ||
|
||
import android.app.Application | ||
import android.content.ContentProvider | ||
import android.content.ContentValues | ||
import android.database.Cursor | ||
import android.net.Uri | ||
|
||
class TedImagePickerContentProvider : ContentProvider() { | ||
override fun onCreate(): Boolean { | ||
ToastUtil.context = context as Application | ||
return true | ||
} | ||
|
||
override fun insert(uri: Uri, values: ContentValues?): Uri? { | ||
throw UnsupportedOperationException() | ||
} | ||
|
||
override fun query( | ||
uri: Uri, | ||
projection: Array<out String>?, | ||
selection: String?, | ||
selectionArgs: Array<out String>?, | ||
sortOrder: String? | ||
): Cursor? { | ||
throw UnsupportedOperationException() | ||
} | ||
|
||
override fun update( | ||
uri: Uri, | ||
values: ContentValues?, | ||
selection: String?, | ||
selectionArgs: Array<out String>? | ||
): Int { | ||
throw UnsupportedOperationException() | ||
} | ||
|
||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int { | ||
throw UnsupportedOperationException() | ||
} | ||
|
||
override fun getType(uri: Uri): String { | ||
throw UnsupportedOperationException() | ||
} | ||
} |