This file contains hidden or 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
| // Entity | |
| data class Product( | |
| val id: String, | |
| val name: String, | |
| val price: Price, | |
| val isFavourite: Boolean | |
| ) { | |
| // Value object | |
| data class Price( | |
| val nowPrice: Double, |
This file contains hidden or 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
| package com.your.package | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import com.your.package.R | |
| import com.google.android.material.bottomsheet.BottomSheetDialog | |
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
| /** | |
| * BottomSheetDialog fragment that uses a custom |
This file contains hidden or 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
| public class RealPathUtil { | |
| public static String getRealPath(Context context, Uri fileUri) { | |
| String realPath; | |
| // SDK < API11 | |
| if (Build.VERSION.SDK_INT < 11) { | |
| realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri); | |
| } | |
| // SDK >= 11 && SDK < 19 | |
| else if (Build.VERSION.SDK_INT < 19) { |
This file contains hidden or 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
| package com.dexode.fragment; | |
| import android.annotation.TargetApi; | |
| import android.app.Activity; | |
| import android.os.Build; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.support.v4.app.Fragment; | |
| import android.view.KeyEvent; |