diff --git a/Habitica/res/layout/daily_not_today.xml b/Habitica/res/layout/daily_not_today.xml index d083a08d2..3e4255143 100644 --- a/Habitica/res/layout/daily_not_today.xml +++ b/Habitica/res/layout/daily_not_today.xml @@ -1,6 +1,6 @@ - + style="@style/CardText" + android:layout_width="match_parent" + android:layout_height="@dimen/row_size" + android:background="@drawable/item_background" + android:gravity="center_vertical" + android:paddingBottom="0dp" + android:paddingLeft="4dp" + android:paddingRight="0dp" + android:paddingTop="0dp"> + - + - - - - - - - - - + + + + + + + + - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/Habitica/src/com/habitrpg/android/habitica/CheckableLinearLayout.java b/Habitica/src/com/habitrpg/android/habitica/CheckableLinearLayout.java index f5a74091e..cdee120d6 100644 --- a/Habitica/src/com/habitrpg/android/habitica/CheckableLinearLayout.java +++ b/Habitica/src/com/habitrpg/android/habitica/CheckableLinearLayout.java @@ -11,58 +11,41 @@ import android.widget.LinearLayout; * This class is useful for using inside of ListView that needs to have checkable items. */ public class CheckableLinearLayout extends LinearLayout implements Checkable { - private CheckedTextView _checkbox; + private CheckedTextView _checkbox; - public CheckableLinearLayout(Context context, AttributeSet attrs) { - super(context, attrs); - } + public CheckableLinearLayout(Context context, AttributeSet attrs) { + super(context, attrs); + } - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - // find checked text view - int childCount = getChildCount(); - /*for (int i = 0; i < childCount; ++i) { - View v = getChildAt(i); - if (v instanceof CheckedTextView) { - _checkbox = (CheckedTextView)v; - Log.v("Checkable", "found CheckedTextViex"); - } - }*/ - View v = findViewById(R.id.TV_habit); - if(v==null) { - v= findViewById(R.id.TV_reward); - } - if(v==null) { - v=findViewById(R.id.TV_title); - } - if(v instanceof CheckedTextView) { - _checkbox = (CheckedTextView)v; - } - } + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + // find checked text view - @Override - public boolean isChecked() { - return _checkbox != null ? _checkbox.isChecked() : false; - } + View v = findViewById(R.id.TV_title); - @Override - public void setChecked(boolean checked) { - if (_checkbox != null) { - _checkbox.setChecked(checked); - if(checked) { - this.setBackgroundResource(R.drawable.list_focused_holo); - } else { - this.setBackgroundResource(R.drawable.item_background); - } - } - } + if (v instanceof CheckedTextView) { + _checkbox = (CheckedTextView) v; + } + } - @Override - public void toggle() { - if (_checkbox != null) { + @Override + public boolean isChecked() { + return _checkbox != null ? _checkbox.isChecked() : false; + } - _checkbox.toggle(); - } - } + @Override + public void setChecked(boolean checked) { + if (_checkbox != null) { + _checkbox.setChecked(checked); + } + } + + @Override + public void toggle() { + if (_checkbox != null) { + + _checkbox.toggle(); + } + } } \ No newline at end of file