Commit 34370e17 authored by 陈前's avatar 陈前

UI

parent ccaad94d
...@@ -2,8 +2,10 @@ package com.xingdata.zzdpos.ui.main.fragment; ...@@ -2,8 +2,10 @@ package com.xingdata.zzdpos.ui.main.fragment;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.view.View; import android.view.View;
import android.widget.LinearLayout;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
...@@ -21,6 +23,7 @@ import com.xingdata.zzdpos.ui.store.StoreActivity; ...@@ -21,6 +23,7 @@ import com.xingdata.zzdpos.ui.store.StoreActivity;
import com.xingdata.zzdpos.ui.vip.VipActivity; import com.xingdata.zzdpos.ui.vip.VipActivity;
import com.xingdata.zzdpos.util.MyMenuItemDecoration; import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.SystemUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -39,6 +42,13 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi ...@@ -39,6 +42,13 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi
@Override @Override
public void initView() { public void initView() {
if (SystemUtil.checkDeviceHasNavigationBar(getActivity())){
LinearLayout.LayoutParams cp = new LinearLayout.LayoutParams( mViewBinding.fragmentCasherRecycler.getLayoutParams());
cp.setMargins(0, 0, 0, 0);
mViewBinding.fragmentCasherRecycler.setLayoutParams(cp);
}
mViewBinding.fragmentCasherRecycler.setLayoutManager(new GridLayoutManager(getActivity(), mViewBinding.fragmentCasherRecycler.setLayoutManager(new GridLayoutManager(getActivity(),
2)); 2));
......
...@@ -87,11 +87,11 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -87,11 +87,11 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList()); else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh); if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete(); else mOtherSelectAdapter.loadMoreComplete();
if (mOtherSelectAdapter.getData().size() == 0) { // if (mOtherSelectAdapter.getData().size() == 0) {
mViewBinding.viewLine.setVisibility(View.GONE); // mViewBinding.viewLine.setVisibility(View.GONE);
} else { // } else {
mViewBinding.viewLine.setVisibility(View.VISIBLE); // mViewBinding.viewLine.setVisibility(View.VISIBLE);
} // }
} }
......
...@@ -85,7 +85,7 @@ public class RecyclerViewUtil { ...@@ -85,7 +85,7 @@ public class RecyclerViewUtil {
@Override @Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state); super.getItemOffsets(outRect, view, parent, state);
outRect.top = mDividerHight + 20; outRect.top = mDividerHight;
} }
@Override @Override
...@@ -99,7 +99,7 @@ public class RecyclerViewUtil { ...@@ -99,7 +99,7 @@ public class RecyclerViewUtil {
public void drawHorizontalDivider(Canvas c, RecyclerView parent) { public void drawHorizontalDivider(Canvas c, RecyclerView parent) {
final int childCount = parent.getChildCount(); final int childCount = parent.getChildCount();
for (int i = 0; i < childCount - 1; i++) { for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i); final View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams(); RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
...@@ -109,8 +109,8 @@ public class RecyclerViewUtil { ...@@ -109,8 +109,8 @@ public class RecyclerViewUtil {
int bottom = 0; int bottom = 0;
top = child.getTop() - params.topMargin; bottom = child.getTop() - params.topMargin;
bottom = top + mDividerHight; top = bottom - mDividerHight;
//画分割线 //画分割线
mDividerDarwable.setBounds(left, top, right, bottom); mDividerDarwable.setBounds(left, top, right, bottom);
mDividerDarwable.draw(c); mDividerDarwable.draw(c);
......
package com.xingdata.zzdpos.util; package com.xingdata.zzdpos.util;
import android.content.Context;
import android.content.res.Resources;
import com.blankj.utilcode.util.AppUtils; import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.DeviceUtils; import com.blankj.utilcode.util.DeviceUtils;
import com.blankj.utilcode.util.ScreenUtils; import com.blankj.utilcode.util.ScreenUtils;
...@@ -55,7 +58,7 @@ public final class SystemUtil { ...@@ -55,7 +58,7 @@ public final class SystemUtil {
} }
} }
// return deviceSN; // return deviceSN;
return "548496116"; return "548496";
} }
...@@ -77,4 +80,31 @@ public final class SystemUtil { ...@@ -77,4 +80,31 @@ public final class SystemUtil {
return ScreenUtils.isPortrait(); return ScreenUtils.isPortrait();
} }
/**
*
*获取是否存在NavigationBar
*/
public static boolean checkDeviceHasNavigationBar(Context context) {
boolean hasNavigationBar = false;
Resources rs = context.getResources();
int id = rs.getIdentifier("config_showNavigationBar", "bool", "android");
if (id > 0) {
hasNavigationBar = rs.getBoolean(id);
}
try {
Class systemPropertiesClass = Class.forName("android.os.SystemProperties");
Method m = systemPropertiesClass.getMethod("get", String.class);
String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys");
if ("1".equals(navBarOverride)) {
hasNavigationBar = false;
} else if ("0".equals(navBarOverride)) {
hasNavigationBar = true;
}
} catch (Exception e) {
}
return hasNavigationBar;
}
} }
...@@ -70,14 +70,24 @@ ...@@ -70,14 +70,24 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView <LinearLayout
android:id="@+id/fragment_casher_recycler"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline" /> app:layout_constraintTop_toTopOf="@id/guideline">
<android.support.v7.widget.RecyclerView
android:id="@+id/fragment_casher_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/white_caocao" />
</LinearLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -61,7 +61,9 @@ ...@@ -61,7 +61,9 @@
android:id="@+id/recycler_inventory" android:id="@+id/recycler_inventory"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_zhouyu"></android.support.v7.widget.RecyclerView> android:background="@color/gray_zhouyu">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
......
...@@ -32,37 +32,38 @@ ...@@ -32,37 +32,38 @@
android:background="@color/gray_huanggai" android:background="@color/gray_huanggai"
app:layout_constraintTop_toBottomOf="@id/ic_title" /> app:layout_constraintTop_toBottomOf="@id/ic_title" />
<TextView
android:id="@+id/tv_title_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/singleline_zhouyu_huanggai"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding"
android:text="@string/manage_inventory_add_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small_title"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/ic_title" />
<LinearLayout <RelativeLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/fl_cart" app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_small"> app:layout_constraintTop_toBottomOf="@id/ic_title">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/tv_title_small"
android:layout_marginTop="@dimen/Minus_padding_left_right"
android:background="@color/gray_zhouyu"> android:background="@color/gray_zhouyu">
</android.support.v7.widget.RecyclerView> </android.support.v7.widget.RecyclerView>
</LinearLayout>
<TextView
android:id="@+id/tv_title_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/singleline_zhouyu_huanggai"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding"
android:text="@string/manage_inventory_add_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small_title"
android:textStyle="bold" />
</RelativeLayout>
<FrameLayout <FrameLayout
......
...@@ -123,25 +123,14 @@ ...@@ -123,25 +123,14 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/fragment_myself_recycler" android:id="@+id/fragment_myself_recycler"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_padding" android:layout_marginBottom="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline" /> app:layout_constraintTop_toTopOf="@id/guideline" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="@id/fragment_myself_recycler" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="@id/fragment_myself_recycler" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
android:orientation="vertical"> android:orientation="vertical">
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_marginTop="@dimen/padding_small"
android:background="@color/gray_huanggai"
android:visibility="gone" />
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product" android:id="@+id/srl_product"
......
...@@ -49,26 +49,34 @@ ...@@ -49,26 +49,34 @@
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tab"
android:layout_marginTop="-1dp" />
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab" android:id="@+id/tab"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white_caocao"
app:tabMinWidth="150dp" app:tabMinWidth="150dp"
app:tabTextColor="@color/black_baozheng"> app:tabTextColor="@color/black_baozheng">
</android.support.design.widget.TabLayout> </android.support.design.widget.TabLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:layout_below="@id/tab"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
</RelativeLayout>
<android.support.v4.view.ViewPager
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_title" android:layout_below="@id/ll_title"
android:background="@color/gray_zhouyu"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"> android:visibility="gone">
......
...@@ -24,6 +24,29 @@ ...@@ -24,6 +24,29 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintEnd_toEndOf="@id/item_tv"
app:layout_constraintStart_toStartOf="@id/item_tv"
app:layout_constraintTop_toTopOf="@id/item_tv" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="@id/item_tv"
app:layout_constraintEnd_toEndOf="@id/item_tv"
app:layout_constraintStart_toStartOf="@id/item_tv" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/all_padding"
android:background="@color/gray_zhouyu"
app:layout_constraintTop_toBottomOf="@id/item_tv"
app:layout_constraintEnd_toEndOf="@id/item_tv"
app:layout_constraintStart_toStartOf="@id/item_tv" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment