Lint issues fixed
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.slideshare.mobile.test.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.support.test.espresso.UiController;
|
||||
@@ -60,8 +61,7 @@ public class OrientationChangeAction implements ViewAction {
|
||||
@Override
|
||||
public void perform(UiController uiController, View view) {
|
||||
uiController.loopMainThreadUntilIdle();
|
||||
final Activity activity = (Activity) view.getContext();
|
||||
activity.setRequestedOrientation(orientation);
|
||||
requestOrientation(view);
|
||||
|
||||
Collection<Activity> resumedActivities = ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(Stage.RESUMED);
|
||||
if (resumedActivities.isEmpty()) {
|
||||
@@ -69,6 +69,12 @@ public class OrientationChangeAction implements ViewAction {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("WrongConstant")
|
||||
private void requestOrientation(View view) {
|
||||
final Activity activity = (Activity) view.getContext();
|
||||
activity.setRequestedOrientation(orientation);
|
||||
}
|
||||
|
||||
public static ViewAction orientationLandscape() {
|
||||
return new OrientationChangeAction(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user