View SomeView.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
if (isCurrentLanguageRTL) { | |
etEmail.doOnTextChanged { text, start, before, count -> | |
etEmail.setSelection(0) | |
} | |
} |
View SomeView.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
if(isCurrentLanguageRTL) { | |
textView.gravity = Gravity.END | |
} |
View MyCustomView.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
override fun onRtlPropertiesChanged(layoutDirection: kotlin.Int) { | |
super.onRtlPropertiesChanged(layoutDirection) | |
//do magic | |
} |
View View.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
val layoutDirection = context.resources.configuration.layoutDirection | |
val viewLayoutDirection = view.layoutDirection | |
if (layoutDirection == View.LAYOUT_DIRECTION_RTL){ | |
//do stuff | |
} |
View WebViewFragment.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
willLoadHtmlData = if(isCurrentLanguageRTL) <html dir=\"rtl\"><body> $mainHtmlData </body></html> else $mainHtmlData |
View ExampleFragment.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
TabLayoutMediator(mTabLayout, mViewPager) { tab, position -> | |
tab.text = it[position].title | |
}.attach() |
View HomeFragment.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
lateinit var user: User | |
val args: HomeFragmentArgs by navArgs() | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
user = args.user | |
} | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, |
View LoginFragment.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
val user = getUserData() | |
val action = LoginFragmentDirections.actionLoginFragmentToHomeFragment(user) | |
navController.navigate(action) | |
// ************************************************************************************ | |
//TODO YOU CAN CUSTOMIZE HERE FOR YOU | |
private fun getUserData() = User(etMail.text.toString(), "Cengiz", "TORU") |
View HomeFragment.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
lateinit var user: User | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
user = arguments!!.getParcelable<User>("user")!! | |
} |
View LoginFragment.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
val bundle = Bundle() | |
bundle.putParcelable("user", getUserData()) | |
navController.navigate(R.id.action_loginFragment_to_homeFragment, bundle) | |
// ************************************************************************************ | |
//TODO YOU CAN CUSTOMIZE HERE FOR YOU | |
private fun getUserData() = User(etMail.text.toString(), "Cengiz", "TORU") |
NewerOlder