Lint issues fixed

This commit is contained in:
serso
2016-03-02 10:26:21 +01:00
parent e108ed1b3b
commit 8cdd640132
99 changed files with 45 additions and 947 deletions

View File

@@ -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);
}