List of usage examples for android.transition Slide Slide
public Slide()
From source file:org.huxizhijian.hhcomicviewer.ui.download.OfflineDownloadBaseActivity.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) protected Visibility buildEnterTransition() { Slide enterTransition = new Slide(); enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium)); enterTransition.setSlideEdge(Gravity.RIGHT); //? return enterTransition; }
From source file:net.huannguyen.conductorexample.transition.DetailPushTransChangeHandler.java
@NonNull @Override/*www.j a v a2s .c o m*/ protected Transition getTransition(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, boolean isPush) { if (to == null || !(to instanceof CountryDetailView)) { throw new IllegalArgumentException("The to view must be a CountryDetailView"); } final CountryDetailView detailView = (CountryDetailView) to; detailView.flagView.setTransitionName(flagViewTransitionName); ChangeTransform changeTransform = new ChangeTransform(); // Shared elements (the flag view in this case) are drawn in the window's view overlay during the transition by default. // That causes the favourite fab being drawn behind the flag when it is scaled up. // Setting the change transform not using overlay addresses this issue. changeTransform.setReparentWithOverlay(false); return new TransitionSet() .addTransition(new TransitionSet().addTransition(new ChangeBounds()) .addTransition(new ChangeClipBounds()).addTransition(changeTransform) .addTransition(new ChangeImageTransform()).setDuration(300)) .addTransition(new Slide().addTarget(detailView.detailGroup).setStartDelay(150)) .addTransition(new Scale().addTarget(detailView.favouriteFab).setStartDelay(300)) .setInterpolator(new FastOutSlowInInterpolator()); }
From source file:io.github.marktony.espresso.mvp.packages.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Set the navigation bar color if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("navigation_bar_tint", true)) { getWindow().setNavigationBarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark)); }// w w w.ja va 2s .c o m // Begin the slide animation. Slide slide = new Slide(); slide.setDuration(500); slide.setInterpolator(new AccelerateDecelerateInterpolator()); getWindow().setExitTransition(slide); Explode explode = new Explode(); explode.setDuration(500); explode.setInterpolator(new AccelerateDecelerateInterpolator()); getWindow().setEnterTransition(explode); initViews(); // Init the fragments. if (savedInstanceState != null) { packagesFragment = (PackagesFragment) getSupportFragmentManager().getFragment(savedInstanceState, "PackagesFragment"); companiesFragment = (CompaniesFragment) getSupportFragmentManager().getFragment(savedInstanceState, "CompaniesFragment"); selectedNavItem = savedInstanceState.getInt(KEY_NAV_ITEM); } else { packagesFragment = (PackagesFragment) getSupportFragmentManager().findFragmentById(R.id.content_main); if (packagesFragment == null) { packagesFragment = PackagesFragment.newInstance(); } companiesFragment = (CompaniesFragment) getSupportFragmentManager().findFragmentById(R.id.content_main); if (companiesFragment == null) { companiesFragment = CompaniesFragment.newInstance(); } } // Add the fragments. if (!packagesFragment.isAdded()) { getSupportFragmentManager().beginTransaction() .add(R.id.content_main, packagesFragment, "PackagesFragment").commit(); } if (!companiesFragment.isAdded()) { getSupportFragmentManager().beginTransaction() .add(R.id.content_main, companiesFragment, "CompaniesFragment").commit(); } // Make sure the data in repository is the latest. // Also to void the repo only contains a package // when user has already gone to detail page // by check a notification or widget. PackagesRepository.destroyInstance(); // Init the presenters. packagesPresenter = new PackagesPresenter(packagesFragment, PackagesRepository .getInstance(PackagesRemoteDataSource.getInstance(), PackagesLocalDataSource.getInstance())); new CompaniesPresenter(companiesFragment, CompaniesRepository.getInstance(CompaniesLocalDataSource.getInstance())); // Get data from Bundle. if (savedInstanceState != null) { PackageFilterType currentFiltering = (PackageFilterType) savedInstanceState .getSerializable(CURRENT_FILTERING_KEY); packagesPresenter.setFiltering(currentFiltering); } // Show the default fragment. if (selectedNavItem == 0) { showPackagesFragment(); } else if (selectedNavItem == 1) { showCompaniesFragment(); } PushUtil.startReminderService(this); }
From source file:com.github.jorgecastilloprz.easymvp.mvp.views.DetailsActivity.java
private void excludeItemsFromTransitionIfLollipop() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); transition.excludeTarget(R.id.detailsToolbar, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); }//from ww w . j ava2s . c om }
From source file:com.github.jorgecastilloprz.corleone.sample.ui.activity.GameDetailsActivity.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void excludeItemsFromTransitionIfLollipop() { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); transition.excludeTarget(R.id.toolbar, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); }
From source file:mbullington.dialogue.activity.ConversationActivity.java
/** * On create/*from w w w . j a v a 2 s .c o m*/ */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); serverId = getIntent().getExtras().getInt("serverId"); server = Dialogue.getInstance().getServerById(serverId); Settings settings = new Settings(this); // Finish activity if server does not exist anymore - See #55 if (server == null) { this.finish(); } setContentView(R.layout.conversations); ButterKnife.inject(this); Slide enterTransition = new Slide(); enterTransition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setEnterTransition(enterTransition); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); toolbar.setNavigationIcon(R.drawable.back_arrow); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ConversationActivity.this.finish(); } }); setTitle(server.getTitle()); boolean isLandscape = (getResources() .getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); EditText input = (EditText) findViewById(R.id.input); input.setOnKeyListener(inputKeyListener); pager = (ViewPager) findViewById(R.id.pager); pagerAdapter = new ConversationPagerAdapter(this, server); pager.setAdapter(pagerAdapter); final float density = getResources().getDisplayMetrics().density; indicator = (ConversationIndicator) findViewById(R.id.titleIndicator); indicator.setServer(server); indicator.setTypeface(Typeface.MONOSPACE); indicator.setViewPager(pager); indicator.setFooterColor(0xFF31B6E7); indicator.setFooterLineHeight(1 * density); indicator.setFooterIndicatorHeight(3 * density); indicator.setFooterIndicatorStyle(IndicatorStyle.Underline); indicator.setSelectedColor(0xFFFFFFFF); indicator.setSelectedBold(true); indicator.setBackgroundColor(0xFF181818); historySize = settings.getHistorySize(); if (server.getStatus() == Status.PRE_CONNECTING) { server.clearConversations(); pagerAdapter.clearConversations(); server.getConversation(ServerInfo.DEFAULT_NAME).setHistorySize(historySize); } float fontSize = settings.getFontSize(); indicator.setTextSize(fontSize * density); input.setTextSize(settings.getFontSize()); input.setTypeface(Typeface.MONOSPACE); // Optimization : cache field lookups Collection<Conversation> mConversations = server.getConversations(); for (Conversation conversation : mConversations) { // Only scroll to new conversation if it was selected before if (conversation.getStatus() == Conversation.STATUS_SELECTED) { onNewConversation(conversation.getName()); } else { createNewConversation(conversation.getName()); } } int setInputTypeFlags = 0; setInputTypeFlags |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; if (settings.autoCapSentences()) { setInputTypeFlags |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES; } if (isLandscape && settings.imeExtract()) { setInputTypeFlags |= InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE; } if (!settings.imeExtract()) { input.setImeOptions(input.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI); } input.setInputType(input.getInputType() | setInputTypeFlags); // Create a new scrollback history scrollback = new Scrollback(); }
From source file:appteam.nith.hillffair.activities.HomeActivity.java
private void setupWindowAnimations() { // Re-enter transition is executed when returning to this activity if (Build.VERSION.SDK_INT >= 21) { Slide slideTransition = new Slide(); slideTransition.setSlideEdge(Gravity.LEFT); slideTransition.setDuration(800); getWindow().setReenterTransition(slideTransition); getWindow().setExitTransition(slideTransition); }/*from www. java 2 s .co m*/ }
From source file:com.raulh82vlc.topratemovies.activities.CardFilmDetailsActivity.java
/** * Method startAllTransitions//from w ww . j a v a 2 s. c o m * if API 21 then effects are settled */ private void startAllTransitions() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); } }
From source file:com.zertinteractive.wallpaper.activities.DetailActivity.java
private void initActivityTransitions() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); }/*from w w w. ja va 2 s . c o m*/ }