make spacing and sizing more consistent

This commit is contained in:
Phillip Thelen 2016-03-16 13:52:42 +01:00
parent 9a49f322ce
commit 095ba04f4e
31 changed files with 270 additions and 211 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="42"
android:versionCode="43"
android:versionName="0.0.27"
android:screenOrientation="portrait"
android:installLocation="auto" >

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
</shape>
</item>
<item
android:bottom="10dp"
android:left="250dp"
android:right="50dp"
android:top="10dp">
<shape
android:innerRadius="10dp"
android:shape="oval" >
<solid android:color="#8bc34a" />
</shape>
</item>
</selector>

View file

@ -21,14 +21,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
style="@style/SectionTitle"
android:text="@{categorytitle}"
android:textAppearance="?android:attr/textAppearanceMedium" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_horizontal_padding">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -39,42 +39,42 @@
android:id="@+id/outfit_head"
bind:title="@{@string/outfit_head}"
bind:value="@{equipmentNames.get(outfit.getHead)}"
bind:imageNamed='@{outfit.getHead}'/>
bind:imageNamed='@{"shop_"+outfit.getHead}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_head_accessory"
bind:title="@{@string/outfit_headAccessory}"
bind:value="@{equipmentNames.get(outfit.getHeadAccessory)}"
bind:imageNamed='@{outfit.getHeadAccessory}'/>
bind:imageNamed='@{"shop_"+outfit.getHeadAccessory}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_Eyewear"
bind:title="@{@string/outfit_eyewear}"
bind:value="@{equipmentNames.get(outfit.getEyeWear)}"
bind:imageNamed='@{outfit.getEyeWear}'/>
bind:imageNamed='@{"shop_"+outfit.getEyeWear}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_Armor"
bind:title="@{@string/outfit_armor}"
bind:value='@{equipmentNames.get(outfit.getArmor)}'
bind:imageNamed='@{userSize + "_" + outfit.getArmor}'/>
bind:imageNamed='@{"shop_"+userSize + "_" + outfit.getArmor}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_back"
bind:title="@{@string/outfit_back}"
bind:value="@{equipmentNames.get(outfit.getBack)}"
bind:imageNamed='@{outfit.getBack}'/>
bind:imageNamed='@{"shop_"+outfit.getBack}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_Body"
bind:title="@{@string/outfit_body}"
bind:value="@{equipmentNames.get(outfit.getBody)}"
bind:imageNamed='@{outfit.getBody}'/>
bind:imageNamed='@{"shop_"+outfit.getBody}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_weapon"
bind:title="@{@string/outfit_weapon}"
bind:value="@{equipmentNames.get(outfit.getWeapon)}"
bind:imageNamed='@{outfit.getWeapon}'/>
bind:imageNamed='@{"shop_"+outfit.getWeapon}'/>
<include layout="@layout/item_image_row"
android:id="@+id/outfit_shield"
bind:title="@{@string/outfit_shield}"
bind:value="@{equipmentNames.get(outfit.getShield)}"
bind:imageNamed='@{outfit.getShield}'/>
bind:imageNamed='@{"shop_"+outfit.getShield}'/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

View file

@ -28,22 +28,20 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
style="@style/SectionTitle"
android:text="@string/avatar_body"
android:textAppearance="?android:attr/textAppearanceMedium" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_horizontal_padding">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:divider="?android:listDivider"
android:showDividers="middle">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
@ -88,12 +86,12 @@
android:layout_height="wrap_content"
android:text="@string/avatar_hair"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_margin="5dp"/>
style="@style/SectionTitle"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -138,12 +136,12 @@
android:layout_height="wrap_content"
android:text="@string/avatar_background"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_margin="5dp"/>
style="@style/SectionTitle"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -17,7 +17,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/questionTextView"
android:layout_gravity="center_horizontal"
android:padding="@dimen/card_padding"/>
@ -25,12 +24,13 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/answerTextView"
android:layout_gravity="center_horizontal"
android:paddingLeft="@dimen/card_padding"
android:paddingStart="@dimen/card_padding"
android:paddingEnd="@dimen/card_padding"
android:paddingRight="@dimen/card_padding"/>
android:paddingRight="@dimen/card_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

View file

@ -37,34 +37,31 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.data5tream.emojilib.EmojiTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
bind:parsemarkdown="@{group.name}"
android:textStyle="bold" />
android:text="@{group.name}"
style="@style/SectionTitle"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:drawable/divider_horizontal_dark"
android:dividerPadding="8dp"
style="@style/CardContent"
android:divider="?android:listDivider"
android:showDividers="middle"
android:orientation="vertical">
<com.github.data5tream.emojilib.EmojiTextView
android:layout_margin="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
bind:parsemarkdown="@{group.description}" />
<com.github.data5tream.emojilib.EmojiTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
bind:parsemarkdown="@{group.description}" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="@dimen/card_padding"
android:visibility='@{group.type.equals("guild") ? View.VISIBLE : View.GONE}' >
<TextView
android:layout_width="0dp"
@ -84,79 +81,96 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quest"
android:layout_margin="5dp"
style="@style/SectionTitle"
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"
style="@style/CardView.Default"
android:visibility="@{quest != null &amp;&amp; !group.quest.active ? View.VISIBLE : View.GONE}">
<LinearLayout
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/CardContent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quest.invitation"
style="@style/CardTitle" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quest.invitation.text"
style="@style/CardText"
android:visibility="@{user.getParty().getQuest().RSVPNeeded? View.VISIBLE : View.GONE}"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">
android:layout_gravity="right">
<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:textColor="@color/btn_success"
style="?android:buttonBarButtonStyle"
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:textColor="@color/btn_danger"
style="?android:buttonBarButtonStyle"
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"
android:textColor="@color/btn_warning"
style="?android:buttonBarButtonStyle"
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"
android:textColor="@color/btn_danger"
style="?android:buttonBarButtonStyle"
android:visibility="@{user.getId().equals(group.quest.leader) ? View.VISIBLE : View.GONE}" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
style="@style/CardView.Default"
android:visibility="@{quest != null ? View.VISIBLE : View.GONE}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
>
style="@style/CardContent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@{quest.text}"
android:textStyle="bold"
style="@style/CardTitle"
/>
<ImageView
@ -170,6 +184,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="?android:buttonBarStyle"
android:visibility="@{group.quest.active? View.VISIBLE : View.GONE}">
<include
@ -196,7 +211,8 @@
android:id="@+id/collectionStats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
android:orientation="vertical"
android:layout_margin="@dimen/row_padding"/>
</LinearLayout>
@ -204,6 +220,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{quest.notes != null ? Html.fromHtml(quest.notes) : null}"
style="@style/CardText"
/>
</LinearLayout>
@ -213,51 +230,55 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
style="@style/CardView.Default"
android:visibility="@{quest != null ? View.VISIBLE : View.GONE}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
style="@style/CardContent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/quest_participants"
android:id="@+id/textView12" />
android:text="@string/quest.participants"
android:id="@+id/textView12"
style="@style/CardTitle" />
<LinearLayout
android:id="@+id/questMemberView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp" />
android:divider="?android:listDivider"
android:showDividers="middle"
style="@style/CardContent"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
android:visibility="@{group.quest.active? View.VISIBLE : View.GONE}">
style="?android:buttonBarStyle"
android:visibility="@{group.quest.active? View.VISIBLE : View.GONE}"
android:layout_gravity="right">
<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"
android:textColor="@color/btn_danger"
style="?android:buttonBarButtonStyle"
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"
android:textColor="@color/btn_warning"
style="?android:buttonBarButtonStyle"
android:visibility="@{(!user.getId().equals(group.quest.leader) &amp;&amp; group.quest.members.containsKey(user.getId()))? View.VISIBLE : View.GONE}" />
</LinearLayout>

View file

@ -17,14 +17,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
style="@style/SectionTitle"
android:text="@string/my_guilds"
android:textAppearance="?android:attr/textAppearanceMedium" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_horizontal_padding">
style="@style/CardView.Default">
<LinearLayout
android:id="@+id/my_guilds_listview"
android:layout_width="match_parent"

View file

@ -2,37 +2,39 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/row_padding"
android:background="@drawable/selection_highlight"
style="@style/Row"
android:id="@+id/gear_container">
<ImageView
android:layout_width="@dimen/gear_image_size"
android:layout_height="@dimen/gear_image_size"
android:id="@+id/gear_image" />
android:id="@+id/gear_image"
android:layout_marginRight="@dimen/row_padding" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gear_text"
android:textStyle="bold" />
style="@style/RowTitle" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/equipped"
android:id="@+id/equippedIndicator" />
android:id="@+id/equippedIndicator"
style="@style/RowText.unimportant"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gear_notes" />
android:id="@+id/gear_notes"
style="@style/RowText" />
</LinearLayout>
</LinearLayout>

View file

@ -16,7 +16,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
android:minHeight="@dimen/task_min_height">
<LinearLayout
android:layout_width="80dp"
android:layout_height="match_parent"

View file

@ -11,35 +11,33 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60dp"
android:padding="5dp"
android:paddingTop="@dimen/row_padding"
android:paddingBottom="@dimen/row_padding"
android:clickable="true"
android:background="@drawable/selection_highlight">
style="Row"
android:clickable="true">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="@dimen/gear_image_size"
android:layout_height="@dimen/gear_image_size"
bind:imageName='@{imageNamed == null ? "head_0" : imageNamed}'
android:contentDescription="@{imageNamed}"
android:alpha="@{imageNamed == null ? 0.4f : 1.0f}"
android:scaleType="fitEnd"/>
android:scaleType="fitEnd"
android:layout_marginRight="@dimen/row_padding"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:layout_margin="5dp"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{title}"
tools:text="Title"
android:textStyle="bold"/>
<TextView android:layout_margin="5dp"
style="@style/RowTitle"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/darker_gray"
tools:text="Value"
android:text="@{value != null ? value : (valueInt != 0 ? String.valueOf(valueInt) : @string/avatar_nothing)}" />
android:text="@{value != null ? value : (valueInt != 0 ? String.valueOf(valueInt) : @string/avatar_nothing)}"
style="@style/RowText"/>
</LinearLayout>
</LinearLayout>
</layout>

View file

@ -12,16 +12,14 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
style="@style/RowTitle"
android:id="@+id/nameTextView"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
style="@style/RowText"
android:id="@+id/memberCountTextView" />
</LinearLayout>

View file

@ -2,12 +2,12 @@
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
style="@style/CardContent"
android:orientation="horizontal">
<ImageView

View file

@ -10,12 +10,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_columnSpan="2"
android:layout_margin="8dp">
style="@style/CardView.Default">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
style="@style/CardContent.Compact">
<LinearLayout
@ -44,8 +45,7 @@
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:ellipsize="middle"
android:lines="1"
android:text="some user name" />
android:lines="1" />
</LinearLayout>
</LinearLayout>
@ -79,8 +79,7 @@
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:clickable="true"
android:gravity="center_vertical"
android:text="+1" />
android:gravity="center_vertical" />
</LinearLayout>
<ImageView
@ -110,8 +109,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:layout_marginRight="8dp"
android:ellipsize="end"
android:text="5 hours ago" />
android:ellipsize="end" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="class_healer">#FFFF00</color>
<color name="class_warrior">#FF0000</color>
<color name="class_wizard">#0000FF</color>
<color name="class_rogue">#7736205D</color>
<color name="class_healer">@color/neutral_100</color>
<color name="class_warrior">@color/worse_100</color>
<color name="class_wizard">@color/best_100</color>
<color name="class_rogue">@color/brand_100</color>
</resources>

View file

@ -9,7 +9,11 @@
<dimen name="card_large_text">25.0sp</dimen>
<dimen name="card_medium_text">18.0sp</dimen>
<dimen name="card_small_text">14.0sp</dimen>
<dimen name="card_padding">16.0dip</dimen>
<dimen name="card_padding">12dp</dimen>
<dimen name="card_padding_compact">6dp</dimen>
<dimen name="section_leftright_padding">6dp</dimen>
<dimen name="section_top_padding">16dp</dimen>
<dimen name="card_margin">6dp</dimen>
<dimen name="bar_size">15dp</dimen>
<dimen name="bar_padding">5dp</dimen>
@ -55,6 +59,9 @@
<dimen name="avatar_small_width">114dp</dimen>
<dimen name="avatar_small_height">90dp</dimen>
<dimen name="customization_width">100dp</dimen>
<dimen name="gear_image_size">90dp</dimen>
<dimen name="row_padding">8dp</dimen>
<dimen name="gear_image_size">60dp</dimen>
<dimen name="row_padding">12dp</dimen>
<dimen name="row_title_size">16sp</dimen>
<dimen name="row_text_size">14sp</dimen>
<dimen name="row_title_bottommargin">2dp</dimen>
</resources>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="define_paperboy"></string>
<!-- Author section -->
<string name="library_paperboy_author">porokoro</string>
<string name="library_paperboy_authorWebsite">https://github.com/porokoro</string>
<!-- Library section -->
<string name="library_paperboy_libraryName">Paperboy</string>
<string name="library_paperboy_libraryDescription">A changelog library for Android</string>
<string name="library_paperboy_libraryWebsite">https://github.com/porokoro</string>
<string name="library_paperboy_libraryVersion">2.1.0</string>
<!-- OpenSource section -->
<string name="library_paperboy_isOpenSource">true</string>
<string name="library_paperboy_repositoryLink">https://github.com/porokoro</string>
<!-- ClassPath for autoDetect section -->
<string name="library_paperboy_classPath">com.github.porokoro.paperboy</string>
<!-- License section -->
<string name="library_paperboy_licenseId">apache_2_0</string>
<!-- Custom variables section -->
</resources>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="fabric_key">CHANGE_ME</string>
<string name="facebook_app_id">CHANGE_ME</string>
<string name="amplitude_app_id">CHANGE_ME</string>
</resources>
<string name="facebook_app_id">128307497299777</string>
<string name="amplitude_app_id">e8d4c24b3d6ef3ee73eeba715023dd43</string>
</resources>

View file

@ -2,7 +2,7 @@
<resources>
<!-- Prefs -->
<string name="SP_address">ServerAddress</string>
<string name="SP_address_default">https://habitrpg-gamma.herokuapp.com/</string>
<string name="SP_address_default">https://habitica.com/</string>
<string name="SP_userID">UserID</string>
<string name="SP_APIToken">APIToken</string>
<string name="SP_username">Username</string>

View file

@ -164,11 +164,14 @@
<string name="due_date">Due Date</string>
<string name="quest.accept">Accept</string>
<string name="quest.reject">Reject</string>
<string name="quest.begin">Begin</string>
<string name="quest.cancel">Cancel</string>
<string name="quest.abort">Abort</string>
<string name="quest.begin">Begin Quest</string>
<string name="quest.cancel">Cancel Invitation</string>
<string name="quest.abort">Abort Quest</string>
<string name="quest.leave">Leave Quest</string>
<string name="quest.pending">Pending</string>
<string name="quest.accepted">Accepted</string>
<string name="quest.rejected">Rejected</string>
<string name="quest.participants">Participants</string>
<string name="version_info" formatted="false">Version %s (%d)</string>
<string name="sidebar_help">Help &amp; FAQ</string>
@ -253,8 +256,9 @@ To start, which parts of your life do you want to improve?</string>
<string name="outfit_weapon">Weapon</string>
<string name="wear_costume">Wear Costume</string>
<string name="equipped">Equipped</string>
<string name="quest_pending">Pending</string>
<string name="quest_accepted">Accepted</string>
<string name="quest_rejected">Rejected</string>
<string name="quest_participants">Participants</string>
<string name="quest_cancel_message">Are you sure you want to cancel this quest? All invitation acceptances will be lost. The quest owner will retain possession of the quest scroll.</string>
<string name="quest.invitation">Quest Invitation</string>
<string name="quest_begin_message">Are you sure you want to begin the quest? Once it is active, no additional party members can join the quest.</string>
<string name="quest.invitation.text">You have been invited to participate in a quest!</string>
</resources>

View file

@ -38,6 +38,8 @@
<item name="actionOverflowMenuStyle">@style/PopupTheme</item>
<item name="android:popupMenuStyle">@style/PopupTheme</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="android:alertDialogTheme">@style/AlertDialogTheme</item>
</style>
<style name="AppThemeWithActionBar" parent="AppTheme">
@ -64,22 +66,53 @@
<item name="android:textSize">@dimen/card_small_text</item>
<item name="android:textColor">@color/card_text</item>
<item name="android:ellipsize">end</item>
<item name="android:maxLines">2</item>
</style>
<style name="CardTitle" parent="@style/CardText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">@dimen/card_medium_text</item>
<item name="android:textColor">@color/card_title_text</item>
</style>
<style name="CardContent">
<item name="android:padding">@dimen/card_padding</item>
</style>
<style name="CardContent.Compact" parent="CardContent">
<item name="android:padding">@dimen/card_padding_compact</item>
</style>
<style name="CardView.Default" parent="CardView.Light">
<item name="android:layout_margin">@dimen/card_margin</item>
</style>
<style name="Row">
<item name="android:padding">@dimen/row_padding</item>
<item name="android:background">@drawable/selection_highlight</item>
</style>
<style name="RowText">
<item name="android:textSize">@dimen/row_text_size</item>
<item name="android:textColor">@color/card_text</item>
</style>
<style name="RowTitle">
<item name="android:textSize">@dimen/row_title_size</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/card_title_text</item>
<item name="android:paddingBottom">@dimen/row_title_bottommargin</item>
</style>
<style name="RowText.unimportant" parent="RowText">
<item name="android:textColor">@android:color/darker_gray</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
<style name="MyOwnListSeperatorTextViewStyle">
<item name="android:background">@drawable/border_lightgray</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps" tools:targetApi="14">true</item>
<item name="android:textAllCaps">true</item>
<item name="android:textSize">14sp</item>
</style>
@ -107,4 +140,15 @@
<item name="android:textColor">@color/brand_100</item>
</style>
<style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/brand_100</item>
</style>
<style name="SectionTitle">
<item name="android:textSize">@dimen/card_medium_text</item>
<item name="android:textStyle">bold</item>
<item name="android:paddingLeft">@dimen/section_leftright_padding</item>
<item name="android:paddingRight">@dimen/section_leftright_padding</item>
<item name="android:paddingTop">@dimen/section_top_padding</item>
</style>
</resources>

View file

@ -95,8 +95,13 @@ class GearViewHolder extends RecyclerView.ViewHolder implements View.OnClickList
this.gearContainer.setBackgroundResource(R.drawable.selection_highlight);
}
String imageUrl = "https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_" + gear.key + ".png";
if (gear.type.equals("armor")) {
imageUrl = "https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_" + userSize + "_" + gear.key + ".png";
}
Picasso.with(imageView.getContext())
.load("https://habitica-assets.s3.amazonaws.com/mobileApp/images/" + userSize + "_" + gear.key + ".png")
.load(imageUrl)
.into(imageView);
}

View file

@ -6,6 +6,7 @@ import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@ -240,7 +241,9 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
if (messageText != null) {
messageText.setText(msg.parsedText);
this.messageText.setMovementMethod(LinkMovementMethod.getInstance());
}
agoLabel.setText(msg.getAgoString());
}
}
@ -287,7 +290,7 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
}
DataBindingUtils.setRoundedBackground(likeBackground, ContextCompat.getColor(context, backgroundColorRes));
tvLikes.setTextColor( ContextCompat.getColor(context, foregroundColorRes));
tvLikes.setTextColor(ContextCompat.getColor(context, foregroundColorRes));
}
@Override
@ -364,13 +367,13 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
return;
}
String text = textNewMessage.getText().toString();
if (!text.equals("")) {
EventBus.getDefault().post(new SendNewGroupMessageCommand(groupId, text));
if (textNewMessage != null) {
String text = textNewMessage.getText().toString();
if (!text.equals("")) {
EventBus.getDefault().post(new SendNewGroupMessageCommand(groupId, text));
}
textNewMessage.setText("");
}
textNewMessage.setText("");
}
private void toggleLike() {

View file

@ -110,26 +110,28 @@ public class PartyMemberRecyclerViewAdapter extends RecyclerView.Adapter<PartyMe
classLabel.setText(user.getStats().getCleanedClassName());
int colorResourceID;
switch (user.getStats()._class) {
case healer: {
ViewHelper.SetBackgroundTint(classBackground, resources.getColor(R.color.neutral_100));
colorResourceID = R.color.class_healer;
break;
}
case warrior: {
ViewHelper.SetBackgroundTint(classBackground, resources.getColor(R.color.worse_100));
colorResourceID = R.color.class_warrior;
break;
}
case rogue: {
ViewHelper.SetBackgroundTint(classBackground, resources.getColor(R.color.brand_50));
colorResourceID = R.color.class_rogue;
break;
}
case wizard: {
ViewHelper.SetBackgroundTint(classBackground, resources.getColor(R.color.best_100));
colorResourceID = R.color.class_wizard;
break;
}
default:
colorResourceID = R.color.task_gray;
}
ViewHelper.SetBackgroundTint(classBackground, resources.getColor(colorResourceID));
userName.setText(user.getProfile().getName());
}
}

View file

@ -88,7 +88,7 @@ public class PublicGuildsRecyclerViewAdapter extends RecyclerView.Adapter<Public
this.nameTextView.setText(guild.name);
this.memberCountTextView.setText(String.valueOf(guild.memberCount));
this.descriptionTextView.setText(guild.description);
if (PublicGuildsRecyclerViewAdapter.this.memberGuildIDs.contains(guild.id)) {
if (PublicGuildsRecyclerViewAdapter.this.memberGuildIDs != null && PublicGuildsRecyclerViewAdapter.this.memberGuildIDs.contains(guild.id)) {
this.isMember = true;
this.joinLeaveButton.setText(R.string.leave);
} else {

View file

@ -8,6 +8,7 @@ import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TouchDelegate;
@ -262,6 +263,9 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
public HabitItem Item;
@Bind(R.id.checkedTextView)
TextView titleTextView;
@Bind(R.id.notesTextView)
TextView notesTextView;
@ -276,6 +280,9 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
ButterKnife.bind(this, itemView);
this.notesTextView.setMovementMethod(LinkMovementMethod.getInstance());
this.titleTextView.setMovementMethod(LinkMovementMethod.getInstance());
resources = itemView.getResources();
}

View file

@ -74,6 +74,7 @@ public abstract class BaseMainFragment extends BaseFragment {
if (tabLayout != null) {
if (this.usesTabLayout) {
tabLayout.removeAllTabs();
tabLayout.setVisibility(View.VISIBLE);
} else {
tabLayout.setVisibility(View.GONE);

View file

@ -1,6 +1,7 @@
package com.habitrpg.android.habitica.ui.fragments.faq;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -8,14 +9,12 @@ import android.widget.TextView;
import com.habitrpg.android.habitica.R;
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment;
import com.habitrpg.android.habitica.ui.helpers.MarkdownParser;
import com.magicmicky.habitrpgwrapper.lib.models.FAQArticle;
import butterknife.Bind;
import butterknife.ButterKnife;
/**
* Created by viirus on 22/01/16.
*/
public class FAQDetailFragment extends BaseMainFragment {
@Bind(R.id.questionTextView)
TextView questionTextView;
@ -35,9 +34,9 @@ public class FAQDetailFragment extends BaseMainFragment {
if (this.article != null) {
this.questionTextView.setText(this.article.getQuestion());
this.answerTextView.setText(this.article.getAnswer());
this.answerTextView.setText(MarkdownParser.parseMarkdown(this.article.getAnswer()));
}
this.answerTextView.setMovementMethod(LinkMovementMethod.getInstance());
return v;
}
@ -47,7 +46,7 @@ public class FAQDetailFragment extends BaseMainFragment {
this.questionTextView.setText(this.article.getQuestion());
}
if (this.answerTextView != null) {
this.answerTextView.setText(this.article.getAnswer());
this.answerTextView.setText(MarkdownParser.parseMarkdown(this.article.getAnswer()));
}
}
}

View file

@ -35,7 +35,6 @@ public class EquipmentDetailFragment extends BaseMainFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
this.usesTabLayout = true;
super.onCreateView(inflater, container, savedInstanceState);
View v = inflater.inflate(R.layout.fragment_recyclerview, container, false);

View file

@ -63,7 +63,6 @@ public class EquipmentOverviewFragment extends BaseMainFragment implements Trans
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
this.usesTabLayout = true;
super.onCreateView(inflater, container, savedInstanceState);
View v = inflater.inflate(R.layout.fragment_equipment_overview, container, false);

View file

@ -138,18 +138,18 @@ public class GroupInformationFragment extends Fragment {
}
private void updateQuestMember(Group group) {
questMemberView.removeAllViewsInLayout();
if (group.quest == null || group.quest.key == null) return;
LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Context context = getContext();
if (context == null) {
return;
}
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for (HabitRPGUser member : group.members) {
final LinearLayout itemView = (LinearLayout) layoutInflater.inflate(R.layout.party_member_quest, null);
TextView questResponse = (TextView) itemView.findViewById(R.id.rsvpneeded);
TextView userName = (TextView) itemView.findViewById(R.id.username);
if (group.quest.leader.equals(member.getId()))
userName.setText("* " + member.getProfile().getName());
else
userName.setText(member.getProfile().getName());
userName.setText(member.getProfile().getName());
if (!group.quest.members.containsKey(member.getId()))
continue;
@ -244,24 +244,38 @@ public class GroupInformationFragment extends Fragment {
@OnClick(R.id.btnQuestBegin)
public void onQuestBegin() {
mAPIHelper.apiService.forceStartQuest(group.id, group, new Callback<Group>() {
@Override
public void success(Group group, Response response) {
setGroup(group);
}
@Override
public void failure(RetrofitError error) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setMessage(R.string.quest_begin_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mAPIHelper.apiService.forceStartQuest(group.id, group, new Callback<Group>() {
@Override
public void success(Group group, Response response) {
setGroup(group);
}
}
});
@Override
public void failure(RetrofitError error) {
}
});
}
}).setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.show();
}
@OnClick(R.id.btnQuestCancel)
public void onQuestCancel() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setMessage("Are you sure you want to cancel this quest? All invitation acceptances will be lost. The quest owner will retain possession of the quest scroll.")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
.setMessage(R.string.quest_cancel_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mAPIHelper.apiService.cancelQuest(group.id, new Callback<Void>() {
@ -277,7 +291,7 @@ public class GroupInformationFragment extends Fragment {
}
});
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
}).setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

View file

@ -23,7 +23,7 @@ public class GroupSerialization implements JsonDeserializer<Group>, JsonSerializ
JsonObject obj = json.getAsJsonObject();
group.id = obj.get("_id").getAsString();
group.name = obj.get("name").getAsString();
if (obj.has("description")) {
if (obj.has("description") && !obj.get("description").isJsonNull()) {
group.description = obj.get("description").getAsString();
}
if (obj.has("privacy")) {
@ -35,7 +35,7 @@ public class GroupSerialization implements JsonDeserializer<Group>, JsonSerializ
if (obj.has("balance")) {
group.balance = obj.get("balance").getAsDouble();
}
if (obj.has("logo")) {
if (obj.has("logo") && !obj.get("logo").isJsonNull()) {
group.logo = obj.get("logo").getAsString();
}
if (obj.has("type")) {