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
🎉 Merged PR #10 in furkanaskin/activity-box | |
🎉 Merged PR #9 in furkanaskin/activity-box | |
❗️ Closed issue #10 in furkanaskin/ClickablePieChart | |
🗣 Commented on #10 in furkanaskin/ClickablePieChart |
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
class DataSenderFragment : Fragment() { | |
// some stuff.. | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
// Set data | |
findNavController().getBackStackEntry(R.id.gamesFragment).savedStateHandle.set("myData", "Test") | |
} | |
} |
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
class BottomSheetSampleFragment : BaseBottomSheetFragment() { | |
private var _binding: FragmentBottomSheetSampleBinding? = null | |
private val binding get() = _binding!! | |
val timerTotal = 600000L // 10 Min | |
lateinit var timer: CountDownTimer | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog |
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
class BottomSheetSampleFragment : BaseBottomSheetFragment() { | |
private var _binding: FragmentBottomSheetSampleBinding? = null | |
private val binding get() = _binding!! | |
val timerTotal = 600000L // 10 Min | |
lateinit var timer: CountDownTimer | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog |
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
//navigation | |
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0-alpha05' | |
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0-alpha05' |
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
class BottomSheetSampleFragment : BaseBottomSheetFragment() { | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog | |
dialog.setOnShowListener { | |
val bottomSheet = | |
(it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout? | |
val behavior = BottomSheetBehavior.from(bottomSheet!!) | |
behavior.state = BottomSheetBehavior.STATE_EXPANDED | |
behavior.isDraggable = false |
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
open class BaseBottomSheetFragment : BottomSheetDialogFragment() { | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
val dialog = super.onCreateDialog(savedInstanceState) | |
if (dialog.window != null) { | |
dialog.window!!.setGravity(Gravity.BOTTOM) | |
dialog.window!!.setBackgroundDrawableResource(android.R.color.transparent) | |
dialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) | |
dialog.setCancelable(false) | |
} | |
return dialog |
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
binding.buttonDynamicTitleNavigate.setOnClickListener { | |
navigateWithAction( | |
SearchFragmentDirections.actionSearchFragmentToDynamicTitleFragment( | |
binding.editTextTitle.text.toString() | |
) | |
) | |
} |
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
binding.toolbar.setNavigationOnClickListener { | |
when (navController.currentDestination?.id) { | |
R.id.searchFragment, R.id.gamesFragment, R.id.notificationsFragment -> { | |
if (onBackPressedDispatcher.hasEnabledCallbacks()) | |
onBackPressedDispatcher.onBackPressed() | |
else | |
navController.navigateUp() | |
} | |
else -> navController.navigateUp() | |
} |
NewerOlder