mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
refactor tasks layouts
This commit is contained in:
parent
a7e78dbd68
commit
305d676976
4 changed files with 61 additions and 116 deletions
|
|
@ -26,51 +26,42 @@
|
|||
app:cardPreventCornerOverlap="false"
|
||||
app:contentPadding="0dp">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="fill_horizontal|center_vertical|center_horizontal|fill|clip_vertical|fill_vertical|center|start|clip_horizontal|bottom|left|right|end|top">
|
||||
android:layout_above="@+id/textView6"
|
||||
android:layout_alignLeft="@+id/checkedTextView"
|
||||
android:layout_alignStart="@+id/checkedTextView">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="false"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_height="fill_parent"
|
||||
android:checked="false"
|
||||
android:gravity="top" />
|
||||
android:gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp">
|
||||
<CheckedTextView
|
||||
android:id="@+id/checkedTextView"
|
||||
style="@style/CardTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{daily.text}" />
|
||||
|
||||
<CheckedTextView
|
||||
android:id="@+id/checkedTextView"
|
||||
style="@style/CardTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="false"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:layout_alignParentLeft="false"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentStart="false"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@+id/checkBox"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@{daily.text}" />
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
style="@style/CardText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{daily.notes}" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
style="@style/CardText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/checkedTextView"
|
||||
android:layout_toEndOf="@+id/checkBox"
|
||||
android:layout_toRightOf="@+id/checkBox"
|
||||
android:text="@{daily.notes}" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@+id/checkedTextView"
|
||||
android:layout_toStartOf="@+id/checkedTextView"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="+" />
|
||||
|
||||
<Button
|
||||
|
|
@ -58,24 +58,25 @@
|
|||
<CheckedTextView
|
||||
android:id="@+id/checkedTextView"
|
||||
style="@style/CardTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="false"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:layout_alignParentLeft="false"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentStart="false"
|
||||
android:layout_toRightOf="@id/btnPlus"
|
||||
android:layout_toEndOf="@id/btnPlus"
|
||||
android:layout_alignParentTop="true"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@{habit.text}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
style="@style/CardText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignLeft="@+id/checkedTextView"
|
||||
android:layout_alignStart="@+id/checkedTextView"
|
||||
android:layout_below="@+id/checkedTextView"
|
||||
|
|
|
|||
|
|
@ -26,51 +26,43 @@
|
|||
app:cardPreventCornerOverlap="false"
|
||||
app:contentPadding="0dp">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="fill_horizontal|center_vertical|center_horizontal|fill|clip_vertical|fill_vertical|center|start|clip_horizontal|bottom|left|right|end|top">
|
||||
android:layout_above="@+id/textView6"
|
||||
android:layout_alignLeft="@+id/checkedTextView"
|
||||
android:layout_alignStart="@+id/checkedTextView">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="false"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_height="fill_parent"
|
||||
android:checked="false"
|
||||
android:gravity="top" />
|
||||
android:gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp">
|
||||
<CheckedTextView
|
||||
android:id="@+id/checkedTextView"
|
||||
style="@style/CardTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{todo.text}" />
|
||||
|
||||
<CheckedTextView
|
||||
android:id="@+id/checkedTextView"
|
||||
style="@style/CardTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="false"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:layout_alignParentLeft="false"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentStart="false"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@+id/checkBox"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@{todo.text}" />
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
style="@style/CardText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{todo.notes}" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
style="@style/CardText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/checkedTextView"
|
||||
android:layout_toEndOf="@+id/checkBox"
|
||||
android:layout_toRightOf="@+id/checkBox"
|
||||
android:text="@{todo.notes}" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
package com.habitrpg.android.habitica.ui;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.InjectView;
|
||||
|
||||
/**
|
||||
* Created by Negue on 15.06.2015.
|
||||
*/
|
||||
public class SidebarHeaderViewModel {
|
||||
@InjectView(R.id.userNameText)
|
||||
TextView userName;
|
||||
|
||||
@InjectView(R.id.goldText)
|
||||
TextView goldText;
|
||||
|
||||
@InjectView(R.id.silverText)
|
||||
TextView silverText;
|
||||
|
||||
public SidebarHeaderViewModel(View v)
|
||||
{
|
||||
ButterKnife.inject(this, v);
|
||||
}
|
||||
|
||||
public void SetData(HabitRPGUser user)
|
||||
{
|
||||
userName.setText(user.getProfile().getName() + " - Lv" + user.getStats().getLvl());
|
||||
|
||||
Double goldPoints = user.getStats().getGp();
|
||||
|
||||
goldText.setText(goldPoints.intValue());
|
||||
silverText.setText((int) ((goldPoints - goldPoints.intValue()) * 100));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue