This commit is contained in:
Daniel Lublin
2021-01-28 10:39:55 +01:00
parent 244d03a718
commit da5b2c194a
6 changed files with 31 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ import org.briarproject.briar.android.blog.RssFeedImportActivity;
import org.briarproject.briar.android.blog.RssFeedManageActivity; import org.briarproject.briar.android.blog.RssFeedManageActivity;
import org.briarproject.briar.android.blog.WriteBlogPostActivity; import org.briarproject.briar.android.blog.WriteBlogPostActivity;
import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupActivity; import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupActivity;
import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupDiscoveryFragment; import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupChooseFragment;
import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupPendingFragment; import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupPendingFragment;
import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupStartFragment; import org.briarproject.briar.android.bluetoothsetup.BluetoothSetupStartFragment;
import org.briarproject.briar.android.contact.ContactListFragment; import org.briarproject.briar.android.contact.ContactListFragment;
@@ -250,7 +250,7 @@ public interface ActivityComponent {
void inject(BluetoothSetupStartFragment fragment); void inject(BluetoothSetupStartFragment fragment);
void inject(BluetoothSetupDiscoveryFragment fragment); void inject(BluetoothSetupChooseFragment fragment);
void inject(BluetoothSetupPendingFragment fragment); void inject(BluetoothSetupPendingFragment fragment);

View File

@@ -19,9 +19,9 @@ import androidx.lifecycle.ViewModelProvider;
@MethodsNotNullByDefault @MethodsNotNullByDefault
@ParametersNotNullByDefault @ParametersNotNullByDefault
public class BluetoothSetupDiscoveryFragment extends BaseFragment { public class BluetoothSetupChooseFragment extends BaseFragment {
private static final String TAG = private static final String TAG =
BluetoothSetupDiscoveryFragment.class.getName(); BluetoothSetupChooseFragment.class.getName();
@Inject @Inject
ViewModelProvider.Factory viewModelFactory; ViewModelProvider.Factory viewModelFactory;
@@ -49,7 +49,7 @@ public class BluetoothSetupDiscoveryFragment extends BaseFragment {
.get(BluetoothSetupViewModel.class); .get(BluetoothSetupViewModel.class);
View v = View v =
inflater.inflate(R.layout.fragment_bluetooth_setup_discovery, inflater.inflate(R.layout.fragment_bluetooth_setup_choose,
container, false); container, false);
// TODO to enable when user picks a device from list // TODO to enable when user picks a device from list
@@ -60,6 +60,13 @@ public class BluetoothSetupDiscoveryFragment extends BaseFragment {
}); });
continueButton.setEnabled(true); continueButton.setEnabled(true);
// RecyclerView devices = v.findViewById(R.id.devices);
// devices.setHasFixedSize(true);
// final LinearLayoutManager layoutManager =
// new LinearLayoutManager(getActivity(),
// LinearLayoutManager.VERTICAL, false);
// devices.setLayoutManager(layoutManager);
return v; return v;
} }
} }

View File

@@ -54,7 +54,6 @@ public class BluetoothSetupPendingFragment extends BaseFragment {
} }
private void onContinueButtonClicked() { private void onContinueButtonClicked() {
// showNextFragment(BluetoothSetupDiscoveryFragment.newInstance());
} }
} }

View File

@@ -55,7 +55,7 @@ public class BluetoothSetupStartFragment extends BaseFragment {
Button startButton = v.findViewById(R.id.startButton); Button startButton = v.findViewById(R.id.startButton);
startButton.setOnClickListener(view -> { startButton.setOnClickListener(view -> {
showNextFragment(new BluetoothSetupDiscoveryFragment()); showNextFragment(new BluetoothSetupChooseFragment());
}); });
startButton.setEnabled(true); startButton.setEnabled(true);

View File

@@ -33,7 +33,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:text="Pick contact's device" android:text="Pick contact"
app:layout_constraintEnd_toStartOf="@+id/guideline" app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/stepOne" /> app:layout_constraintTop_toBottomOf="@+id/stepOne" />
@@ -67,7 +67,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:alpha="0.5" android:alpha="0.5"
android:text="Wait for contact" android:text="Wait for setup"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/stepTwo" /> app:layout_constraintTop_toBottomOf="@+id/stepTwo" />
@@ -80,14 +80,14 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:textSize="16sp" android:textSize="16sp"
android:text="Please pick your contact's device below" android:text="Pick the nearby contact to perform the setup with."
app:layout_constraintBottom_toTopOf="@id/devices" app:layout_constraintBottom_toTopOf="@id/contacts"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/stepOneText" /> app:layout_constraintTop_toBottomOf="@id/stepOneText" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/devices" android:id="@+id/contacts"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginVertical="32dp" android:layout_marginVertical="32dp"
@@ -109,5 +109,14 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
tools:enabled="true" /> tools:enabled="true" />
<TextView
android:id="@+id/commentTextView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="list of all [contact-name-and-avatar]"
android:textColor="@color/briar_red_500"
tools:layout_editor_absoluteX="72dp"
tools:layout_editor_absoluteY="189dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@@ -33,7 +33,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:text="Pick contact's device" android:text="Pick contact"
app:layout_constraintEnd_toStartOf="@+id/guideline" app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/stepOne" /> app:layout_constraintTop_toBottomOf="@+id/stepOne" />
@@ -65,20 +65,20 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:text="Wait for contact" android:text="Wait for setup"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/stepTwo" /> app:layout_constraintTop_toBottomOf="@+id/stepTwo" />
<TextView <TextView
android:id="@+id/discoveryText" android:id="@+id/pendingText"
android:layout_marginTop="32dp" android:layout_marginTop="32dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:textSize="16sp" android:textSize="16sp"
android:text="Waiting for your contact to pick your device" android:text="Waiting for a connection to be established with:\n\n[chosen contact-name-and-avatar]"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/stepOneText" /> app:layout_constraintTop_toBottomOf="@id/stepOneText" />