@@ -45,15 +45,6 @@ public ActivityTaskView(Context context) {
4545 mObservable = new LifecycleObservable ();
4646 }
4747
48- private LinearLayout createLinearLayout (String tag ) {
49- LinearLayout layout = new LinearLayout (getContext ());
50- layout .setOrientation (LinearLayout .VERTICAL );
51- layout .setBackgroundResource (R .drawable .bg_rect_inner );
52- layout .setPadding (10 ,0 ,10 ,0 );
53- layout .setTag (tag );
54- return layout ;
55- }
56-
5748 public FragmentTaskView findFragmentTaskView (String activity ) {
5849 for (int i = 0 ; i < mContainer .getChildCount (); i ++) {
5950 View view = mContainer .getChildAt (i );
@@ -142,7 +133,7 @@ public void update(LifecycleInfo info) {
142133 } else if (info .lifecycle .contains ("Pause" )) {
143134 FragmentTaskView view = findFragmentTaskView (info .activity );
144135 if (view != null ) {
145- view .setVisibility (INVISIBLE );
136+ view .setVisibility (GONE );
146137 }
147138 }
148139
@@ -155,14 +146,15 @@ private void notifyData() {
155146 mObservable .deleteObservers ();
156147 Set <Map .Entry <String , ArrayList <String >>> set = aTree .entrySet ();
157148 for (Map .Entry <String , ArrayList <String >> entry : set ) {
158- LinearLayout layout = createLinearLayout ("" );
149+ TaskLayout layout = new TaskLayout (getContext ());
150+ layout .setTitle (entry .getKey ());
159151 for (String value : entry .getValue ()) {
160152 ObserverTextView textView = new ObserverTextView (getContext ());
161153 textView .setInfoText (value , aTree .getLifecycle (value ));
162- layout .addView (textView , 0 );
154+ layout .add (textView );
163155 mObservable .addObserver (textView );
164156 }
165- mLinearLayout .addView (layout );
157+ mLinearLayout .addView (layout , 0 );
166158 }
167159 }
168160
0 commit comments