diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-09-28 01:56:58 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-09-28 01:56:58 +0000 |
commit | 60108462ceb93a5797b67bee66f55237f4730561 (patch) | |
tree | 52d1ce227ecc38aad4ec122cfc27aae0a1f6c8fd /app/src/main/res | |
parent | ca19c566c338a8c815ce68aa88e3a09987112881 (diff) | |
download | infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar.gz infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar.bz2 infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar.lz infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar.xz infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.tar.zst infinity-for-reddit-60108462ceb93a5797b67bee66f55237f4730561.zip |
Giving award is available. Giving award is not tested because I don't have Reddit Coins. Currently all the award ids are hardcoded.
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_give_award.xml | 33 | ||||
-rw-r--r-- | app/src/main/res/layout/dialog_give_award.xml | 23 | ||||
-rw-r--r-- | app/src/main/res/layout/item_award.xml | 48 | ||||
-rw-r--r-- | app/src/main/res/menu/view_post_detail_activity.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 10 |
5 files changed, 122 insertions, 4 deletions
diff --git a/app/src/main/res/layout/activity_give_award.xml b/app/src/main/res/layout/activity_give_award.xml new file mode 100644 index 00000000..4eec2c84 --- /dev/null +++ b/app/src/main/res/layout/activity_give_award.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/coordinator_layout_give_award_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Activity.GiveAwardActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar_layout_give_award_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_give_award_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?attr/actionBarSize" + app:title="@string/give_award_activity_label" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> + + </com.google.android.material.appbar.AppBarLayout> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_view_give_award_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/dialog_give_award.xml b/app/src/main/res/layout/dialog_give_award.xml new file mode 100644 index 00000000..c38791c1 --- /dev/null +++ b/app/src/main/res/layout/dialog_give_award.xml @@ -0,0 +1,23 @@ +<?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="match_parent" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="24dp" + android:paddingEnd="16dp"> + + <TextView + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_marginEnd="16dp" + android:text="@string/anonymous" + android:textColor="?attr/primaryTextColor" /> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/switch_material_give_award_dialog" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_award.xml b/app/src/main/res/layout/item_award.xml new file mode 100644 index 00000000..baf4052d --- /dev/null +++ b/app/src/main/res/layout/item_award.xml @@ -0,0 +1,48 @@ +<?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:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> + + <pl.droidsonroids.gif.GifImageView + android:id="@+id/icon_image_view_item_award" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" /> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp"> + + <TextView + android:id="@+id/name_text_view_item_award" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" /> + + <TextView + android:id="@+id/description_text_view_item_award" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </LinearLayout> + + <TextView + android:id="@+id/coin_text_view_item_award" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" /> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/view_post_detail_activity.xml b/app/src/main/res/menu/view_post_detail_activity.xml index 306fabb0..454603aa 100644 --- a/app/src/main/res/menu/view_post_detail_activity.xml +++ b/app/src/main/res/menu/view_post_detail_activity.xml @@ -76,21 +76,27 @@ android:visible="false" /> <item - android:id="@+id/action_report_view_post_detail_activity" + android:id="@+id/action_give_award_view_post_detail_activity" android:orderInCategory="12" + android:title="@string/action_give_award" + app:showAsAction="never" /> + + <item + android:id="@+id/action_report_view_post_detail_activity" + android:orderInCategory="13" android:title="@string/action_report" app:showAsAction="never" /> <item android:id="@+id/action_see_removed_view_post_detail_activity" - android:orderInCategory="13" + android:orderInCategory="14" android:title="@string/action_see_removed" app:showAsAction="never" android:visible="false" /> <item android:id="@+id/action_crosspost_view_post_detail_activity" - android:orderInCategory="14" + android:orderInCategory="15" android:title="@string/action_crosspost" app:showAsAction="never" /> </menu> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a4b5a801..4c3ffde7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,6 +32,7 @@ <string name="view_reddit_gallery_activity_gif_label">Gif %1$d/%2$d</string> <string name="view_reddit_gallery_activity_video_label">Video %1$d/%2$d</string> <string name="submit_crosspost_activity_label">Crosspost</string> + <string name="give_award_activity_label">Give Award</string> <string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string> @@ -68,6 +69,7 @@ <string name="action_send_private_message">Send Private Message</string> <string name="action_block_user">Block User</string> <string name="action_select_user_flair">Select User Flair</string> + <string name="action_give_award">Give Award</string> <string name="parse_json_response_error">Error occurred when parsing the JSON response</string> <string name="retrieve_token_error">Error Retrieving the token</string> @@ -560,7 +562,7 @@ <string name="copy_raw_text">Copy Raw Text</string> <string name="copy_all_markdown">Copy All Markdown</string> <string name="copy_all_raw_text">Copy All Raw Text</string> - + <string name="copy_failed">Copy failed</string> <string name="exit_app">Exit?</string> @@ -900,4 +902,10 @@ <string name="change_sort_type">Change Sort Type</string> <string name="change_post_layout">Change Post Layout</string> + <string name="give_award_dialog_title">Give Award?</string> + <string name="anonymous">Anonymous</string> + <string name="give_award_error_message">Code: %1$d/\n Message: %2$s</string> + <string name="give_award_success">Award given</string> + <string name="give_award_failed">Failed</string> + </resources> |