Android Open Source - DouDouAndroidDemo Rocket Launcher






From Project

Back to project page DouDouAndroidDemo.

License

The source code is released under:

Apache License

If you think the Android project DouDouAndroidDemo 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 floatwindow;
/*ww  w.  java2 s  . com*/
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.oldoldb.doudouandroiddemo.R;

public class RocketLauncher extends LinearLayout{

  private static RocketLauncher instance;
  
  private int mWidth;
  public int getmWidth() {
    return mWidth;
  }
  public void setmWidth(int mWidth) {
    this.mWidth = mWidth;
  }

  private int mHeight;
  public int getmHeight() {
    return mHeight;
  }
  public void setmHeight(int mHeight) {
    this.mHeight = mHeight;
  }

  private ImageView mlauncherImageView;
  
  public static RocketLauncher getInstance(Context context)
  {
    if(instance == null){
      synchronized (RocketLauncher.class) {
        if(instance == null){
          instance = new RocketLauncher(context);
        }
      }
    }
    return instance;
  }
  private RocketLauncher(Context context)
  {
    super(context);
    LayoutInflater.from(context).inflate(R.layout.launcher, this);
    mlauncherImageView = (ImageView)findViewById(R.id.imageview_launcher);
    mWidth = mlauncherImageView.getLayoutParams().width;
    mHeight = mlauncherImageView.getLayoutParams().height;
  }
  
  public void updateLauncherStatus(boolean isReadyToLaunch)
  {
    if(isReadyToLaunch){
      mlauncherImageView.setImageResource(R.drawable.launcher_bg_fire);
    }else{
      mlauncherImageView.setImageResource(R.drawable.launcher_bg_hold);
    }
  }
}




Java Source Code List

com.oldoldb.doudouandroiddemo.FloatWindowLargeView.java
com.oldoldb.doudouandroiddemo.FloatWindowManager.java
com.oldoldb.doudouandroiddemo.FloatWindowService.java
com.oldoldb.doudouandroiddemo.FloatWindowSmallView.java
com.oldoldb.doudouandroiddemo.MainActivity.java
floatwindow.FloatWindowLargeView.java
floatwindow.FloatWindowManager.java
floatwindow.FloatWindowService.java
floatwindow.FloatWindowSmallView.java
floatwindow.RocketLauncher.java