Sfoglia il codice sorgente

if webview show app name

tobiasKaminsky 8 anni fa
parent
commit
92f12ac6a9

+ 12 - 3
src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -78,7 +78,9 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
         final boolean isBeta = getResources().getBoolean(R.bool.is_beta);
         String[] urls = getResources().getStringArray(R.array.whatsnew_urls);
 
-        if (urls.length > 0) {
+        boolean showWebView = urls.length > 0;
+
+        if (showWebView) {
             FeaturesWebViewAdapter featuresWebViewAdapter = new FeaturesWebViewAdapter(getSupportFragmentManager(),
                     urls);
             mProgress.setNumberOfSteps(featuresWebViewAdapter.getCount());
@@ -124,7 +126,14 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
         });
 
         TextView tv = (TextView)findViewById(R.id.welcomeText);
-        tv.setText(isFirstRun() ? R.string.empty : R.string.whats_new_title);
+
+        if (showWebView) {
+            tv.setText(R.string.app_name);
+        } else if (isFirstRun()) {
+            tv.setText(R.string.empty);
+        } else {
+            tv.setText(R.string.whats_new_title);
+        }
 
         updateNextButtonIfNeeded();
     }
@@ -235,7 +244,7 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
         @Override
         public void onCreate(@Nullable Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
-            mWebUrl = getArguments() != null ? (String)getArguments().getString("url") : null;
+            mWebUrl = getArguments() != null ? getArguments().getString("url") : null;
         }
 
         @Nullable

+ 6 - 3
src/main/res/layout/whats_new_activity.xml

@@ -29,12 +29,15 @@
         android:id="@+id/welcomeText"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_margin="5dp"
+        android:layout_marginBottom="5dp"
+        android:layout_marginLeft="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:layout_weight="6"
-        android:gravity="center"
+        android:gravity="center_vertical"
         android:text="@string/placeholder_sentence"
         android:textAppearance="?android:attr/textAppearanceLarge"
-        android:textColor="@color/login_text_hint_color"/>
+        android:textColor="@color/white"/>
 
     <android.support.v4.view.ViewPager
         android:id="@+id/contentPanel"