Skip to content

Commit f66e39e

Browse files
committed
优化构建脚本
1 parent f7783fe commit f66e39e

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

Application/src/main/java/com/bihe0832/android/app/message/BaseActivityWrapperForMessage.kt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.bihe0832.android.lib.utils.os.DisplayUtil
2121
private val mAutoShowMessageList = mutableListOf<String>()
2222

2323
fun BaseActivity.addMessageAction(messageView: ImageView, unreadView: TextViewWithBackground) {
24-
AAFMessageManager.getMessageLiveData().value?.let { updateMessageMenuAndShowFace(it, this, unreadView) }
24+
AAFMessageManager.getMessageLiveData().value.let { updateMessageMenuAndShowFace(it, this, unreadView) }
2525
AAFMessageManager.getMessageLiveData().observe(this) { t ->
2626
updateMessageMenuAndShowFace(t, this, unreadView)
2727
}
@@ -35,17 +35,22 @@ fun BaseActivity.addMessageAction(messageView: ImageView, unreadView: TextViewWi
3535
}
3636

3737
@Synchronized
38-
fun updateMessageMenuAndShowFace(noticeList: List<MessageInfoItem>, activity: BaseActivity, unreadView: TextViewWithBackground) {
39-
noticeList.filter { !it.hasRead() }.let {
40-
if (it.isNotEmpty()) {
41-
unreadView.changeStatusWithUnreadMsg(it.size, DisplayUtil.dip2px(activity, 8f))
42-
} else {
43-
unreadView.changeStatusWithUnreadMsg(-1, DisplayUtil.dip2px(activity, 8f))
38+
fun updateMessageMenuAndShowFace(noticeList: List<MessageInfoItem>?, activity: BaseActivity, unreadView: TextViewWithBackground) {
39+
if (noticeList.isNullOrEmpty()) {
40+
unreadView.changeStatusWithUnreadMsg(-1, DisplayUtil.dip2px(activity, 8f))
41+
} else {
42+
noticeList.filter { !it.hasRead() }.let {
43+
if (it.isNotEmpty()) {
44+
unreadView.changeStatusWithUnreadMsg(it.size, DisplayUtil.dip2px(activity, 8f))
45+
} else {
46+
unreadView.changeStatusWithUnreadMsg(-1, DisplayUtil.dip2px(activity, 8f))
47+
}
4448
}
45-
}
4649

47-
noticeList.distinctBy { it.messageID }.filter { !mAutoShowMessageList.contains(it.messageID) && AAFMessageManager.canShowFace(it, false) }.forEach {
48-
mAutoShowMessageList.add(it.messageID)
49-
AAFMessageManager.showMessage(activity, it, true)
50+
noticeList.distinctBy { it.messageID }.filter { !mAutoShowMessageList.contains(it.messageID) && AAFMessageManager.canShowFace(it, false) }.forEach {
51+
mAutoShowMessageList.add(it.messageID)
52+
AAFMessageManager.showMessage(activity, it, true)
53+
}
5054
}
55+
5156
}

PubGetAPKInfo/src/main/java/com/bihe0832/android/app/apk/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.content.pm.ApplicationInfo
55
import android.content.pm.PackageManager
66
import android.os.Bundle
77
import android.view.View
8-
import android.widget.ImageView
98
import androidx.core.content.ContextCompat
109
import androidx.recyclerview.widget.RecyclerView
1110
import com.bihe0832.android.app.getapk.R
@@ -17,7 +16,7 @@ import com.bihe0832.android.base.card.apk.APPItemData
1716
import com.bihe0832.android.base.card.tips.TipsData
1817
import com.bihe0832.android.common.list.CardItemForCommonList
1918
import com.bihe0832.android.common.list.CommonListLiveData
20-
import com.bihe0832.android.common.list.easyrefresh.CommonListActivity
19+
import com.bihe0832.android.common.list.swiperefresh.CommonListActivity
2120
import com.bihe0832.android.framework.ZixieContext
2221
import com.bihe0832.android.lib.adapter.CardBaseModule
2322
import com.bihe0832.android.lib.debug.DebugTools

PubGetAPKInfo/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</androidx.appcompat.widget.Toolbar>
5353

5454

55-
<com.bihe0832.android.lib.ui.recycleview.ext.MyEasyRefreshLayout
55+
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
5656
android:id="@+id/activity_list_refresh"
5757
android:layout_width="match_parent"
5858
android:layout_height="match_parent">
@@ -63,6 +63,6 @@
6363
android:layout_height="match_parent"
6464
android:clipChildren="false" />
6565

66-
</com.bihe0832.android.lib.ui.recycleview.ext.MyEasyRefreshLayout>
66+
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
6767

6868
</LinearLayout>

build_apk.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ cd $localPath
104104
if [ ! -d "$localPath/bin" ]; then
105105
mkdir "$localPath/bin"
106106
fi
107-
rm -fr $localPath/bin/*
107+
#rm -fr $localPath/bin/*
108+
rm -fr $localPath/bin/temp
108109
mkdir $localPath/bin/temp
109110

110111
echo "********APK build touch tag *******"
@@ -260,7 +261,8 @@ if [ "$isOfficial"x = "true"x ]; then
260261
java -jar $localPath/AndResGuard-cli-1.2.0.jar $localPath/${appModule}/build/outputs/apk/release/${appPrefix}_V${versionWithCode}_release.apk -config $localPath/proguard-rules-resource.xml -out $localPath/bin/temp/official
261262
# 签名完整包
262263
$ANDROID_HOME/build-tools/32.0.0/zipalign -p -v 4 $localPath/bin/temp/official/${appPrefix}_V${versionWithCode}_release_unsigned.apk $localPath/bin/temp/official/${appPrefix}_V${versionWithCode}_official_unsigned_zipalign.apk
263-
$ANDROID_HOME/build-tools/32.0.0/apksigner sign --ks $localPath/debug.keystore --out $localPath/bin/${appPrefix}_V${versionWithCode}_${timeinfo}_official.apk --ks-pass pass:android $localPath/bin/temp/official/${appPrefix}_V${versionWithCode}_official_unsigned_zipalign.apk
264+
$ANDROID_HOME/build-tools/32.0.0/apksigner sign --ks $localPath/debug.keystore --out $localPath/bin/temp/${appPrefix}_V${versionWithCode}_${timeinfo}_official.apk --ks-pass pass:android $localPath/bin/temp/official/${appPrefix}_V${versionWithCode}_official_unsigned_zipalign.apk
265+
cp -fr $localPath/bin/temp/${appPrefix}_V${versionWithCode}_${timeinfo}_official.apk $localPath/bin/${appPrefix}_V${versionWithCode}_${timeinfo}_official.apk
264266
checkResult
265267

266268
echo "********APK build start add mapping and hash*******"

0 commit comments

Comments
 (0)