chore: readd all the new bottom sheet code

This commit is contained in:
LucasGGamerM
2024-03-04 16:29:57 -03:00
parent 0d7e10ca8a
commit 71dd974d19
21 changed files with 1075 additions and 36 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:tint="@color/m3_primary_alpha11"
android:tintMode="src_over">
<solid android:color="?colorM3Surface" />
<corners android:radius="8dp"/>
</shape>
</item>
<item>
<shape>
<stroke android:width="2dp" android:color="?colorM3OutlineVariant" android:dashWidth="5dp" android:dashGap="5dp"/>
<corners android:radius="8dp"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M4,22Q3.175,22 2.588,21.413Q2,20.825 2,20V9Q2,8.175 2.588,7.587Q3.175,7 4,7H9V4Q9,3.175 9.588,2.587Q10.175,2 11,2H13Q13.825,2 14.413,2.587Q15,3.175 15,4V7H20Q20.825,7 21.413,7.587Q22,8.175 22,9V20Q22,20.825 21.413,21.413Q20.825,22 20,22ZM4,20H20Q20,20 20,20Q20,20 20,20V9Q20,9 20,9Q20,9 20,9H15Q15,9.825 14.413,10.412Q13.825,11 13,11H11Q10.175,11 9.588,10.412Q9,9.825 9,9H4Q4,9 4,9Q4,9 4,9V20Q4,20 4,20Q4,20 4,20ZM6,18H12V17.55Q12,17.125 11.762,16.762Q11.525,16.4 11.1,16.2Q10.6,15.975 10.088,15.863Q9.575,15.75 9,15.75Q8.425,15.75 7.913,15.863Q7.4,15.975 6.9,16.2Q6.475,16.4 6.238,16.762Q6,17.125 6,17.55ZM14,16.5H18V15H14ZM9,15Q9.625,15 10.062,14.562Q10.5,14.125 10.5,13.5Q10.5,12.875 10.062,12.438Q9.625,12 9,12Q8.375,12 7.938,12.438Q7.5,12.875 7.5,13.5Q7.5,14.125 7.938,14.562Q8.375,15 9,15ZM14,13.5H18V12H14ZM11,9H13V4H11ZM12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Q12,14.5 12,14.5Z"/>
</vector>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:id="@+id/sheet_handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:background="@drawable/white_circle"
android:backgroundTint="?colorM3SecondaryContainer"
android:scaleType="center"
android:tint="?colorM3OnSecondaryContainer"
android:src="@drawable/ic_badge_24px"
android:importantForAccessibility="no"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
android:fontFamily="sans-serif"
android:textColor="?colorM3OnSurface"
android:text="@string/handle_help_title"/>
</LinearLayout>
<LinearLayout
android:id="@+id/handle_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
android:background="@drawable/bg_handle_help"
android:clipChildren="false"
android:clipToPadding="false"
android:padding="12dp">
<TextView
android:id="@+id/handle_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_label_small"
android:textColor="?colorM3OnSurfaceVariant"
android:alpha="0.6"
tools:text="@string/handle_title"/>
<org.joinmastodon.android.ui.views.RippleAnimationTextView
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
tools:text="\@Gargron@mastodon.social"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/username_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:importantForAccessibility="no"
android:scaleType="center"
android:tint="?colorM3Primary"
android:src="@drawable/ic_fluent_mention_24_regular"/>
<TextView
android:id="@+id/username_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_medium"
android:textColor="?colorM3OnSurface"
android:text="@string/username"/>
<TextView
android:id="@+id/username_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/username_title"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_username_explanation"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/server_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:importantForAccessibility="no"
android:scaleType="center"
android:tint="?colorM3Primary"
android:src="@drawable/ic_fluent_earth_24_regular"/>
<TextView
android:id="@+id/server_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_medium"
android:textColor="?colorM3OnSurface"
android:text="@string/server"/>
<TextView
android:id="@+id/server_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/server_title"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_server_explanation"/>
</RelativeLayout>
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/handle_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="16dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_explanation"/>
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:layout_marginHorizontal="16dp"
style="@style/Widget.Mastodon.M3.Button.Filled"
android:text="@string/got_it"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp">
<View
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_centerVertical="true"
android:background="@drawable/white_circle"
android:backgroundTint="?colorM3SecondaryContainer"
android:scaleType="center"
android:tint="?colorM3OnSecondaryContainer"
tools:src="@drawable/ic_waving_hand_24px"
android:importantForAccessibility="no"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_large"
android:fontFamily="sans-serif"
android:textColor="?colorM3OnSurface"
tools:text="@string/mute_user_confirm_title"/>
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/title"
android:textAppearance="@style/m3_body_medium"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="\@username"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/content_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="32dp"
android:orientation="vertical"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="40dp"
style="@style/Widget.Mastodon.M3.Button.Filled"
app:progressBar="@id/confirm_progress"
tools:text="@string/got_it"/>
<ProgressBar
android:id="@+id/confirm_progress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="10dp"
android:indeterminate="true"
android:outlineProvider="none"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/btn_secondary"
android:layout_width="match_parent"
android:layout_height="40dp"
style="@style/Widget.Mastodon.M3.Button.Tonal"
app:progressBar="@id/secondary_progress"
tools:text="@string/got_it"/>
<ProgressBar
android:id="@+id/secondary_progress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="10dp"
android:indeterminate="true"
android:outlineProvider="none"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
style="@style/Widget.Mastodon.M3.Button.Text"
android:text="@string/cancel"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>

View File

@@ -133,4 +133,13 @@
<attr name="aspectRatio" format="float"/>
<attr name="useHeight" format="boolean"/>
</declare-styleable>
<declare-styleable name="ProgressBarButton">
<attr name="progressBar" format="reference"/>
</declare-styleable>
<declare-styleable name="RoundedImageView">
<attr name="cornerRadius" format="dimension"/>
<attr name="roundBottomCorners" format="boolean"/>
</declare-styleable>
</resources>

View File

@@ -36,13 +36,13 @@
<item quantity="other">following</item>
</plurals>
<string name="posts">Posts</string>
<string name="posts_and_replies">Posts and Replies</string>
<string name="posts_and_replies">Posts and replies</string>
<string name="media">Media</string>
<string name="profile_about">About</string>
<string name="button_follow">Follow</string>
<string name="button_following">Following</string>
<string name="edit_profile">Edit Profile</string>
<string name="share_user">Share profile</string>
<string name="edit_profile">Edit profile</string>
<string name="share_user">Share profile via…</string>
<string name="mute_user">Mute %s</string>
<string name="unmute_user">Unmute %s</string>
<string name="block_user">Block %s</string>
@@ -159,9 +159,9 @@
<string name="report_personal_subtitle">Here are your options for controlling what you see on Mastodon:</string>
<string name="back">Back</string>
<string name="search_communities">Server name or URL</string>
<string name="instance_rules_title">Server Rules</string>
<string name="instance_rules_title">Server rules</string>
<string name="instance_rules_subtitle">By continuing, you agree to follow by the following rules set and enforced by the %s moderators.</string>
<string name="signup_title">Create Account</string>
<string name="signup_title">Create account</string>
<string name="display_name">Name</string>
<string name="username">Username</string>
<string name="email">Email</string>
@@ -169,7 +169,7 @@
<string name="confirm_password">Confirm password</string>
<string name="password_note">Include capital letters, special characters, and numbers to increase your password strength.</string>
<string name="category_general">General</string>
<string name="confirm_email_title">Check Your Inbox</string>
<string name="confirm_email_title">Check your inbox</string>
<!-- %s is the email address -->
<string name="confirm_email_subtitle">Tap the link we sent you to verify %s. Well wait right here.</string>
<string name="confirm_email_didnt_get">Didnt get a link?</string>
@@ -204,7 +204,7 @@
<string name="theme_dark">Dark</string>
<string name="settings_behavior">Behavior</string>
<string name="settings_gif">Play animated avatars and emoji</string>
<string name="settings_custom_tabs">Use in-app browser</string>
<string name="settings_custom_tabs">Open links in</string>
<string name="settings_notifications">Notifications</string>
<string name="settings_contribute">Contribute to Mastodon</string>
<string name="settings_tos">Terms of service</string>
@@ -233,8 +233,8 @@
<string name="followed_user">Youre now following %s</string>
<string name="following_user_requested">Requested to follow %s</string>
<string name="open_in_browser">Open in browser</string>
<string name="hide_boosts_from_user">Hide boosts from %s</string>
<string name="show_boosts_from_user">Show boosts from %s</string>
<string name="hide_boosts_from_user">Hide boosts</string>
<string name="show_boosts_from_user">Show boosts</string>
<string name="signup_reason">Why do you want to join?</string>
<string name="signup_reason_note">This will help us review your application.</string>
<string name="clear">Clear</string>
@@ -257,7 +257,7 @@
<string name="recommended_accounts_info_banner">You might like these accounts based on others you follow.</string>
<string name="see_new_posts">New posts</string>
<string name="load_missing_posts">Load missing posts</string>
<string name="follow_back">Follow Back</string>
<string name="follow_back">Follow back</string>
<string name="button_follow_pending">Pending</string>
<string name="follows_you">Follows you</string>
<string name="manually_approves_followers">Manually approves followers</string>
@@ -314,28 +314,26 @@
<string name="file_size_mb">%.2f MB</string>
<string name="file_size_gb">%.2f GB</string>
<string name="upload_processing">Processing…</string>
<!-- %s is version like 1.2.3 -->
<!-- %s is version like 1.2.3 -->
<!-- %s is file size -->
<string name="download_update">Download (%s)</string>
<string name="install_update">Install</string>
<string name="privacy_policy_title">Your Privacy</string>
<string name="privacy_policy_title">Your privacy</string>
<string name="privacy_policy_subtitle">Although the Mastodon app does not collect any data, the server you sign up through may have a different policy.\n\nIf you disagree with the policy for %s, you can go back and pick a different server.</string>
<string name="i_agree">I Agree</string>
<string name="i_agree">I agree</string>
<string name="empty_list">This list is empty</string>
<string name="instance_signup_closed">This server does not accept new registrations.</string>
<string name="text_copied">Copied to clipboard</string>
<string name="add_bookmark">Bookmark</string>
<string name="remove_bookmark">Remove bookmark</string>
<string name="bookmarks">Bookmarks</string>
<string name="your_favorites">Your Favorites</string>
<string name="login_title">Welcome Back</string>
<string name="your_favorites">Your favorites</string>
<string name="login_title">Welcome back</string>
<string name="login_subtitle">Log in with the server where you created your account.</string>
<string name="server_url">Server URL</string>
<string name="server_filter_any_language">Any Language</string>
<string name="server_filter_instant_signup">Instant Sign-up</string>
<string name="server_filter_manual_review">Manual Review</string>
<string name="server_filter_any_signup_speed">Any Sign-up Speed</string>
<string name="server_filter_any_language">Any language</string>
<string name="server_filter_instant_signup">Instant sign-up</string>
<string name="server_filter_manual_review">Manual review</string>
<string name="server_filter_any_signup_speed">Any sign-up speed</string>
<string name="server_filter_region_europe">Europe</string>
<string name="server_filter_region_north_america">North America</string>
<string name="server_filter_region_south_america">South America</string>
@@ -343,7 +341,7 @@
<string name="server_filter_region_asia">Asia</string>
<string name="server_filter_region_oceania">Oceania</string>
<string name="not_accepting_new_members">Not accepting new members</string>
<string name="category_special_interests">Special Interests</string>
<string name="category_special_interests">Special interests</string>
<string name="signup_passwords_dont_match">Passwords dont match</string>
<string name="profile_add_row">Add row</string>
<string name="profile_setup">Profile setup</string>
@@ -616,7 +614,7 @@
<string name="remove">Remove</string>
<string name="add_list_member">Add member</string>
<string name="search_among_people_you_follow">Search among people you follow</string>
<string name="add_user_to_list">Add to list…</string>
<string name="add_user_to_list">Add/remove from lists</string>
<string name="add_user_to_list_title">Add to list</string>
<!-- %s is a username -->
<string name="manage_user_lists">Manage the lists %s appears on</string>
@@ -679,4 +677,57 @@
<string name="this_invite_has_expired">This invite link has expired.</string>
<string name="invite_link_pasted">Link pasted from your clipboard.</string>
<string name="need_invite_to_join_server">To join %s, youll need an invite link from an existing user.</string>
<string name="mute_user_confirm_title">Mute user?</string>
<string name="user_wont_know_muted">They wont know theyve been muted.</string>
<string name="user_can_still_see_your_posts">They can still see your posts, but you wont see theirs.</string>
<string name="you_wont_see_user_mentions">You wont see posts that mention them.</string>
<string name="user_can_mention_and_follow_you">They can mention and follow you, but you wont see them.</string>
<string name="unmuted_user_x">Unmuted %s</string>
<string name="block_user_confirm_title">Block user?</string>
<string name="user_can_see_blocked">They can see that theyre blocked.</string>
<string name="user_cant_see_each_other_posts">They cant see your posts and you wont see theirs.</string>
<string name="user_cant_mention_or_follow_you">They cant mention or follow you.</string>
<string name="unblocked_user_x">Unblocked %s</string>
<string name="block_domain_confirm_title">Block domain?</string>
<string name="do_block_server">Block server</string>
<string name="block_user_x_instead">Block %s instead</string>
<string name="users_cant_see_blocked">You wont see posts or notifications from users on this server.</string>
<string name="you_wont_see_server_posts">You wont see any posts from users on this server.</string>
<string name="server_followers_will_be_removed">Your followers from this server will be removed.</string>
<string name="server_cant_mention_or_follow_you">Nobody from this server can follow you.</string>
<string name="server_can_interact_with_older">People from this server can interact with your old posts.</string>
<string name="unblocked_domain_x">Unblocked domain %s</string>
<string name="handle_help_title">Whats in a handle?</string>
<string name="handle_title">Their handle</string>
<string name="handle_username_explanation">Their unique identifier on their server. Its possible to find users with the same username on different servers.</string>
<string name="handle_title_own">Your handle</string>
<string name="handle_username_explanation_own">Your unique identifier on this server. Its possible to find users with the same username on different servers.</string>
<string name="server">Server</string>
<string name="handle_server_explanation">Their digital home, where all of their posts live.</string>
<string name="handle_explanation">Since handles say who someone is and where they are, you can interact with people across the social web of &lt;a>ActivityPub-powered platforms&lt;/a>.</string>
<string name="handle_server_explanation_own">Your digital home, where all of your posts live. Dont like this one? Transfer servers at any time and bring your followers, too.</string>
<string name="handle_explanation_own">Because your handle says who you are and where you are, people can interact with you across the social web of &lt;a>ActivityPub-powered platforms&lt;/a>.</string>
<string name="what_is_activitypub_title">Whats ActivityPub?</string>
<string name="what_is_activitypub">ActivityPub is like the language Mastodon speaks with other social networks.\n\nIt lets you connect and interact with people not just on Mastodon, but across different social apps too.</string>
<string name="handle_copied">Handle copied to clipboard.</string>
<string name="qr_code">QR code</string>
<string name="scan_qr_code">Scan QR code</string>
<!-- Shown on a button that saves a file, after it was successfully saved -->
<string name="saved">Saved</string>
<string name="image_saved">Image saved.</string>
<string name="video_saved">Video saved.</string>
<string name="view_file">View</string>
<string name="share_sheet_preview_profile">%s on Mastodon</string>
<string name="share_sheet_preview_post">%1$s on Mastodon: “%2$s”</string>
<string name="copy_profile_link">Copy link to profile</string>
<string name="in_app_browser">In-app browser</string>
<string name="system_browser">System browser</string>
<string name="add_muted_word_short">Add word</string>
<string name="tab_home">Home</string>
<string name="tab_search">Explore</string>
<string name="tab_profile">Profile</string>
<string name="pin_post">Pin on profile</string>
<string name="unpin_post">Unpin from profile</string>
<string name="post_pinned">Post has been pinned</string>
<string name="post_unpinned">Post has been unpinned</string>
</resources>