Android Open Source - gif-video-adrnoid Main Activity






From Project

Back to project page gif-video-adrnoid.

License

The source code is released under:

Copyright (c) 2013, Sergey Bakhtiarov All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...

If you think the Android project gif-video-adrnoid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.basv.gifmoviewview;
/*from   ww w  .j  a  va  2 s  .c  o m*/
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

import com.basv.gifmoviewview.widget.GifMovieView;

public class MainActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    GifMovieView gif1 = new GifMovieView(this);
    gif1.setMovieResource(R.drawable.gif_heart);
    setContentView(gif1);
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
  }

  public void onGifClick(View v) {
    GifMovieView gif = (GifMovieView) v;
    gif.setPaused(!gif.isPaused());
  }

}




Java Source Code List

com.basv.gifmoviewview.MainActivity.java
com.basv.gifmoviewview.widget.GifMovieView.java