Update "Nearby" splash screen to new UI.

Be sure to not hardcode "F-Droid" to ensure it is easier to rebadge
F-Droid if creating a whitelabel version.

Fixes #894.
This commit is contained in:
Peter Serwylo 2017-03-20 19:42:14 +11:00
parent 53bed0f2e1
commit b177dc2cda
4 changed files with 61 additions and 39 deletions

View File

@ -8,6 +8,7 @@ import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.views.fragments.PreferencesFragment;
@ -75,6 +76,11 @@ class MainViewController extends RecyclerView.ViewHolder {
public void bindSwapView() {
View swapView = activity.getLayoutInflater().inflate(R.layout.main_tab_swap, frame, true);
// To allow for whitelabel versions of F-Droid, make sure not to hardcode "F-Droid" into our
// translation here.
TextView subtext = (TextView) swapView.findViewById(R.id.text2);
subtext.setText(activity.getString(R.string.nearby_splash__both_parties_need_fdroid, activity.getString(R.string.app_name)));
Button startButton = (Button) swapView.findViewById(R.id.button);
startButton.setOnClickListener(new View.OnClickListener() {
@Override

View File

@ -0,0 +1,6 @@
<vector android:height="24dp" android:viewportHeight="634.0"
android:viewportWidth="720.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#f9f9f9"
android:pathData="M105,0L105,321.3L0,387.7L0,405.9L105,339.5L105,392L104.6,392L104.6,407.5L105,407.5L105,633L120,633L120,407.5L209,407.5L209,633L224,633L224,407.5L393,407.5L498.7,633.1L514.6,633.6L408.7,407.5L624.5,407.5L624.5,633L639.5,633L639.5,470.5L720,435.9L720,419L639.5,453.6L639.5,67.1L720,67.1L720,51.5L120,51.5L120,0L105,0zM120,67.1L233.4,67.1L385.7,392L120,392L120,67.1zM249.1,67.1L624.5,67.1L624.5,392L401.4,392L249.1,67.1z"
android:strokeColor="#00000000" android:strokeWidth="1"/>
</vector>

View File

@ -4,60 +4,66 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/swap_start_header"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
android:layout_height="match_parent"
android:background="#FAFAFA">
<TextView
android:id="@+id/text1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Download apps from people near you."
android:layout_marginEnd="48dp"
android:layout_marginLeft="48dp"
android:layout_marginRight="48dp"
android:layout_marginStart="48dp"
android:layout_marginTop="48dp"
android:text="@string/nearby_splash__download_apps_from_people_nearby"
android:textAlignment="center"
android:textSize="20sp"
android:textAlignment="center"
app:layout_constraintTop_toBottomOf="@+id/image"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#4a4a4a"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="32dp"
android:layout_marginEnd="48dp"
android:layout_marginRight="48dp"
android:layout_marginStart="48dp"
android:layout_marginLeft="48dp" />
<!-- TODO: Use @string/app_name instead of "F-Droid". -->
<!-- TODO: The swap process helps to get F-Droid to the other user. That should probably be made a bit clearer here. -->
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Participants must have F-Droid installed."
android:textSize="14sp"
android:textAlignment="center"
app:layout_constraintTop_toBottomOf="@+id/text1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="16dp"
android:layout_marginEnd="48dp"
android:layout_marginRight="48dp"
android:layout_marginStart="48dp"
android:layout_marginLeft="48dp" />
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Find people near me"
android:text="@string/nearby_splash__find_people_button"
style="@style/DetailsSecondaryButtonStyle"
app:layout_constraintTop_toBottomOf="@+id/text2"
app:layout_constraintTop_toBottomOf="@+id/text1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="16dp" />
android:layout_marginTop="24dp" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@string/nearby_splash__both_parties_need_fdroid"
android:textSize="15sp"
android:textAlignment="center"
android:textColor="#5B5B5B"
app:layout_constraintTop_toBottomOf="@+id/button"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="24dp"
android:layout_marginEnd="48dp"
android:layout_marginRight="48dp"
android:layout_marginStart="48dp"
android:layout_marginLeft="48dp" />
<ImageView
android:id="@+id/image"
android:layout_width="0dp"
android:layout_height="0dp"
app:srcCompat="@drawable/nearby_splash"
android:importantForAccessibility="no"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text2"
android:layout_marginTop="36dp"
android:tint="#f5f5f5"
android:scaleType="fitXY" />
</android.support.constraint.ConstraintLayout>

View File

@ -342,6 +342,10 @@
<string name="system_uninstall_button">Uninstall</string>
<string name="system_install_not_supported">Installation of F-Droid Privileged Extension is currently not supported on Android 5.1 or later.</string>
<string name="nearby_splash__download_apps_from_people_nearby">No internet? Download apps from people near you!</string>
<string name="nearby_splash__find_people_button">Find people near me</string>
<string name="nearby_splash__both_parties_need_fdroid">Both parties need %1$s to use nearby.</string>
<string name="swap_nfc_title">Touch to swap</string>
<string name="swap_nfc_description">If your friend has F-Droid and NFC turned on touch your devices together.</string>
<string name="swap_join_same_wifi">Join the same Wi-Fi as your friend</string>