forked from organicmaps/organicmaps
[android] Review fixes
This commit is contained in:
parent
002c85ad1d
commit
c47720c14d
14 changed files with 95 additions and 11 deletions
|
@ -172,7 +172,7 @@ private:
|
|||
|
||||
Rule BuildOneOf(JNIEnv * env, jobject filter, unsigned value)
|
||||
{
|
||||
if (filter == NULL)
|
||||
if (filter == nullptr)
|
||||
return search::hotels_filter::OneOf(value);
|
||||
|
||||
auto const hotelType = env->GetObjectField(filter, m_hotelType);
|
||||
|
@ -504,7 +504,7 @@ extern "C"
|
|||
{
|
||||
using Type = ftypes::IsHotelChecker::Type;
|
||||
static jclass const hotelTypeClass =
|
||||
env->FindClass("com/mapswithme/maps/search/HotelsFilter$HotelType");
|
||||
jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/HotelsFilter$HotelType");
|
||||
static jmethodID const hotelTypeCtorId =
|
||||
jni::GetConstructorID(env, hotelTypeClass, "(ILjava/lang/String;)V");
|
||||
|
||||
|
|
16
android/res/drawable-v21/bg_tag_normal.xml
Normal file
16
android/res/drawable-v21/bg_tag_normal.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/button_pressed">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:color="@color/black_11" android:width="1dp"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<padding
|
||||
android:bottom="@dimen/margin_half"
|
||||
android:top="@dimen/margin_half"
|
||||
android:left="@dimen/margin_base"
|
||||
android:right="@dimen/margin_base"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
16
android/res/drawable-v21/bg_tag_normal_night.xml
Normal file
16
android/res/drawable-v21/bg_tag_normal_night.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/button_pressed_night">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:color="@color/black_11" android:width="1dp"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<padding
|
||||
android:bottom="@dimen/margin_half"
|
||||
android:top="@dimen/margin_half"
|
||||
android:left="@dimen/margin_base"
|
||||
android:right="@dimen/margin_base"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
11
android/res/drawable-v21/button_accent_round_normal.xml
Normal file
11
android/res/drawable-v21/button_accent_round_normal.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/button_accent_pressed">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/button_accent"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/button_accent_pressed_night">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/button_accent_night"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/bg_tag_pressed"
|
||||
android:state_pressed="true"/>
|
||||
|
||||
<item android:drawable="@drawable/bg_tag_selected"
|
||||
android:state_selected="true"/>
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/bg_tag_pressed_night"
|
||||
android:state_pressed="true"/>
|
||||
|
||||
<item android:drawable="@drawable/bg_tag_selected_night"
|
||||
android:state_selected="true"/>
|
||||
|
||||
|
|
13
android/res/drawable/bg_tag_pressed.xml
Normal file
13
android/res/drawable/bg_tag_pressed.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/button_pressed"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<padding
|
||||
android:bottom="@dimen/margin_half"
|
||||
android:top="@dimen/margin_half"
|
||||
android:left="@dimen/margin_base"
|
||||
android:right="@dimen/margin_base"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
13
android/res/drawable/bg_tag_pressed_night.xml
Normal file
13
android/res/drawable/bg_tag_pressed_night.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/button_pressed_night"/>
|
||||
<size android:height="@dimen/hotel_filters_tag_height"/>
|
||||
<padding
|
||||
android:bottom="@dimen/margin_half"
|
||||
android:top="@dimen/margin_half"
|
||||
android:left="@dimen/margin_base"
|
||||
android:right="@dimen/margin_base"/>
|
||||
<corners android:radius="@dimen/margin_base"/>
|
||||
</shape>
|
|
@ -181,10 +181,9 @@
|
|||
<dimen name="placeholder_margin_top">20dp</dimen>
|
||||
<dimen name="placeholder_margin_top_no_image">80dp</dimen>
|
||||
|
||||
<dimen name="hotels_filter_padding">128dp</dimen>
|
||||
|
||||
<dimen name="margin_dialog_title">20dp</dimen>
|
||||
|
||||
<!-- Hotel silters-->
|
||||
<!-- Hotel filters-->
|
||||
<dimen name="hotel_filters_tag_height">32dp</dimen>
|
||||
<dimen name="hotels_filter_padding">128dp</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -243,13 +243,13 @@ public class HotelsFilter implements Parcelable
|
|||
}
|
||||
};
|
||||
|
||||
public static class HotelType implements Parcelable
|
||||
static class HotelType implements Parcelable
|
||||
{
|
||||
final int mType;
|
||||
@NonNull
|
||||
final String mTag;
|
||||
|
||||
public HotelType(int type, @NonNull String tag)
|
||||
HotelType(int type, @NonNull String tag)
|
||||
{
|
||||
mType = type;
|
||||
mTag = tag;
|
||||
|
|
|
@ -236,7 +236,7 @@ public class HotelsFilterView extends FrameLayout
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private HotelsFilter.OneOf makeOneOf(Iterator<HotelsFilter.HotelType> iterator)
|
||||
private HotelsFilter.OneOf makeOneOf(@NonNull Iterator<HotelsFilter.HotelType> iterator)
|
||||
{
|
||||
if (!iterator.hasNext())
|
||||
return null;
|
||||
|
|
|
@ -54,7 +54,6 @@ public class TagItemDecoration extends RecyclerView.ItemDecoration
|
|||
child.getTop(),
|
||||
child.getLeft(),
|
||||
child.getBottom());
|
||||
mDivider.draw(canvas);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -62,8 +61,8 @@ public class TagItemDecoration extends RecyclerView.ItemDecoration
|
|||
child.getTop() - mDivider.getIntrinsicHeight(),
|
||||
parentRight,
|
||||
child.getTop());
|
||||
mDivider.draw(canvas);
|
||||
}
|
||||
mDivider.draw(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TagLayoutManager extends RecyclerView.LayoutManager
|
|||
int heightUsed = 0;
|
||||
int maxHeight = 0;
|
||||
int itemsCountOneLine = 0;
|
||||
for (int i=0; i < getItemCount(); i++)
|
||||
for (int i = 0; i < getItemCount(); i++)
|
||||
{
|
||||
View child = recycler.getViewForPosition(i);
|
||||
addView(child);
|
||||
|
|
Loading…
Add table
Reference in a new issue