diff --git a/android/3rd_party/BottomSheet/src/main/java/com/cocosw/bottomsheet/BottomSheet.java b/android/3rd_party/BottomSheet/src/main/java/com/cocosw/bottomsheet/BottomSheet.java index 7711c24786..e30158eff8 100644 --- a/android/3rd_party/BottomSheet/src/main/java/com/cocosw/bottomsheet/BottomSheet.java +++ b/android/3rd_party/BottomSheet/src/main/java/com/cocosw/bottomsheet/BottomSheet.java @@ -50,7 +50,6 @@ import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowManager; -import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.FrameLayout; @@ -80,8 +79,7 @@ public class BottomSheet extends Dialog implements DialogInterface { private Drawable more; private boolean collapseListIcons; private int mStatusBarHeight; - private GridView list; - private View listShadow; + protected GridView list; private SimpleSectionedGridAdapter adapter; private Builder builder; @@ -113,7 +111,7 @@ public class BottomSheet extends Dialog implements DialogInterface { } @SuppressWarnings("WeakerAccess") - BottomSheet(Context context, int theme) { + protected BottomSheet(Context context, int theme) { super(context, theme); TypedArray a = getContext() @@ -264,7 +262,7 @@ public class BottomSheet extends Dialog implements DialogInterface { cancelOnSwipeDown = cancel; } - private void init(final Context context) { + protected void init(final Context context) { setCanceledOnTouchOutside(cancelOnTouchOutside); final ClosableSlidingLayout mDialogView = (ClosableSlidingLayout) View.inflate(context, R.layout.bottom_sheet_dialog, null); setContentView(mDialogView); @@ -319,8 +317,6 @@ public class BottomSheet extends Dialog implements DialogInterface { list.setNumColumns(1); } - listShadow = mDialogView.findViewById(R.id.bottom_sheet_list_shadow); - if (builder.grid) { for (int i = 0; i < getMenu().size(); i++) { if (getMenu().getItem(i).getIcon() == null) @@ -480,20 +476,7 @@ public class BottomSheet extends Dialog implements DialogInterface { } } - public boolean shouldShowShadow() { - int first = list.getFirstVisiblePosition(); - if (first > 0) - return true; - - View child = list.getChildAt(0); - return (child.getTop() < 0); - } - - private void updateListShadow() { - listShadow.setVisibility(shouldShowShadow() ? View.VISIBLE : View.GONE); - } - - private void showFullItems() { + protected void showFullItems() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Transition changeBounds = new ChangeBounds(); changeBounds.setDuration(300); @@ -512,20 +495,9 @@ public class BottomSheet extends Dialog implements DialogInterface { } }); setListLayout(); - - list.setOnScrollListener(new AbsListView.OnScrollListener() { - @Override - public void onScrollStateChanged(AbsListView view, int scrollState) { - } - - @Override - public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { - updateListShadow(); - } - }); } - private void showShortItems() { + protected void showShortItems() { actions = menuItem; updateSection(); adapter.notifyDataSetChanged(); @@ -539,7 +511,6 @@ public class BottomSheet extends Dialog implements DialogInterface { } list.setOnScrollListener(null); - listShadow.setVisibility(View.GONE); } private boolean hasDivider() { @@ -852,6 +823,9 @@ public class BottomSheet extends Dialog implements DialogInterface { return this; } + protected BottomSheet createDialog(Context context, int theme) { + return new BottomSheet(context, theme); + } /** * Create a BottomSheet but not show it @@ -860,7 +834,7 @@ public class BottomSheet extends Dialog implements DialogInterface { */ @SuppressLint("Override") public BottomSheet build() { - BottomSheet dialog = new BottomSheet(context, theme); + BottomSheet dialog = createDialog(context, theme); dialog.builder = this; return dialog; } diff --git a/android/3rd_party/BottomSheet/src/main/res/drawable-hdpi/bs_shadow.9.png b/android/3rd_party/BottomSheet/src/main/res/drawable-hdpi/shadow_top.9.png similarity index 100% rename from android/3rd_party/BottomSheet/src/main/res/drawable-hdpi/bs_shadow.9.png rename to android/3rd_party/BottomSheet/src/main/res/drawable-hdpi/shadow_top.9.png diff --git a/android/3rd_party/BottomSheet/src/main/res/drawable-mdpi/bs_shadow.9.png b/android/3rd_party/BottomSheet/src/main/res/drawable-mdpi/shadow_top.9.png similarity index 100% rename from android/3rd_party/BottomSheet/src/main/res/drawable-mdpi/bs_shadow.9.png rename to android/3rd_party/BottomSheet/src/main/res/drawable-mdpi/shadow_top.9.png diff --git a/android/3rd_party/BottomSheet/src/main/res/drawable-xhdpi/bs_shadow.9.png b/android/3rd_party/BottomSheet/src/main/res/drawable-xhdpi/shadow_top.9.png similarity index 100% rename from android/3rd_party/BottomSheet/src/main/res/drawable-xhdpi/bs_shadow.9.png rename to android/3rd_party/BottomSheet/src/main/res/drawable-xhdpi/shadow_top.9.png diff --git a/android/3rd_party/BottomSheet/src/main/res/drawable-xxhdpi/bs_shadow.9.png b/android/3rd_party/BottomSheet/src/main/res/drawable-xxhdpi/shadow_top.9.png similarity index 100% rename from android/3rd_party/BottomSheet/src/main/res/drawable-xxhdpi/bs_shadow.9.png rename to android/3rd_party/BottomSheet/src/main/res/drawable-xxhdpi/shadow_top.9.png diff --git a/android/3rd_party/BottomSheet/src/main/res/drawable-xxxhdpi/bs_shadow.9.png b/android/3rd_party/BottomSheet/src/main/res/drawable-xxxhdpi/shadow_top.9.png similarity index 100% rename from android/3rd_party/BottomSheet/src/main/res/drawable-xxxhdpi/bs_shadow.9.png rename to android/3rd_party/BottomSheet/src/main/res/drawable-xxxhdpi/shadow_top.9.png diff --git a/android/3rd_party/BottomSheet/src/main/res/layout/bottom_sheet_dialog.xml b/android/3rd_party/BottomSheet/src/main/res/layout/bottom_sheet_dialog.xml index 2f0c21f788..cdfbe6e152 100644 --- a/android/3rd_party/BottomSheet/src/main/res/layout/bottom_sheet_dialog.xml +++ b/android/3rd_party/BottomSheet/src/main/res/layout/bottom_sheet_dialog.xml @@ -46,13 +46,6 @@ android:fadingEdge="none" style="?bs_listStyle" tools:listitem="@layout/bs_grid_entry" /> - - diff --git a/android/res/drawable-hdpi/shadow_bottom.9.png b/android/res/drawable-hdpi/shadow_bottom.9.png new file mode 100644 index 0000000000..32581d651f Binary files /dev/null and b/android/res/drawable-hdpi/shadow_bottom.9.png differ diff --git a/android/res/drawable-hdpi/shadow_top.9.png b/android/res/drawable-hdpi/shadow_top.9.png new file mode 100644 index 0000000000..00696aa757 Binary files /dev/null and b/android/res/drawable-hdpi/shadow_top.9.png differ diff --git a/android/res/drawable-mdpi/shadow_bottom.9.png b/android/res/drawable-mdpi/shadow_bottom.9.png new file mode 100644 index 0000000000..5d55243e2f Binary files /dev/null and b/android/res/drawable-mdpi/shadow_bottom.9.png differ diff --git a/android/res/drawable-mdpi/shadow_top.9.png b/android/res/drawable-mdpi/shadow_top.9.png new file mode 100644 index 0000000000..1a784f3c12 Binary files /dev/null and b/android/res/drawable-mdpi/shadow_top.9.png differ diff --git a/android/res/drawable-xhdpi/shadow_bottom.9.png b/android/res/drawable-xhdpi/shadow_bottom.9.png new file mode 100644 index 0000000000..f62994e486 Binary files /dev/null and b/android/res/drawable-xhdpi/shadow_bottom.9.png differ diff --git a/android/res/drawable-xhdpi/shadow_top.9.png b/android/res/drawable-xhdpi/shadow_top.9.png new file mode 100644 index 0000000000..62083b02e8 Binary files /dev/null and b/android/res/drawable-xhdpi/shadow_top.9.png differ diff --git a/android/res/drawable-xxhdpi/shadow_bottom.9.png b/android/res/drawable-xxhdpi/shadow_bottom.9.png new file mode 100644 index 0000000000..893e25af0d Binary files /dev/null and b/android/res/drawable-xxhdpi/shadow_bottom.9.png differ diff --git a/android/res/drawable-xxhdpi/shadow_top.9.png b/android/res/drawable-xxhdpi/shadow_top.9.png new file mode 100644 index 0000000000..4dcf1830ca Binary files /dev/null and b/android/res/drawable-xxhdpi/shadow_top.9.png differ diff --git a/android/res/drawable-xxxhdpi/shadow_bottom.9.png b/android/res/drawable-xxxhdpi/shadow_bottom.9.png new file mode 100644 index 0000000000..fbf8804a18 Binary files /dev/null and b/android/res/drawable-xxxhdpi/shadow_bottom.9.png differ diff --git a/android/res/drawable-xxxhdpi/shadow_top.9.png b/android/res/drawable-xxxhdpi/shadow_top.9.png new file mode 100644 index 0000000000..ad5e1dc7a2 Binary files /dev/null and b/android/res/drawable-xxxhdpi/shadow_top.9.png differ diff --git a/android/res/layout-land/place_page.xml b/android/res/layout-land/place_page.xml index 1204c7548d..0b6f731160 100644 --- a/android/res/layout-land/place_page.xml +++ b/android/res/layout-land/place_page.xml @@ -1,6 +1,5 @@ - - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/android/res/layout-sw600dp/place_page_details.xml b/android/res/layout-sw600dp/place_page_details.xml index 7e4272ec10..cdf87ef788 100644 --- a/android/res/layout-sw600dp/place_page_details.xml +++ b/android/res/layout-sw600dp/place_page_details.xml @@ -1,81 +1,94 @@ - - - + - - + android:background="@color/bg_top_panels" + android:overScrollMode="never"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:clipChildren="false"> - + - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/res/layout-sw720dp/place_page_details.xml b/android/res/layout-sw720dp/place_page_details.xml index f87f7af9c5..9bd370ebc8 100644 --- a/android/res/layout-sw720dp/place_page_details.xml +++ b/android/res/layout-sw720dp/place_page_details.xml @@ -1,10 +1,6 @@ - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/android/res/layout-v11/place_page.xml b/android/res/layout-v11/place_page.xml index a74ee35848..5e4eae6f9c 100644 --- a/android/res/layout-v11/place_page.xml +++ b/android/res/layout-v11/place_page.xml @@ -9,7 +9,6 @@ android:layout_above="@+id/pp__buttons"/> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/res/layout/place_page.xml b/android/res/layout/place_page.xml index faa99c39b2..714574df3e 100644 --- a/android/res/layout/place_page.xml +++ b/android/res/layout/place_page.xml @@ -13,9 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"/> - + diff --git a/android/res/layout/place_page_bookmark_details.xml b/android/res/layout/place_page_bookmark_details.xml index 30722eefe3..edfae0b77c 100644 --- a/android/res/layout/place_page_bookmark_details.xml +++ b/android/res/layout/place_page_bookmark_details.xml @@ -1,12 +1,14 @@ + android:visibility="invisible" + tools:visibility="visible"> diff --git a/android/res/layout/place_page_buttons.xml b/android/res/layout/place_page_buttons.xml index 54fb86a5ec..1d98a88504 100644 --- a/android/res/layout/place_page_buttons.xml +++ b/android/res/layout/place_page_buttons.xml @@ -5,7 +5,8 @@ android:background="@color/bg_top_panels" android:orientation="vertical" android:paddingLeft="@dimen/margin_half_plus" - android:paddingRight="@dimen/margin_half_plus"> + android:paddingRight="@dimen/margin_half_plus" + android:layout_marginTop="@dimen/margin_base"> - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/android/res/layout/place_page_details_common.xml b/android/res/layout/place_page_details_common.xml index c4aa210bc3..53ac60c659 100644 --- a/android/res/layout/place_page_details_common.xml +++ b/android/res/layout/place_page_details_common.xml @@ -1,47 +1,59 @@ - - - + - - + + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@color/bg_top_panels" + android:paddingLeft="@dimen/margin_base_plus" + android:paddingRight="@dimen/margin_base_plus" + android:paddingTop="@dimen/margin_base"> - + - + - + - + - + - + - + - + - + - + - + + + - \ No newline at end of file + + + + \ No newline at end of file diff --git a/android/res/layout/place_page_email.xml b/android/res/layout/place_page_email.xml index 989e8318ce..c461ab093e 100644 --- a/android/res/layout/place_page_email.xml +++ b/android/res/layout/place_page_email.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#F000FF00"> + android:textSize="@dimen/place_page_subtitle" + tools:text="email@maps.me"/> \ No newline at end of file diff --git a/android/res/layout/place_page_land_600dp.xml b/android/res/layout/place_page_land_600dp.xml index be2dd9a6b2..2d64820f71 100644 --- a/android/res/layout/place_page_land_600dp.xml +++ b/android/res/layout/place_page_land_600dp.xml @@ -15,7 +15,6 @@ android:background="@drawable/bg_place_page_back"/> + android:tag="latlon" + tools:background="#20FF0000"> + android:textSize="@dimen/place_page_subtitle" + tools:text="55.747, 37.616"/> diff --git a/android/res/layout/place_page_operator.xml b/android/res/layout/place_page_operator.xml index 94bf380f71..e40881708e 100644 --- a/android/res/layout/place_page_operator.xml +++ b/android/res/layout/place_page_operator.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#8000FFFF"> + android:textSize="@dimen/place_page_subtitle" + tools:text="Operator"/> \ No newline at end of file diff --git a/android/res/layout/place_page_phone.xml b/android/res/layout/place_page_phone.xml index 4914fd74ef..a2d8a3c447 100644 --- a/android/res/layout/place_page_phone.xml +++ b/android/res/layout/place_page_phone.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#200000FF"> + android:textSize="@dimen/place_page_subtitle" + tools:text="+1 234 567-89-00" + /> \ No newline at end of file diff --git a/android/res/layout/place_page_placename.xml b/android/res/layout/place_page_placename.xml index 7fd7764d38..b1c1a83ff5 100644 --- a/android/res/layout/place_page_placename.xml +++ b/android/res/layout/place_page_placename.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#6000FF00"> + android:textSize="@dimen/place_page_subtitle" + tools:text="Sample place"/> \ No newline at end of file diff --git a/android/res/layout/place_page_website.xml b/android/res/layout/place_page_website.xml index 478c7e6203..fe14ba91a1 100644 --- a/android/res/layout/place_page_website.xml +++ b/android/res/layout/place_page_website.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#20FF0000"> + android:textSize="@dimen/place_page_subtitle" + tools:text="Sample website"/> diff --git a/android/res/layout/place_page_wifi.xml b/android/res/layout/place_page_wifi.xml index 0b381edeb7..c1652baa6c 100644 --- a/android/res/layout/place_page_wifi.xml +++ b/android/res/layout/place_page_wifi.xml @@ -1,7 +1,8 @@ + android:visibility="gone" + tools:visibility="visible" + tools:background="#40FF0000"> + android:textSize="@dimen/place_page_subtitle" + tools:text="Wi-Fi"/> \ No newline at end of file diff --git a/android/res/layout/shadow_bottom.xml b/android/res/layout/shadow_bottom.xml new file mode 100644 index 0000000000..4b2640c34d --- /dev/null +++ b/android/res/layout/shadow_bottom.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/android/res/layout/shadow_top.xml b/android/res/layout/shadow_top.xml new file mode 100644 index 0000000000..fc58efa93b --- /dev/null +++ b/android/res/layout/shadow_top.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/android/res/values/styles.xml b/android/res/values/styles.xml index 71c54855f3..3fe2195309 100644 --- a/android/res/values/styles.xml +++ b/android/res/values/styles.xml @@ -181,7 +181,7 @@