<View android:layout_width="300dp"
android:layout_height="300dp"
android:id="@+id/square"/>
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
View square= view.findViewById(R.id.square);
square.setRotationX(45f);
}