Created
October 31, 2020 21:23
-
-
Save FrancescoBonizzi/eefac687f83ee1db1d353f898ec82313 to your computer and use it in GitHub Desktop.
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 DialogArticleTap() : BottomSheetDialogFragment() | |
{ | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? | |
{ | |
return inflater.inflate( | |
R.layout.d_article_tap, | |
container, | |
false) | |
} | |
override fun onActivityCreated(savedInstanceState: Bundle?) | |
{ | |
super.onActivityCreated(savedInstanceState) | |
(view?.parent as View).setBackgroundColor(Color.TRANSPARENT) | |
val resources = resources | |
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) | |
{ | |
val parent = view?.parent as View | |
val layoutParams = parent.layoutParams as CoordinatorLayout.LayoutParams | |
layoutParams.setMargins( | |
resources.getDimensionPixelSize(R.dimen.activity_horizontal_margin), | |
0, | |
resources.getDimensionPixelSize(R.dimen.activity_horizontal_margin), | |
0 | |
) | |
parent.layoutParams = layoutParams | |
} | |
} | |
// A lot of other things | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment