Example usage for android.animation LayoutTransition LayoutTransition

List of usage examples for android.animation LayoutTransition LayoutTransition

Introduction

In this page you can find the example usage for android.animation LayoutTransition LayoutTransition.

Prototype

public LayoutTransition() 

Source Link

Document

Constructs a LayoutTransition object.

Usage

From source file:com.money.manager.ex.fragment.BaseExpandableListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    // set animation
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        getExpandableListView().setLayoutTransition(new LayoutTransition());
    // saved instance
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(KEY_SHOWN_TIPS_WILDCARD))
            isShowTipsWildcard = savedInstanceState.getBoolean(KEY_SHOWN_TIPS_WILDCARD);
    }/*from  w ww  .  j  a va  2s  .c  om*/
    // set subtitle in actionbar
    if (!(TextUtils.isEmpty(getSubTitle())))
        getSherlockActivity().getSupportActionBar().setSubtitle(getSubTitle());
}

From source file:com.money.manager.ex.fragment.BaseListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    // set animation
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        getListView().setLayoutTransition(new LayoutTransition());
    // saved instance
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(KEY_SHOWN_TIPS_WILDCARD))
            isShowTipsWildcard = savedInstanceState.getBoolean(KEY_SHOWN_TIPS_WILDCARD);
    }/*from  ww  w .  j a va 2s  . c  om*/
    // set subtitle in actionbar
    if (!(TextUtils.isEmpty(getSubTitle())))
        getSherlockActivity().getSupportActionBar().setSubtitle(getSubTitle());
}

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

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

From source file:org.borderstone.tagtags.TTProtocolActivity.java

@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    this.setContentView(R.layout.activity_protocol);

    this.setTheme(R.style.AppTheme);

    if (Constants.files.contains(Constants.filename)) {
        int idex = Constants.files.indexOf(Constants.filename);
        row = Constants.file_rows.get(idex);
    }//  ww  w. j a v a2  s .  c om

    lblGlobal = new BTitleLabel(this);
    lblLocal = new BTitleLabel(this);
    btnUpload = new BButton(this);

    lblGlobal.setPadding(15, 15, 15, 15);
    lblLocal.setPadding(15, 15, 15, 15);
    lblGlobal.setGravity(Gravity.CENTER);
    lblLocal.setGravity(Gravity.CENTER);
    lblLocal.setTextColor(Color.WHITE);
    lblGlobal.setTextColor(Color.WHITE);
    lblLocal.setTextSize(Constants.fontSize + 2);
    lblGlobal.setTextSize(Constants.fontSize + 2);

    lblGlobal.setText("GLOBAL PROPERTIES");
    lblLocal.setText("TECHNICAL MATERIAL");

    widgetLayout = new BMultiColumnLayout(this);
    mDrawerList = (LinearLayout) this.findViewById(R.id.protocolDrawer);

    lockSwitch = new Switch(this);

    btnUpload.setOnClickListener(this);

    btnUpload.setIcon(R.drawable.upload);
    btnUpload.setText("Upload data");

    btnGPS = new ImageButton(this);

    btnGPS.setOnClickListener(this);
    btnGPS.setLongClickable(true);
    btnGPS.setOnLongClickListener(this);

    DisplayMetrics metrics = getResources().getDisplayMetrics();
    DrawerLayout.LayoutParams lp = new DrawerLayout.LayoutParams(metrics.densityDpi * 2,
            LinearLayout.LayoutParams.MATCH_PARENT);
    lp.gravity = Gravity.START;

    sv = (ScrollView) this.findViewById(R.id.protocolBack);

    widgetLayout.setLayoutParams(Constants.defaultParams);

    sv.addView(widgetLayout);
    sv.setLayoutTransition(new LayoutTransition());

    toolbar = (Toolbar) this.findViewById(R.id.protToolbar);
    this.setSupportActionBar(toolbar);

    toolbar.setNavigationIcon(R.drawable.drawer);

    toolbar.inflateMenu(R.menu.protocol_menu);

    toolbar.addView(lockSwitch);

    lblPercent = new BTitleLabel(this);
    lblInfo = new BInfoLabel(this);

    drawProtocolPage();

    widgetLayout.setFocusable(true);
    widgetLayout.setFocusableInTouchMode(true);
    widgetLayout.requestFocus();

    mDrawerList.bringToFront();

    final DrawerLayout drawerLayout = (DrawerLayout) this.findViewById(R.id.drawerLayoutProtocol);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (!drawerLayout.isDrawerOpen(Gravity.LEFT))
                drawerLayout.openDrawer(Gravity.LEFT);
            else
                drawerLayout.closeDrawer(Gravity.LEFT);
        }
    });
}

From source file:br.ufrgs.ufrgsmapas.libs.SearchBox.java

/**
 * Create a searchbox with params and a style
 * @param context Context//from www. j a  v  a 2  s. com
 * @param attrs Attributes
 * @param defStyle Style
 */
public SearchBox(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    inflate(context, R.layout.searchbox, this);
    this.searchOpen = false;
    this.isMic = true;
    this.materialMenu = (MaterialMenuView) findViewById(R.id.material_menu_button);
    this.logo = (TextView) findViewById(R.id.logo);
    this.search = (EditText) findViewById(R.id.search);
    this.results = (ListView) findViewById(R.id.results);
    this.context = context;
    this.pb = (ProgressBar) findViewById(R.id.pb);
    this.mic = (ImageView) findViewById(R.id.mic);
    this.drawerLogo = (ImageView) findViewById(R.id.drawer_logo);

    mCollator = Collator.getInstance(new Locale("pt", "BR"));
    mCollator.setStrength(Collator.PRIMARY);

    materialMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (searchOpen) {
                toggleSearch();
            } else {
                if (menuListener != null)
                    menuListener.onMenuClick();
            }
        }

    });
    resultList = new ArrayList<SearchResult>();
    results.setAdapter(new SearchAdapter(context, resultList));
    animate = true;
    isVoiceRecognitionIntentSupported = isIntentAvailable(context,
            new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH));
    logo.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            toggleSearch();
        }

    });
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        RelativeLayout searchRoot = (RelativeLayout) findViewById(R.id.search_root);
        LayoutTransition lt = new LayoutTransition();
        lt.setDuration(100);
        searchRoot.setLayoutTransition(lt);
    }
    searchables = new ArrayList<SearchResult>();
    search.setOnEditorActionListener(new OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_SEARCH) {
                search(getSearchText());
                return true;
            }
            return false;
        }
    });
    search.setOnKeyListener(new OnKeyListener() {
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_ENTER) {
                if (TextUtils.isEmpty(getSearchText())) {
                    toggleSearch();
                } else {
                    search(getSearchText());
                }
                return true;
            }
            return false;
        }
    });
    logoText = "Logo";
    micStateChanged();
    mic.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (voiceRecognitionListener != null) {
                voiceRecognitionListener.onClick();
            } else {
                micClick();
            }
        }
    });
}

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 w w w.  j  a v  a2 s.com
    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:info.bartowski.easteregg.MLand.java

public void setScoreFieldHolder(ViewGroup vg) {
    mScoreFields = vg;//from  w  w  w.jav a 2  s  .  c o m
    if (vg != null) {
        final LayoutTransition lt = new LayoutTransition();
        lt.setDuration(250);
        mScoreFields.setLayoutTransition(lt);
    }
    for (Player p : mPlayers) {
        mScoreFields.addView(p.mScoreField,
                new MarginLayoutParams(MarginLayoutParams.WRAP_CONTENT, MarginLayoutParams.MATCH_PARENT));
    }
}

From source file:org.zywx.wbpalmstar.plugin.inputtextfieldview.ACEInputTextFieldView.java

/**
 *    initLayout Animator//www  .j  a v  a 2 s . c  om
 */
private void initLayoutTransition() {
    if (mLayoutTransition != null) {
        return;
    }
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING,
            mLayoutTransition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    mLayoutTransition.setAnimator(LayoutTransition.APPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null);
    // mLayoutTransition.getAnimator(LayoutTransition.CHANGE_DISAPPEARING));
    mLayoutTransition.addTransitionListener(new TransitionListener() {

        @Override
        public void startTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
        }

        @Override
        public void endTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
            if (view.getId() == CRes.plugin_inputtextfieldview_parent_layout
                    && transitionType == LayoutTransition.CHANGE_APPEARING) {
                //Parent view height change ,so input and pager show together.
                goScroll(0);
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            } else if (view.getId() == CRes.plugin_inputtextfieldview_pager_layout
                    && transitionType == LayoutTransition.DISAPPEARING) {
                if (!isKeyBoardVisible)
                    backScroll();
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            }
        }
    });
    mParentLayout.setLayoutTransition(mLayoutTransition);
}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static LayoutTransition getDefaultTransition() {
    LayoutTransition itemLayoutTransition = new LayoutTransition();
    itemLayoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
    itemLayoutTransition.setDuration(100);
    itemLayoutTransition.setInterpolator(LayoutTransition.CHANGING, new OvershootInterpolator(2f));
    Animator scaleUp = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 0, 1));
    scaleUp.setDuration(50);//from w w  w  .ja  va  2  s  .c om
    scaleUp.setStartDelay(50);
    Animator scaleDown = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, 0));
    scaleDown.setDuration(2);
    itemLayoutTransition.setAnimator(LayoutTransition.APPEARING, scaleUp);
    itemLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    itemLayoutTransition.enableTransitionType(LayoutTransition.CHANGING);
    return itemLayoutTransition;
}

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);
}