[android] UI tweaks, removed some old code.

This commit is contained in:
Dmitry Yunitsky 2016-03-23 16:22:43 +03:00
parent b7c2a29903
commit 75f2ae73d6
5 changed files with 17 additions and 15 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="?android:textColorPrimary"
android:state_enabled="true"/>
<item
android:color="?android:textColorSecondary"/>
</selector>

View file

@ -187,6 +187,7 @@
android:id="@+id/input"
style="@style/MwmWidget.Editor.FieldLayout.EditText"
android:hint="@string/phone"
android:inputType="phone"
tools:text="+937 99 92"/>
</com.mapswithme.maps.widget.CustomTextInputLayout>

View file

@ -47,6 +47,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">@style/MwmTextAppearance.Body1</item>
<item name="android:textColor">@color/timetable_add_complement_text</item>
</style>
<style name="MwmWidget.Editor.DayLayout">
@ -67,6 +68,8 @@
<style name="MwmWidget.Editor.FieldLayout.EditText">
<item name="android:singleLine">true</item>
<item name="android:textAppearance">@style/MwmTextAppearance.Body1</item>
<!-- TODO check night colors -->
<item name="android:theme">@style/MwmTheme.Editor.EditText</item>
</style>
<style name="MwmWidget.Editor.Problem" tools:ignore="NewApi">

View file

@ -5,7 +5,6 @@ import android.support.annotation.IntRange;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
@ -95,7 +94,6 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
protected void addTimetable()
{
mItems.add(OpeningHours.nativeGetComplementTimetable(mItems.toArray(new Timetable[mItems.size()])));
printItems();
notifyItemInserted(mItems.size() - 1);
refreshComplement();
}
@ -103,7 +101,6 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
protected void removeTimetable(int position)
{
mItems.remove(position);
printItems();
notifyItemRemoved(position);
refreshComplement();
}
@ -154,18 +151,9 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
final Timetable tts[] = mItems.toArray(new Timetable[mItems.size()]);
mItems = new ArrayList<>(Arrays.asList(OpeningHours.nativeRemoveWorkingDay(tts, position, day)));
refreshComplement();
printItems();
notifyDataSetChanged();
}
// FIXME remove
private void printItems()
{
Log.d("TEST", "Items : \n");
for (Timetable tt : mItems)
Log.d("TEST", tt.toString() + "\n");
}
private void setFullday(int position, boolean fullday)
{
mItems.set(position, OpeningHours.nativeSetIsFullday(mItems.get(position), fullday));
@ -400,8 +388,8 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
@Override
void onBind()
{
// TODO @yunik add text with complement days
add.setEnabled(mComplementItem != null && mComplementItem.weekdays.length != 0);
add.setText(TimeFormatUtils.formatWeekdays(mComplementItem));
}
}
}

View file

@ -53,9 +53,8 @@ public class TimeFormatUtils
}
if (i < weekdays.length)
{
builder.append(", ").append(sShortWeekdays[weekdays[i]]);
}
i++;
}