List of usage examples for android.view.animation AnimationUtils loadAnimation
public static Animation loadAnimation(Context context, @AnimRes int id) throws NotFoundException
From source file:com.mercandalli.android.apps.files.admin.ServerLogsFragment.java
public void updateAdapter() { if (this.recyclerView != null && this.list != null && this.isAdded()) { this.circularProgressBar.setVisibility(View.GONE); this.mAdapter = new AdapterModelUserConnection(list); this.recyclerView.setAdapter(mAdapter); this.recyclerView .setItemAnimator(/*new SlideInFromLeftItemAnimator(mRecyclerView)*/new DefaultItemAnimator()); if (circle.getVisibility() == View.GONE) { circle.setVisibility(View.VISIBLE); Animation animOpen = AnimationUtils.loadAnimation(getContext(), R.anim.circle_button_bottom_open); circle.startAnimation(animOpen); }//from w w w . jav a 2s . co m circle.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mAdapter.addItem(new UserConnectionModel("Number", "" + mNewItemPosition), 0); recyclerView.scrollToPosition(0); mNewItemPosition++; } }); this.mAdapter.setOnItemClickListener(new AdapterModelUserConnection.OnItemClickListener() { @Override public void onItemClick(View view, int position) { } }); this.swipeRefreshLayout.setRefreshing(false); mNewItemPosition = 0; } }
From source file:de.elanev.studip.android.app.backend.net.oauth.SignInFragment.java
@Override public void onCreate(Bundle savedInstanceState) { Log.i(TAG, "onCreate Called!"); super.onCreate(savedInstanceState); mContext = getActivity();//from ww w.ja va2 s. com Bundle args = getArguments(); if (args != null) { boolean resetFlag = args.getBoolean(AUTH_CANCELED); if (resetFlag) { resetSignInActivityState(); } } int res = R.layout.list_item_single_text; if (!ApiUtils.isOverApi11()) { res = android.R.layout.simple_list_item_checked; } mAdapter = new ServerAdapter(mContext, res, getItems().getServers()); slideUpIn = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_up_in); setHasOptionsMenu(true); }
From source file:com.battlelancer.seriesguide.ui.PeopleFragment.java
/** * Shows or hides a custom indeterminate progress indicator inside this activity layout. *//*from www .j a va 2 s . c o m*/ private void setProgressVisibility(boolean isVisible) { if (mProgressBar.getVisibility() == (isVisible ? View.VISIBLE : View.GONE)) { // already in desired state, avoid replaying animation return; } mProgressBar.startAnimation(AnimationUtils.loadAnimation(mProgressBar.getContext(), isVisible ? R.anim.fade_in : R.anim.fade_out)); mProgressBar.setVisibility(isVisible ? View.VISIBLE : View.GONE); }
From source file:com.kuloud.android.aboutlibraries.ui.LibsFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { mAdapter.addLibs(libraries);//from w w w . j av a 2 s . c o m if (animate) { Animation fadeIn = AnimationUtils.loadAnimation(LibsFragment.this.getActivity(), android.R.anim.slide_in_left); fadeIn.setDuration(500); LayoutAnimationController layoutAnimationController = new LayoutAnimationController(fadeIn); mRecyclerView.setLayoutAnimation(layoutAnimationController); mRecyclerView.startLayoutAnimation(); } super.onViewCreated(view, savedInstanceState); }
From source file:com.amaze.filemanager.fragments.RarViewer.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); s = getArguments().getString("path"); f = new File(s); listView.setVisibility(View.VISIBLE); Sp = PreferenceManager.getDefaultSharedPreferences(getActivity()); res = getResources();//from w w w . j a v a2 s . co m listView.setVisibility(View.VISIBLE); mLayoutManager = new LinearLayoutManager(getActivity()); listView.setLayoutManager(mLayoutManager); if (mainActivity.theme1 == 1) rootView.setBackgroundColor(getResources().getColor(R.color.holo_dark_background)); else listView.setBackgroundColor(getResources().getColor(android.R.color.background_light)); gobackitem = Sp.getBoolean("goBack_checkbox", true); coloriseIcons = Sp.getBoolean("coloriseIcons", false); Calendar calendar = Calendar.getInstance(); showSize = Sp.getBoolean("showFileSize", false); showLastModified = Sp.getBoolean("showLastModified", true); showDividers = Sp.getBoolean("showDividers", true); year = ("" + calendar.get(Calendar.YEAR)).substring(2, 4); skin = Sp.getString("skin_color", "#3f51b5"); iconskin = Sp.getString("icon_skin_color", skin); String x = getSelectionColor(); skinselection = Color.parseColor(x); files = new ArrayList<File>(); loadlist(f.getPath()); mToolbarContainer = getActivity().findViewById(R.id.lin); hidemode = Sp.getInt("hidemode", 0); try { mainActivity.toolbar.setTitle(f.getName()); } catch (Exception e) { mainActivity.toolbar.setTitle(getResources().getString(R.string.zip_viewer)); } mainActivity.tabsSpinner.setVisibility(View.GONE); mainActivity.fabHideAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_hide); mainActivity.floatingActionButton.setAnimation(mainActivity.fabHideAnim); mainActivity.floatingActionButton.animate(); mainActivity.floatingActionButton.setVisibility(View.GONE); mainActivity.supportInvalidateOptionsMenu(); mToolbarHeight = getToolbarHeight(getActivity()); paddingTop = (mToolbarHeight) + dpToPx(72); if (hidemode == 2) mToolbarHeight = paddingTop; mToolbarContainer.getViewTreeObserver() .addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { paddingTop = mToolbarContainer.getHeight(); if (hidemode != 2) mToolbarHeight = mainActivity.toolbar.getHeight(); else mToolbarHeight = paddingTop; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { mToolbarContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this); } else { mToolbarContainer.getViewTreeObserver().removeGlobalOnLayoutListener(this); } } }); }
From source file:at.alladin.rmbt.android.main.RMBTMainMenuFragment.java
/** * */// w w w . java2 s. c om @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); Log.i(DEBUG_TAG, "onCreate"); pulseAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.pulse); interfaceTrafficGatherer = new InterfaceTrafficGatherer(); informationCollector = new InformationCollector(getActivity(), false, false); speedFormat = new DecimalFormat( String.format("@@ %s", getActivity().getResources().getString(R.string.test_mbps))); ipv4CheckRunnable = new IpCheckRunnable(getActivity(), IpVersionType.V4, true); ipv4CheckRunnable.addListener(new OnIpCheckFinishedListener() { @Override public void onFinish(InetAddress privAddress, InetAddress pubAddress, InetAddress oldPrivAddress, InetAddress oldPubAddress) { if ((privAddress != null && !privAddress.equals(oldPrivAddress)) || (pubAddress != null && !pubAddress.equals(oldPubAddress)) || (privAddress == null && oldPrivAddress != null || pubAddress == null && oldPubAddress != null)) { Log.d(DEBUG_TAG, "new ipv4, run captive portal check..."); ((RMBTMainActivity) getActivity()).getNetworkInfoCollector().checkForCaptivePortal(); } } }); ipv6CheckRunnable = new IpCheckRunnable(getActivity(), IpVersionType.V6, true); ipv6CheckRunnable.addListener(new OnIpCheckFinishedListener() { @Override public void onFinish(InetAddress privAddress, InetAddress pubAddress, InetAddress oldPrivAddress, InetAddress oldPubAddress) { if ((privAddress != null && !privAddress.equals(oldPrivAddress)) || (pubAddress != null && !pubAddress.equals(oldPubAddress)) || (privAddress == null && oldPrivAddress != null || pubAddress == null && oldPubAddress != null)) { Log.d(DEBUG_TAG, "new ipv6, run captive portal check..."); ((RMBTMainActivity) getActivity()).getNetworkInfoCollector().checkForCaptivePortal(); } } }); networkWatcherRunnable = new NetworkWatcherRunnable(getActivity()); networkWatcherRunnable.addListener(new OnActiveNetworkChangeListener() { @Override public void onChange(Set<InetAddress> oldInterfaceSet, Set<InetAddress> newInterfaceSet, String oldSsid, String newSsid) { ipv4CheckRunnable.clearIps(); ipv6CheckRunnable.clearIps(); ((RMBTMainActivity) getActivity()).getNetworkInfoCollector().checkForCaptivePortal(); } }); }
From source file:com.raspi.chatapp.ui.image.SingleImageFragment.java
private void showOverlay(boolean active) { final View imageInfo = getActivity().findViewById(R.id.image_info); Animation anim;/* w ww . ja v a 2 s . c o m*/ if (active) { View decorView = getActivity().getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(uiOptions); anim = AnimationUtils.loadAnimation(getContext(), R.anim.bottom_in); anim.setDuration(300); imageInfo.setVisibility(View.VISIBLE); imageInfo.startAnimation(anim); } else { View decorView = getActivity().getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(uiOptions); anim = AnimationUtils.loadAnimation(getContext(), R.anim.bottom_out); anim.setDuration(300); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { imageInfo.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); imageInfo.startAnimation(anim); } overlayActive = active; }
From source file:com.blueverdi.rosietheriveter.PhotoViewActivity.java
private void slide(final ImageView v, final Bitmap new_image, final int in, final int out, final TextView view, final String string) { final Animation anim_out = AnimationUtils.loadAnimation(this, out); final Animation anim_in = AnimationUtils.loadAnimation(this, in); anim_out.setAnimationListener(new AnimationListener() { @Override//w w w .java 2 s .c o m public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { v.setImageBitmap(new_image); anim_in.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { view.setText(string); } }); v.startAnimation(anim_in); } }); v.startAnimation(anim_out); }
From source file:com.battlelancer.seriesguide.ui.MoviesSearchFragment.java
private void setProgressVisible(boolean visible, boolean animate) { if (animate) { Animation out = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out); Animation in = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in); resultsContainer.startAnimation(visible ? out : in); progressBar.startAnimation(visible ? in : out); }/* w ww. j a va 2s.c om*/ resultsContainer.setVisibility(visible ? View.GONE : View.VISIBLE); progressBar.setVisibility(visible ? View.VISIBLE : View.GONE); }
From source file:com.heinrichreimersoftware.singleinputform.SingleInputFormActivity.java
private Animation getAnimation(int animationResId, boolean isInAnimation) { final Interpolator interpolator; if (isInAnimation) { interpolator = new DecelerateInterpolator(1.0f); } else {/* w ww. j av a2s.c o m*/ interpolator = new AccelerateInterpolator(1.0f); } Animation animation = AnimationUtils.loadAnimation(activity, animationResId); animation.setInterpolator(interpolator); return animation; }