Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/githubak2002/first_simple_mobile_app
https://github.com/githubak2002/first_simple_mobile_app
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/githubak2002/first_simple_mobile_app
- Owner: Githubak2002
- Created: 2024-02-22T20:08:33.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-01T11:45:05.000Z (10 months ago)
- Last Synced: 2024-03-01T12:44:24.147Z (10 months ago)
- Language: Java
- Size: 2.68 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
My first simple mobile app. --- 3D image change
======================================== Activity.java file ========================================
package com.eg.try_animation;import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;public class MainActivity extends AppCompatActivity {
ImageView a1,a2;
boolean flag = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);
a1 = (ImageView)findViewById(R.id.imga);
a2 = (ImageView)findViewById(R.id.imgb);}
public void fade1(View v){
// a1.animate().alpha(0).setDuration(1000);
a1.animate().scaleX(.5f).scaleY(.5f).setDuration(1000);
if(!flag){
flag = true;
a1.animate().scaleX(1).scaleY(1).setDuration(1000);
a1.animate().translationX(-1000).setDuration(1000);}
else{
flag = false;
a1.animate().scaleX(.5f).scaleY(.5f).setDuration(1000);
a1.animate().translationX(0).setDuration(1000);}
}
public void fade(View v){
if(!flag){
a1.animate().alpha(0).scaleX(.5f).scaleY(.5f).setDuration(1000);
a2.animate().alpha(1).scaleX(1).scaleY(1).setDuration(1000);
flag = true;
}
else{
a2.animate().alpha(0).scaleX(.5f).scaleY(.5f).setDuration(1000);
a1.animate().alpha(1).scaleX(1).scaleY(1).setDuration(1000);
flag = false;}
}
}================================== .xml file ==============================