Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overall design improvements #407

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public static boolean isLargeFontEnabled(Resources resources) {
return configuration.fontScale > 1;
}

public static boolean isSmallFontEnabled(Resources resources) {
Configuration configuration = resources.getConfiguration();
return configuration.fontScale < 1;
}

public static void setCustomClickAccessibilityFeedBack(TextView titleView, ExpandableLayout containerView) {
ViewCompat.setAccessibilityDelegate(titleView, new AccessibilityDelegateCompat() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static com.jakewharton.rxbinding4.view.RxView.clicks;
import static com.jakewharton.rxbinding4.widget.RxToolbar.navigationClicks;
import static ee.ria.DigiDoc.android.accessibility.AccessibilityUtils.isLargeFontEnabled;
import static ee.ria.DigiDoc.android.accessibility.AccessibilityUtils.isSmallFontEnabled;
import static ee.ria.DigiDoc.android.utils.TextUtil.convertPxToDp;
import static com.jakewharton.rxbinding4.view.RxView.clicks;
import static com.jakewharton.rxbinding4.widget.RxToolbar.navigationClicks;
Expand Down Expand Up @@ -223,19 +224,19 @@ private void setActionButtonsTextSize() {

signatureAddButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
sendButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
mobileIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
smartIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
mobileIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);
smartIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);

if (isLargeFontEnabled(getResources())) {
if (isLargeFontEnabled(getResources()) || isSmallFontEnabled(getResources())) {
signatureAddButton.setAutoSizeTextTypeUniformWithConfiguration(7, 12, 1, COMPLEX_UNIT_SP);
sendButton.setAutoSizeTextTypeUniformWithConfiguration(7, 12, 1, COMPLEX_UNIT_SP);
mobileIdCancelButton.setAutoSizeTextTypeUniformWithConfiguration(7, 12, 1, COMPLEX_UNIT_SP);
smartIdCancelButton.setAutoSizeTextTypeUniformWithConfiguration(7, 12, 1, COMPLEX_UNIT_SP);
mobileIdCancelButton.setAutoSizeTextTypeUniformWithConfiguration(7, 20, 1, COMPLEX_UNIT_SP);
smartIdCancelButton.setAutoSizeTextTypeUniformWithConfiguration(7, 20, 1, COMPLEX_UNIT_SP);
} else {
signatureAddButton.setAutoSizeTextTypeUniformWithConfiguration(11, 20, 1, COMPLEX_UNIT_SP);
sendButton.setAutoSizeTextTypeUniformWithConfiguration(11, 20, 1, COMPLEX_UNIT_SP);
mobileIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
smartIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
mobileIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);
smartIdCancelButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/cryptoCreateAddButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/material_typography_dense_display_3_text_size"
android:layout_marginStart="@dimen/material_list_normal_padding_vertical"
android:layout_marginEnd="@dimen/material_list_normal_padding_vertical"
android:text="@string/documents_add_button"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/crypto_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
android:textAppearance="@style/TextAppearance.Application.Value"
android:gravity="center_horizontal"
android:text="@string/crypto_home_create_text"
android:textSize="@dimen/material_subheader_text_size"
android:importantForAccessibility="no" />

<Button
android:id="@id/cryptoHomeCreateButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/material_typography_dense_display_3_text_size"
android:text="@string/crypto_home_create_button"
android:contentDescription="@string/crypto_home_create_text_accessibility" />

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/crypto_list_item_recipient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
style="@style/Widget.Application.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/material_list_icon_last_position_margin_horizontal"
android:layout_marginEnd="@dimen/material_button_padding_horizontal"
android:src="@drawable/ic_icon_remove"
android:tint="@color/error"
android:contentDescription="@string/crypto_recipient_remove_button" />
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/res/layout/eid_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
<LinearLayout
android:id="@id/eidHomeProgressLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
android:layout_height="match_parent"
android:padding="@dimen/material_content_edge_margin_horizontal"
android:textAppearance="@style/TextAppearance.Application.Value"
android:textSize="@dimen/material_subheader_text_size"
android:gravity="center" />

<TextView
android:id="@id/eidHomeProgressMessage"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/main_about_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:id="@id/mainAboutComponentName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/material_baseline_grid_1x"
android:layout_marginBottom="@dimen/material_baseline_grid_1x"
android:gravity="center"
android:textAppearance="@style/TextAppearance.Application.Value"
Expand All @@ -20,6 +21,7 @@
android:id="@id/mainAboutComponentLicenseName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/material_baseline_grid_1x"
android:layout_marginBottom="@dimen/material_baseline_grid_1x"
android:gravity="center"
android:textAppearance="@style/TextAppearance.Application.ListItem"
Expand All @@ -29,6 +31,7 @@
android:id="@id/mainAboutComponentLicenseUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/material_baseline_grid_1x"
android:layout_marginBottom="@dimen/material_baseline_grid_1x"
android:autoLink="web"
android:gravity="center"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/main_about_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/material_content_edge_margin_horizontal"
android:layout_marginEnd="@dimen/material_content_edge_margin_horizontal"
android:layout_marginTop="@dimen/material_content_edge_margin_horizontal"
android:layout_marginBottom="@dimen/material_baseline_grid_1x"
android:gravity="center"
android:text="@string/main_about_licenses_title" />

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/signature_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
android:textAppearance="@style/TextAppearance.Application.Value"
android:gravity="center_horizontal"
android:text="@string/signature_home_create_text"
android:textSize="@dimen/material_subheader_text_size"
android:importantForAccessibility="no" />

<Button
android:id="@id/signatureHomeCreateButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/material_typography_dense_display_3_text_size"
android:text="@string/signature_home_create_button"
android:contentDescription="@string/signature_home_create_text_accessibility" />

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/layout/signature_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintWidth="115dp"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/cancel_button"
android:backgroundTint="@color/error"
Expand Down Expand Up @@ -177,7 +176,6 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintWidth="115dp"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/cancel_button"
android:backgroundTint="@color/error"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/signatureUpdateListDocumentsAddButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/material_typography_dense_display_3_text_size"
android:layout_marginStart="@dimen/material_list_normal_padding_vertical"
android:layout_marginEnd="@dimen/material_list_normal_padding_vertical"
android:text="@string/documents_add_button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
style="@style/Widget.Application.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/material_list_icon_last_position_margin_horizontal"
android:layout_marginEnd="@dimen/material_button_padding_horizontal"
android:src="@drawable/ic_icon_remove"
android:tint="@color/error"
android:contentDescription="@string/signature_update_signature_remove_button" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<color name="primaryDark">#F4F5F6</color>
<color name="accent">#006EB5</color>
<color name="error">#981E32</color>
<color name="warning">#DDCC00</color>
<color name="warningText">#996C0B</color>
<color name="warning">#FFEABD</color>
<color name="warningText">#DDCC00</color>
<color name="success">#8CC368</color>
<color name="bottomNavigation">#023664</color>
<color name="windowBackground">@color/material_color_white</color>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<string name="file_provider_authority">ee.ria.digidoc.fileprovider</string>

<string name="main_home_menu_locale_et">Eesti keel</string>
<string name="main_home_menu_locale_ru">Русский язык</string>
<string name="main_home_menu_locale_ru">Русский</string>
<string name="main_home_menu_locale_en">English</string>

<string name="main_settings_signature_add_method_key">signature_add_method</string>
Expand Down
Loading