Profiles
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<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="M9.277 16.221c0.293 0.293 0.293 0.768 0 1.06-0.293 0.294-0.768 0.293-1.061 0l-4.997-5.003c-0.292-0.293-0.292-0.768 0-1.06L8.217 6.22c0.293-0.293 0.768-0.293 1.06 0C9.57 6.513 9.57 6.987 9.278 7.28L5.557 11h7.842c1.595 0 2.81 0.242 3.889 0.764l0.246 0.126c1.109 0.593 1.983 1.467 2.576 2.576 0.61 1.14 0.89 2.418 0.89 4.135 0 0.414-0.336 0.75-0.75 0.75s-0.75-0.336-0.75-0.75c0-1.484-0.228-2.52-0.713-3.428-0.453-0.847-1.113-1.507-1.96-1.96-0.838-0.448-1.786-0.676-3.094-0.709L13.4 12.5H5.562l3.715 3.721z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
22
mastodon/src/main/res/drawable/m3_tabs_line_indicator.xml
Normal file
22
mastodon/src/main/res/drawable/m3_tabs_line_indicator.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<size android:height="2dp"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:left="2dp"
|
||||
android:right="2dp">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="3dp"
|
||||
android:topRightRadius="3dp"/>
|
||||
<size android:height="3dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<size android:height="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
5
mastodon/src/main/res/drawable/profile_ava_bg.xml
Normal file
5
mastodon/src/main/res/drawable/profile_ava_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="27dp"/>
|
||||
<stroke android:width="2dp" android:color="@color/gray_25"/>
|
||||
</shape>
|
||||
26
mastodon/src/main/res/drawable/tab_indicator_inset.xml
Normal file
26
mastodon/src/main/res/drawable/tab_indicator_inset.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:left="12dp" android:right="12dp">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<size android:height="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
22
mastodon/src/main/res/layout/design_layout_tab_icon.xml
Normal file
22
mastodon/src/main/res/layout/design_layout_tab_icon.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerInside"/>
|
||||
23
mastodon/src/main/res/layout/design_layout_tab_text.xml
Normal file
23
mastodon/src/main/res/layout/design_layout_tab_text.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"/>
|
||||
188
mastodon/src/main/res/layout/fragment_profile.xml
Normal file
188
mastodon/src/main/res/layout/fragment_profile.xml
Normal file
@@ -0,0 +1,188 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<me.grishka.appkit.views.RecursiveSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<org.joinmastodon.android.ui.views.NestedRecyclerScrollView
|
||||
android:id="@+id/scroller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:nestedScrollingEnabled="true">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="23dp"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<org.joinmastodon.android.ui.views.CoverImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="229dp"
|
||||
android:background="#808080"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/avatar_border"
|
||||
android:layout_width="102dp"
|
||||
android:layout_height="102dp"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginTop="-40dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:background="@drawable/profile_ava_bg"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="98dp"
|
||||
android:layout_height="98dp"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="-38dp"
|
||||
tools:src="#0f0" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/following_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:padding="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<TextView
|
||||
android:id="@+id/following_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_large"
|
||||
tools:text="123"/>
|
||||
<TextView
|
||||
android:id="@+id/following_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_small"
|
||||
tools:text="following"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/followers_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:layout_toStartOf="@id/following_btn"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:padding="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<TextView
|
||||
android:id="@+id/followers_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_large"
|
||||
tools:text="123"/>
|
||||
<TextView
|
||||
android:id="@+id/followers_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_small"
|
||||
tools:text="following"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/posts_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:layout_toStartOf="@id/followers_btn"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:padding="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<TextView
|
||||
android:id="@+id/posts_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_large"
|
||||
tools:text="123"/>
|
||||
<TextView
|
||||
android:id="@+id/posts_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_small"
|
||||
tools:text="following"/>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/profile_action_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_below="@id/following_btn"
|
||||
android:layout_margin="16dp"
|
||||
tools:text="Edit Profile"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/avatar"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/profile_action_btn"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textAppearance="@style/m3_headline_small"
|
||||
tools:text="Eugen"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/name"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_toStartOf="@id/profile_action_btn"
|
||||
android:textAppearance="@style/m3_title_medium"
|
||||
android:textColor="@color/light_ui_action_button"
|
||||
tools:text="\@Gargron"/>
|
||||
|
||||
<org.joinmastodon.android.ui.views.LinkedTextView
|
||||
android:id="@+id/bio"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/username"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
tools:text="Founder, CEO and lead developer @Mastodon, Germany." />
|
||||
|
||||
</RelativeLayout>
|
||||
<org.joinmastodon.android.ui.tabs.TabLayout
|
||||
android:id="@+id/tabbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
app:tabPaddingStart="12dp"
|
||||
app:tabPaddingEnd="12dp"
|
||||
app:tabMinWidth="0dp"
|
||||
app:tabIndicator="@drawable/tab_indicator_inset"
|
||||
app:tabIndicatorAnimationMode="elastic"
|
||||
app:tabMode="scrollable"
|
||||
app:tabGravity="start"/>
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</org.joinmastodon.android.ui.views.NestedRecyclerScrollView>
|
||||
</me.grishka.appkit.views.RecursiveSwipeRefreshLayout>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<me.grishka.appkit.views.FragmentRootLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/appkit_loader_root"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?android:windowBackground">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/appkit_loader_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include layout="@layout/profile_toolbar"/>
|
||||
|
||||
<include layout="@layout/loading"
|
||||
android:id="@+id/loading"/>
|
||||
|
||||
<ViewStub android:layout="?errorViewLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/error"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/content_stub"/>
|
||||
|
||||
</FrameLayout>
|
||||
</me.grishka.appkit.views.FragmentRootLinearLayout>
|
||||
10
mastodon/src/main/res/layout/profile_toolbar.xml
Normal file
10
mastodon/src/main/res/layout/profile_toolbar.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:elevation="3dip"
|
||||
android:popupTheme="?android:attr/actionBarPopupTheme"
|
||||
android:subtitleTextAppearance="?android:attr/subtitleTextAppearance"
|
||||
android:theme="@style/Theme.Mastodon.Toolbar.Profile"
|
||||
android:titleTextAppearance="?android:attr/titleTextAppearance" />
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/content_wrap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"/>
|
||||
|
||||
<ViewStub android:layout="?emptyViewLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/empty"/>
|
||||
</FrameLayout>
|
||||
9
mastodon/src/main/res/menu/profile.xml
Normal file
9
mastodon/src/main/res/menu/profile.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/mention" android:title="@string/mention_user" android:icon="@drawable/ic_fluent_arrow_reply_24_regular" android:showAsAction="always"/>
|
||||
<item android:id="@+id/share" android:title="@string/share_user"/>
|
||||
<item android:id="@+id/mute" android:title="@string/mute_user"/>
|
||||
<item android:id="@+id/block" android:title="@string/block_user"/>
|
||||
<item android:id="@+id/report" android:title="@string/report_user"/>
|
||||
<item android:id="@+id/block_domain" android:title="@string/block_domain"/>
|
||||
</menu>
|
||||
@@ -18,6 +18,7 @@
|
||||
<color name="gray_500">#667085</color>
|
||||
|
||||
<color name="gray_800_alpha50">#80282C37</color>
|
||||
<color name="light_ui_action_button">#606984</color>
|
||||
|
||||
<color name="text_primary">@color/gray_800</color>
|
||||
<color name="text_secondary">@color/gray_500</color>
|
||||
|
||||
@@ -33,4 +33,37 @@
|
||||
<string name="discard">Discard</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="publishing">Your toot is being tooted</string>
|
||||
|
||||
<plurals name="followers">
|
||||
<item quantity="one">follower</item>
|
||||
<item quantity="other">followers</item>
|
||||
</plurals>
|
||||
<plurals name="following">
|
||||
<item quantity="one">following</item>
|
||||
<item quantity="other">following</item>
|
||||
</plurals>
|
||||
<plurals name="posts">
|
||||
<item quantity="one">post</item>
|
||||
<item quantity="other">posts</item>
|
||||
</plurals>
|
||||
<string name="posts">Posts</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="mention_user">Mention %s</string>
|
||||
<string name="share_user">Share %s</string>
|
||||
<string name="mute_user">Mute %s</string>
|
||||
<string name="unmute_user">Unmute %s</string>
|
||||
<string name="block_user">Block %s</string>
|
||||
<string name="unblock_user">Unblock %s</string>
|
||||
<string name="report_user">Report %s</string>
|
||||
<string name="block_domain">Block %s</string>
|
||||
<string name="unblock_domain">Unblock %s</string>
|
||||
<plurals name="x_posts">
|
||||
<item quantity="one">%,d post</item>
|
||||
<item quantity="other">%,d posts</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
@@ -23,6 +23,13 @@
|
||||
<item name="android:textColorSecondary">@color/gray_800</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Toolbar.Profile">
|
||||
<item name="android:textColorPrimary">@color/gray_50</item>
|
||||
<item name="android:textColorSecondary">@color/gray_50</item>
|
||||
<item name="android:drawableTint">@color/gray_50</item>
|
||||
<item name="android:popupTheme">@style/Theme.Mastodon</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Mastodon.Button" parent="android:Widget.Material.Button">
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="android:background">@drawable/bg_button</item>
|
||||
@@ -92,4 +99,15 @@
|
||||
<item name="android:textColor">@color/text_secondary</item>
|
||||
<item name="android:textSize">14dp</item>
|
||||
</style>
|
||||
|
||||
<style name="m3_title_large">
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textSize">22dp</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="m3_headline_small">
|
||||
<item name="android:textSize">24dp</item>
|
||||
<item name="android:textColor">@color/gray_800</item>
|
||||
</style>
|
||||
</resources>
|
||||
133
mastodon/src/main/res/values/tablayout_attrs.xml
Normal file
133
mastodon/src/main/res/values/tablayout_attrs.xml
Normal file
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Style to use for TabLayout in the theme. -->
|
||||
<attr name="tabStyle" format="reference"/>
|
||||
|
||||
<!-- Style to use for Secondary TabLayout in the theme. -->
|
||||
<attr name="tabSecondaryStyle" format="reference"/>
|
||||
|
||||
<declare-styleable name="TabLayout">
|
||||
<!-- Color of the indicator used to show the currently selected tab. -->
|
||||
<attr name="tabIndicatorColor" format="color"/>
|
||||
<!-- {@deprecated Instead, set the intrinsic size of the custom drawable provided to the
|
||||
tabIndicator attribute in order to change the indicator height. For example, this can be
|
||||
done by setting the <size> property in a <shape> resource.} -->
|
||||
<attr name="tabIndicatorHeight" format="dimension"/>
|
||||
<!-- Position in the Y axis from the starting edge that tabs should be positioned from. -->
|
||||
<attr name="tabContentStart" format="dimension"/>
|
||||
<!-- Reference to a background to be applied to tabs. -->
|
||||
<attr name="tabBackground" format="reference"/>
|
||||
<!-- Reference to a drawable to use as selection indicator for tabs. If this attribute is not
|
||||
specified, indicator defaults to a line along the bottom of the tab. -->
|
||||
<attr name="tabIndicator" format="reference"/>
|
||||
<!-- Gravity constant for tab selection indicator. -->
|
||||
<attr name="tabIndicatorGravity">
|
||||
<!-- Align indicator to the bottom of this tab layout. -->
|
||||
<enum name="bottom" value="0"/>
|
||||
<!-- Align indicator along the center of this tab layout. -->
|
||||
<enum name="center" value="1"/>
|
||||
<!-- Align indicator to the top of this tab layout. -->
|
||||
<enum name="top" value="2"/>
|
||||
<!-- Stretch indicator to match the height and width of a tab item in this layout. -->
|
||||
<enum name="stretch" value="3"/>
|
||||
</attr>
|
||||
<!-- Duration in milliseconds for the animation of the selection indicator from one tab item
|
||||
to another. -->
|
||||
<attr name="tabIndicatorAnimationDuration" format="integer"/>
|
||||
<!-- Whether the selection indicator width should fill the full width of the tab item,
|
||||
or if it should be fitted to the content of the tab text label. If no text label is
|
||||
present, it will be set to the width of the icon or to a minimum width of 24dp. -->
|
||||
<attr name="tabIndicatorFullWidth" format="boolean"/>
|
||||
<!-- The animation mode used to animate the selection indicator between
|
||||
destinations. -->
|
||||
<attr name="tabIndicatorAnimationMode">
|
||||
<!-- Animate the selection indicator's left and right bounds in step with
|
||||
each other. -->
|
||||
<enum name="linear" value="0"/>
|
||||
<!-- Animate the selection indicator's left and right bounds out of step
|
||||
with each other, decelerating the front and accelerating the back.
|
||||
This causes the indicator to look like it stretches between destinations
|
||||
an then shrinks back down to fit the size of it's target tab. -->
|
||||
<enum name="elastic" value="1"/>
|
||||
</attr>
|
||||
<!-- The behavior mode for the Tabs in this layout -->
|
||||
<attr name="tabMode">
|
||||
<enum name="scrollable" value="0"/>
|
||||
<enum name="fixed" value="1"/>
|
||||
<enum name="auto" value="2"/>
|
||||
</attr>
|
||||
<!-- Gravity constant for tabs. -->
|
||||
<attr name="tabGravity">
|
||||
<enum name="fill" value="0"/>
|
||||
<enum name="center" value="1"/>
|
||||
<enum name="start" value="2"/>
|
||||
</attr>
|
||||
<!-- Whether to display tab labels horizontally inline with icons, or underneath icons. -->
|
||||
<attr name="tabInlineLabel" format="boolean"/>
|
||||
<!-- The minimum width for tabs. -->
|
||||
<attr name="tabMinWidth" format="dimension"/>
|
||||
<!-- The maximum width for tabs. -->
|
||||
<attr name="tabMaxWidth" format="dimension"/>
|
||||
<!-- A reference to a TextAppearance style to be applied to tabs. -->
|
||||
<attr name="tabTextAppearance" format="reference"/>
|
||||
<!-- The default text color to be applied to tabs. -->
|
||||
<attr name="tabTextColor" format="color"/>
|
||||
<!-- {@deprecated Instead, provide a ColorStateList to the tabTextColor attribute with a
|
||||
selected color set.} -->
|
||||
<attr name="tabSelectedTextColor" format="color"/>
|
||||
<!-- The preferred padding along the start edge of tabs. -->
|
||||
<attr name="tabPaddingStart" format="dimension"/>
|
||||
<!-- The preferred padding along the top edge of tabs. -->
|
||||
<attr name="tabPaddingTop" format="dimension"/>
|
||||
<!-- The preferred padding along the end edge of tabs. -->
|
||||
<attr name="tabPaddingEnd" format="dimension"/>
|
||||
<!-- The preferred padding along the bottom edge of tabs. -->
|
||||
<attr name="tabPaddingBottom" format="dimension"/>
|
||||
<!-- The preferred padding along all edges of tabs. -->
|
||||
<attr name="tabPadding" format="dimension"/>
|
||||
<!-- Tint to apply to tab icons, if present. This can be a color state list or a color. -->
|
||||
<attr name="tabIconTint" format="color"/>
|
||||
<!-- Blending mode to apply to tab icons. -->
|
||||
<attr name="tabIconTintMode">
|
||||
<enum name="src_over" value="3"/>
|
||||
<enum name="src_in" value="5"/>
|
||||
<enum name="src_atop" value="9"/>
|
||||
<enum name="multiply" value="14"/>
|
||||
<enum name="screen" value="15"/>
|
||||
<enum name="add" value="16"/>
|
||||
</attr>
|
||||
<!-- Ripple color for the tabs. This may be a color state list, if the desired ripple color
|
||||
should be stateful.-->
|
||||
<attr name="tabRippleColor" format="color"/>
|
||||
<!-- Whether to use unbounded ripple effect for tabs, or if ripple should instead be bound to
|
||||
tab item bounds. -->
|
||||
<attr name="tabUnboundedRipple" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TabItem">
|
||||
<!-- Text to display in the tab. -->
|
||||
<attr name="android:text"/>
|
||||
<!-- Icon to display in the tab. -->
|
||||
<attr name="android:icon"/>
|
||||
<!-- A reference to a layout resource to be displayed in the tab. -->
|
||||
<attr name="android:layout"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
25
mastodon/src/main/res/values/tablayout_dimens.xml
Normal file
25
mastodon/src/main/res/values/tablayout_dimens.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<dimen name="design_tab_scrollable_min_width">72dp</dimen>
|
||||
<dimen name="design_tab_max_width">264dp</dimen>
|
||||
<dimen name="design_tab_text_size">14sp</dimen>
|
||||
<dimen name="design_tab_text_size_2line">12sp</dimen>
|
||||
|
||||
</resources>
|
||||
23
mastodon/src/main/res/values/tablayout_integers.xml
Normal file
23
mastodon/src/main/res/values/tablayout_integers.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<integer name="design_tab_indicator_anim_duration_ms">300</integer>
|
||||
<integer name="mtrl_tab_indicator_anim_duration_ms">250</integer>
|
||||
|
||||
</resources>
|
||||
103
mastodon/src/main/res/values/tablayout_styles.xml
Normal file
103
mastodon/src/main/res/values/tablayout_styles.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2015 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Design.TabLayout" parent="Base.Widget.Design.TabLayout">
|
||||
<item name="tabGravity">fill</item>
|
||||
<item name="tabMode">fixed</item>
|
||||
<item name="tabIndicatorFullWidth">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Base.Widget.Design.TabLayout" parent="android:Widget">
|
||||
<item name="android:background">@null</item>
|
||||
<item name="tabIconTint">@null</item>
|
||||
<item name="tabMaxWidth">@dimen/design_tab_max_width</item>
|
||||
<item name="tabIndicatorAnimationDuration">@integer/design_tab_indicator_anim_duration_ms</item>
|
||||
<item name="tabIndicatorColor">?android:attr/colorAccent</item>
|
||||
<item name="tabIndicatorGravity">bottom</item>
|
||||
<item name="tabIndicatorAnimationMode">linear</item>
|
||||
<item name="tabIndicator">@drawable/mtrl_tabs_default_indicator</item>
|
||||
<item name="tabPaddingStart">12dp</item>
|
||||
<item name="tabPaddingEnd">12dp</item>
|
||||
<item name="tabTextAppearance">@style/TextAppearance.Design.Tab</item>
|
||||
<item name="tabTextColor">@null</item>
|
||||
<item name="tabRippleColor">?android:attr/colorControlHighlight</item>
|
||||
<item name="tabUnboundedRipple">false</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Design.Tab" parent="android:TextAppearance.Material.Button">
|
||||
<item name="android:textSize">@dimen/design_tab_text_size</item>
|
||||
<!-- <item name="android:textColor">@color/mtrl_tabs_legacy_text_color_selector</item>-->
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.MaterialComponents.TabLayout" parent="Widget.Design.TabLayout">
|
||||
<!-- <item name="enforceMaterialTheme">true</item>-->
|
||||
<!-- <item name="enforceTextAppearance">true</item>-->
|
||||
<!-- <item name="android:background">?android:attr/colorSurface</item>-->
|
||||
<!-- <item name="tabIconTint">@color/mtrl_tabs_icon_color_selector</item>-->
|
||||
<item name="tabIndicatorAnimationDuration">@integer/mtrl_tab_indicator_anim_duration_ms</item>
|
||||
<item name="tabIndicatorColor">?android:attr/colorPrimary</item>
|
||||
<item name="tabTextAppearance">?android:attr/textAppearanceButton</item>
|
||||
<!-- <item name="tabTextColor">@color/mtrl_tabs_icon_color_selector</item>-->
|
||||
<!-- <item name="tabRippleColor">@color/mtrl_tabs_ripple_color</item>-->
|
||||
<item name="tabUnboundedRipple">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.MaterialComponents.TabLayout.Colored">
|
||||
<item name="android:background">?android:attr/colorPrimary</item>
|
||||
<!-- <item name="tabIconTint">@color/mtrl_tabs_icon_color_selector_colored</item>-->
|
||||
<item name="tabIndicatorColor">?android:attr/colorAccent</item>
|
||||
<!-- <item name="tabTextColor">@color/mtrl_tabs_icon_color_selector_colored</item>-->
|
||||
<!-- <item name="tabRippleColor">@color/mtrl_tabs_colored_ripple_color</item>-->
|
||||
</style>
|
||||
|
||||
<style name="Widget.MaterialComponents.TabLayout.PrimarySurface" parent="Widget.MaterialComponents.TabLayout.Colored"/>
|
||||
|
||||
<!-- Styles for M3 Tabs -->
|
||||
<style name="Base.Widget.Material3.TabLayout" parent="Widget.MaterialComponents.TabLayout">
|
||||
<!-- <item name="enforceTextAppearance">false</item>-->
|
||||
<!-- <item name="tabIconTint">@color/m3_tabs_icon_color</item>-->
|
||||
<!-- <item name="tabTextAppearance">?android:attr/textAppearanceLabelLarge</item>-->
|
||||
<!-- <item name="tabTextColor">@color/m3_tabs_icon_color</item>-->
|
||||
<item name="tabIndicator">@drawable/m3_tabs_rounded_line_indicator</item>
|
||||
<item name="tabIndicatorAnimationMode">elastic</item>
|
||||
<item name="tabIndicatorColor">?android:attr/colorPrimary</item>
|
||||
<!-- <item name="tabRippleColor">@color/m3_tabs_ripple_color</item>-->
|
||||
<item name="tabIndicatorFullWidth">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Material3.TabLayout" parent="Base.Widget.Material3.TabLayout"/>
|
||||
|
||||
<!-- Styles for M3 Tabs used on an elevatable surface. -->
|
||||
<style name="Base.Widget.Material3.TabLayout.OnSurface" parent="Widget.Material3.TabLayout">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Material3.TabLayout.OnSurface" parent="Base.Widget.Material3.TabLayout.OnSurface"/>
|
||||
|
||||
<!-- Style for M3 secondary tabs, which are used as an alternate when primary tabs are already
|
||||
present in the UI. This style does not have a bottom divider, which is added in v21 because
|
||||
the drawable cannot use theme colors pre-21. -->
|
||||
<style name="Base.Widget.Material3.TabLayout.Secondary" parent="Widget.Material3.TabLayout">
|
||||
<item name="tabIndicator">@drawable/m3_tabs_line_indicator</item>
|
||||
<item name="tabIndicatorFullWidth">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Material3.TabLayout.Secondary" parent="Base.Widget.Material3.TabLayout.Secondary"/>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user