pull/5/head v2.0.7
fengyuecanzhu 4 years ago
parent 21141f1f6f
commit 1848beef19
  1. 5
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java
  2. 17
      DialogX/src/main/java/com/kongzue/dialogx/util/views/BottomDialogListView.java
  3. 6
      DialogX/src/main/res/drawable/button_dialogx_miui_gray.xml
  4. 6
      DialogX/src/main/res/drawable/button_dialogx_miui_gray_night.xml
  5. 11
      DialogX/src/main/res/drawable/rect_dialogx_miui_bkg_light.xml
  6. 11
      DialogX/src/main/res/drawable/rect_dialogx_miui_bkg_night.xml
  7. 10
      DialogX/src/main/res/drawable/rect_dialogx_miui_button_gray_normal.xml
  8. 10
      DialogX/src/main/res/drawable/rect_dialogx_miui_button_gray_normal_night.xml
  9. 10
      DialogX/src/main/res/drawable/rect_dialogx_miui_button_gray_press.xml
  10. 10
      DialogX/src/main/res/drawable/rect_dialogx_miui_button_gray_press_night.xml
  11. 75
      DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml
  12. 81
      DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml
  13. 19
      DialogX/src/main/res/values/colors.xml
  14. 7
      app/src/main/assets/updatelog.fy
  15. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java
  16. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  17. 4
      app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseAdapter.java
  18. 5
      app/src/main/java/xyz/fycz/myreader/ui/fragment/BookcaseFragment.java
  19. 2
      app/src/main/res/layout/dialog_textview.xml
  20. 147
      app/src/main/res/layout/fragment_bookcase.xml

@ -501,11 +501,6 @@ public class BottomMenu extends BottomDialog {
public void down(MotionEvent event) { public void down(MotionEvent event) {
curTouchY = dialog.bkg.getY(); curTouchY = dialog.bkg.getY();
} }
@Override
public void move(MotionEvent event) {
curTouchY = event.getRawY();
}
}); });
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

@ -71,26 +71,25 @@ public class BottomDialogListView extends ListView {
if (bottomMenuListViewTouchEvent != null) { if (bottomMenuListViewTouchEvent != null) {
bottomMenuListViewTouchEvent.down(ev); bottomMenuListViewTouchEvent.down(ev);
} }
mPosition = pointToPosition((int) ev.getX(), (int) ev.getY()); /*mPosition = pointToPosition((int) ev.getX(), (int) ev.getY());
return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev);*/
} }
if (actionMasked == MotionEvent.ACTION_MOVE) { if (actionMasked == MotionEvent.ACTION_MOVE) {
if (bottomMenuListViewTouchEvent != null) { if (bottomMenuListViewTouchEvent != null) {
bottomMenuListViewTouchEvent.move(ev); bottomMenuListViewTouchEvent.move(ev);
} }
return true; /*setPressed(pointToPosition((int) ev.getX(), (int) ev.getY()) == mPosition);
invalidate();
return true;*/
} }
if (actionMasked == MotionEvent.ACTION_UP || actionMasked == MotionEvent.ACTION_CANCEL) { if (actionMasked == MotionEvent.ACTION_UP || actionMasked == MotionEvent.ACTION_CANCEL) {
if (bottomMenuListViewTouchEvent != null) { if (bottomMenuListViewTouchEvent != null) {
bottomMenuListViewTouchEvent.up(ev); bottomMenuListViewTouchEvent.up(ev);
} }
if (pointToPosition((int) ev.getX(), (int) ev.getY()) == mPosition) { /*if (pointToPosition((int) ev.getX(), (int) ev.getY()) != mPosition) {
super.dispatchTouchEvent(ev); return true;
} else { }*/
setPressed(false);
invalidate();
}
} }
return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev);

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="100">
<item android:drawable="@drawable/rect_dialogx_miui_button_gray_press" android:state_pressed="true" />
<item android:drawable="@drawable/rect_dialogx_miui_button_gray_normal" android:state_pressed="false" />
</selector>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="100">
<item android:drawable="@drawable/rect_dialogx_miui_button_gray_press_night" android:state_pressed="true" />
<item android:drawable="@drawable/rect_dialogx_miui_button_gray_normal_night" android:state_pressed="false" />
</selector>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--left to right-->
<solid
android:color="@color/white"/>
<corners
android:topRightRadius="20dp"
android:topLeftRadius="20dp"/>
</shape>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--left to right-->
<solid
android:color="@color/dialogxMIUIEditboxBkgDark"/>
<corners
android:topRightRadius="20dp"
android:topLeftRadius="20dp"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/dialogxMIUIButtonGrayNormal"/>
<corners
android:radius="99dp"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/dialogxMIUIButtonGrayNormalDark"/>
<corners
android:radius="99dp"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/dialogxMIUIButtonGrayPress"/>
<corners
android:radius="99dp"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/dialogxMIUIButtonGrayPressDark"/>
<corners
android:radius="99dp"/>
</shape>

@ -44,6 +44,7 @@
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="20dp" android:paddingRight="20dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingTop="3dp"
android:text="Title" android:text="Title"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="21dp" /> android:textSize="21dp" />
@ -89,68 +90,20 @@
</com.kongzue.dialogx.util.views.BottomDialogScrollView> </com.kongzue.dialogx.util.views.BottomDialogScrollView>
<LinearLayout <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_gravity="center_horizontal" android:layout_marginLeft="26dp"
android:gravity="right|center_vertical" android:layout_marginTop="10dp"
android:orientation="horizontal" android:layout_marginRight="26dp"
android:paddingLeft="10dp" android:layout_marginBottom="20dp"
android:paddingRight="10dp"> android:background="@drawable/button_dialogx_miui_gray"
android:clickable="true"
<TextView android:gravity="center"
android:id="@+id/btn_selectOther" android:tag="cancel"
android:layout_width="wrap_content" android:text="取消"
android:layout_height="36dp" android:textColor="@color/black80"
android:layout_marginTop="10dp" android:textSize="16dp" />
android:layout_marginBottom="10dp"
android:background="@drawable/button_dialogx_material_light"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="Other"
android:textColor="@color/colorAccent"
android:textSize="15dp"
android:visibility="gone" />
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/btn_selectNegative"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_dialogx_material_light"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:tag="cancel"
android:text="Cancel"
android:textColor="@color/colorAccent"
android:textSize="15dp" />
<TextView
android:id="@+id/btn_selectPositive"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_dialogx_material_light"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="OK"
android:textColor="@color/colorAccent"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>

@ -16,7 +16,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@drawable/rect_dialogx_material_bottom_bkg_night" android:background="@drawable/rect_dialogx_miui_bkg_night"
android:clickable="true" android:clickable="true"
android:focusableInTouchMode="true"> android:focusableInTouchMode="true">
@ -44,8 +44,9 @@
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="20dp" android:paddingRight="20dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingTop="3dp"
android:text="Title" android:text="Title"
android:textColor="@color/white" android:textColor="@color/dialogxMIUITextDark"
android:textSize="21dp" /> android:textSize="21dp" />
<com.kongzue.dialogx.util.views.BottomDialogScrollView <com.kongzue.dialogx.util.views.BottomDialogScrollView
@ -72,7 +73,7 @@
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:text="This is content text." android:text="This is content text."
android:textColor="@color/white60" android:textColor="@color/dialogxMIUITextDark"
android:textSize="16dp" /> android:textSize="16dp" />
<RelativeLayout <RelativeLayout
@ -89,68 +90,20 @@
</com.kongzue.dialogx.util.views.BottomDialogScrollView> </com.kongzue.dialogx.util.views.BottomDialogScrollView>
<LinearLayout <TextView
android:id="@+id/box_button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_gravity="center_horizontal" android:layout_marginLeft="26dp"
android:gravity="right|center_vertical" android:layout_marginTop="10dp"
android:orientation="horizontal" android:layout_marginRight="26dp"
android:paddingLeft="10dp" android:layout_marginBottom="20dp"
android:paddingRight="10dp"> android:background="@drawable/button_dialogx_miui_gray_night"
android:clickable="true"
<TextView android:gravity="center"
android:layout_width="wrap_content" android:tag="cancel"
android:layout_height="36dp" android:text="取消"
android:layout_marginTop="10dp" android:textColor="@color/dialogxMIUITextDark"
android:layout_marginBottom="10dp" android:textSize="16dp" />
android:background="@drawable/button_dialogx_material_night"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="Other"
android:textColor="@color/colorAccent"
android:textSize="15dp"
android:visibility="gone" />
<Space
android:id="@+id/space_other_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_dialogx_material_night"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:tag="cancel"
android:text="Cancel"
android:textColor="@color/colorAccent"
android:textSize="15dp" />
<TextView
android:id="@+id/btn_selectPositive"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_dialogx_material_night"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="OK"
android:textColor="@color/colorAccent"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>

@ -37,4 +37,23 @@
<color name="dialogxWaitBkgDark">#232323</color> <color name="dialogxWaitBkgDark">#232323</color>
<color name="dialogxPopButtonBlueDark">#86B3D6</color> <color name="dialogxPopButtonBlueDark">#86B3D6</color>
<color name="dialogxMIUIEditboxBkgDark">#222224</color>
<color name="dialogxMIUIEditboxBlue">#0C84FF</color>
<color name="dialogxMIUIEditboxBkg">#EDEDED</color>
<color name="dialogxMIUIEditboxBkgDeepDark">#141414</color>
<color name="dialogxMIUIButtonGrayNormal">#F0F0F0</color>
<color name="dialogxMIUIButtonGrayPress">#DCDCDC</color>
<color name="dialogxMIUIButtonBlueNormal">#0C84FF</color>
<color name="dialogxMIUIButtonBluePress">#096CD1</color>
<color name="dialogxMIUIButtonText">#606060</color>
<color name="dialogxMIUITextDark">#D3D3D3</color>
<color name="dialogxMIUIButtonBluePressDark">#0062BC</color>
<color name="dialogxMIUIButtonBlueNormalDark">#096CD1</color>
<color name="dialogxMIUIButtonGrayNormalDark">#333335</color>
<color name="dialogxMIUIButtonGrayPressDark">#29292B</color>
<color name="dialogxMIUIItemSelectionBkg">#1A0C84FF</color>
<color name="dialogxMIUIItemSelectionBkgDark">#6282BA</color>
</resources> </resources>

@ -1,3 +1,10 @@
2021.06.03
风月读书v2.0.7
更新内容:
1、修复进入私密书架分组后书架书籍未改变的问题
2、修复部分机型底部菜单无法点击的问题
3、底部对话框按钮优化
2021.06.02 2021.06.02
风月读书v2.0.6 风月读书v2.0.6
更新内容: 更新内容:

@ -484,7 +484,7 @@ public class MainActivity extends BaseActivity {
if (mBookcaseFragment.isRecreate()) { if (mBookcaseFragment.isRecreate()) {
reLoadFragment(); reLoadFragment();
} }
mBookcaseFragment.onResume(); mBookcaseFragment.init();
} }
/** /**

@ -1608,7 +1608,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
public void onOneItemSelect(BottomMenu dialog, CharSequence text, int which) { public void onOneItemSelect(BottomMenu dialog, CharSequence text, int which) {
selectedIndex = which; selectedIndex = which;
} }
}).setOkButton("确定", (baseDialog, v) -> { }).setCancelButton("确定", (baseDialog, v) -> {
switch (selectedIndex) { switch (selectedIndex) {
case 0: case 0:
addDownload(mPageLoader.getChapterPos(), mPageLoader.getChapterPos() + 50); addDownload(mPageLoader.getChapterPos(), mPageLoader.getChapterPos() + 50);
@ -1624,7 +1624,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
break; break;
} }
return false; return false;
}).setCancelButton(R.string.cancel); });
}); });
} }

@ -323,7 +323,7 @@ public abstract class BookcaseAdapter extends RecyclerView.Adapter<BookcaseAdapt
public void onOneItemSelect(BottomMenu dialog, CharSequence text, int which) { public void onOneItemSelect(BottomMenu dialog, CharSequence text, int which) {
selectedIndex = which; selectedIndex = which;
} }
}).setOkButton("确定", (baseDialog, v) -> { }).setCancelButton("确定", (baseDialog, v) -> {
switch (selectedIndex) { switch (selectedIndex) {
case 0: case 0:
begin[0] = book.getHisttoryChapterNum(); begin[0] = book.getHisttoryChapterNum();
@ -348,7 +348,7 @@ public abstract class BookcaseAdapter extends RecyclerView.Adapter<BookcaseAdapt
}); });
mBookcasePresenter.getEs().submit(downloadThread); mBookcasePresenter.getEs().submit(downloadThread);
return false; return false;
}).setCancelButton(R.string.cancel); });
} }
public void refreshBook(String chapterUrl){ public void refreshBook(String chapterUrl){

@ -19,7 +19,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import xyz.fycz.myreader.databinding.FragmentBookListBinding; import xyz.fycz.myreader.databinding.FragmentBookListBinding;
import xyz.fycz.myreader.databinding.FragmentBookcaseBinding;
import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.ui.presenter.BookcasePresenter;
import xyz.fycz.myreader.widget.custom.DragSortGridView; import xyz.fycz.myreader.widget.custom.DragSortGridView;
@ -59,6 +58,10 @@ public class BookcaseFragment extends Fragment {
mBookcasePresenter.init(); mBookcasePresenter.init();
} }
public void init(){
mBookcasePresenter.init();
}
public LinearLayout getLlNoDataTips() { public LinearLayout getLlNoDataTips() {
return binding.llNoDataTips; return binding.llNoDataTips;
} }

@ -8,6 +8,6 @@
android:textSize="@dimen/text_normal_size" android:textSize="@dimen/text_normal_size"
android:textIsSelectable="true" android:textIsSelectable="true"
android:paddingHorizontal="25dp" android:paddingHorizontal="25dp"
android:paddingTop="10dp"> android:paddingBottom="10dp">
</TextView> </TextView>

@ -1,147 +0,0 @@
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/srl_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
tools:context="xyz.fycz.myreader.ui.fragment.BookcaseFragment">
<com.scwang.smartrefresh.header.MaterialHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:id="@+id/ll_no_data_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:padding="10dp"
android:visibility="gone">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="@drawable/ic_vector_add_bookcase"
app:tint="@color/textSecondary" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="当前无任何书籍,点击添加"
android:textColor="@color/textSecondary"
android:textSize="16sp" />
</LinearLayout>
<xyz.fycz.myreader.widget.custom.DragSortGridView
android:id="@+id/gv_book"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/rl_book_edit"
android:layout_alignParentTop="true"
android:columnWidth="100dp"
android:gravity="center"
android:horizontalSpacing="10dp"
android:listSelector="@android:color/transparent"
android:numColumns="auto_fit"
android:scrollbars="none"
android:verticalSpacing="10dp" />
<RelativeLayout
android:id="@+id/rl_download_tip"
android:layout_width="match_parent"
android:layout_height="39dp"
android:layout_alignParentBottom="true"
android:background="@color/colorForeground"
android:visibility="gone">
<ProgressBar
android:id="@+id/pb_download"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_alignParentTop="true"
android:max="100" />
<TextView
android:id="@+id/tv_download_tip"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|start"
android:maxLines="1"
android:paddingStart="15dp"
android:text="正在初始化..."
android:textColor="@color/textSecondary"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_stop_download"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/stop_download_tip"
android:textColor="@color/colorAccent"
android:textSize="14sp"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_book_edit"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentBottom="true"
android:background="@color/colorForeground"
android:gravity="center_vertical"
android:paddingEnd="10dp"
android:visibility="gone">
<CheckBox
android:id="@+id/book_selected_all"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:text="全选"
android:textColor="@color/textSecondary"
android:textSize="15dp"
android:theme="@style/MyCheckBox" />
<Button
android:id="@+id/book_add_group"
android:layout_width="90dp"
android:layout_height="35dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/selector_btn_add"
android:clickable="false"
android:enabled="false"
android:minWidth="110dp"
android:text="加入分组"
android:textColor="@color/selector_btn_file_add" />
<Button
android:id="@+id/book_btn_delete"
android:layout_width="90dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_marginEnd="15dp"
android:layout_toLeftOf="@id/book_add_group"
android:background="@drawable/selector_btn_add"
android:clickable="false"
android:enabled="false"
android:text="删除/移除"
android:textColor="@color/selector_btn_file_add" />
</RelativeLayout>
</RelativeLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
Loading…
Cancel
Save