Commit 36462351 by 郑鹏

修改字体

parent 69fa5dd9
...@@ -29,12 +29,17 @@ ...@@ -29,12 +29,17 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity android:name=".ui.TestActivity">
android:name=".ui.home.FoodAllEvaluateActivity" <intent-filter>
android:screenOrientation="portrait"> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.home.FoodAllEvaluateActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name=".ui.home.HomeActivity" android:name=".ui.home.HomeActivity"
android:configChanges="locale" android:configChanges="locale"
android:launchMode="singleTask" android:launchMode="singleTask"
...@@ -106,13 +111,16 @@ ...@@ -106,13 +111,16 @@
sign the APK for publishing. sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/. You can define the keys for the debug and release targets in src/debug/ and src/release/.
--> -->
<!-- <meta-data <!--
<meta-data
android:name="com.google.android.geo.API_KEY" android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" /> android:value="@string/google_maps_key" />
<meta-data <meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id" android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />--> android:value="@string/default_notification_channel_id" />
<!-- <activity -->
<!--
<activity
android:name=".ui.home.map.GoogleMapsActivity" android:name=".ui.home.map.GoogleMapsActivity"
android:label="@string/title_activity_google_maps" android:label="@string/title_activity_google_maps"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -123,11 +131,14 @@ ...@@ -123,11 +131,14 @@
<activity <activity
android:name=".ui.home.map.GoogleMapsMallActivity" android:name=".ui.home.map.GoogleMapsMallActivity"
android:label="@string/title_activity_google_maps" android:label="@string/title_activity_google_maps"
android:screenOrientation="portrait" />--> android:screenOrientation="portrait" />
<!-- <activity -->
<!--
<activity
android:name=".ui.home.map.MapsActivity" android:name=".ui.home.map.MapsActivity"
android:label="@string/title_activity_maps" android:label="@string/title_activity_maps"
android:screenOrientation="portrait" />--> android:screenOrientation="portrait" />
-->
<activity <activity
android:name=".ui.personal.QuestionDetailsActivity" android:name=".ui.personal.QuestionDetailsActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -137,11 +148,14 @@ ...@@ -137,11 +148,14 @@
<activity <activity
android:name=".ui.personal.order.food.FoodEvaluationActivity" android:name=".ui.personal.order.food.FoodEvaluationActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<!-- <intent-filter>
<!--
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>--> </intent-filter>
-->
</activity> </activity>
<provider <provider
...@@ -285,11 +299,7 @@ ...@@ -285,11 +299,7 @@
<activity <activity
android:name="cn.dankal.user.login.LanguageSelectActivity" android:name="cn.dankal.user.login.LanguageSelectActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> </activity>
<activity <activity
android:name="com.mhq.smartorder.wxapi.WXPayEntryActivity" android:name="com.mhq.smartorder.wxapi.WXPayEntryActivity"
...@@ -308,32 +318,35 @@ ...@@ -308,32 +318,35 @@
android:name="com.mhq.smartorder.wxapi.WXEntryActivity" android:name="com.mhq.smartorder.wxapi.WXEntryActivity"
android:exported="true" android:exported="true"
android:theme="@style/MyTranslucentTheme" /> android:theme="@style/MyTranslucentTheme" />
<!--
<!-- <service android:name=".ui.service.MyFirebaseMessagingService"> <service android:name=".ui.service.MyFirebaseMessagingService">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter> </intent-filter>
</service>--> <!-- [END firebase_service] --> </service>
<!-- <service -->
<!-- [END firebase_service] -->
<!--
<service
android:name=".ui.service.MyJobService" android:name=".ui.service.MyJobService"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" /> <action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
</intent-filter> </intent-filter>
</service>--> </service>
-->
<activity android:name="cn.dankal.basiclib.base.activity.BaseListActivity"></activity> <activity android:name="cn.dankal.basiclib.base.activity.BaseListActivity" />
<activity <activity
android:name="cn.dankal.basiclib.base.activity.BigPhotoActivity" android:name="cn.dankal.basiclib.base.activity.BigPhotoActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<!--
<!-- <meta-data <meta-data
android:name="firebase_messaging_auto_init_enabled" android:name="firebase_messaging_auto_init_enabled"
android:value="false" /> android:value="false" />
<meta-data <meta-data
android:name="firebase_analytics_collection_enabled" android:name="firebase_analytics_collection_enabled"
android:value="false" />--> android:value="false" />
-->
<activity <activity
android:name="com.yzq.zxinglibrary.android.CaptureActivity" android:name="com.yzq.zxinglibrary.android.CaptureActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
......
...@@ -45,6 +45,7 @@ public class ModooApplication extends Application { ...@@ -45,6 +45,7 @@ public class ModooApplication extends Application {
private static IWXAPI api; private static IWXAPI api;
private Typeface mFromAsset; private Typeface mFromAsset;
private Typeface mFromAssetBold;
@Override @Override
public void onCreate() { public void onCreate() {
...@@ -111,8 +112,8 @@ public class ModooApplication extends Application { ...@@ -111,8 +112,8 @@ public class ModooApplication extends Application {
} else if ("zh".equals(language)) { } else if ("zh".equals(language)) {
SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(0); SPUtil.getInstance(ModooApplication.getContext()).saveLanguage(0);
} }
mFromAsset = Typeface.createFromAsset(getAssets(), "fonts/test_font.ttf"); this.mFromAsset = Typeface.createFromAsset(this.getAssets(), "fonts/GothamMedium.ttf");
this.mFromAssetBold = Typeface.createFromAsset(this.getAssets(), "fonts/GothamBold.ttf");
//setFonts(); //setFonts();
} }
...@@ -120,20 +121,19 @@ public class ModooApplication extends Application { ...@@ -120,20 +121,19 @@ public class ModooApplication extends Application {
return mFromAsset; return mFromAsset;
} }
public Typeface getFromAssetBold() {
return mFromAssetBold;
}
private void setFonts() { private void setFonts() {
Typeface typeFaceYaHei = Typeface.createFromAsset(getAssets(), "fonts/NotoSansKR-Light.otf"); Typeface typeFaceYaHei = Typeface.createFromAsset(getAssets(), "fonts/NotoSansKR-Light.otf");
try try {
{
Field field = Typeface.class.getDeclaredField("MONOSPACE"); Field field = Typeface.class.getDeclaredField("MONOSPACE");
field.setAccessible(true); field.setAccessible(true);
field.set(null, typeFaceYaHei); field.set(null, typeFaceYaHei);
} } catch (NoSuchFieldException e) {
catch (NoSuchFieldException e)
{
e.printStackTrace(); e.printStackTrace();
} } catch (IllegalAccessException e) {
catch (IllegalAccessException e)
{
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -169,8 +169,6 @@ public class ModooApplication extends Application { ...@@ -169,8 +169,6 @@ public class ModooApplication extends Application {
} }
/** /**
* 페 이 스 북 제작 보조 개발 도구 * 페 이 스 북 제작 보조 개발 도구
*/ */
......
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package cn.dankal.basiclib.widget; package cn.dankal.basiclib.widget;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.text.Layout; import android.support.v7.widget.AppCompatTextView;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import cn.dankal.basiclib.ModooApplication; import cn.dankal.basiclib.ModooApplication;
import cn.dankal.basiclib.widget.passwordview.Util;
import cn.dankal.client.R;
/**
* Author: roczheng
* Date: 2021/3/18
* Time: 21:43
* Description:
*/
public class NewFontTextView extends android.support.v7.widget.AppCompatTextView {
public class NewFontTextView extends AppCompatTextView {
private Context context; private Context context;
private Float testSize; private Float testSize;
public NewFontTextView(Context context) { public NewFontTextView(Context context) {
this(context, null); this(context, (AttributeSet)null);
} }
public NewFontTextView(Context context, AttributeSet attrs) { public NewFontTextView(Context context, AttributeSet attrs) {
...@@ -38,87 +27,13 @@ public class NewFontTextView extends android.support.v7.widget.AppCompatTextView ...@@ -38,87 +27,13 @@ public class NewFontTextView extends android.support.v7.widget.AppCompatTextView
public NewFontTextView(Context context, AttributeSet attrs, int defStyleAttr) { public NewFontTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
this.context = context; this.context = context;
// getPaint().setTypeface(ModooApplication.getInstance().getFromAsset());
} }
public void setTypeface(Typeface tf, int style) { public void setTypeface(Typeface tf, int style) {
if (style == Typeface.BOLD) { if (style == 1) {
super.setTypeface(ModooApplication.getInstance().getFromAsset()); super.setTypeface(ModooApplication.getInstance().getFromAssetBold());
} else { } else {
super.setTypeface(ModooApplication.getInstance().getFromAsset()); super.setTypeface(ModooApplication.getInstance().getFromAsset());
} }
} }
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int wMode = MeasureSpec.getMode(widthMeasureSpec);
int wSize = MeasureSpec.getSize(widthMeasureSpec);
int hMode = MeasureSpec.getMode(heightMeasureSpec);
int hSize = MeasureSpec.getSize(heightMeasureSpec);
/* hSize = this.getMeasuredHeight();
TextPaint newPaint = new TextPaint();
String textStr = getText().toString();
float textSize = getResources().getDisplayMetrics().scaledDensity * Util.px2sp(context, getTextSize());
newPaint.setTextSize(textSize);
float textWidth = getLineLength(textStr, getTextSize());
int targetWidith = 0;
int newWidthMeasureSpec = 0;
int newHeightMeasureSpec = 0;
switch (wMode) {
case MeasureSpec.UNSPECIFIED:
wSize = (int) ( textWidth);
newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(wSize, wMode);
break;
case MeasureSpec.EXACTLY:
newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(wSize, wMode);
break;
case MeasureSpec.AT_MOST:
targetWidith = (int) (textWidth);
if (wSize > targetWidith) {
wSize = targetWidith;
}
newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(wSize, wMode);
break;
}*/
/* String textStr = getText().toString();
//float textSize = getResources().getDisplayMetrics().scaledDensity * Util.px2sp(context, getTextSize());
float textWidth = getLineLength(textStr, getTextSize());
int targetWidith = 0;
targetWidith = (int) (textWidth);
int newWidthMeasureSpec = 0;
int newHeightMeasureSpec = 0;
newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(getHeight(), hMode);
newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(getWidth(), wMode);
setMeasuredDimension(newWidthMeasureSpec, newHeightMeasureSpec);*/
}
/* @Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (!TextUtils.isEmpty(getText())){
float txtLen = Layout.getDesiredWidth(getText().toString(),0,getText().length(),getPaint());
if(txtLen>getWidth()-10){//当字体长度大于宽度-10的时候,按比例缩放
float scale = getWidth()/txtLen;
setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize()*scale);
}else{
setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize());
}
}
}*/
public int getLineLength(String str, float textSize) {
Paint pFont = new Paint();
pFont.setTextSize(textSize);
pFont.setTypeface(ModooApplication.getInstance().getFromAsset());
return (int) pFont.measureText(str);
}
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
}
\ No newline at end of file
package cn.dankal.client.ui;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import cn.dankal.client.R;
public class TestActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
TextView tv1 = findViewById(R.id.tv_1);//기본 글꼴
TextView tv2 = findViewById(R.id.tv_2);//인터넷 글꼴 파일test_font.ttf
TextView tv3 = findViewById(R.id.tv_3);//한국 글씨체 파일GothamMedium.ttf
TextView tv4 = findViewById(R.id.tv_4);//网上下的韩文字体goindol.ttf
TextView tv5 = findViewById(R.id.tv_4);//网上下的韩文字体mhbson.ttf
tv2.setTypeface(Typeface.createFromAsset(this.getAssets(), "fonts/test_font.ttf"));
tv3.setTypeface(Typeface.createFromAsset(this.getAssets(), "fonts/GothamMedium.ttf"));
tv4.setTypeface(Typeface.createFromAsset(this.getAssets(), "fonts/goindol.ttf"));
tv4.setTypeface(Typeface.createFromAsset(this.getAssets(), "fonts/mhbson.ttf"));
}
}
\ No newline at end of file
...@@ -18,6 +18,7 @@ import android.widget.ImageView; ...@@ -18,6 +18,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import cn.dankal.basiclib.util.rx.RxPermissions; import cn.dankal.basiclib.util.rx.RxPermissions;
import com.yanzhenjie.permission.Permission; import com.yanzhenjie.permission.Permission;
import com.yzq.zxinglibrary.android.CaptureActivity; import com.yzq.zxinglibrary.android.CaptureActivity;
import com.zhy.view.flowlayout.FlowLayout; import com.zhy.view.flowlayout.FlowLayout;
...@@ -79,6 +80,8 @@ public class MenuItemFragment extends BaseFragment { ...@@ -79,6 +80,8 @@ public class MenuItemFragment extends BaseFragment {
private TagFlowLayout flowLayoutTow; private TagFlowLayout flowLayoutTow;
private TagFlowLayout flowLayoutThree;
private RxPermissions rxPermissions; private RxPermissions rxPermissions;
@Override @Override
...@@ -261,6 +264,7 @@ public class MenuItemFragment extends BaseFragment { ...@@ -261,6 +264,7 @@ public class MenuItemFragment extends BaseFragment {
flowLayoutOne = view.findViewById(R.id.fl_tag_one); flowLayoutOne = view.findViewById(R.id.fl_tag_one);
flowLayoutTow = view.findViewById(R.id.fl_tag_tow); flowLayoutTow = view.findViewById(R.id.fl_tag_tow);
flowLayoutThree = view.findViewById(R.id.fl_tag_tow);
TextView btnReset = view.findViewById(R.id.tv_mall_add_car); TextView btnReset = view.findViewById(R.id.tv_mall_add_car);
TextView btnComplete = view.findViewById(R.id.tv_mall_pay); TextView btnComplete = view.findViewById(R.id.tv_mall_pay);
...@@ -337,6 +341,29 @@ public class MenuItemFragment extends BaseFragment { ...@@ -337,6 +341,29 @@ public class MenuItemFragment extends BaseFragment {
}; };
flowLayoutTow.setAdapter(adapterTow); flowLayoutTow.setAdapter(adapterTow);
List<String> listThree = new ArrayList<>();
listThree.add("200m");
listThree.add("500m");
listThree.add("1000m");
listThree.add("1km");
listThree.add("3km");
listThree.add("4km");
listThree.add("5km");
TagAdapter adapterThree = new TagAdapter(listThree) {
@Override
public View getView(FlowLayout parent, int position, Object o) {
TextView tv = (TextView) LayoutInflater.from(ModooApplication.getContext()).inflate(R.layout.item_dialog_select, flowLayoutOne, false);
tv.setText(String.valueOf(o));
return tv;
}
};
flowLayoutThree.setAdapter(adapterTow);
if ("0".equals(queue_status)) {//줄 을 설 필요 가 없다 if ("0".equals(queue_status)) {//줄 을 설 필요 가 없다
adapterTow.setSelectedList(2); adapterTow.setSelectedList(2);
} else if ("1".equals(queue_status)) { } else if ("1".equals(queue_status)) {
...@@ -367,6 +394,9 @@ public class MenuItemFragment extends BaseFragment { ...@@ -367,6 +394,9 @@ public class MenuItemFragment extends BaseFragment {
if (flowLayoutOne != null) { if (flowLayoutOne != null) {
flowLayoutOne = null; flowLayoutOne = null;
} }
if (flowLayoutThree != null) {
flowLayoutThree = null;
}
requestAllList(); requestAllList();
popupWindow.dismiss(); popupWindow.dismiss();
}); });
......
...@@ -126,6 +126,24 @@ ...@@ -126,6 +126,24 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18" android:layout_marginLeft="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_13"
app:max_select="1" />
<cn.dankal.basiclib.widget.NewFontTextView
android:id="@+id/tv_mall_title_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="@string/distance"
android:textColor="@color/color_d3d3d3"
android:textSize="@dimen/sp_16" />
<com.zhy.view.flowlayout.TagFlowLayout
android:id="@+id/fl_tag_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_13" android:layout_marginTop="@dimen/dp_13"
app:max_select="1" /> app:max_select="1" />
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.LinearLayoutCompat 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.TestActivity">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="저 는 기본 글씨 입 니 다."
android:textSize="24sp" />
<TextView
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="저 는 인터넷 에서 서 체 를 다운 받 습 니 다."
android:textSize="24sp" />
<TextView
android:id="@+id/tv_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="한국 에서 제공 하 는 글씨체"
android:textSize="24sp" />
<TextView
android:id="@+id/tv_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="한국 에서 제공 하 는 글씨체"
android:textSize="24sp" />
<TextView
android:id="@+id/tv_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="한국 에서 제공 하 는 글씨체"
android:textSize="24sp" />
</android.support.v7.widget.LinearLayoutCompat>
\ No newline at end of file
...@@ -127,6 +127,24 @@ ...@@ -127,6 +127,24 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18" android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_13" android:layout_marginTop="@dimen/dp_13"
android:layout_marginBottom="@dimen/dp_13"
app:max_select="1" />
<cn.dankal.basiclib.widget.NewFontTextView
android:id="@+id/tv_mall_title_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="@string/distance"
android:textColor="@color/color33"
android:textSize="@dimen/sp_16" />
<com.zhy.view.flowlayout.TagFlowLayout
android:id="@+id/fl_tag_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_13"
app:max_select="1" /> app:max_select="1" />
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_18" android:layout_marginTop="@dimen/dp_18"
android:visibility="gone"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"> android:clipToPadding="false">
<TextView <cn.dankal.basiclib.widget.NewFontTextView
android:id="@+id/tv_tab_title" android:id="@+id/tv_tab_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<resources> <resources>
<!--<string name="app_name">modoo order</string>--> <!--<string name="app_name">modoo order</string>-->
<string name="login_activity_path">cn.dankal.user.login.LoginActivity</string> <string name="login_activity_path">cn.dankal.user.login.LoginActivity</string>
......
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