完成光环前端优化汇总(4月第1周)的7,8,12 https://gitlab.ghzs.com/pm/halo-app-issues/issues/824

This commit is contained in:
chenjuntao
2020-04-06 10:05:17 +08:00
parent 860769c44a
commit c7cd56e7be
6 changed files with 36 additions and 10 deletions

View File

@ -189,8 +189,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
}
/**
* 可凭借此回调确定当前 activity 已经执行了 finish() 处于 isFinishing 状态
* 可在后续进行
* 此回调可用于确认当前 activity 已经执行了 finish() 方法并处于 isFinishing 状态
*/
protected void onFinish() {

View File

@ -206,9 +206,9 @@ public class ShareUtils {
arrLogo[7] = R.drawable.share_cancel_logo;
}
popupWindow = new PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT
popupWindow = new SharePopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT
, LinearLayout.LayoutParams.MATCH_PARENT, true);
popupWindow.setAnimationStyle(R.style.mypopwindow_anim_style);
popupWindow.setAnimationStyle(R.style.popwindow_exit_only_anim_style);
//解决PopupWindow无法覆盖状态栏
popupWindow.setClippingEnabled(false);
@ -655,5 +655,20 @@ public class ShareUtils {
void onCancel();
}
}
private static class SharePopupWindow extends PopupWindow {
SharePopupWindow(View contentView, int width, int height, boolean focusable) {
super(contentView, width, height, focusable);
}
@Override
public void dismiss() {
View backgroundView = getContentView().findViewById(R.id.share_container);
if (backgroundView != null) {
backgroundView.setBackgroundColor(Color.TRANSPARENT);
}
getContentView().postDelayed(super::dismiss, 0);
}
}
}

View File

@ -3,6 +3,7 @@ package com.gh.gamecenter.qa.comment
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.View
import butterknife.OnClick
@ -11,6 +12,7 @@ import com.gh.common.util.DisplayUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.qa.answer.detail.AnswerDetailFragment
import com.lightgame.utils.Util_System_Keyboard
import kotlinx.android.synthetic.main.activity_comment.*
class CommentActivity : BaseActivity() {
@ -69,15 +71,20 @@ class CommentActivity : BaseActivity() {
commentCallback)
}
supportFragmentManager.beginTransaction().replace(R.id.answer_comment_placeholder, commentFragment).commitNowAllowingStateLoss()
supportFragmentManager.beginTransaction().replace(R.id.answerCommentPlaceholderView, commentFragment).commitNowAllowingStateLoss()
}
@OnClick(R.id.answer_comment_container)
@OnClick(R.id.answerCommentContainerView)
fun finishActivity(view: View) {
Util_System_Keyboard.hideSoftKeyboard(this)
finish()
}
override fun onFinish() {
super.onFinish()
answerCommentContainerView.setBackgroundColor(Color.TRANSPARENT)
}
companion object {
const val ANSWER_ID = "answer_id"
const val COMMENT_COUNT = "comment_count"

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/answer_comment_container"
android:id="@+id/answerCommentContainerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#9D000000">
<FrameLayout
android:id="@+id/answer_comment_placeholder"
android:id="@+id/answerCommentPlaceholderView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
android:id="@+id/share_container"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "@color/bg_popup" >

View File

@ -126,6 +126,10 @@
<!-- 指定消失的动画xml -->
</style>
<style name="popwindow_exit_only_anim_style">
<item name="android:windowExitAnimation">@anim/pophidden_anim</item>
</style>
<style name="popwindow_option_anim_style">
<item name="android:windowEnterAnimation">@anim/popwindow_option_anim_enter</item>
<item name="android:windowExitAnimation">@anim/popwindow_option_anim_exit</item>