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
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
btn_open_screen_two.setOnClickListener { | |
findNavController().safeNavigate(FragmentOneDirections.actionFragmentOneToFragmentTwo()) | |
} | |
btn_double_click.setOnClickListener { | |
performDoubleClick() | |
} |
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
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
btn_open_screen_two.setOnClickListener { | |
findNavController().safeNavigate(FragmentOneDirections.actionFragmentOneToFragmentTwo()) | |
} | |
btn_double_click.setOnClickListener { | |
performDoubleClick() | |
} |
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
fun NavController.safeNavigate(direction: NavDirections) { | |
currentDestination?.getAction(direction.actionId)?.run { navigate(direction) } | |
} | |
fun NavController.safeNavigate( | |
@IdRes currentDestinationId: Int, | |
@IdRes id: Int, | |
args: Bundle? = null | |
) { | |
if (currentDestinationId == currentDestination?.id) { |
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
package com.nezspencer.navigationtest | |
import android.os.Bundle | |
import android.os.SystemClock | |
import android.util.Log | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.navigation.fragment.findNavController | |
import kotlinx.android.synthetic.main.fragment_one.* |
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
package com.nezspencer.navigationtest | |
import android.os.Bundle | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.navigation.fragment.findNavController | |
import kotlinx.android.synthetic.main.fragment_one.* | |
class FragmentOne : Fragment(R.layout.fragment_one) { |
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
val calendar = Calendar.getInstance() | |
val utcOffset = calendar.get(Calendar.DST_OFFSET) + calendar.get(Calendar.ZONE_OFFSET) |
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
private val supportedNorthAmericanAreaCodes = listOf( | |
"201", | |
"202", | |
"203", | |
"204", | |
"205", | |
"206", | |
"207", | |
"208", | |
"209", |
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
<style name="KycDialogStyle" parent="android:Theme.Dialog"> | |
<item name="android:windowBackground">@drawable/white_3dp_corner_radius</item> | |
<item name="android:windowAnimationStyle">@null</item> | |
<item name="android:backgroundDimEnabled">false</item> | |
<item name="android:windowMinWidthMajor">100%</item> | |
<item name="android:windowMinWidthMinor">90%</item> | |
<item name="android:windowNoTitle">true</item> | |
</style> |
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
import androidx.fragment.app.FragmentActivity | |
class LoggerCrashHandler(private val app: FragmentActivity) : Thread.UncaughtExceptionHandler { | |
private val defaultUEH: Thread.UncaughtExceptionHandler? = | |
Thread.getDefaultUncaughtExceptionHandler() | |
override fun uncaughtException(t: Thread, e: Throwable) { | |
var arr = e.stackTrace | |
var report = "$e\n\n" | |
report += "--------- Stack trace ---------\n\n" |
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
val termsAndConditionsTextView = findViewById<TextView>(R.id.tv_terms_conditions) | |
termsAndConditionsTextView.text = termsCopy | |
termsAndConditionsTextView.movementMethod = LinkMovementMethod.getInstance() | |
termsAndConditionsTextView.highlightColor = Color.TRANSPARENT |
NewerOlder