Android Open Source - open-radiobrony Stop Button






From Project

Back to project page open-radiobrony.

License

The source code is released under:

Apache License

If you think the Android project open-radiobrony 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.lesikapk.openradiobrony;
//w ww .j a  va  2 s . c om
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.Button;
import android.widget.Toast;

public class StopButton extends Button implements OnClickListener, OnLongClickListener {

  private static StopButton mThis;
  
    public StopButton(final Context context, final AttributeSet attrs) {
        super(context, attrs);
        setOnClickListener(this);
        setOnLongClickListener(this);
        mThis = this;
    }

    @Override
    public void onClick(final View v) {
    if(PlayerActivity.isPrepared()) {
          PlayerActivity.getThis().stopPlaying();
      }
    }

    @Override
    public boolean onLongClick(final View view) {
        Toast.makeText(getContext(), "Press this button to stop the stream.", Toast.LENGTH_SHORT).show();
        return true;
    }
    
    public static StopButton getThis() {
      return mThis;
    }
}




Java Source Code List

.NotificationHelper.java
com.lesikapk.openradiobrony.ErrorActivity.java
com.lesikapk.openradiobrony.ErrorHandler.java
com.lesikapk.openradiobrony.LayoutSuppressingImageView.java
com.lesikapk.openradiobrony.MusicInformation.java
com.lesikapk.openradiobrony.PlayButton.java
com.lesikapk.openradiobrony.PlayerActivity.java
com.lesikapk.openradiobrony.SquareImageView.java
com.lesikapk.openradiobrony.StopButton.java
com.lesikapk.openradiobrony.Utils.java