Skip to content

Commit

Permalink
***2022/09/24***
Browse files Browse the repository at this point in the history
* font file
  • Loading branch information
Jack251970 committed Sep 24, 2022
1 parent 9aacc72 commit eb7f595
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 65 deletions.
4 changes: 2 additions & 2 deletions app/debug/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"filters": [],
"attributes": [],
"versionCode": 10095,
"versionName": "2.22.0924.103117.6286debug",
"outputFile": "Read_For_MatePadPaper_2.22.0924.103117.6286.apk"
"versionName": "2.22.0924.175516.3461debug",
"outputFile": "Read_For_MatePadPaper_2.22.0924.175516.3461.apk"
}
],
"elementType": "File"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.PopupWindow;

import com.jack.bookshelf.R;
Expand Down Expand Up @@ -42,13 +43,10 @@ public FontSelectorDialog(Context context) {
private void initView() {
switch (readBookControl.getFontItem()) {
case 0:
view.findViewById(R.id.iv_font_harmony_regular).setVisibility(View.VISIBLE);
((ImageView)view.findViewById(R.id.iv_indicator_font_harmony_regular)).setImageResource(R.drawable.ic_select_menu_selected);
break;
case 1:
view.findViewById(R.id.iv_font_harmony_bold).setVisibility(View.VISIBLE);
break;
case 2:
view.findViewById(R.id.iv_font_harmony_thin).setVisibility(View.VISIBLE);
((ImageView)view.findViewById(R.id.iv_indicator_font_harmony_bold)).setImageResource(R.drawable.ic_select_menu_selected);
break;
}
}
Expand All @@ -66,10 +64,6 @@ private void bindView() {
dismiss();
thisListener.forMenuItem(1);
});
view.findViewById(R.id.tv_font_harmony_thin).setOnClickListener(v -> {
dismiss();
thisListener.forMenuItem(2);
});
}

public FontSelectorDialog setListener(OnThisListener thisListener) {
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/jack/bookshelf/widget/menu/SelectMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ public SelectMenu(Context context) {
}

private void bindView(View view) {
tvTitle = view.findViewById(R.id.mpp_tv_title_selectMenu);
llBottomButton = view.findViewById(R.id.mpp_ll_bottom_button_select_menu);
tvBottomButton = view.findViewById(R.id.mpp_tv_bottom_button_select_menu);
lvMenu = view.findViewById(R.id.mpp_lv_arrange_rule_main);
tvTitle = view.findViewById(R.id.tv_title_selectMenu);
llBottomButton = view.findViewById(R.id.ll_bottom_button_select_menu);
tvBottomButton = view.findViewById(R.id.tv_bottom_button_select_menu);
lvMenu = view.findViewById(R.id.lv_arrange_rule_main);
}

public void show(View mainView) {
Expand Down Expand Up @@ -172,8 +172,8 @@ public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder;
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_select_menu, null);
holder.tv_name_select_menu_item = convertView.findViewById(R.id.mpp_tv_name_select_menu_item);
holder.iv_indicator_select_menu_item = convertView.findViewById(R.id.mpp_iv_indicator_select_menu_item);
holder.tv_name_select_menu_item = convertView.findViewById(R.id.tv_name_select_menu_item);
holder.iv_indicator_select_menu_item = convertView.findViewById(R.id.iv_indicator_select_menu_item);
String menuName = menuList.get(position);
holder.tv_name_select_menu_item.setText(menuName);
if (lastChoose == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public abstract class PageLoader {
private int readTextLength; //已读字符数
private boolean resetReadAloud; //是否重新朗读
private int readAloudParagraph; //正在朗读章节
Bitmap cover;
CompositeDisposable compositeDisposable;
private long skipPageTime = 0; //翻页时间

Expand Down Expand Up @@ -914,7 +913,6 @@ private synchronized void drawContent(Bitmap bitmap, TxtChapter txtChapter, TxtP
for (int i = txtPage.getTitleLines(); i < txtPage.size(); ++i) {
str = txtPage.getLine(i);
strLength = strLength + str.length();
int paragraphLength = txtPage.getPosition() == 0 ? strLength : txtChapter.getPageLength(txtPage.getPosition() - 1) + strLength;
mTextPaint.setColor(readBookControl.getTextColor());
Layout tempLayout = StaticLayout.Builder.obtain(str, 0, str.length(), mTextPaint, mVisibleWidth)
.setAlignment(Layout.Alignment.ALIGN_NORMAL)
Expand Down
52 changes: 16 additions & 36 deletions app/src/main/res/layout/dialog_font_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,62 +30,42 @@
android:id="@+id/tv_font_harmony_regular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="HarmonyOS_Sans_SC_Regular.ttf"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:text="HarmonyOS_Sans_Bold"
android:textSize="16sp"
android:textColor="@color/text_color"
tools:ignore="HardcodedText"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/iv_font_harmony_regular"
android:layout_width="16sp"
android:layout_height="16sp"
android:id="@+id/iv_indicator_font_harmony_regular"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_check"
android:src="@drawable/ic_select_menu_unselected"
app:layout_constraintTop_toTopOf="@id/tv_font_harmony_regular"
app:layout_constraintBottom_toBottomOf="@id/tv_font_harmony_regular"
app:layout_constraintRight_toRightOf="parent"
android:visibility="invisible" />
app:layout_constraintRight_toRightOf="parent"/>
<TextView
android:id="@+id/tv_font_harmony_bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="HarmonyOS_Sans_SC_Bold.ttf"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:text="HarmonyOS_Sans_Black"
android:textSize="16sp"
android:textColor="@color/text_color"
tools:ignore="HardcodedText"
app:layout_constraintTop_toBottomOf="@id/tv_font_harmony_regular"/>
<ImageView
android:id="@+id/iv_font_harmony_bold"
android:layout_width="16sp"
android:layout_height="16sp"
android:id="@+id/iv_indicator_font_harmony_bold"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_check"
android:src="@drawable/ic_select_menu_unselected"
app:layout_constraintTop_toTopOf="@id/tv_font_harmony_bold"
app:layout_constraintBottom_toBottomOf="@id/tv_font_harmony_bold"
app:layout_constraintRight_toRightOf="parent"
android:visibility="invisible"/>
<TextView
android:id="@+id/tv_font_harmony_thin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="HarmonyOS_Sans_SC_Thin.ttf"
android:textSize="16sp"
android:textColor="@color/text_color"
tools:ignore="HardcodedText"
app:layout_constraintTop_toBottomOf="@id/tv_font_harmony_bold"/>
<ImageView
android:id="@+id/iv_font_harmony_thin"
android:layout_width="16sp"
android:layout_height="16sp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_check"
app:layout_constraintTop_toTopOf="@id/tv_font_harmony_thin"
app:layout_constraintBottom_toBottomOf="@id/tv_font_harmony_thin"
app:layout_constraintRight_toRightOf="parent"
android:visibility="invisible"/>
app:layout_constraintRight_toRightOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 按钮 -->
<TextView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_select_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/mpp_tv_name_select_menu_item"
android:id="@+id/tv_name_select_menu_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand All @@ -25,7 +25,7 @@
android:layout_height="match_parent"
android:layout_weight="1"/>
<ImageView
android:id="@+id/mpp_iv_indicator_select_menu_item"
android:id="@+id/iv_indicator_select_menu_item"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/menu_select.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/mpp_tv_title_selectMenu"
android:id="@+id/tv_title_selectMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
Expand All @@ -28,7 +28,7 @@
android:layout_height="16dp"/>
</LinearLayout>
<ListView
android:id="@+id/mpp_lv_arrange_rule_main"
android:id="@+id/lv_arrange_rule_main"
android:layout_width="347dp"
android:layout_height="wrap_content"
android:divider="@color/black"
Expand All @@ -37,15 +37,15 @@
android:fastScrollEnabled="false">
</ListView>
<LinearLayout
android:id="@+id/mpp_ll_bottom_button_select_menu"
android:id="@+id/ll_bottom_button_select_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="23dp"/>
<TextView
android:id="@+id/mpp_tv_bottom_button_select_menu"
android:id="@+id/tv_bottom_button_select_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@

<!-- Font Path -->
<string-array name="font_path">
<item>font/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Regular.ttf</item>
<item>font/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Bold.ttf</item>
<item>font/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Thin.ttf</item>
<item>font/HarmonyOS_Sans/HarmonyOS_Sans_Bold.ttf</item>
<item>font/HarmonyOS_Sans/HarmonyOS_Sans_Black.ttf</item>
</string-array>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
<!-- Font Select Dialog -->
<string name="select_font">选择字体</string>
<string name="self_choose_font">自定义字体</string>
<string name="choose_font_cannot_find">字体文件未找到</string>
<string name="choose_font_cannot_find">字体文件未找到</string>
<string name="fonts_folder">请将字体文件放到内部存储根目录下的Fonts文件夹中重新选择</string>
<!-- Txt Chapter Rule Dialog -->
<string name="name">名称</string>
Expand Down

0 comments on commit eb7f595

Please sign in to comment.