mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-06 05:49:49 +02:00
Log in other reddit accounts are available. Add an account switcher in the navigation drawer in MainActivity.
This commit is contained in:
@@ -33,87 +33,101 @@
|
||||
layout="@layout/nav_header_main" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/profile_linear_layout_main_activity"
|
||||
android:id="@+id/all_drawer_items_linear_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_account_circle_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/profile_linear_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/profile"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_account_circle_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/profile"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/subscriptions_linear_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_check_circle_outline_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/subscriptions"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_linear_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_settings_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/settings"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/subscriptions_linear_layout_main_activity"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/account_recycler_view_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_check_circle_outline_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/subscriptions"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_linear_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:src="@drawable/ic_outline_settings_24px"
|
||||
android:tint="@color/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/settings"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -15,39 +15,18 @@
|
||||
android:id="@+id/collapsing_toolbar_layout_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:titleEnabled="false"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:titleEnabled="false"
|
||||
app:toolbarId="@+id/toolbar">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/toolbar_frame_layout_main_activity"
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_collapseMode="pin"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
<com.ferfalk.simplesearchview.SimpleSearchView
|
||||
android:id="@+id/search_view_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="@android:color/white"
|
||||
app:voiceSearch="true"
|
||||
app:searchBackground="@color/colorPrimary"
|
||||
app:cursorColor="@android:color/white"
|
||||
app:hintColor="#E0E0E0"
|
||||
app:iconsTint="@android:color/white"
|
||||
app:backIconTint="@android:color/white"
|
||||
app:iconsAlpha="1"
|
||||
app:backIconAlpha="1"/>
|
||||
|
||||
</FrameLayout>
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_collapseMode="pin"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
@@ -59,12 +38,12 @@
|
||||
android:background="@color/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabIndicatorHeight="3dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabRippleColor="?attr/colorControlHighlight"
|
||||
app:tabSelectedTextColor="@android:color/white"
|
||||
app:tabTextColor="@android:color/white"
|
||||
app:tabRippleColor="?attr/colorControlHighlight"
|
||||
app:tabUnboundedRipple="false" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
@@ -75,7 +54,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="#40000000"
|
||||
android:elevation="1dp"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<!--<include layout="@layout/content_main" />-->
|
||||
|
||||
|
25
app/src/main/res/layout/item_account.xml
Normal file
25
app/src/main/res/layout/item_account.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/profile_image_item_account"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username_text_view_item_account"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
@@ -30,8 +30,10 @@
|
||||
android:layout_marginTop="@dimen/nav_header_vertical_spacing"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:layout_below="@id/profile_image_view_nav_header_main"/>
|
||||
android:layout_below="@id/profile_image_view_nav_header_main"
|
||||
android:layout_toStartOf="@id/account_switcher_image_view_nav_header_main" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/karma_text_view_nav_header_main"
|
||||
@@ -39,6 +41,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_below="@id/name_text_view_nav_header_main"/>
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/name_text_view_nav_header_main"
|
||||
android:layout_toStartOf="@id/account_switcher_image_view_nav_header_main" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/account_switcher_image_view_nav_header_main"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="@drawable/ic_baseline_arrow_drop_down_24px" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
Reference in New Issue
Block a user