Java Code Examples for android.transition.Fade#IN

The following examples show how to use android.transition.Fade#IN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CacheControlActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private void updateStorageUsageRow() {
    View view = layoutManager.findViewByPosition(storageUsageRow);
    if (view instanceof StroageUsageView) {
        StroageUsageView stroageUsageView = ((StroageUsageView) view);
        long currentTime =  System.currentTimeMillis();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && currentTime - fragmentCreateTime > 250) {
            TransitionSet transition = new TransitionSet();
            ChangeBounds changeBounds = new ChangeBounds();
            changeBounds.setDuration(250);
            changeBounds.excludeTarget(stroageUsageView.legendLayout,true);
            Fade in = new Fade(Fade.IN);
            in.setDuration(290);
            transition
                    .addTransition(new Fade(Fade.OUT).setDuration(250))
                    .addTransition(changeBounds)
                    .addTransition(in);
            transition.setOrdering(TransitionSet.ORDERING_TOGETHER);
            transition.setInterpolator(CubicBezierInterpolator.EASE_OUT);
            TransitionManager.beginDelayedTransition(listView, transition);
        }
        stroageUsageView.setStorageUsage(calculating, databaseSize, totalSize, totalDeviceFreeSize, totalDeviceSize);
        RecyclerView.ViewHolder holder = listView.findViewHolderForAdapterPosition(storageUsageRow);
        if (holder != null) {
            stroageUsageView.setEnabled(listAdapter.isEnabled(holder));
        }
    } else {
        listAdapter.notifyDataSetChanged();
    }
}
 
Example 2
Source File: CacheControlActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private void updateStorageUsageRow() {
    View view = layoutManager.findViewByPosition(storageUsageRow);
    if (view instanceof StroageUsageView) {
        StroageUsageView stroageUsageView = ((StroageUsageView) view);
        long currentTime =  System.currentTimeMillis();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && currentTime - fragmentCreateTime > 250) {
            TransitionSet transition = new TransitionSet();
            ChangeBounds changeBounds = new ChangeBounds();
            changeBounds.setDuration(250);
            changeBounds.excludeTarget(stroageUsageView.legendLayout,true);
            Fade in = new Fade(Fade.IN);
            in.setDuration(290);
            transition
                    .addTransition(new Fade(Fade.OUT).setDuration(250))
                    .addTransition(changeBounds)
                    .addTransition(in);
            transition.setOrdering(TransitionSet.ORDERING_TOGETHER);
            transition.setInterpolator(CubicBezierInterpolator.EASE_OUT);
            TransitionManager.beginDelayedTransition(listView, transition);
        }
        stroageUsageView.setStorageUsage(calculating, databaseSize, totalSize, totalDeviceFreeSize, totalDeviceSize);
        RecyclerView.ViewHolder holder = listView.findViewHolderForAdapterPosition(storageUsageRow);
        if (holder != null) {
            stroageUsageView.setEnabled(listAdapter.isEnabled(holder));
        }
    } else {
        listAdapter.notifyDataSetChanged();
    }
}