Skip to content

Commit

Permalink
[Android][Sync] Fix some minor UI issues as per design and remove unn…
Browse files Browse the repository at this point in the history
…ecessary colors entries.

And move |GetBraveSyncServiceURL| and |GetBraveDefaultSyncServiceURL| to brave_sync_service_impl.cc
  • Loading branch information
jagadeshjai authored and brave-browser-releases committed Dec 19, 2024
1 parent ed358f3 commit 58b66f3
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/brave_sync_advanced_options_dialog_bg_color" />
<solid android:color="@color/schemes_surface_container" />
<size android:width="320dp" android:height="552dp" />
<corners android:radius="28dp" />
</shape>
2 changes: 1 addition & 1 deletion android/java/res/drawable/brave_sync_btn_disabled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/brave_sync_disabled_button_bg_color" />
<solid android:color="@color/leo_color_button_disabled_20" />
<corners android:radius="12dp" />
</shape>
2 changes: 1 addition & 1 deletion android/java/res/drawable/brave_sync_btn_text_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:color="@color/text_on_primary" />
<item android:state_enabled="false" android:color="@color/brave_sync_disabled_button_text_color" />
<item android:state_enabled="false" android:color="@color/leo_color_text_disabled_50" />
</selector>
4 changes: 2 additions & 2 deletions android/java/res/drawable/brave_sync_reset_btn_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:color="@color/leo_reset_text_color" />
<item android:state_enabled="false" android:color="@color/brave_sync_disabled_button_color" />
<item android:state_enabled="true" android:color="@color/systemfeedback_error_text" />
<item android:state_enabled="false" android:color="@color/leo_color_text_disabled_50" />
</selector>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
android:orientation="vertical"
android:clipToOutline="true"
android:paddingHorizontal="24dp"
android:paddingVertical="16dp">
android:paddingTop="24dp"
android:paddingBottom="16dp">

<TextView
android:id="@+id/advanced_options_title"
Expand Down Expand Up @@ -76,7 +77,7 @@
android:textColor="@color/schemes_on_surface"
android:textSize="16sp"
android:autofillHints="url"
android:textColorHint="@color/brave_sync_url_disabled_text_color" />
android:textColorHint="@color/leo_color_text_tertiary" />

</com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -92,6 +93,8 @@
<android.widget.Button android:id="@+id/brave_sync_save_and_relaunch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:text="@string/brave_sync_url_save_and_relaunch"
android:enabled="false"
style="@style/BraveSyncButton" />
Expand Down
13 changes: 6 additions & 7 deletions android/java/res/values-night/brave_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<color name="scan_qr_code_text_color">#F0F2FF</color>
<color name="scan_qr_code_bg_color">#1E2029</color>

<!-- Day/Night brave wallet colors -->
<color name="brave_wallet_onboarding_item_background_color">#A1ABBA</color>
<color name="brave_wallet_day_night_toolbar_icon_color">@android:color/white</color>
Expand Down Expand Up @@ -90,11 +90,6 @@
<color name="brave_sync_bg_color">@android:color/transparent</color>
<color name="brave_sync_border_color">@color/modern_grey_800</color>
<color name="brave_sync_bg_secondary_color">#212529</color>
<color name="brave_sync_advanced_options_dialog_bg_color">#1B1B1F</color>
<color name="brave_sync_url_disabled_text_color">#909094</color>
<color name="brave_sync_disabled_button_bg_color">#33EBEEF0</color>
<color name="brave_sync_disabled_button_text_color">#80EBEEF0</color>
<color name="brave_sync_disabled_button_color">#80EBEEF0</color>

<color name="container_background">#0d1214</color>
<color name="divider_interactive">#545ff8</color>
Expand All @@ -116,7 +111,7 @@

<color name="shield_toggle_button_tint">#F0F2FF</color>
<color name="shield_toggle_bg_color">#1E2029</color>

<color name="shield_thank_you_icon_color">#F0F2FF</color>

<color name="filter_title_color">#EDEEF1</color>
Expand Down Expand Up @@ -278,9 +273,13 @@
<color name="schemes_on_surface_variant">#c7c7cc</color>
<color name="schemes_outline_variant">#3b3b3f</color>
<color name="schemes_primary">#c1c4ff</color>
<color name="schemes_surface_container">#1b1b1f</color>
<color name="schemes_surface_container_highest">#303034</color>
<color name="text_interactive">#7c91ff</color>
<color name="leo_color_text_interactive">#C1C4FF</color>
<color name="leo_color_text_tertiary">#909094</color>
<color name="leo_color_button_disabled_20">#33EBEEF0</color>
<color name="leo_color_text_disabled_50">#80EBEEF0</color>

<color name="open_yt_dialog_bg">#000000</color>
</resources>
9 changes: 4 additions & 5 deletions android/java/res/values/brave_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@
<color name="brave_sync_main_button_color">@color/button_background</color>
<color name="brave_sync_copy_words_text_color">@color/text_secondary</color>
<color name="brave_sync_btn_transparent_text_color">@color/leo_color_text_interactive</color>
<color name="brave_sync_advanced_options_dialog_bg_color">#F0F0F4</color>
<color name="brave_sync_url_disabled_text_color">#76767A</color>
<color name="brave_sync_disabled_button_bg_color">#3346464A</color>
<color name="brave_sync_disabled_button_text_color">#8021272A</color>
<color name="brave_sync_disabled_button_color">#8021272A</color>

<!-- Sync informer icon colors -->
<color name="brave_informer_dark_theme_icon_color">@color/baseline_neutral_90</color>
Expand Down Expand Up @@ -431,8 +426,12 @@
<color name="schemes_on_surface_variant">#46464a</color>
<color name="schemes_outline_variant">#e3e3e8</color>
<color name="schemes_primary">#3e37d4</color>
<color name="schemes_surface_container">#f0f0f4</color>
<color name="schemes_surface_container_highest">#c7c7cc</color>
<color name="leo_color_text_interactive">#3E37D4</color>
<color name="leo_color_text_tertiary">#76767A</color>
<color name="leo_color_button_disabled_20">#3346464A</color>
<color name="leo_color_text_disabled_50">#8021272A</color>

<color name="open_yt_dialog_bg">#FFFFFF</color>
</resources>
16 changes: 4 additions & 12 deletions chromium_src/components/sync/service/sync_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

namespace syncer {

GURL BraveGetSyncServiceURL(const base::CommandLine& command_line,
version_info::Channel channel,
PrefService* prefs) {
GURL SyncServiceImpl::BraveGetSyncServiceURL(
const base::CommandLine& command_line,
version_info::Channel channel,
PrefService* prefs) {
if (prefs) {
std::string value = prefs->GetString(brave_sync::kCustomSyncServiceUrl);
if (!value.empty()) {
Expand Down Expand Up @@ -55,15 +56,6 @@ GURL BraveGetSyncServiceURL(const base::CommandLine& command_line,
return GetSyncServiceURL(command_line, channel);
}

GURL SyncServiceImpl::GetBraveSyncServiceURL() {
return BraveGetSyncServiceURL(*base::CommandLine::ForCurrentProcess(),
channel_, sync_client_->GetPrefService());
}

GURL SyncServiceImpl::GetBraveDefaultSyncServiceURL() {
return GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), channel_);
}

} // namespace syncer

#define SyncAuthManager BraveSyncAuthManager
Expand Down
11 changes: 8 additions & 3 deletions chromium_src/components/sync/service/sync_service_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
#include "base/gtest_prod_util.h"
#include "components/signin/public/identity_manager/identity_manager.h"

namespace base {
class CommandLine;
}

#define BRAVE_SYNC_SERVICE_IMPL_H_ \
public: \
GURL GetBraveSyncServiceURL(); \
GURL GetBraveDefaultSyncServiceURL(); \
protected: \
static GURL BraveGetSyncServiceURL(const base::CommandLine& command_line, \
version_info::Channel channel, \
PrefService* prefs); \
\
private: \
friend class BraveSyncServiceImpl; \
Expand Down
11 changes: 11 additions & 0 deletions components/sync/service/brave_sync_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vector>

#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
Expand All @@ -19,6 +20,7 @@
#include "brave/components/sync/service/sync_service_impl_delegate.h"
#include "build/build_config.h"
#include "components/prefs/pref_service.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/engine/sync_protocol_error.h"
#include "components/sync/model/type_entities_count.h"

Expand Down Expand Up @@ -439,4 +441,13 @@ bool BraveSyncServiceImpl::SetCustomSyncServiceURL(
return false;
}

GURL BraveSyncServiceImpl::GetBraveSyncServiceURL() {
return BraveGetSyncServiceURL(*base::CommandLine::ForCurrentProcess(),
channel_, sync_client_->GetPrefService());
}

GURL BraveSyncServiceImpl::GetBraveDefaultSyncServiceURL() {
return GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), channel_);
}

} // namespace syncer
3 changes: 3 additions & 0 deletions components/sync/service/brave_sync_service_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class BraveSyncServiceImpl : public SyncServiceImpl {
std::string GetCustomSyncServiceURL();
bool SetCustomSyncServiceURL(std::string custom_sync_url);

GURL GetBraveSyncServiceURL();
GURL GetBraveDefaultSyncServiceURL();

private:
friend class BraveSyncServiceImplGACookiesTest;
friend class BraveSyncServiceImplTest;
Expand Down

0 comments on commit 58b66f3

Please sign in to comment.