aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-08 12:05:45 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-08 12:05:45 +0000
commite542ac51388b9293297bb74b851dcb5ded621a3e (patch)
treec6c7073946063ca1a430f85ce0335d51d8d0812b /app/src/main/res
parent5b5da3d3fd44d79bc301546b7be94de0a206e020 (diff)
downloadinfinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar.gz
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar.bz2
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar.lz
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar.xz
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.tar.zst
infinity-for-reddit-e542ac51388b9293297bb74b851dcb5ded621a3e.zip
Log in other reddit accounts are available. Add an account switcher in the navigation drawer in MainActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/drawable/ic_baseline_arrow_drop_down_24px.xml9
-rw-r--r--app/src/main/res/drawable/ic_baseline_arrow_drop_up_24px.xml9
-rw-r--r--app/src/main/res/drawable/ic_outline_add_circle_outline_24px.xml9
-rw-r--r--app/src/main/res/drawable/ic_outline_block_24px.xml9
-rw-r--r--app/src/main/res/drawable/ic_outline_public_24px.xml9
-rw-r--r--app/src/main/res/layout/activity_main.xml160
-rw-r--r--app/src/main/res/layout/app_bar_main.xml43
-rw-r--r--app/src/main/res/layout/item_account.xml25
-rw-r--r--app/src/main/res/layout/nav_header_main.xml17
-rw-r--r--app/src/main/res/values/strings.xml5
10 files changed, 188 insertions, 107 deletions
diff --git a/app/src/main/res/drawable/ic_baseline_arrow_drop_down_24px.xml b/app/src/main/res/drawable/ic_baseline_arrow_drop_down_24px.xml
new file mode 100644
index 00000000..af6df01c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_arrow_drop_down_24px.xml
@@ -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="#FFFFFFFF"
+ android:pathData="M7,10l5,5 5,-5z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24px.xml b/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24px.xml
new file mode 100644
index 00000000..2cfbe4d2
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_arrow_drop_up_24px.xml
@@ -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="#FFFFFFFF"
+ android:pathData="M7,14l5,-5 5,5z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_outline_add_circle_outline_24px.xml b/app/src/main/res/drawable/ic_outline_add_circle_outline_24px.xml
new file mode 100644
index 00000000..8611136a
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_add_circle_outline_24px.xml
@@ -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="#FF000000"
+ android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_outline_block_24px.xml b/app/src/main/res/drawable/ic_outline_block_24px.xml
new file mode 100644
index 00000000..0c5dbe45
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_block_24px.xml
@@ -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="#FF000000"
+ android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_outline_public_24px.xml b/app/src/main/res/drawable/ic_outline_public_24px.xml
new file mode 100644
index 00000000..aafeefba
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_public_24px.xml
@@ -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="#FF000000"
+ android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-0.61 0.08,-1.21 0.21,-1.78L8.99,15v1c0,1.1 0.9,2 2,2v1.93C7.06,19.43 4,16.07 4,12zM17.89,17.4c-0.26,-0.81 -1,-1.4 -1.9,-1.4h-1v-3c0,-0.55 -0.45,-1 -1,-1h-6v-2h2c0.55,0 1,-0.45 1,-1L10.99,7h2c1.1,0 2,-0.9 2,-2v-0.41C17.92,5.77 20,8.65 20,12c0,2.08 -0.81,3.98 -2.11,5.4z"/>
+</vector>
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index fc198172..ba4d146c 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -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">
-
- <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>
+ android:orientation="vertical">
- <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"
+ <LinearLayout
+ android:id="@+id/profile_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_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:layout_gravity="center_vertical"
- android:text="@string/subscriptions"
- 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_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>
- <View
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/account_recycler_view_main_activity"
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>
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
index 8bec0647..46a388a9 100644
--- a/app/src/main/res/layout/app_bar_main.xml
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -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" />-->
diff --git a/app/src/main/res/layout/item_account.xml b/app/src/main/res/layout/item_account.xml
new file mode 100644
index 00000000..d347dd67
--- /dev/null
+++ b/app/src/main/res/layout/item_account.xml
@@ -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> \ No newline at end of file
diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml
index 593385f1..9938d47c 100644
--- a/app/src/main/res/layout/nav_header_main.xml
+++ b/app/src/main/res/layout/nav_header_main.xml
@@ -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>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2801d12b..062c13fc 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -170,4 +170,9 @@
<string name="posting_video">Posting video</string>
<string name="posting_image">Posting image</string>
<string name="please_wait">Please wait.</string>
+
+ <string name="add_account">Add account</string>
+ <string name="anonymous_account">Anonymous</string>
+ <string name="manage_accounts">Manage accounts</string>
+ <string name="log_out">Log out</string>
</resources>