Commit fb8af712 by 王佳洋

Merge branch '333' into feat/wjy/合规

# Conflicts:
#	ydl-platform/src/main/res/values/colors.xml
parents e742fa88 8259f321
......@@ -59,8 +59,8 @@ class FeedBackActivity : BaseActivity(), View.OnClickListener {
private var isPhoneNull = true
private var imgFiles: MutableList<File>? = null
internal var work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
internal var tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
private var work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private var tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, true)
}
......
......@@ -135,5 +135,5 @@
<color name="color_C3C4CA">#C3C4CA</color>
<color name="color_2E2E30">#2E2E30</color>
<color name="color_191919">#191919</color>
<color name="color_E5E5E5">#E5E5E5</color>
</resources>
package com.ydl.utils;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.PopupWindow;
import com.ydl.view.MoreClickView;
import com.ydl.webview.IJavascriptHandler;
/**
* Created by Wi1ls on 2016/10/17;
*/
public class PopUtils {
public static PopupWindow showMoreItem(Context context, View view, IJavascriptHandler jtoJHandle){
MoreClickView v= new MoreClickView(context,jtoJHandle);
WindowManager windowManager= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final PopupWindow popupWindow=new PopupWindow(v, windowManager.getDefaultDisplay().getWidth(),
windowManager.getDefaultDisplay().getHeight());
v.setPopupWindow(popupWindow);
popupWindow.setFocusable(false);
popupWindow.setOutsideTouchable(true);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
popupWindow.showAtLocation(view, Gravity.CENTER,0,0);
return popupWindow;
}
}
......@@ -20,12 +20,17 @@ import kotlinx.android.synthetic.main.web_ui_new_more.view.*
/**
* Created by Wi1ls on 2016/10/17;
*/
class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : RelativeLayout(context), View.OnClickListener {
private var mJtoJHandle: IJavascriptHandler?= jtoJHandle
class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : RelativeLayout(context),
View.OnClickListener {
private var mJtoJHandle: IJavascriptHandler? = jtoJHandle
private var mPopupWindow: PopupWindow? = null
private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
private val work_time = if (PlatformDataManager.getRam()
.getGlobalInfo() == null
) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private val tel = if (PlatformDataManager.getRam()
.getGlobalInfo() == null
) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
init {
View.inflate(context, R.layout.web_ui_new_more, this)
......@@ -33,38 +38,41 @@ class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : Relative
}
internal fun init() {
fl_main.setOnClickListener(this)
if(mJtoJHandle?.setMoreMsg()!=null){
if (mJtoJHandle?.setMoreMsg() != null) {
more_msg.setOnClickListener(mJtoJHandle?.setMoreMsg())
}else{
} else {
more_msg.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreHomePage()!=null){
if (mJtoJHandle?.setMoreHomePage() != null) {
more_homepage.setOnClickListener(mJtoJHandle?.setMoreHomePage())
}else{
} else {
more_homepage.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreService()!=null){
if (mJtoJHandle?.setMoreService() != null) {
more_service.setOnClickListener(mJtoJHandle?.setMoreService())
}else{
} else {
more_service.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreCall()!=null){
if (mJtoJHandle?.setMoreCall() != null) {
more_ray.setOnClickListener(mJtoJHandle?.setMoreCall())
}else{
} else {
more_ray.setOnClickListener(this)
}
if (mJtoJHandle?.setMoreCall() != null) {
more_feed.setOnClickListener(mJtoJHandle?.setMoreCall())
} else {
more_feed.setOnClickListener(this)
}
/* if (YdlCommonRouterManager.getYdlCommonRoute().isHasUnread()) {
msg_new.setVisibility(View.VISIBLE)
} else {
msg_new.setVisibility(View.INVISIBLE)
}*/
var unreadNum = ModularServiceManager.provide(IImService::class.java).getAllUnReadNum()
val unreadNum = ModularServiceManager.provide(IImService::class.java).getAllUnReadNum()
if (unreadNum <= 0) {
un_read_num.visibility = View.GONE
}
else {
} else {
if (unreadNum > 99) {
un_read_num.text = "${unreadNum}+"
} else {
......@@ -80,8 +88,6 @@ class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : Relative
mPopupWindow!!.dismiss()
}
when (view.id) {
R.id.fl_main -> {
}
R.id.more_msg -> {
setMoreMsg()
}
......@@ -126,16 +132,6 @@ class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : Relative
}.show()
}
private var callBack: CallPhoneCallBack? = null
fun setCallPhoneCallBack(callBack: CallPhoneCallBack) {
this.callBack = callBack
}
interface CallPhoneCallBack {
fun call(tel: String, action: String)
}
fun setPopupWindow(popupWindow: PopupWindow) {
mPopupWindow = popupWindow
}
......
......@@ -15,8 +15,10 @@ import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
......@@ -34,10 +36,10 @@ import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.utils.PopUtils;
import com.ydl.utils.ProxyCheckUtils;
import com.ydl.utils.WebUrlParamsUtils;
import com.ydl.view.ArticleDialogFragment;
import com.ydl.view.MoreClickView;
import com.ydl.view.ShareMeditationDialog;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.base.BaseActivity;
......@@ -131,8 +133,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private ShareMeditationDialog shareMeditationDialog;
private ArticleDialogFragment commentArticleDialog;
protected PopupWindow popupWindow;
protected ValueCallback<Uri> uploadMessage;
protected ValueCallback<Uri[]> uploadMessageAboveL;
private boolean shouldClearHistory = false;
......@@ -536,8 +536,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
public void openRightTopMenu() {
popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), jtoJHandle);
MoreClickView moreView = new MoreClickView(this, jtoJHandle);
PopupWindow popupWindow = new PopupWindow(moreView, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
moreView.setPopupWindow(popupWindow);
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true); // 防止外部点击事件穿透
popupWindow.showAtLocation(tb_title, Gravity.TOP | Gravity.END, 0, 0);
}
public void openShareMenu(H5JsBean.H5JsCmd.Params params) {
......@@ -641,8 +645,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
purl = intent.getStringExtra("purl");
//要加"more"按钮
if (h5Params.isShowMenu()) {
tb_title.setRightImageListener(v -> popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), jtoJHandle));
tb_title.setRightImageListener(v -> openRightTopMenu());
tb_title.setRightImageIfShouldSee();
} else {
tb_title.setRightImageIfNoSee();
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@android:color/white"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="150dp"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="right"
android:elevation="4dp"
android:background="@color/platform_white"
android:layout_marginTop="55dp"
android:layout_marginRight="5dp">
android:layout_marginEnd="5dp"
android:background="@drawable/bg_corner_8_white"
android:elevation="4dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/more_msg"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
android:layout_height="48dp"
android:paddingStart="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_news"/>
android:layout_marginEnd="17dp"
android:src="@drawable/platform_ic_pop_news" />
<TextView
android:id="@+id/tv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="消息"
android:textColor="#333333"/>
android:textColor="@color/platform_color_333333"
android:textSize="14sp" />
<TextView
android:id="@+id/un_read_num"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="5dp"
android:background="@drawable/web_message_num_bg"
android:gravity="center"
android:minWidth="14dp"
android:textSize="10dp"
tools:text="10"
android:textColor="#ffffff"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:gravity="center"
android:background="@drawable/web_message_num_bg"
android:layout_marginLeft="5dp"/>
android:textColor="#ffffff"
android:textSize="11sp"
tools:text="10" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
android:layout_height="0.5dp"
android:background="@color/color_E5E5E5" />
<LinearLayout
android:id="@+id/more_homepage"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
android:layout_height="48dp"
android:paddingStart="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_home"/>
android:layout_marginEnd="17dp"
android:src="@drawable/platform_ic_pop_home" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="首页"
android:textColor="#333333"/>
android:textColor="@color/platform_color_333333"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
android:layout_height="0.5dp"
android:background="@color/color_E5E5E5" />
<LinearLayout
android:id="@+id/more_service"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
android:layout_height="48dp"
android:paddingStart="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_kefu"/>
android:layout_marginEnd="17dp"
android:src="@drawable/platform_ic_pop_kefu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="在线客服"
android:textColor="#333333"/>
android:textColor="@color/platform_color_333333"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
android:layout_height="0.5dp"
android:background="@color/color_E5E5E5" />
<LinearLayout
android:id="@+id/more_ray"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
android:layout_height="48dp"
android:paddingStart="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_phone"/>
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="17dp"
android:src="@drawable/platform_ic_pop_phone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="免费热线"
android:textColor="#333333"/>
android:textColor="@color/platform_color_333333"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_E5E5E5" />
<LinearLayout
android:id="@+id/more_feed"
android:layout_width="match_parent"
android:layout_height="48dp"
android:paddingStart="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="17dp"
android:src="@drawable/platform_ic_pop_feed" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="投诉与反馈"
android:textColor="@color/platform_color_333333"
android:textSize="14sp" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
</LinearLayout>
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