AndyScherzinger 8 жил өмнө
parent
commit
8436dc92e0

+ 11 - 9
src/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -144,18 +144,17 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
     }
 
     static private boolean isFirstRun() {
-        if (getLastSeenVersionCode() != 0)
-            return false;
-        return AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()) == null;
-
+        return getLastSeenVersionCode() == 0 && AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()) == null;
     }
 
     static public void runIfNeeded(Context context) {
-        if (context instanceof WhatsNewActivity)
+        if (context instanceof WhatsNewActivity) {
             return;
+        }
 
-        if (shouldShow(context))
+        if (shouldShow(context)) {
             context.startActivity(new Intent(context, WhatsNewActivity.class));
+        }
     }
 
     static private boolean shouldShow(Context context) {
@@ -226,16 +225,19 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
             View v = inflater.inflate(R.layout.whats_new_element, container, false);
 
             ImageView iv = (ImageView)v.findViewById(R.id.whatsNewImage);
-            if (mItem.shouldShowImage())
+            if (mItem.shouldShowImage()) {
                 iv.setImageResource(mItem.getImage());
+            }
 
             TextView tv2 = (TextView)v.findViewById(R.id.whatsNewTitle);
-            if (mItem.shouldShowTitleText())
+            if (mItem.shouldShowTitleText()) {
                 tv2.setText(mItem.getTitleText());
+            }
 
             tv2 = (TextView)v.findViewById(R.id.whatsNewText);
-            if (mItem.shouldShowContentText())
+            if (mItem.shouldShowContentText()) {
                 tv2.setText(mItem.getContentText());
+            }
 
             return v;
         }

+ 3 - 1
src/com/owncloud/android/ui/whatsnew/ProgressIndicator.java

@@ -74,7 +74,9 @@ public class ProgressIndicator extends FrameLayout {
     }
 
     public void animateToStep(int step) {
-        if (step < 1 || step > mNumberOfSteps) return;
+        if (step < 1 || step > mNumberOfSteps) {
+            return;
+        }
 
         if (mCurrentStep != -1) {
             ImageView prevDot = (ImageView) mDotsContainer.getChildAt(mCurrentStep-1);