First iteration of the bot account tag

This commit is contained in:
LucasGGamerM 2023-01-01 18:06:26 -03:00
parent 32c94c8948
commit 10f9230139
5 changed files with 29 additions and 27 deletions

View File

@ -35,6 +35,7 @@ import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import android.widget.Toolbar; import android.widget.Toolbar;
import org.joinmastodon.android.GlobalUserPreferences; import org.joinmastodon.android.GlobalUserPreferences;
@ -96,7 +97,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
private static final int COVER_RESULT=343; private static final int COVER_RESULT=343;
private ImageView avatar; private ImageView avatar;
private TextView botIcon; private Button botIcon;
private CoverImageView cover; private CoverImageView cover;
private View avatarBorder; private View avatarBorder;
private TextView name, username, bio, followersCount, followersLabel, followingCount, followingLabel, postsCount, postsLabel; private TextView name, username, bio, followersCount, followersLabel, followingCount, followingLabel, postsCount, postsLabel;
@ -174,6 +175,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
cover=content.findViewById(R.id.cover); cover=content.findViewById(R.id.cover);
avatarBorder=content.findViewById(R.id.avatar_border); avatarBorder=content.findViewById(R.id.avatar_border);
botIcon=content.findViewById(R.id.bot_icon); botIcon=content.findViewById(R.id.bot_icon);
botIcon.setOnClickListener(v ->{
Toast.makeText(getActivity(), R.string.sk_bot_account,
Toast.LENGTH_LONG).show();
});
name=content.findViewById(R.id.name); name=content.findViewById(R.id.name);
username=content.findViewById(R.id.username); username=content.findViewById(R.id.username);
bio=content.findViewById(R.id.bio); bio=content.findViewById(R.id.bio);

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17.753,14a2.25,2.25 0,0 1,2.25 2.25v0.905a3.75,3.75 0,0 1,-1.307 2.846C17.13,21.345 14.89,22 12,22c-2.89,0 -5.128,-0.656 -6.691,-2a3.75,3.75 0,0 1,-1.306 -2.843v-0.908A2.25,2.25 0,0 1,6.253 14h11.5ZM11.898,2.008 L12,2a0.75,0.75 0,0 1,0.743 0.648l0.007,0.102L12.75,3.5h3.5a2.25,2.25 0,0 1,2.25 2.25v4.505a2.25,2.25 0,0 1,-2.25 2.25h-8.5a2.25,2.25 0,0 1,-2.25 -2.25L5.5,5.75A2.25,2.25 0,0 1,7.75 3.5h3.5v-0.749a0.75,0.75 0,0 1,0.648 -0.743L12,2l-0.102,0.007ZM9.75,6.5a1.25,1.25 0,1 0,0 2.5,1.25 1.25,0 0,0 0,-2.5ZM14.243,6.5a1.25,1.25 0,1 0,0 2.499,1.25 1.25,0 0,0 0,-2.499Z"
android:fillColor="#000000"/>
</vector>

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:pathData="M17.753,13.999C18.996,13.999 20.003,15.007 20.003,16.249V17.154C20.003,18.248 19.526,19.287 18.696,20C17.131,21.344 14.89,22.001 12,22.001C9.111,22.001 6.872,21.344 5.309,20C4.481,19.288 4.004,18.25 4.004,17.157V16.249C4.004,15.007 5.011,13.999 6.254,13.999H17.753ZM17.753,15.499H6.254C5.84,15.499 5.504,15.835 5.504,16.249V17.157C5.504,17.812 5.79,18.435 6.287,18.863C7.545,19.944 9.441,20.501 12,20.501C14.56,20.501 16.458,19.944 17.719,18.862C18.217,18.434 18.503,17.811 18.503,17.154V16.249C18.503,15.835 18.168,15.499 17.753,15.499ZM11.899,2.007L12.001,2C12.38,2 12.694,2.282 12.744,2.648L12.751,2.75L12.75,3.499L16.25,3.5C17.493,3.5 18.5,4.507 18.5,5.75V10.254C18.5,11.497 17.493,12.504 16.25,12.504H7.75C6.508,12.504 5.5,11.497 5.5,10.254V5.75C5.5,4.507 6.508,3.5 7.75,3.5L11.25,3.499L11.251,2.75C11.251,2.37 11.533,2.057 11.899,2.007L12.001,2L11.899,2.007ZM16.25,5H7.75C7.336,5 7,5.335 7,5.75V10.254C7,10.668 7.336,11.004 7.75,11.004H16.25C16.665,11.004 17,10.668 17,10.254V5.75C17,5.335 16.665,5 16.25,5ZM9.75,6.5C10.44,6.5 10.999,7.059 10.999,7.749C10.999,8.439 10.44,8.998 9.75,8.998C9.06,8.998 8.5,8.439 8.5,7.749C8.5,7.059 9.06,6.5 9.75,6.5ZM14.242,6.5C14.932,6.5 15.492,7.059 15.492,7.749C15.492,8.439 14.932,8.998 14.242,8.998C13.552,8.998 12.993,8.439 12.993,7.749C12.993,7.059 13.552,6.5 14.242,6.5Z"
android:fillColor="?colorButtonText"/>
</vector>

View File

@ -72,22 +72,6 @@
android:contentDescription="@string/profile_picture" android:contentDescription="@string/profile_picture"
tools:src="#0f0" /> tools:src="#0f0" />
<TextView
android:id="@+id/bot_icon"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="end|top"
android:drawableStart="@drawable/ic_fluent_bot"
android:drawablePadding="8dp"
android:paddingTop="-14dp"
android:paddingEnd="-12dp"
android:drawableTint="?colorPrimary400"
android:gravity="center_vertical"
android:textAppearance="@style/m3_label_large"
tools:text="123"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@ -189,13 +173,23 @@
android:layout_below="@id/profile_counters" android:layout_below="@id/profile_counters"
android:layout_alignParentEnd="true"> android:layout_alignParentEnd="true">
<Button
android:id="@+id/bot_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="8dp"
android:drawableStart="@drawable/ic_fluent_bot_24_regular"
/>
<FrameLayout <FrameLayout
android:clipToPadding="false" android:clipToPadding="false"
android:paddingVertical="16dp" android:paddingVertical="16dp"
android:paddingLeft="16dp" android:paddingLeft="8dp"
android:paddingRight="4dp" android:paddingRight="4dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<org.joinmastodon.android.ui.views.ProgressBarButton <org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/notify_btn" android:id="@+id/notify_btn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -214,6 +208,7 @@
android:indeterminateTint="?colorButtonText" android:indeterminateTint="?colorButtonText"
android:outlineProvider="none" android:outlineProvider="none"
android:visibility="gone" /> android:visibility="gone" />
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
@ -223,6 +218,7 @@
android:paddingLeft="4dp" android:paddingLeft="4dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<org.joinmastodon.android.ui.views.ProgressBarButton <org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/profile_action_btn" android:id="@+id/profile_action_btn"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -130,4 +130,5 @@
<string name="sk_compose_no_schedule">Dont schedule</string> <string name="sk_compose_no_schedule">Dont schedule</string>
<string name="sk_compose_no_draft">Dont draft</string> <string name="sk_compose_no_draft">Dont draft</string>
<string name="sk_settings_reduce_motion">Reduce motion in animations</string> <string name="sk_settings_reduce_motion">Reduce motion in animations</string>
<string name="sk_bot_account">This is a bot account</string>
</resources> </resources>