1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.amsal.ta.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.amsal.ta.R;
import com.amsal.ta.ui.dashboard.DashboardFragment;
public class HomeFragment extends Fragment {
private HomeViewModel homeViewModel;
Animation botAnim;
Animation topAnim;
ImageView image;
CardView cardView;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
return root;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
botAnim = AnimationUtils.loadAnimation(getContext(), R.anim.bottom_animation);
topAnim = AnimationUtils.loadAnimation(getContext(), R.anim.top_animation);
image = getView().findViewById(R.id.imageLogo);
cardView = getView().findViewById(R.id.card);
cardView.setAnimation(botAnim);
image.setAnimation(topAnim);
}
}