Commit 3e939c1d by 刘鹏

feat : 医疗2.0.1版本内容完整提交

parent faa17171
......@@ -20,8 +20,8 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;
public static String appEnv = YDLConstants.ENV_PROD;
public static String appEnv = YDLConstants.ENV_NEW_TEST;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
......
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.88",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.64",
"m-im" : "0.0.20.66",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10",
......@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.62",
"ydl-platform" : "0.0.40.63",
//第二步 若干
"ydl-webview" : "0.0.38.56",
......@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.88",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.64",
"m-im" : "0.0.20.66",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8",
......@@ -116,7 +116,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.61",
"ydl-platform" : "0.0.40.63",
//第二步 若干
"ydl-webview" : "0.0.38.56",
......
......@@ -111,6 +111,7 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
val builder = NormalDialog.Builder(this@MedicalAddNewArchivesActivity, "center", false)
builder.setTitle("")
builder.setMessage("\n为向您添加的就诊人提供问诊服务,您需要向我们提供该就诊人的身份证号码,并确保在提供前已取得该就诊人的授权同意;若该就诊人为儿童的,您需要在提供前征得该儿童监护人的同意。\n")
builder.setMessageEndBold("\n为向您添加的就诊人提供问诊服务,您需要向我们提供该","就诊人的身份证号码,并确保在提供前已取得该就诊人的授权同意;若该就诊人为儿童的,您需要在提供前征得该儿童监护人的同意。\n")
builder.setPositiveButton(
"不同意"
) { dialog, which ->
......
......@@ -6,6 +6,10 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.StyleSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
......@@ -38,6 +42,8 @@ public class NormalDialog extends Dialog {
private Context context; //上下文对象
private String title; //对话框标题
private String message; //对话框内容
private String messageStar; //对话框内容开始
private String messageEnd; //对话框内容加粗部分
private String confirm_btnText; //按钮名称“确定”
private String cancel_btnText; //按钮名称“取消”
private View contentView; //对话框中间加载的其他布局界面
......@@ -54,29 +60,31 @@ public class NormalDialog extends Dialog {
/*按钮坚挺事件*/
private DialogInterface.OnClickListener confirm_btnClickListener;
private DialogInterface.OnClickListener cancel_btnClickListener;
private boolean CanceledOnTouchOutside=true;
private boolean CanceledOnTouchOutside = true;
public Builder(Context context) {
this.context = context;
}
public Builder(Context context,String dialog_type,boolean canceledOnTouchOutside) {
public Builder(Context context, String dialog_type, boolean canceledOnTouchOutside) {
this.context = context;
this.dialog_type=dialog_type;
CanceledOnTouchOutside=canceledOnTouchOutside;
this.dialog_type = dialog_type;
CanceledOnTouchOutside = canceledOnTouchOutside;
}
public Builder(Context context , boolean canceledOnTouchOutside) {
public Builder(Context context, boolean canceledOnTouchOutside) {
this.context = context;
CanceledOnTouchOutside=canceledOnTouchOutside;
CanceledOnTouchOutside = canceledOnTouchOutside;
}
/**
* 设置取消按钮的隐藏与显示
*
* @return
*/
public Builder setCancleIsVisibility(int visibility){
public Builder setCancleIsVisibility(int visibility) {
if (left_btn!=null){
if (left_btn != null) {
left_btn.setVisibility(visibility);
}
return this;
......@@ -88,6 +96,12 @@ public class NormalDialog extends Dialog {
return this;
}
public Builder setMessageEndBold(String strStart, String strEnd) {
this.messageStar = strStart;
this.messageEnd = strEnd;
return this;
}
/**
* Set the Dialog message from resource
*
......@@ -120,23 +134,23 @@ public class NormalDialog extends Dialog {
return this;
}
public Builder setTitle_color(String title_color){
this.title_color=title_color;
public Builder setTitle_color(String title_color) {
this.title_color = title_color;
return this;
}
public Builder setContent_color(String content_color){
this.content_color=content_color;
public Builder setContent_color(String content_color) {
this.content_color = content_color;
return this;
}
public Builder setLeft_color(String left_color){
this.left_color=left_color;
public Builder setLeft_color(String left_color) {
this.left_color = left_color;
return this;
}
public Builder setRight_color(String right_color){
this.right_color=right_color;
public Builder setRight_color(String right_color) {
this.right_color = right_color;
return this;
}
......@@ -184,8 +198,6 @@ public class NormalDialog extends Dialog {
}
/**
* Set the negative button resource and it's listener
*
......@@ -211,8 +223,8 @@ public class NormalDialog extends Dialog {
return this;
}
public void dismiss(){
if(dialog!=null){
public void dismiss() {
if (dialog != null) {
dialog.dismiss();
}
......@@ -225,27 +237,27 @@ public class NormalDialog extends Dialog {
// instantiate the dialog with the custom Theme
dialog = new NormalDialog(context, R.style.platform_normaldialog_style);
View layout;
if("left".equals(dialog_type)){
if ("left".equals(dialog_type)) {
layout = inflater.inflate(R.layout.platform_dialog_common_left_layout, null);
}else {
} else {
layout = inflater.inflate(R.layout.platform_dialog_normal_layout, null);
}
dialog.addContentView(layout, new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
// set the dialog title
TextView title_tv=((TextView) layout.findViewById(R.id.title));
TextView message_tv=((TextView) layout.findViewById(R.id.message));
left_btn=((Button) layout.findViewById(R.id.cancel_btn));
Button right_btn= ((Button) layout.findViewById(R.id.confirm_btn));
TextView title_tv = ((TextView) layout.findViewById(R.id.title));
TextView message_tv = ((TextView) layout.findViewById(R.id.message));
left_btn = ((Button) layout.findViewById(R.id.cancel_btn));
Button right_btn = ((Button) layout.findViewById(R.id.confirm_btn));
if("".equals(title)||title==null){
if ("".equals(title) || title == null) {
title_tv.setVisibility(View.GONE);
}else {
} else {
title_tv.setVisibility(View.VISIBLE);
title_tv.setText(title);
title_tv.getPaint().setFakeBoldText(true);
if(title_color!=null&&!"".equals(title_color)){
if (title_color != null && !"".equals(title_color)) {
title_tv.setTextColor(Color.parseColor(title_color));
}
}
......@@ -261,7 +273,7 @@ public class NormalDialog extends Dialog {
}
});
}
if(right_color!=null&&!"".equals(right_color)){
if (right_color != null && !"".equals(right_color)) {
right_btn.setTextColor(Color.parseColor(right_color));
}
} else {
......@@ -269,9 +281,9 @@ public class NormalDialog extends Dialog {
right_btn.setVisibility(View.GONE);
}
// set the cancel button
if(left_btn!=null){
if (left_btn != null) {
if (cancel_btnText != null) {
left_btn .setText(cancel_btnText);
left_btn.setText(cancel_btnText);
if (cancel_btnClickListener != null) {
left_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
......@@ -280,7 +292,7 @@ public class NormalDialog extends Dialog {
}
});
}
if(left_color!=null&&!"".equals(left_color)){
if (left_color != null && !"".equals(left_color)) {
left_btn.setTextColor(Color.parseColor(left_color));
}
} else {
......@@ -293,10 +305,18 @@ public class NormalDialog extends Dialog {
// set the content message
if (message != null) {
message_tv.setText(message);
if(content_color!=null&&!"".equals(content_color)){
if (content_color != null && !"".equals(content_color)) {
message_tv.setTextColor(Color.parseColor(content_color));
}
if (messageStar != null) {
SpannableStringBuilder builder = new SpannableStringBuilder(messageStar + messageEnd);
builder.setSpan(new StyleSpan(Typeface.BOLD), messageStar.length(), messageStar.length() + messageEnd.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
message_tv.setText(builder);
} else {
message_tv.setText(message);
}
} else if (contentView != null) {
// if no message set
// add the lceContentView to the dialog body
......@@ -317,7 +337,7 @@ public class NormalDialog extends Dialog {
@Override
public void show() {
if (null == mContext){
if (null == mContext) {
return;
}
if (mContext instanceof Activity) {
......
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