66import android .graphics .Matrix ;
77import android .graphics .PointF ;
88import android .os .Bundle ;
9-
10- import androidx .annotation .NonNull ;
11- import androidx .appcompat .app .AlertDialog ;
12- import androidx .core .content .res .ResourcesCompat ;
13- import androidx .fragment .app .Fragment ;
14-
159import android .view .LayoutInflater ;
1610import android .view .MotionEvent ;
1711import android .view .View ;
2014import android .widget .ImageView ;
2115import android .widget .TextView ;
2216
17+ import androidx .annotation .NonNull ;
18+ import androidx .appcompat .app .AlertDialog ;
19+ import androidx .core .content .res .ResourcesCompat ;
20+ import androidx .fragment .app .Fragment ;
21+
2322import java .util .ArrayList ;
2423
2524import io .pslab .R ;
@@ -45,6 +44,8 @@ public class PSLabPinLayoutFragment extends Fragment implements View.OnTouchList
4544
4645 private ImageView colorMap ;
4746
47+ private ImageView imgLayout ;
48+
4849 public static PSLabPinLayoutFragment newInstance () {
4950 return new PSLabPinLayoutFragment ();
5051 }
@@ -53,16 +54,27 @@ public static PSLabPinLayoutFragment newInstance() {
5354 public View onCreateView (@ NonNull LayoutInflater inflater , ViewGroup container ,
5455 Bundle savedInstanceState ) {
5556 View view = inflater .inflate (R .layout .fragment_pin_layout , container , false );
56- ImageView imgLayout = view .findViewById (R .id .img_pslab_pin_layout );
57+ imgLayout = view .findViewById (R .id .img_pslab_pin_layout );
5758 colorMap = view .findViewById (R .id .img_pslab_color_map );
59+ return view ;
60+ }
61+
62+ @ Override
63+ public void onResume () {
64+ super .onResume ();
5865 imgLayout .setImageDrawable (ResourcesCompat .getDrawable (getResources (),
5966 frontSide ? R .drawable .pslab_v5_front_layout : R .drawable .pslab_v5_back_layout , null ));
6067 colorMap .setImageDrawable (ResourcesCompat .getDrawable (getResources (),
6168 frontSide ? R .drawable .pslab_v5_front_colormap : R .drawable .pslab_v5_back_colormap , null ));
6269 imgLayout .setOnTouchListener (this );
6370 populatePinDetails ();
71+ }
6472
65- return view ;
73+ @ Override
74+ public void onPause () {
75+ super .onPause ();
76+ imgLayout .setImageDrawable (null );
77+ colorMap .setImageDrawable (null );
6678 }
6779
6880 private void populatePinDetails () {
0 commit comments