habitica-android/Habitica/res/layout/fragment_group_info.xml

221 lines
10 KiB
XML
Raw Normal View History

2015-10-01 18:58:04 +00:00
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:bind="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.magicmicky.habitrpgwrapper.lib.models.Group" />
<import type="com.magicmicky.habitrpgwrapper.lib.models.QuestContent" />
<import type="com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser" />
2015-10-01 18:58:04 +00:00
<import type="android.view.View" />
<import type="android.text.Html"/>
2015-10-01 18:58:04 +00:00
<variable
2016-03-05 13:54:19 +00:00
name="group"
2015-10-01 18:58:04 +00:00
type="Group" />
<variable
name="quest"
type="QuestContent" />
<variable
name="user"
type="HabitRPGUser" />
2015-10-01 18:58:04 +00:00
</data>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@color/md_grey_500"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.data5tream.emojilib.EmojiTextView
2015-10-01 18:58:04 +00:00
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
2016-03-05 13:54:19 +00:00
bind:parsemarkdown="@{group.name}"
2015-10-01 18:58:04 +00:00
android:textStyle="bold" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
2016-03-05 13:54:19 +00:00
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:drawable/divider_horizontal_dark"
android:dividerPadding="8dp"
android:showDividers="middle"
android:orientation="vertical">
<com.github.data5tream.emojilib.EmojiTextView
android:layout_margin="5dp"
2015-10-01 18:58:04 +00:00
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2016-03-05 13:54:19 +00:00
bind:parsemarkdown="@{group.description}" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="@dimen/card_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/gems"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(group.balance * 4)}"/>
</LinearLayout>
</LinearLayout>
2015-10-01 18:58:04 +00:00
</android.support.v7.widget.CardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2015-12-17 13:01:39 +00:00
android:text="@string/quest"
2015-10-01 18:58:04 +00:00
android:layout_margin="5dp"
android:visibility="@{quest != null ? View.VISIBLE : View.GONE}" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:visibility="@{quest != null ? View.VISIBLE : View.GONE}">
<LinearLayout
2015-10-01 18:58:04 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
>
2015-10-01 18:58:04 +00:00
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@{quest.text}"
android:textStyle="bold"
/>
2015-10-01 18:58:04 +00:00
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
2016-01-12 16:08:02 +00:00
bind:questImageName='@{"quest_"+ quest.key}'
/>
2015-10-01 18:58:04 +00:00
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{quest.notes != null ? Html.fromHtml(quest.notes) : null}"
/>
2015-10-01 18:58:04 +00:00
</LinearLayout>
2015-10-01 18:58:04 +00:00
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:visibility="@{quest != null ? View.VISIBLE : View.GONE}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/questMemberView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
2016-03-05 15:53:36 +00:00
android:visibility="@{group.quest.active? View.VISIBLE : View.GONE}">
<Button
android:id="@+id/btnQuestAbort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_warning"
android:text="@string/quest.abort"
android:textColor="@android:color/white"
2016-03-05 15:53:36 +00:00
android:visibility="@{(group.quest != null &amp;&amp; user.getId().equals(group.quest.leader))? View.VISIBLE : View.GONE}" />
<Button
android:id="@+id/btnQuestLeave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_warning"
android:text="@string/quest.leave"
android:textColor="@android:color/white"
2016-03-05 15:53:36 +00:00
android:visibility="@{(!user.getId().equals(group.quest.leader) &amp;&amp; group.quest.members.containsKey(user.getId()))? View.VISIBLE : View.GONE}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
2016-03-05 15:53:36 +00:00
android:visibility="@{!group.quest.active? View.VISIBLE : View.GONE}">
<Button
android:id="@+id/btnQuestAccept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_success"
android:text="@string/quest.accept"
android:textColor="@android:color/white"
android:visibility="@{user.getParty().getQuest().RSVPNeeded? View.VISIBLE : View.GONE}" />
<Button
android:id="@+id/btnQuestReject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_danger"
android:text="@string/quest.reject"
android:textColor="@android:color/white"
android:visibility="@{user.getParty().getQuest().RSVPNeeded? View.VISIBLE : View.GONE}" />
<Button
android:id="@+id/btnQuestBegin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_warning"
android:text="@string/quest.begin"
android:textColor="@android:color/white"
2016-03-05 15:53:36 +00:00
android:visibility="@{user.getId().equals(group.quest.leader) ? View.VISIBLE : View.GONE}" />
<Button
android:id="@+id/btnQuestCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/btn_danger"
android:text="@string/quest.cancel"
android:textColor="@android:color/white"
2016-03-05 15:53:36 +00:00
android:visibility="@{user.getId().equals(group.quest.leader) ? View.VISIBLE : View.GONE}" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
2015-10-01 18:58:04 +00:00
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</layout>