Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimation is not working in Samsung Galaxy s3 in android?
    primarykey
    data
    text
    <p>I am making animation effect by referening the follwing link . <a href="http://www.edumobile.org/android/android-development/custom-popup-window-example/comment-page-1/#comment-1649" rel="nofollow">http://www.edumobile.org/android/android-development/custom-popup-window-example/comment-page-1/#comment-1649</a>.</p> <p>Code :</p> <pre><code> public class TutorialActivity extends Activity implements OnClickListener { private static String TAG = TutorialActivity.class.getSimpleName(); private static final String NULL_STRING = "null"; private Button mInfoBtn; private Animation animShow, animHide; private AlertDialog mErrorAlertDialog; private boolean isLogOff = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.tutorial); mInfoBtn = (Button) findViewById(R.id.btn_info); mInfoBtn.setOnClickListener(this); } @Override public void onClick(View v) { initPopup(); } /** * Used to show the Logoff Popup menu */ private void initPopup() { Intent intent = getIntent(); final PopupPanel popup = (PopupPanel) findViewById(R.id.popup_window); popup.setVisibility(View.VISIBLE); animShow = AnimationUtils.loadAnimation(this, R.anim.popup_show); animHide = AnimationUtils.loadAnimation(this, R.anim.popup_hide); popup.startAnimation(animShow); final Button closeButton = (Button) findViewById(R.id.btnClose); closeButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { popup.startAnimation(animHide); popup.setVisibility(View.GONE); } }); final Button cancelAppointmet = (Button) findViewById(R.id.btnCancel); final Button logoff = (Button) findViewById(R.id.btnLogoff); logoff.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { popup.startAnimation(animHide); popup.setVisibility(View.GONE); } }); cancelAppointmet.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { popup.startAnimation(animHide); popup.setVisibility(View.GONE); } }); } } </code></pre> <p>PopupPanel.java</p> <pre><code> public class PopupPanel extends LinearLayout { private Paint innerPaint, borderPaint; public PopupPanel(Context context, AttributeSet attrs) { super(context, attrs); init(); } public PopupPanel(Context context) { super(context); init(); } private void init() { innerPaint = new Paint(); innerPaint.setARGB(225, 0, 0, 0); innerPaint.setAntiAlias(true); borderPaint = new Paint(); borderPaint.setARGB(255, 0, 0, 0); borderPaint.setAntiAlias(true); borderPaint.setStyle(Style.STROKE); borderPaint.setStrokeWidth(2); } public void setInnerPaint(Paint innerPaint) { this.innerPaint = innerPaint; } public void setBorderPaint(Paint borderPaint) { this.borderPaint = borderPaint; } @Override protected void dispatchDraw(Canvas canvas) { RectF drawRect = new RectF(); drawRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); canvas.drawRoundRect(drawRect, 5, 5, innerPaint); canvas.drawRoundRect(drawRect, 5, 5, borderPaint); super.dispatchDraw(canvas); } } </code></pre> <p>tutorial.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;RelativeLayout android:id="@+id/heading" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:background="@drawable/header_bg_short" &gt; &lt;Button android:id="@+id/btn_info" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="10px" android:background="@drawable/btn_info" &gt; &lt;/Button&gt; &lt;ImageView android:id="@+id/iveMailMinder" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:src="@drawable/header_text" /&gt; &lt;/RelativeLayout&gt; &lt;ImageView android:id="@+id/tutorilaimage" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/heading" android:scaleType="fitXY" android:src="@drawable/tutorial_android3" /&gt; &lt;/RelativeLayout&gt; &lt;com.xxx.com.PopupPanel android:id="@+id/popup_window" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:gravity="left" android:orientation="vertical" android:visibility="gone" &gt; &lt;Button android:id="@+id/btnClose" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="10dp" android:enabled="false" android:text="@string/btn_close_name" android:textSize="16sp" android:textStyle="bold" /&gt; &lt;Button android:id="@+id/btnLogoff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="5dp" android:enabled="false" android:text="@string/btn_logoff_name" android:textSize="16sp" android:textStyle="bold" /&gt; &lt;Button android:id="@+id/btnCancel" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="10dp" android:text="@string/btn_cancel_name" android:textSize="16sp" android:textStyle="bold" /&gt; &lt;/com.xxx.com.PopupPanel&gt; &lt;/FrameLayout&gt; </code></pre> <p>.Code is working in all the devices except <strong>Samsung Galaxy S3</strong>.</p> <p>I am showing the animation when i click on "Info" button .</p> <p><strong>Observed that in S3 ,when i long click on the "Info" button then animation is coming .With normal click event animation is not coming.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload