Showing
3 changed files
with
12 additions
and
3 deletions
@@ -30,6 +30,7 @@ import com.studymachine.www.action.PresentationAction; | @@ -30,6 +30,7 @@ import com.studymachine.www.action.PresentationAction; | ||
30 | import com.studymachine.www.action.TitleBarAction; | 30 | import com.studymachine.www.action.TitleBarAction; |
31 | import com.studymachine.www.action.ToastAction; | 31 | import com.studymachine.www.action.ToastAction; |
32 | import com.studymachine.www.http.model.HttpData; | 32 | import com.studymachine.www.http.model.HttpData; |
33 | +import com.studymachine.www.manager.ActivityManager; | ||
33 | import com.studymachine.www.manager.EventBusManager; | 34 | import com.studymachine.www.manager.EventBusManager; |
34 | import com.studymachine.www.other.Tool; | 35 | import com.studymachine.www.other.Tool; |
35 | import com.studymachine.www.ui.activity.HomeActivity; | 36 | import com.studymachine.www.ui.activity.HomeActivity; |
@@ -148,6 +149,7 @@ public abstract class AppActivity extends BaseActivity | @@ -148,6 +149,7 @@ public abstract class AppActivity extends BaseActivity | ||
148 | @Override | 149 | @Override |
149 | public void onGlassDeviceDisconnected() { | 150 | public void onGlassDeviceDisconnected() { |
150 | connectStatus.setValue(false); | 151 | connectStatus.setValue(false); |
152 | + ActivityManager.getInstance().finishAllActivities(); | ||
151 | // mControllerBid.setVisibility(View.GONE); | 153 | // mControllerBid.setVisibility(View.GONE); |
152 | } | 154 | } |
153 | }); | 155 | }); |
@@ -337,6 +337,10 @@ public abstract class AppPresentation extends Presentation implements TitleBarAc | @@ -337,6 +337,10 @@ public abstract class AppPresentation extends Presentation implements TitleBarAc | ||
337 | mControllerImage.layout(left, top, right, bottom); | 337 | mControllerImage.layout(left, top, right, bottom); |
338 | if (move) { | 338 | if (move) { |
339 | View view = getViewAtActivity(x, y); | 339 | View view = getViewAtActivity(x, y); |
340 | + if (view == null){ | ||
341 | + break; | ||
342 | + } | ||
343 | + | ||
340 | MotionEvent motionEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_DOWN, 0, 0, 0); | 344 | MotionEvent motionEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_DOWN, 0, 0, 0); |
341 | view.dispatchTouchEvent(motionEvent); | 345 | view.dispatchTouchEvent(motionEvent); |
342 | MotionEvent moveEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_MOVE, 0 - scollX, 0 - scollY, 0); | 346 | MotionEvent moveEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_MOVE, 0 - scollX, 0 - scollY, 0); |
@@ -346,6 +350,9 @@ public abstract class AppPresentation extends Presentation implements TitleBarAc | @@ -346,6 +350,9 @@ public abstract class AppPresentation extends Presentation implements TitleBarAc | ||
346 | } | 350 | } |
347 | } else { | 351 | } else { |
348 | View view = getViewAtActivity(x, y); | 352 | View view = getViewAtActivity(x, y); |
353 | + if (view == null){ | ||
354 | + break; | ||
355 | + } | ||
349 | MotionEvent motionEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_DOWN, 0, 0, 0); | 356 | MotionEvent motionEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_DOWN, 0, 0, 0); |
350 | view.dispatchTouchEvent(motionEvent); | 357 | view.dispatchTouchEvent(motionEvent); |
351 | MotionEvent moveEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_MOVE, 0 - distanceX, 0 - distanceY, 0); | 358 | MotionEvent moveEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_MOVE, 0 - distanceX, 0 - distanceY, 0); |
@@ -8,15 +8,15 @@ | @@ -8,15 +8,15 @@ | ||
8 | tools:context="com.studymachine.www.ui.activity.AiListActivity"> | 8 | tools:context="com.studymachine.www.ui.activity.AiListActivity"> |
9 | 9 | ||
10 | <androidx.appcompat.widget.AppCompatImageView | 10 | <androidx.appcompat.widget.AppCompatImageView |
11 | - android:layout_width="wrap_content" | ||
12 | - android:layout_height="wrap_content" | 11 | + android:layout_width="match_parent" |
12 | + android:layout_height="match_parent" | ||
13 | android:src="@drawable/ai_person_bg" | 13 | android:src="@drawable/ai_person_bg" |
14 | android:translationZ="@dimen/dp_2" /> | 14 | android:translationZ="@dimen/dp_2" /> |
15 | 15 | ||
16 | 16 | ||
17 | <androidx.appcompat.widget.AppCompatImageView | 17 | <androidx.appcompat.widget.AppCompatImageView |
18 | android:id="@+id/iv_person" | 18 | android:id="@+id/iv_person" |
19 | - android:layout_width="@dimen/dp_300" | 19 | + android:layout_width="@dimen/dp_500" |
20 | android:layout_centerVertical="true" | 20 | android:layout_centerVertical="true" |
21 | android:layout_height="wrap_content" | 21 | android:layout_height="wrap_content" |
22 | android:src="@drawable/ai_person_to" | 22 | android:src="@drawable/ai_person_to" |