Merge branch 'dev' of git.ghzs.com:halo/android/assistant-android into dev
This commit is contained in:
@ -213,6 +213,8 @@ public class Constants {
|
||||
public static final String SP_QUESTION_VIDEO_GUIDE = "question_video_guide";
|
||||
// 社区首页引导
|
||||
public static final String SP_COMMUNITY_HOME_GUIDE = "community_home_guide";
|
||||
// 社区首页发布按钮引导
|
||||
public static final String SP_COMMUNITY_HOME_VIDEO_GUIDE = "community_home_video_guide";
|
||||
// 论坛详情申请版主引导
|
||||
public static final String SP_FORUM_DETAIL_MODERATOR_GUIDE = "forum_detail_moderator_guide";
|
||||
|
||||
|
||||
@ -254,6 +254,14 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
String downloadId = PackageInstaller.createDownloadId(gameEntity.getName());
|
||||
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
|
||||
path = SimulatorGameManager.getPathByType(gameEntity.getSimulatorType()) + "/" + gameEntity.getName() + "." + apkEntity.getFormat();
|
||||
|
||||
// 下载模拟器游戏配置文件,地址是 "模拟器游戏类型根目录/cheat/"
|
||||
if (!TextUtils.isEmpty(gameEntity.getSimulatorGameConfig())) {
|
||||
String configFilePath = SimulatorGameManager.getPathByType(gameEntity.getSimulatorType()) + "/cheat/" + gameEntity.getName() + ".ini";
|
||||
AppExecutor.getIoExecutor().execute(() -> {
|
||||
FileUtils.downloadFile(gameEntity.getSimulatorGameConfig(), configFilePath);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
path = PackageInstaller.getDownloadPathWithId(downloadId, apkEntity.getFormat());
|
||||
}
|
||||
|
||||
@ -121,7 +121,9 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
// 判断是不是光环的新用户
|
||||
if (SPUtils.getBoolean(Constants.SP_BRAND_NEW_USER, true)) {
|
||||
mStartMainActivityDirectly = true;
|
||||
// 引导页需用户点击 “立即体验” 按钮才进入首页,所以这里不能置为true
|
||||
// https://git.ghzs.com/pm/halo-app-issues/-/issues/1422(第3点)
|
||||
// mStartMainActivityDirectly = true;
|
||||
SPUtils.setLong(Constants.SP_INITIAL_USAGE_TIME, System.currentTimeMillis());
|
||||
HaloApp.getInstance().isBrandNewInstall = true;
|
||||
showPrivacyDialog(guideLayout);
|
||||
|
||||
@ -241,6 +241,9 @@ data class GameEntity(
|
||||
@SerializedName("column_recommend")
|
||||
val columnRecommend: LinkEntity? = null,
|
||||
|
||||
@SerializedName("simulator_game_config")
|
||||
val simulatorGameConfig: String? = "",
|
||||
|
||||
// 本地字段,使用镜像信息
|
||||
var useMirrorInfo: Boolean = false,
|
||||
// 本地字段,曝光用
|
||||
|
||||
@ -140,6 +140,7 @@ class ForumDetailViewModel(application: Application, val bbsId: String) : Androi
|
||||
answerEntity.images = articleDetailEntity.images
|
||||
answerEntity.imagesInfo = articleDetailEntity.imagesInfo
|
||||
answerEntity.videos = articleDetailEntity.videos
|
||||
answerEntity.status = articleDetailEntity.status
|
||||
answerEntity.type = "community_article"
|
||||
|
||||
return answerEntity
|
||||
@ -159,6 +160,7 @@ class ForumDetailViewModel(application: Application, val bbsId: String) : Androi
|
||||
answerEntity.images = questionDetailEntity.images
|
||||
answerEntity.imagesInfo = questionDetailEntity.imagesInfo
|
||||
answerEntity.videos = questionDetailEntity.videos
|
||||
answerEntity.status = questionDetailEntity.status
|
||||
answerEntity.type = "question"
|
||||
|
||||
return answerEntity
|
||||
|
||||
@ -95,12 +95,21 @@ class CommunityHomeFragment : LazyFragment() {
|
||||
if (isShow) return
|
||||
mBinding?.run {
|
||||
guideContainer.visibility = View.VISIBLE
|
||||
guideContainer.setOnClickListener {
|
||||
guideContainer.visibility = View.GONE
|
||||
}
|
||||
guideIv.setOnClickListener {
|
||||
guideContainer.visibility = View.GONE
|
||||
showCommunityEditWindow()
|
||||
}
|
||||
guideTipIv.alpha = 0F
|
||||
guideTipIv.animate().alpha(1F).setDuration(200).start()
|
||||
guideTipIv.postDelayed({
|
||||
tryCatchInRelease {
|
||||
guideTipIv.animate().alpha(1F).setDuration(200).start()
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_GUIDE, true)
|
||||
}
|
||||
|
||||
fun setCurrentItem(index: Int) {
|
||||
@ -217,12 +226,11 @@ class CommunityHomeFragment : LazyFragment() {
|
||||
}
|
||||
|
||||
private fun showCommunityEditWindow() {
|
||||
val guideFlag = SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_GUIDE)
|
||||
val contentView = LayoutInflater.from(context).inflate(R.layout.community_edit_window, null)
|
||||
val params = ViewGroup.LayoutParams(resources.displayMetrics.widthPixels, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
val dialog = TrackableDialog(
|
||||
requireContext(),
|
||||
if (guideFlag) R.style.DialogWindowTransparent else R.style.TransparentDialog,
|
||||
R.style.DialogWindowTransparent,
|
||||
"社区",
|
||||
UserManager.getInstance().community.name,
|
||||
null,
|
||||
@ -273,9 +281,6 @@ class CommunityHomeFragment : LazyFragment() {
|
||||
entrance = mEntrance,
|
||||
path = "论坛首页"),
|
||||
VIDEO_REQUEST_CODE)
|
||||
|
||||
SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_GUIDE, true)
|
||||
mBinding?.guideContainer?.visibility = View.GONE
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
@ -286,37 +291,40 @@ class CommunityHomeFragment : LazyFragment() {
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
if (!guideFlag) {
|
||||
mBinding?.guideTipIv?.run {
|
||||
animate().alpha(0F).setDuration(200).withEndAction { visibility = View.GONE }.start()
|
||||
}
|
||||
if (!SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_VIDEO_GUIDE)) {
|
||||
videoEditBtn.visibility = View.INVISIBLE
|
||||
|
||||
val emptyView = contentView.findViewById<View>(R.id.emptyView)
|
||||
val guideContainer = contentView.findViewById<View>(R.id.guideContainer)
|
||||
val guideIv = contentView.findViewById<View>(R.id.guideIv)
|
||||
val guideTipIv = contentView.findViewById<View>(R.id.guideTipIv)
|
||||
val screenWidth = resources.displayMetrics.widthPixels
|
||||
val videoItemMargin = (screenWidth - 64F.dip2px() * 3) / 4
|
||||
emptyView.visibility = View.VISIBLE
|
||||
emptyView.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
}
|
||||
guideContainer.visibility = View.VISIBLE
|
||||
guideContainer.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
videoEditBtn.visibility = View.VISIBLE
|
||||
guideContainer.visibility = View.GONE
|
||||
}
|
||||
guideIv.layoutParams = (guideIv.layoutParams as ViewGroup.MarginLayoutParams).apply {
|
||||
rightMargin = videoItemMargin - 28F.dip2px()
|
||||
}
|
||||
guideIv.setOnClickListener {
|
||||
videoEditBtn.visibility = View.VISIBLE
|
||||
guideContainer.visibility = View.GONE
|
||||
videoEditBtn.performClick()
|
||||
}
|
||||
guideTipIv.alpha = 0F
|
||||
guideTipIv.animate().alpha(1F).setDuration(200).start()
|
||||
dialog.setOnDismissListener {
|
||||
if (!SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_GUIDE)) {
|
||||
mBinding?.guideTipIv?.run {
|
||||
visibility = View.VISIBLE
|
||||
animate().alpha(1F).setDuration(200).start()
|
||||
}
|
||||
guideTipIv.postDelayed({
|
||||
tryCatchInRelease {
|
||||
guideTipIv.animate().alpha(1F).setDuration(200).start()
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
|
||||
SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_VIDEO_GUIDE, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -68,6 +68,7 @@ class CommunityHomeViewModel(application: Application) : AndroidViewModel(applic
|
||||
articleEntity.images = articleDetailEntity.images
|
||||
articleEntity.imagesInfo = articleDetailEntity.imagesInfo
|
||||
articleEntity.videos = articleDetailEntity.videos
|
||||
articleEntity.status = articleDetailEntity.status
|
||||
articleEntity.type = "community_article"
|
||||
|
||||
return articleEntity
|
||||
@ -87,6 +88,7 @@ class CommunityHomeViewModel(application: Application) : AndroidViewModel(applic
|
||||
articleEntity.images = questionDetailEntity.images
|
||||
articleEntity.imagesInfo = questionDetailEntity.imagesInfo
|
||||
articleEntity.videos = questionDetailEntity.videos
|
||||
articleEntity.status = questionDetailEntity.status
|
||||
articleEntity.type = "question"
|
||||
|
||||
return articleEntity
|
||||
|
||||
@ -148,7 +148,7 @@ class ForumArticleListFragment : LazyListFragment<ArticleEntity, ForumArticleLis
|
||||
|
||||
override fun onLoadDone() {
|
||||
super.onLoadDone()
|
||||
if (CheckLoginUtils.isLogin()) mHaveLoadLoginData = true
|
||||
mHaveLoadLoginData = CheckLoginUtils.isLogin()
|
||||
AppExecutor.uiExecutor.executeWithDelay(Runnable {
|
||||
tryCatchInRelease {
|
||||
scroll()
|
||||
|
||||
@ -32,8 +32,13 @@ class ModeratorListAdapter(context: Context, val mViewModel: ModeratorListViewMo
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if (holder is ModeratorItemViewHolder) {
|
||||
val personalEntity = datas[position]
|
||||
var mHasNameLabel = false
|
||||
if (personalEntity.nameLabel?.isNotEmpty() == true){
|
||||
mHasNameLabel = true
|
||||
}
|
||||
holder.binding.run {
|
||||
entity = personalEntity
|
||||
hasNameLabel = mHasNameLabel
|
||||
executePendingBindings()
|
||||
|
||||
followTv.goneIf(personalEntity.id == UserManager.getInstance().userId)
|
||||
|
||||
@ -4,6 +4,20 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/emptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="188dp"
|
||||
@ -110,7 +124,6 @@
|
||||
android:id="@+id/guideContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
@ -118,8 +131,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="188dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/community_edit_window_guide_bg" />
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
@ -29,9 +29,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taskNameTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_333333"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
@ -39,13 +38,10 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taskDesTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/text_999999"
|
||||
android:textSize="12sp"
|
||||
android:textSize="11sp"
|
||||
tools:text="活跃度=发帖数量+回帖数量+回复数量≥20" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -4,7 +4,10 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="hasNameLabel"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="entity"
|
||||
type="com.gh.gamecenter.entity.PersonalEntity" />
|
||||
@ -34,39 +37,34 @@
|
||||
app:roundingBorderWidth="1dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/followTv"
|
||||
app:layout_constraintStart_toEndOf="@+id/userIcon"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userNameTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{entity.name}"
|
||||
android:textColor="@color/text_333333"
|
||||
android:textStyle="bold"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="@string/app_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{entity.nameLabel}"
|
||||
android:textColor="@color/theme_font"
|
||||
android:textSize="12sp"
|
||||
android:visibility="@{hasNameLabel ? View.VISIBLE:View.GONE}"
|
||||
tools:text="@string/app_name" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Submodule libraries/LGLibrary updated: 02846264a9...ba2591cec4
Reference in New Issue
Block a user