Skip to content

Commit

Permalink
Design notice #8: QR code should have a border around it
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed Jun 7, 2024
1 parent 1f0983a commit 1364253
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public class BraveSyncScreensPreference extends BravePreferenceFragment
private ScrollView mAddDeviceTab;
private LayoutInflater mInflater;
private ImageView mQRCodeImage;
private LinearLayout mQRContainer;
private LinearLayout mLayoutSyncStartChain;
private EditText mCodeWords;
private FrameLayout mLayoutMobile;
Expand Down Expand Up @@ -399,6 +400,8 @@ public void onActivityCreated(Bundle savedInstanceState) {

mQRCodeImage = getView().findViewById(R.id.brave_sync_qr_code_image);

mQRContainer = getView().findViewById(R.id.brave_sync_qr_containter);

mDoneButton = getView().findViewById(R.id.brave_sync_btn_done);
if (mDoneButton != null) {
mDoneButton.setOnClickListener(this);
Expand Down Expand Up @@ -821,7 +824,7 @@ void generateNewQrCode() {
ChromeBrowserInitializer.getInstance()
.runNowOrAfterFullBrowserStarted(() -> fillQrCode(qrCodeString));

mQRCodeImage.setVisibility(View.VISIBLE);
mQRContainer.setVisibility(View.VISIBLE);
mNewQrCodeButton.setVisibility(View.GONE);
}
}
Expand Down Expand Up @@ -1528,7 +1531,7 @@ private void setQrCountDown(LocalDateTime notAfterTime) {
countdown.setExpiredRunnable(
() -> {
mNewQrCodeButton.setVisibility(View.VISIBLE);
mQRCodeImage.setVisibility(View.GONE);
mQRContainer.setVisibility(View.GONE);
});
countdown.setNotAfter(notAfterTime);
}
Expand Down
33 changes: 22 additions & 11 deletions android/java/res/layout/brave_sync_add_mobile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,33 @@

</LinearLayout>

<LinearLayout android:orientation="vertical"
<LinearLayout android:id="@+id/brave_sync_qr_containter"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/brave_sync_qr_rounded"
android:background="@drawable/brave_sync_top_rounded"
android:layout_gravity="center"
android:paddingBottom="5dip"
android:paddingTop="5dip"
android:paddingStart="5dip"
android:paddingEnd="5dip"
android:layout_marginBottom="15dp" >
android:layout_marginBottom="15dp"
android:padding="15dip"
android:layout_marginStart="60dip"
android:layout_marginEnd="60dip" >

<ImageView android:id="@+id/brave_sync_qr_code_image"
android:layout_width="300dp"
android:layout_height="300dp"
<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/brave_sync_qr_rounded"
android:layout_gravity="center"
android:contentDescription="@string/brave_sync_btn_laptop" />
android:paddingBottom="5dip"
android:paddingTop="5dip"
android:paddingStart="5dip"
android:paddingEnd="5dip" >

<ImageView android:id="@+id/brave_sync_qr_code_image"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_gravity="center"
android:contentDescription="@string/brave_sync_btn_laptop" />
</LinearLayout>
</LinearLayout>

<androidx.fragment.app.FragmentContainerView
Expand Down

0 comments on commit 1364253

Please sign in to comment.