Example usage for android.view ViewGroup setLayoutTransition

List of usage examples for android.view ViewGroup setLayoutTransition

Introduction

In this page you can find the example usage for android.view ViewGroup setLayoutTransition.

Prototype

public void setLayoutTransition(LayoutTransition transition) 

Source Link

Document

Sets the LayoutTransition object for this ViewGroup.

Usage

From source file:Main.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void disableAnimationTransition(Object view) {
    if (view instanceof ViewGroup && Build.VERSION.SDK_INT > 10) {
        ViewGroup viewGroup = (ViewGroup) view;
        viewGroup.setLayoutTransition(null);
    }/*  w w  w.j a v a  2  s .co m*/
}

From source file:Main.java

public static void infoSwitch(ViewGroup viewgroup, ViewGroup viewgroup1) {
    viewgroup.setLayoutTransition(null);
    viewgroup1.setLayoutTransition(null);
    dismissChildren(viewgroup);//from  w  w w.  j a va 2s . co  m
    showChildren(viewgroup1);
}

From source file:de.stadtrallye.rallyesoft.fragments.AssistantServerFragment.java

@TargetApi(11)
private void setLayoutTransition(ViewGroup vg) {
    vg.setLayoutTransition(new LayoutTransition());
}

From source file:com.google.android.media.tv.companionlibrary.ChannelSetupFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(getLayoutResourceId(), container, false);
    // Make sure this view is focused
    view.requestFocus();/*from  ww w .  j av  a2s .co  m*/
    mProgressBar = (ProgressBar) view.findViewById(R.id.tune_progress);
    mScanningMessage = (TextView) view.findViewById(R.id.tune_description);
    mTitle = (TextView) view.findViewById(R.id.tune_title);
    mBadge = (ImageView) view.findViewById(R.id.tune_icon);
    mChannelHolder = view.findViewById(R.id.channel_holder);
    mCancelButton = (Button) view.findViewById(R.id.tune_cancel);

    ListView channelList = (ListView) view.findViewById(R.id.channel_list);
    mAdapter = new ChannelAdapter();
    channelList.setAdapter(mAdapter);
    channelList.setOnItemClickListener(null);

    ViewGroup progressHolder = (ViewGroup) view.findViewById(R.id.progress_holder);
    LayoutTransition transition = new LayoutTransition();
    transition.enableTransitionType(LayoutTransition.CHANGING);
    progressHolder.setLayoutTransition(transition);

    mCancelButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finishScan(false);
        }
    });
    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mSyncStatusChangedReceiver,
            new IntentFilter(EpgSyncJobService.ACTION_SYNC_STATUS_CHANGED));

    mChannelScanLayout = view;
    setChannelListVisibility(false);
    setBackgroundColor(getResources().getColor(android.R.color.holo_blue_dark));
    return view;
}

From source file:com.todoroo.astrid.activity.TaskListActivity.java

private void setupLayoutTransitions() {
    LayoutTransition transition = new LayoutTransition();
    ViewGroup container = (ViewGroup) findViewById(R.id.right_column);
    container.setLayoutTransition(transition);
}

From source file:edu.usf.cutr.opentripplanner.android.fragments.MainFragment.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override//from ww w .  j  a v  a 2  s.c o  m
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    final View mainView = inflater.inflate(R.layout.main, container, false);

    if (mainView != null) {
        ViewTreeObserver vto = mainView.getViewTreeObserver();

        if (vto != null) {
            vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
                @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
                @Override
                public void onGlobalLayout() {
                    MainFragment.removeOnGlobalLayoutListener(mainView, this);
                    int locationTbEndLocation[] = new int[2];
                    mTbEndLocation.getLocationInWindow(locationTbEndLocation);
                    int locationItinerarySelectionSpinner[] = new int[2];
                    mItinerarySelectionSpinner.getLocationInWindow(locationItinerarySelectionSpinner);
                    int locationBtnHandle[] = new int[2];
                    mBtnHandle.getLocationInWindow(locationBtnHandle);
                    DisplayMetrics metrics = MainFragment.this.getResources().getDisplayMetrics();
                    int windowHeight = metrics.heightPixels;
                    int paddingMargin = MainFragment.this.getResources()
                            .getInteger(R.integer.map_padding_margin);
                    if (mMap != null) {
                        mMap.setPadding(locationBtnHandle[0] + mBtnHandle.getWidth() / 2 + paddingMargin,
                                locationTbEndLocation[1] + mTbEndLocation.getHeight() / 2 + paddingMargin, 0,
                                windowHeight - locationItinerarySelectionSpinner[1] + paddingMargin);
                    }
                }
            });
        } else {
            Log.w(OTPApp.TAG, "Not possible to obtain exact element's positions on screen, some other"
                    + "elements can be misplaced");
        }

        mTbStartLocation = (EditText) mainView.findViewById(R.id.tbStartLocation);
        mTbEndLocation = (EditText) mainView.findViewById(R.id.tbEndLocation);

        mBtnPlanTrip = (ImageButton) mainView.findViewById(R.id.btnPlanTrip);
        mDdlOptimization = (ListView) mainView.findViewById(R.id.spinOptimization);
        mDdlTravelMode = (ListView) mainView.findViewById(R.id.spinTravelMode);

        mBikeTriangleParameters = new RangeSeekBar<Double>(OTPApp.BIKE_PARAMETERS_MIN_VALUE,
                OTPApp.BIKE_PARAMETERS_MAX_VALUE, this.getActivity().getApplicationContext(), R.color.sysRed,
                R.color.sysGreen, R.color.sysBlue, R.drawable.seek_thumb_normal, R.drawable.seek_thumb_pressed);

        // add RangeSeekBar to pre-defined layout
        mBikeTriangleParametersLayout = (ViewGroup) mainView.findViewById(R.id.bikeParametersLayout);

        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.BELOW, R.id.bikeParametersTags);

        mBikeTriangleParametersLayout.addView(mBikeTriangleParameters, params);

        mBtnMyLocation = (ImageButton) mainView.findViewById(R.id.btnMyLocation);

        mBtnDateDialog = (ImageButton) mainView.findViewById(R.id.btnDateDialog);

        mBtnDisplayDirection = (ImageButton) mainView.findViewById(R.id.btnDisplayDirection);

        mNavigationDrawerLeftPane = (ViewGroup) mainView.findViewById(R.id.navigationDrawerLeftPane);
        mPanelDisplayDirection = mainView.findViewById(R.id.panelDisplayDirection);

        mBtnHandle = (ImageButton) mainView.findViewById(R.id.btnHandle);
        mDrawerLayout = (DrawerLayout) mainView.findViewById(R.id.drawerLayout);

        mTbStartLocation.setImeOptions(EditorInfo.IME_ACTION_NEXT);
        mTbEndLocation.setImeOptions(EditorInfo.IME_ACTION_DONE);
        mTbEndLocation.requestFocus();

        mItinerarySelectionSpinner = (Spinner) mainView.findViewById(R.id.itinerarySelection);

        Log.v(OTPApp.TAG, "finish onStart()");

        if (Build.VERSION.SDK_INT > 11) {
            LayoutTransition l = new LayoutTransition();
            ViewGroup mainButtons = (ViewGroup) mainView.findViewById(R.id.content_frame);
            mainButtons.setLayoutTransition(l);
        }

        return mainView;
    } else {
        Log.e(OTPApp.TAG, "Not possible to obtain main view, UI won't be correctly created");
        return null;
    }
}