Example usage for android.view ViewGroup getLayoutTransition

List of usage examples for android.view ViewGroup getLayoutTransition

Introduction

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

Prototype

public LayoutTransition getLayoutTransition() 

Source Link

Document

Gets the LayoutTransition object for this ViewGroup.

Usage

From source file:Main.java

public static void setupChangeAnimationOneTime(ViewGroup viewGroup) {
    LayoutTransition layoutTransition = viewGroup.getLayoutTransition();
    if (layoutTransition == null) {
        return;/* ww w. j  ava  2  s . co  m*/
    }
    try {
        Method method = LayoutTransition.class.getMethod("enableTransitionType", new Class[] { int.class });
        Field field = LayoutTransition.class.getField("CHANGING");
        method.invoke(layoutTransition, field.get(null));
    } catch (Exception e) {
        setupChangeAnimationOneTime((View) viewGroup);
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            View childAt = viewGroup.getChildAt(i);
            setupChangeAnimationOneTime(childAt);
        }
    }
}

From source file:org.wheelmap.android.activity.MainMultiPaneActivity.java

@SuppressLint("NewApi")
@Override//from ww w  .ja  v  a 2 s  .c  om
public void onCreate(Bundle savedInstanceState) {

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);

    super.onCreate(savedInstanceState);

    appProperties = new AppProperties(WheelmapApp.getApp());
    Log.d(TAG, "onCreate");

    setProgressBarIndeterminate(true);
    setSupportProgressBarIndeterminateVisibility(false);

    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setHomeButtonEnabled(false);

    setContentView(R.layout.activity_multipane);
    mMovableLayout = (ViewGroup) findViewById(R.id.movable_layout);
    mResizeButton = (ImageButton) findViewById(R.id.button_movable_resize);

    ViewGroup g = (ViewGroup) findViewById(R.id.layout_multi);
    if (Build.VERSION.SDK_INT > 16) {
        g.getLayoutTransition().disableTransitionType(LayoutTransition.APPEARING);
    }

    if (savedInstanceState != null) {
        executeState(savedInstanceState);
    } else {
        executeDefaultInstanceState();
    }

    Bundle extras = getIntent().getExtras();
    if (extras.containsKey(Extra.MAP_MODE_ENGAGE)) {
        mapModeType = MapModeType.MAP_MODE_ENGAGE;
    } else {
        mapModeType = MapModeType.MAP_MODE_NORMAL;
    }

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);

    mResizeButton.setOnClickListener(this);

    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction t = fm.beginTransaction();

    mWorkerFragment = (CombinedWorkerFragment) fm.findFragmentByTag(CombinedWorkerFragment.TAG);

    if (mWorkerFragment == null) {
        mWorkerFragment = new CombinedWorkerFragment();
        t.add(mWorkerFragment, CombinedWorkerFragment.TAG);
    }

    mListFragment = (POIsListFragment) fm.findFragmentById(R.id.list_layout);
    if (mListFragment == null) {
        mListFragment = POIsListFragment.newInstance(false, true);
        t.add(R.id.list_layout, mListFragment, POIsListFragment.TAG);
    }

    mMapFragment = (POIsOsmdroidFragment) fm.findFragmentById(R.id.map_layout);
    if (mMapFragment == null) {
        mMapFragment = POIsOsmdroidFragment.newInstance(false, true);
        t.add(R.id.map_layout, mMapFragment, POIsOsmdroidFragment.TAG);
    }

    mDetailFragment = (POIDetailFragment) fm.findFragmentById(R.id.detail_layout);
    if (mDetailFragment == null) {
        mDetailFragment = POIDetailFragment.newInstance();
        t.add(R.id.detail_layout, mDetailFragment);
    }

    t.commit();

    WheelmapApp.checkForUpdates(this);

    app = (WheelmapApp) this.getApplication();
    String uri = null;

    try {
        address = app.getAddressString();
    } catch (Exception ex) {
    }

    if (address != null) {
        showSearch();
    }

    // Show a dialog if meets conditions
    AppRate.showRateDialogIfMeetsConditions(this);

}