当前位置: 首页>>代码示例>>Java>>正文


Java TransitionManager.beginDelayedTransition方法代码示例

本文整理汇总了Java中android.support.transition.TransitionManager.beginDelayedTransition方法的典型用法代码示例。如果您正苦于以下问题:Java TransitionManager.beginDelayedTransition方法的具体用法?Java TransitionManager.beginDelayedTransition怎么用?Java TransitionManager.beginDelayedTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.transition.TransitionManager的用法示例。


在下文中一共展示了TransitionManager.beginDelayedTransition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@Override public void render(MenuViewState menuViewState) {
  Timber.d("Render %s", menuViewState);

  TransitionManager.beginDelayedTransition(this);
  if (menuViewState instanceof MenuViewState.LoadingState) {
    loadingView.setVisibility(View.VISIBLE);
    recyclerView.setVisibility(View.GONE);
    errorView.setVisibility(View.GONE);
  } else if (menuViewState instanceof MenuViewState.DataState) {
    adapter.setItems(((MenuViewState.DataState) menuViewState).getCategories());
    adapter.notifyDataSetChanged();
    loadingView.setVisibility(View.GONE);
    recyclerView.setVisibility(View.VISIBLE);
    errorView.setVisibility(View.GONE);
  } else if (menuViewState instanceof MenuViewState.ErrorState) {
    loadingView.setVisibility(View.GONE);
    recyclerView.setVisibility(View.GONE);
    errorView.setVisibility(View.VISIBLE);
  } else {
    throw new IllegalStateException("Unknown state " + menuViewState);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:MainMenuLayout.java

示例2: renderData

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void renderData(ProductDetailsViewState.DataState state) {
  TransitionManager.beginDelayedTransition(rootView);
  errorView.setVisibility(View.GONE);
  loadingView.setVisibility(View.GONE);
  detailsView.setVisibility(View.VISIBLE);

  isProductInshoppingCart = state.getDetail().isInShoppingCart();
  product = state.getDetail().getProduct();
  price.setText("Price: $" + String.format(Locale.US, "%.2f", product.getPrice()));
  description.setText(product.getDescription());
  toolbar.setTitle(product.getName());
  collapsingToolbarLayout.setTitle(product.getName());

  if (isProductInshoppingCart) {
    fab.setImageResource(R.drawable.ic_in_shopping_cart);
  } else {
    fab.setImageResource(R.drawable.ic_add_shopping_cart);
  }

  Glide.with(this)
      .load(DependencyInjection.BASE_IMAGE_URL + product.getImage())
      .centerCrop()
      .into(backdrop);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:ProductDetailsActivity.java

示例3: onCheckboxClicked

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
public void onCheckboxClicked(View view) {
    boolean checked = ((CheckBox) view).isChecked();

    ViewGroup containerView = (ViewGroup) findViewById(R.id.container);

    // Check which checkbox was clicked
    switch(view.getId()) {
        case R.id.customMaxDamageCheck:
            TransitionManager.beginDelayedTransition(containerView);
            if (checked) {
                etMaxDamage.setVisibility(View.VISIBLE);
                bCustomMaxDamage = true;
            } else {
                etMaxDamage.setVisibility(View.GONE);
                bCustomMaxDamage = false;
            }
            break;
    }
}
 
开发者ID:TheLuckyCoder,项目名称:Class-Maker,代码行数:20,代码来源:ArmorItemMaker.java

示例4: setResults

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void setResults(List<? extends SearchResult> data, @Nullable String errorMsg) {
    if (data != null && data.size() > 0) {
        if (recyclerView.getVisibility() != View.VISIBLE) {
            TransitionManager.beginDelayedTransition(binding.resultsContainer,
                    getAutoTransition());
            binding.progressBar.setVisibility(View.GONE);
            recyclerView.setVisibility(View.VISIBLE);
        }
        adapter.swapDataSet(data);
    } else {
        TransitionManager.beginDelayedTransition(
                binding.resultsContainer, getAutoTransition());
        binding.progressBar.setVisibility(View.GONE);
        setNoResultsVisibility(View.VISIBLE, errorMsg);
    }
}
 
开发者ID:ykrank,项目名称:S1-Next,代码行数:17,代码来源:SearchActivity.java

示例5: setSwatches

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
public void setSwatches(List<Palette.Swatch> swatches) {
    TransitionManager.beginDelayedTransition(this);

    if (swatches.size() < 2) {
        setVisibility(GONE);
        return;
    }

    LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f);

    for (Palette.Swatch swatch : swatches) {
        ColorView colorView = new ColorView(getContext(), swatch.getRgb());
        colorView.setLayoutParams(param);
        colorView.setOnClickListener(view -> {
            if (listener != null) {
                listener.onColorClick(view, colorView.getColor());
            }
        });
        addView(colorView);
    }
}
 
开发者ID:b1acKr0se,项目名称:bridddle-for-dribbble,代码行数:23,代码来源:ColorPaletteView.java

示例6: hideWithFadeView

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
public static void hideWithFadeView(boolean on, ViewGroup rootView, View view) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
        TransitionManager.beginDelayedTransition(rootView, transitionSet);
    }
    view.setVisibility(on ? View.GONE : View.VISIBLE);
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:17,代码来源:UIhelper.java

示例7: goneSlidingTabs

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void goneSlidingTabs(boolean on) {
    if (!isInvisible) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);

        TransitionManager.beginDelayedTransition(getBinding().root, transitionSet);
        getBinding().slidingTabs.setVisibility(on ? View.GONE : View.VISIBLE);
    }
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:18,代码来源:FriendProfileTabFragmentVM.java

示例8: onTabSelected

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@Override
protected void onTabSelected(TabLayout.Tab tab, int index) {
  ViewGroup tabContent = getTabContent();
  TransitionManager.beginDelayedTransition(tabContent);

  tabContent.removeAllViews();
  View contentView = null;
  if (index == 0) {
    contentView = new OverviewView(getContext());
  } else if (index == 1) {
    contentView = new ColoniesView(getContext());
  } else if (index == 2) {
    contentView = new BuildQueueView(getContext());
  } else if (index == 3) {
    contentView = new FleetsLayout(getContext(), new MyEmpireStarCollection());
  }
  tabContent.addView(contentView);
}
 
开发者ID:codeka,项目名称:wwmmo,代码行数:19,代码来源:EmpireLayout.java

示例9: onTabSelected

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@Override
protected void onTabSelected(TabLayout.Tab tab, int index) {
  ViewGroup tabContent = getTabContent();
  TransitionManager.beginDelayedTransition(tabContent);

  buildLayout.hideBottomSheet();
  tabContent.removeAllViews();
  if (tab.getPosition() == 0) {
    contentView = new BuildingsView(context, star, colony, buildLayout);
  } else if (tab.getPosition() == 1) {
    contentView = new ShipsView(context, star, colony, buildLayout);
  } else if (tab.getPosition() == 2) {
    contentView = new QueueView(context, star, colony);
  }
  tabContent.addView((View) contentView);
}
 
开发者ID:codeka,项目名称:wwmmo,代码行数:17,代码来源:ColonyView.java

示例10: renderError

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void renderError() {
  TransitionManager.beginDelayedTransition(container);
  recyclerView.setVisibility(View.GONE);
  loadingView.setVisibility(View.GONE);
  errorView.setVisibility(View.VISIBLE);
  emptyView.setVisibility(View.GONE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:SearchFragment.java

示例11: expandCardOnClick

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@OnClick(R.id.expand_time_left_calendar_view)
void expandCardOnClick() {
    TransitionManager.beginDelayedTransition(timeLeftCalendarContent);
    TransitionManager.beginDelayedTransition(calendarCard);
    TransitionManager.beginDelayedTransition(fragTimeLeftRootLinearLayout);
    if(timeLeftCalendarContent.getVisibility() == View.VISIBLE) {
        timeLeftCalendarContent.setVisibility(View.GONE);
    } else timeLeftCalendarContent.setVisibility(View.VISIBLE);
}
 
开发者ID:AndroidNewbies,项目名称:Sanxing,代码行数:10,代码来源:TimeLeftCalendarFragment.java

示例12: showAnalysisProgress

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@Override public void showAnalysisProgress() {
  if (analysisStatusView.getVisibility() == View.GONE) {
    TransitionManager.beginDelayedTransition(rootView);
    progressBar.setVisibility(View.VISIBLE);
    analysisStatusView.setVisibility(View.VISIBLE);
  }
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:8,代码来源:AppManagerFragment.java

示例13: renderData

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void renderData(List<Product> products) {
  adapter.setProducts(products);
  adapter.notifyDataSetChanged();
  TransitionManager.beginDelayedTransition((ViewGroup) getView());
  loadingView.setVisibility(View.GONE);
  errorView.setVisibility(View.GONE);
  recyclerView.setVisibility(View.VISIBLE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:CategoryFragment.java

示例14: onBindViewHolder

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
@Override
protected void onBindViewHolder(@NonNull WelcomeHolder holder, @NonNull WelcomeItem dataSet) {
    final Resources resources = holder.download.getResources();
    TransitionManager.beginDelayedTransition((ViewGroup) holder.itemView);

    switch (dataSet.state()) {
        case WelcomeItem.READY:
            holder.download.setText(R.string.data_ready);
            holder.download.setTextColor(ResourcesCompat.getColor(resources, R.color.data_ready_text, null));
            holder.download.setClickable(false);
            holder.progress.setVisibility(View.GONE);
            break;

        case WelcomeItem.WAITING:
            holder.download.setTextColor(ResourcesCompat.getColor(resources, R.color.data_waiting_text, null));
            holder.download.setText(R.string.data_waiting);
            holder.download.setClickable(true);
            holder.progress.setVisibility(View.VISIBLE);
            break;

        case WelcomeItem.UNREADY:
            holder.download.setTextColor(ResourcesCompat.getColor(resources, R.color.data_unready_text, null));
            holder.download.setText(R.string.data_unready);
            holder.download.setClickable(true);
            holder.progress.setVisibility(View.GONE);
            break;
    }
}
 
开发者ID:huazhouwang,项目名称:Synapse,代码行数:29,代码来源:WelcomeViewBinder.java

示例15: renderEmptyResult

import android.support.transition.TransitionManager; //导入方法依赖的package包/类
private void renderEmptyResult() {
  TransitionManager.beginDelayedTransition(container);
  recyclerView.setVisibility(View.GONE);
  loadingView.setVisibility(View.GONE);
  errorView.setVisibility(View.GONE);
  emptyView.setVisibility(View.VISIBLE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:SearchFragment.java


注:本文中的android.support.transition.TransitionManager.beginDelayedTransition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。