android-gesture

Viewpager in Android to switch between days endlessly

五迷三道 提交于 2019-11-27 02:28:43
问题 I am currently making a app where students can view there lesson grid. The lessons are retrieved using a json file. Now the date changing is done via buttons in the actionbar, but i want to make it also work with smooth swipe effects. The only things that need to change is the SlectedDate-1 on left swipe . the SelectedDate+1 on right swipe . I tried it with ViewPager s but it didn't work does anybody know how to do it? Maybe something with 3 viewpagers?, please a detailed code because I'm not

android - How can I make a button flash?

无人久伴 提交于 2019-11-26 19:33:52
Is there any way, in code, to make a button flash continually and then stop flashing when pressed? Alex Orlov There are several, depending on what kind of flashing you mean. You can, for example, use alpha animation and start it as your button first appears. And when the user clicks button, in your OnClickListener just do clearAnimation() . Example: public void onCreate(Bundle savedInstanceState) { final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible animation.setDuration(500); // duration - half a second animation.setInterpolator(new

Can we use scale gesture detector for pinch zoom in Android?

巧了我就是萌 提交于 2019-11-26 09:26:29
问题 Can we use scale gesture detector for pinch zoom in Android? 回答1: You can use this import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.BitmapDrawable; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; public class MyImageView extends View { private static final int INVALID_POINTER_ID = -1; private Drawable mImage; private float mPosX;

android - How can I make a button flash?

旧街凉风 提交于 2019-11-26 06:17:14
问题 Is there any way, in code, to make a button flash continually and then stop flashing when pressed? 回答1: There are several, depending on what kind of flashing you mean. You can, for example, use alpha animation and start it as your button first appears. And when the user clicks button, in your OnClickListener just do clearAnimation() . Example: public void onCreate(Bundle savedInstanceState) { final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible