Tags » Imageview

[Android] Android Development for Beginners (1)

 [내용정리]  Android Development for Beginners LESSON 1

  • TextView (View)


참고 : android developers #androidDev #protip

  • ImageView (View)

android:scaleType=”centerCrop”

-orientation : vertical / horizontal…

60 more words
Android

fun with animation

Android animation with ripple effect on buttons. Will add description later. for now enjoy coding

Main class :

public class MainActivity extends AppCompatActivity {

    ImageView image;
    TextView text;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        image = (ImageView)findViewById(R.id.imageView);
        text = (TextView) findViewById(R.id.textView2);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    public void clockwise(View view){

        Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.my_animation);
        image.startAnimation(animation);
        text.startAnimation(animation);
    }

    public void zoom(View view){
       Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.cloackwise);
        image.startAnimation(animation1);
        text.startAnimation(animation1);
    }

    public void fade(View view){
        Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade);
        image.startAnimation(animation1);
        text.setAnimation(animation1);
    }

    public void blink(View view){
        Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink);
        image.startAnimation(animation1);
        text.setAnimation(animation1);
    }

    public void move(View view){
        Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move);
        image.startAnimation(animation1);
        text.setAnimation(animation1);
    }

    public void slide(View view){
        Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide);
        image.startAnimation(animation1);
        text.setAnimation(animation1);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present. 1,056 more words
Android

Android Show grey gradient on ImageView

In android if you are working on ImageViews at times you may be needing to show texts on top of ImageViews, so you can use this small hack so that you can show a grey gradient from bottom and textview on the grey will be more visible.

Android

[Hướng dẫn] Vấn đề adjustViewBounds của ImageView trong API level 17 trở xuống

Vấn đề mình muốn nói ở đây chính là việc tự động co dãn ImageView.

Nói đến đây, nhiều bạn sẽ nghĩ ngay đến thuộc tính “android:adjustViewBounds”. 937 more words

News

[Hướng dẫn] Scale hình ảnh với scaleType

Trong ImageView có attribute scaleType cho phép bạn dễ dàng scale hình ảnh theo yêu cầu mong muốn. Bao gồm các values sau đây:

CENTER… 83 more words

News