Skip to content

Commit

Permalink
Sync flow (beta2 version)
Browse files Browse the repository at this point in the history
  • Loading branch information
samartnik committed Mar 21, 2018
1 parent c0ccb68 commit 9fb383d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 38 deletions.
13 changes: 5 additions & 8 deletions chrome/android/java/res/drawable/rounded_shape.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent" />

<stroke android:width="2dp" android:color="#FFFFFFFF" />
<stroke android:width="1px" android:color="@android:color/white" />

<corners android:bottomRightRadius="7dp"
android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp" />
<corners android:radius="15dp"/>

</shape>
3 changes: 2 additions & 1 deletion chrome/android/java/res/layout/brave_sync_add_laptop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
android:layout_height="match_parent"
android:fillViewport="true"
android:background="@color/google_grey_50" >

<LinearLayout android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="match_parent">
android:layout_width="match_parent" >

<LinearLayout android:orientation="horizontal"
android:layout_height="wrap_content"
Expand Down
3 changes: 1 addition & 2 deletions chrome/android/java/res/layout/brave_sync_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@

<RelativeLayout android:id="@+id/camera_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" >
android:layout_height="match_parent" >

<ImageView android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static void recordHomePageLaunchMetrics(
boolean showHomeButton, boolean homepageIsNtp, String homepageUrl) {
if (homepageUrl == null) {
homepageUrl = "";
assert !showHomeButton : "Homepage should be disabled for a null URL";
//assert !showHomeButton : "Homepage should be disabled for a null URL";
}
nativeRecordHomePageLaunchMetrics(showHomeButton, homepageIsNtp, homepageUrl);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public boolean isBookmarksEditingDisabled() {
* class has been completed.
*/
static boolean isHomepageProviderAvailableAndEnabled() {
return !TextUtils.isEmpty(getHomePageUrl());
return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import android.text.style.RelativeSizeSpan;
import android.text.TextWatcher;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
Expand Down Expand Up @@ -641,13 +642,13 @@ public void run() {
mLayoutMobile = (FrameLayout) getView().findViewById(R.id.brave_sync_frame_mobile);
mLayoutLaptop = (FrameLayout) getView().findViewById(R.id.brave_sync_frame_laptop);

// TODO for non-tablet devices set fixed camera size to be able to apply overlay
/*if (!DeviceFormFactor.isTablet()) {
if (!DeviceFormFactor.isTablet()) {
RelativeLayout cameraLayout = (RelativeLayout) getView().findViewById(R.id.camera_layout);
if (null != cameraLayout) {
overlay.setVisibility(View.GONE);
}
}*/
LayoutParams params = cameraLayout.getLayoutParams();
params.width = LayoutParams.MATCH_PARENT;
params.height = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 300, getActivity().getApplicationContext().getResources().getDisplayMetrics());
cameraLayout.setLayoutParams(params);
}

setAppropriateView();

Expand Down Expand Up @@ -1154,9 +1155,6 @@ public void onClick(DialogInterface dialog, int button) {
ChromeApplication application = (ChromeApplication)ContextUtils.getApplicationContext();
if (null != application && null != application.mBraveSyncWorker) {
application.mBraveSyncWorker.SetUpdateDeleteDeviceName(BraveSyncWorker.DELETE_RECORD, deviceName, deviceId, deviceObjectId);
if (null != v) {
v.setVisibility(View.GONE);
}
application.mBraveSyncWorker.InterruptSyncSleep();
showProgressDialog(getResources().getString(R.string.brave_sync_delete_sent));
}
Expand Down
16 changes: 8 additions & 8 deletions chrome/android/java/strings/android_chrome_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -3555,19 +3555,19 @@ Saved
Sync
</message>
<message name="IDS_BRAVE_SYNC_DESCRIPTION_PAGE_1_PART_1" desc="Brave sync main screen message (part 1).">
Brave Sync allows you to sync bookmarks, tabs, history and other data privately between your Brave Browsers on your various devices.
Brave Sync allows you to sync bookmarks data privately between your Brave Browsers on your various devices.
</message>
<message name="IDS_BRAVE_SYNC_DESCRIPTION_PAGE_1_PART_2" desc="Brave sync main screen message (part 2).">
Simply scan the code from your sync chain that you created on another device. Or start a new sync chain.
</message>
<message name="IDS_BRAVE_SYNC_SCAN_CHAIN_CODE" desc="Scan chain code button title.">
Scan a sync chain code
Scan or enter sync code
</message>
<message name="IDS_BRAVE_SYNC_START_NEW_CHAIN" desc="Start new chain button title.">
Start a new sync chain
</message>
<message name="IDS_BRAVE_SYNC_QRCODE_MESSAGE_V2" desc="Brave sync main screen QRCode message.">
Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" and scan the code displayed on the screen.
Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" and scan the QR Code displayed on the screen.
</message>
<message name="IDS_BRAVE_SYNC_CODEWORDS_MESSAGE" desc="Brave sync hint for code words edit box.">
Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" then "Display code words instead".
Expand Down Expand Up @@ -3615,10 +3615,10 @@ Saved
LOADING DEVICES...
</message>
<message name="IDS_BRAVE_SYNC_ADD_DEVICE_TEXT" desc="Text for 'Add Another Device' button.">
Add Another Device
Add another device
</message>
<message name="IDS_BRAVE_SYNC_REMOVE_DEVICE_TEXT" desc="Text for 'Remove My Device' button.">
Remove My Device
Remove this device
</message>
<message name="IDS_BRAVE_SYNC_CODE_WORDS_TITLE" desc="Title for 'Code Words' Brave sync settings page.">
Pair
Expand All @@ -3627,13 +3627,13 @@ Saved
Enter the sync chain code
</message>
<message name="IDS_BRAVE_SYNC_ADD_LAPTOP_TEXT_PART_1" desc="Part 1 of the text on 'Add Laptop' page.">
On your laptop, navigate to Brave Settings > Sync. Choose "Enter a Sync Chain Code".
On your computer, navigate to Brave Settings > Sync. Choose "Enter a Sync Chain Code".
</message>
<message name="IDS_BRAVE_SYNC_ADD_LAPTOP_TEXT_PART_2" desc="Part 2 of the text on 'Add Laptop' page.">
Enter the code words above, including spaces.
</message>
<message name="IDS_BRAVE_SYNC_DELETE_DEVICE" desc="Delete device message.">
Are you sure you want to delete device
Are you sure you want to delete device?
</message>
<message name="IDS_BRAVE_SYNC_DELETE_SENT" desc="Delete request sent message.">
Delete request has been sent. Device will be removed shortly.
Expand All @@ -3642,7 +3642,7 @@ Saved
Loading data...
</message>
<message name="IDS_BRAVE_SYNC_TIME_OUT_MESSAGE" desc="Time out message.">
Time is out
Something went wrong, looks like your request timed out.
</message>
<message name="IDS_BRAVE_SYNC_USE_CAMERA_TEXT" desc="Text for 'Use camera' button.">
I'll use my camera...
Expand Down
16 changes: 8 additions & 8 deletions chrome/android/java/strings/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ Saved</string>
<string name="website_settings_category_play_yt_video_in_browser_enabled">If enabled, videos will be played in Brave instead of corresponding app</string>

<string name="prefs_sync">Sync</string>
<string name="brave_sync_description_page_1_part_1">Brave Sync allows you to sync bookmarks, tabs, history and other data privately between your Brave Browsers on your various devices.</string>
<string name="brave_sync_description_page_1_part_1">Brave Sync allows you to sync bookmarks data privately between your Brave Browsers on your various devices.</string>
<string name="brave_sync_description_page_1_part_2">Simply scan the code from your sync chain that you created on another device. Or start a new sync chain.</string>
<string name="brave_sync_scan_chain_code">Scan a sync chain code</string>
<string name="brave_sync_scan_chain_code">Scan or enter sync code</string>
<string name="brave_sync_start_new_chain">Start a new sync chain</string>
<string name="brave_sync_qrcode_message_v2">Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" and scan the code displayed on the screen.</string>
<string name="brave_sync_qrcode_message_v2">Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" and scan the QR Code displayed on the screen.</string>
<string name="brave_sync_codewords_message">Using existing synced device, open Brave Settings and navigate to Settings > Sync. Choose "Add Device" then "Display code words instead".</string>
<string name="brave_sync_btn_mobile">Add a Mobile Device</string>
<string name="brave_sync_btn_laptop">Add a Computer</string>
Expand All @@ -109,16 +109,16 @@ Saved</string>
<string name="brave_sync_settings_description">Changing settings will only affect data that this device shares with others.</string>
<string name="brave_sync_devices_title">OTHER DEVICES ON CHAIN</string>
<string name="brave_sync_loading_devices_title">LOADING DEVICES...</string>
<string name="brave_sync_add_device_text">Add Another Device</string>
<string name="brave_sync_remove_device_text">Remove My Device</string>
<string name="brave_sync_add_device_text">Add another device</string>
<string name="brave_sync_remove_device_text">Remove this device</string>
<string name="brave_sync_code_words_title">Pair</string>
<string name="brave_sync_add_laptop_text_title">Enter the sync chain code</string>
<string name="brave_sync_add_laptop_text_part_1">On your laptop, navigate to Brave Settings > Sync. Choose "Enter a Sync Chain Code".</string>
<string name="brave_sync_add_laptop_text_part_1">On your computer, navigate to Brave Settings > Sync. Choose "Enter a Sync Chain Code".</string>
<string name="brave_sync_add_laptop_text_part_2">Enter the code words above, including spaces.</string>
<string name="brave_sync_delete_device">Are you sure you want to delete device</string>
<string name="brave_sync_delete_device">Are you sure you want to delete device?</string>
<string name="brave_sync_delete_sent">Delete request has been sent. Device will be removed shortly.</string>
<string name="brave_sync_loading_data_title">Loading data...</string>
<string name="brave_sync_time_out_message">Time is out</string>
<string name="brave_sync_time_out_message">Something went wrong, looks like your request timed out.</string>
<string name="brave_sync_use_camera_text">I'll use my camera...</string>
<string name="brave_sync_confirm_code_words_text">Confirm</string>
<string name="brave_sync_word_count_text">Word count</string>
Expand Down

0 comments on commit 9fb383d

Please sign in to comment.