本文整理汇总了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);
}
}
示例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);
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例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);
}