Bläddra i källkod

feat: 本地化

tongmengxiao 2 månader sedan
förälder
incheckning
bc1243f609

+ 38 - 18
app/src/main/java/com/swago/app/MyFirebaseMessagingService.kt

@@ -1,10 +1,12 @@
 package com.swago.app
 
+import android.app.Notification
 import android.app.NotificationChannel
 import android.app.NotificationManager
 import android.app.PendingIntent
 import android.content.Context
 import android.content.Intent
+import android.graphics.BitmapFactory
 import android.os.Build
 import androidx.core.app.NotificationCompat
 import com.google.firebase.messaging.FirebaseMessagingService
@@ -25,31 +27,49 @@ class MyFirebaseMessagingService: FirebaseMessagingService() {
 
     override fun onNewToken(token: String) {
         super.onNewToken(token)
+        LogUtil.d("FirebaseMessaging","onNewToken" + token)
     }
 
     private fun sendNotification(title:String?,messageBody: String?) {
         LogUtil.d("FCM", "sendNotification: " + messageBody)
-        val intent = Intent(this, HomeActivity::class.java)
-        intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
-        val pendIntent = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_IMMUTABLE)
-        val channelId = "meliv_channel_id"
-        val notificationBuilder = NotificationCompat.Builder(this, channelId)
-            .setSmallIcon(R.mipmap.ic_launcher_foreground)
-            .setContentTitle(title)
-            .setContentText(messageBody)
-            .setAutoCancel(true)
-            .setContentIntent(pendIntent)
-
-        val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
-        // Android 8.0及以上需要设置通知渠道
+        // Create notification default intent.
+        val pendingIntent: PendingIntent
+        val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
+        val builder: NotificationCompat.Builder
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             val channel = NotificationChannel(
-                channelId,
-                "Channel title",
-                NotificationManager.IMPORTANCE_DEFAULT
+                "com.swago.app.MyFirebaseMessagingService" //这里的id里面输入自己的项目的包的路径
+                //这里的id里面输入自己的项目的包的路径
+                , "MeLiv", NotificationManager.IMPORTANCE_HIGH)
+            channel.enableLights(true)
+            channel.setShowBadge(true)
+            channel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
+            manager.createNotificationChannel(channel)
+            builder = NotificationCompat.Builder(this).setChannelId(
+                "com.swago.app.MyFirebaseMessagingService" //这里的id里面输入自己的项目的包的路径
             )
-            notificationManager.createNotificationChannel(channel)
+        } else {
+            builder = NotificationCompat.Builder(this)
+        }
+
+        pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            PendingIntent.getActivity(this, 0, Intent(), PendingIntent.FLAG_IMMUTABLE)
+        } else {
+            PendingIntent.getActivity(this, 0, Intent(), PendingIntent.FLAG_UPDATE_CURRENT)
         }
-        notificationManager.notify(0, notificationBuilder.build())
+
+        builder.setContentTitle(title)
+            .setContentText(messageBody)
+            .setWhen(System.currentTimeMillis())
+            .setSmallIcon(R.mipmap.ic_launcher_foreground)
+            .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_foreground))
+            .setPriority(Notification.PRIORITY_MAX)
+            .setWhen(System.currentTimeMillis())
+            .setContentIntent(pendingIntent)
+            .setFullScreenIntent(pendingIntent, true)
+            .build()
+        val notification = builder.build()
+        manager.notify(1, notification)
     }
+
 }

+ 1 - 1
user/src/main/java/com/swago/user/store/BaseStoreDFragment.kt → baseswago/src/main/java/com/swago/baseswago/dialog/BaseStoreDFragment.kt

@@ -1,4 +1,4 @@
-package com.swago.user.store
+package com.swago.baseswago.dialog
 
 import android.os.Bundle
 import android.view.Gravity

+ 54 - 5
baseswago/src/main/java/com/swago/baseswago/dialog/TodayTrafficDialog.kt

@@ -1,21 +1,34 @@
 package com.swago.baseswago.dialog
 
+import android.graphics.Bitmap
 import android.graphics.Color
+import android.os.Build
 import android.os.Bundle
 import android.view.Gravity
+import android.view.ViewGroup
 import android.webkit.JavascriptInterface
+import android.webkit.WebChromeClient
+import android.webkit.WebSettings
+import android.webkit.WebView
 import android.webkit.WebViewClient
+import androidx.constraintlayout.widget.ConstraintLayout
+import androidx.transition.Visibility
+import com.google.firebase.firestore.core.View
 import com.swago.baseswago.databinding.DialogTodayTrafficBinding
+import com.swago.baseswago.util.DpPxUtil
+import com.swago.baseswago.util.SwagoInfo
+import com.swago.baseswago.util.UserInfo
+import org.json.JSONObject
 
-class TodayTrafficDialog : BaseXDFragment<DialogTodayTrafficBinding>() {
+class TodayTrafficDialog : BaseStoreDFragment<DialogTodayTrafficBinding>() {
     private var showDialog:Boolean = true
     private val jsLoad by lazy {
         JSLoad()
     }
     init {
         setGravity(Gravity.CENTER)
-        setDimAmount(0f)
-        setCanCancel(false)
+        setDimAmount(0.6f)
+        setCanCancel(true)
         setHeightMatchParent()
     }
 
@@ -29,18 +42,54 @@ class TodayTrafficDialog : BaseXDFragment<DialogTodayTrafficBinding>() {
     }
 
     override fun initOther() {
-        binding.webview.apply {
+        binding?.loadingProgress?.visibility = android.view.View.VISIBLE
+        binding?.webview?.apply {
+            //设置大小
+            val params = ConstraintLayout.LayoutParams(
+                ViewGroup.LayoutParams.MATCH_PARENT,
+                ViewGroup.LayoutParams.MATCH_PARENT
+            )
+            params.topMargin =  DpPxUtil.getScreenHeight()/6
+            this.layoutParams = params
+            try {
+                val jsonObject = JSONObject()
+                jsonObject.put("TokenParam", UserInfo.getLoginModel()?.token?:"")
+                jsonObject.put("UserIdParam", UserInfo.getUserInfo()?.id?:"")
+                jsonObject.put("LocaleParam", SwagoInfo.getLanguageCode())
+                jsonObject.put("AppVersionParam", SwagoInfo.getVersionCode())
+                jsonObject.put("ClientParam", SwagoInfo.getAppClient())
+                jsonObject.put("ChannelParam", SwagoInfo.getChannel())
+                jsonObject.put("DeviceParam", SwagoInfo.getDeviceInfo())
+                settings.userAgentString = settings.userAgentString + jsonObject.toString()
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+
+            if (Build.VERSION.SDK_INT >= 21) {
+                settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
+            }
             settings.javaScriptEnabled = true
             addJavascriptInterface(jsLoad, "melive")
+            settings.allowUniversalAccessFromFileURLs = true
             settings.allowFileAccess = true
+            settings.allowFileAccessFromFileURLs = true
             settings.useWideViewPort = true
             settings.loadWithOverviewMode = true
             settings.javaScriptCanOpenWindowsAutomatically = true//设置允许JS弹窗
             settings.domStorageEnabled = true
+            settings.cacheMode = WebSettings.LOAD_CACHE_ELSE_NETWORK
+            settings.domStorageEnabled = true
             isHorizontalScrollBarEnabled = true
             isVerticalScrollBarEnabled = true
+            settings.databaseEnabled = true
             setBackgroundColor(Color.TRANSPARENT)
-            webViewClient = WebViewClient()
+            webViewClient = object : WebViewClient(){
+                override fun onPageFinished(view: WebView?, url: String?) {
+                    super.onPageFinished(view, url)
+                    binding?.loadingProgress?.visibility = android.view.View.GONE
+
+                }
+            }
             loadUrl("http://test-h5.swago.cn/checkIn")
         }
     }

+ 16 - 1
baseswago/src/main/res/layout/dialog_today_traffic.xml

@@ -8,6 +8,21 @@
     <WebView
         android:id="@+id/webview"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
+        android:layout_height="match_parent"
+        android:layout_marginTop="80dp"/>
+
+    <ProgressBar
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:id="@+id/loading_progress"
+        style="?android:attr/progressBarStyle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:padding="6dp"
+        android:background="@drawable/shape_80000000_20"/>
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 7 - 0
baseswago/src/main/res/values-ar/strings.xml

@@ -363,4 +363,11 @@
     <string name="login_fail">فشل تسجيل الدخول</string>
     <string name="user_refused_invitation">رفض المستخدم دعوتك</string>
     <string name="user_agreed_invitation">وافق المستخدم على دعوتك</string>
+    <string name="user_above_level_10">يمكن للمستخدمين فوق المستوى 10 الحصول عليه</string>
+    <string name="pk_now_wait">المرساة الحالية هي PK، يرجى الانتظار </string>
+    <string name="congratulations">تهانينا!</string>
+    <string name="you_get">تحصل</string>
+    <string name="continue_in_room_earn_coins">ابق في الغرفة لمدة %s دقيقة لتربح عملات %s أخرى.</string>
+    <string name="please_setting_camera_microphone">رجى الانتقال إلى الإعدادات لتمكين أذونات الكاميرا </string>
+    <string name="successful_collection">تم الاستلام بنجاح</string>
 </resources>

+ 9 - 2
baseswago/src/main/res/values-in/strings.xml

@@ -52,11 +52,11 @@
     <string name="recharge_gear">List isi ulang</string>
     <string name="recharge">Isi ulang</string>
     <string name="daily_task">Tugas Harian</string>
-    <string name="newer_task">Tugas pengguna baru</string>
+    <string name="newer_task">Tugas Pengguna Baru</string>
     <string name="reward">Bonus:</string>
     <string name="exp">Pengalaman</string>
     <string name="receive">Terima</string>
-    <string name="uncomplete">Belum selesar</string>
+    <string name="uncomplete">Belum</string>
     <string name="complete">Selesai</string>
     <string name="live_end">Live ini telah terakhir</string>
     <string name="sure_close">Mengonfirmasi</string>
@@ -375,4 +375,11 @@
     <string name="login_fail">Gagal masuk</string>
     <string name="user_refused_invitation">Pengguna menolak undangan Anda</string>
     <string name="user_agreed_invitation">Pengguna menyetujui undangan Anda</string>
+    <string name="user_above_level_10">Pengguna di atas level 10 dapat menerimanya</string>
+    <string name="pk_now_wait">Host sedang PK, harap tunggu ya</string>
+    <string name="congratulations">Selamat!</string>
+    <string name="you_get">You get</string>
+    <string name="continue_in_room_earn_coins">Lanjutkan di ruangan host selama %s menit untuk mendapatkan %s koin lagi.</string>
+    <string name="please_setting_camera_microphone">Silakan mengaktifkan izin kamera dan mikrofon di pengaturan.</string>
+    <string name="successful_collection">Berhasil diterima</string>
 </resources>

+ 8 - 1
baseswago/src/main/res/values-ms/strings.xml

@@ -56,7 +56,7 @@
     <string name="reward">hadiah:</string>
     <string name="exp">pengalaman</string>
     <string name="receive">terima</string>
-    <string name="uncomplete">tidak di selesai kan</string>
+    <string name="uncomplete">Belum</string>
     <string name="complete">selesai</string>
     <string name="live_end">Live telah sampai ke penghujungnya</string>
     <string name="sure_close">mengesahkan</string>
@@ -375,4 +375,11 @@
     <string name="login_fail">Daftar masuk gagal</string>
     <string name="user_refused_invitation">Pengguna menolak jemputan anda</string>
     <string name="user_agreed_invitation">Pengguna menerima jemputan anda</string>
+    <string name="user_above_level_10">Pengguna di atas level 10 dapat menerimanya</string>
+    <string name="pk_now_wait">Host sedang PK, harap tunggu ya</string>
+    <string name="congratulations">Selamat!</string>
+    <string name="you_get">You get</string>
+    <string name="continue_in_room_earn_coins">Lanjutkan di ruangan host selama %s menit untuk mendapatkan %s koin lagi.</string>
+    <string name="please_setting_camera_microphone">Silakan mengaktifkan izin kamera dan mikrofon di pengaturan.</string>
+    <string name="successful_collection">Berhasil diterima</string>
 </resources>

+ 7 - 0
baseswago/src/main/res/values-zh/strings.xml

@@ -363,4 +363,11 @@
     <string name="login_fail">登录失败</string>
     <string name="user_refused_invitation">用户拒绝了你的邀请</string>
     <string name="user_agreed_invitation">用户同意了你的邀请</string>
+    <string name="user_above_level_10">10级以上用户可以领取</string>
+    <string name="pk_now_wait">当前主播正在PK,请稍后</string>
+    <string name="congratulations">Congratulations!</string>
+    <string name="you_get">You get</string>
+    <string name="continue_in_room_earn_coins">Continue in the room for %s mins to earn another %s coins.</string>
+    <string name="please_setting_camera_microphone">请到设置里开启相机和麦克风权限</string>
+    <string name="successful_collection">领取成功</string>
 </resources>

+ 7 - 0
baseswago/src/main/res/values/strings.xml

@@ -395,4 +395,11 @@
     <string name="login_fail">login fail</string>
     <string name="user_refused_invitation">user refused your invitation</string>
     <string name="user_agreed_invitation">user agreed your invitation</string>
+    <string name="user_above_level_10">Users above level 10 can obtain it</string>
+    <string name="pk_now_wait">Host on pk now , pls wait and try again </string>
+    <string name="congratulations">Congratulations!</string>
+    <string name="you_get">You get</string>
+    <string name="continue_in_room_earn_coins">Continue in the room for %s mins to earn another %s coins.</string>
+    <string name="please_setting_camera_microphone">Please go to settings to enable camera and microphone permissions</string>
+    <string name="successful_collection">Successful collection</string>
 </resources>

+ 1 - 5
home/src/main/java/com/swago/home/HomeActivity.kt

@@ -61,11 +61,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
         arrayListOf(HomeFragment(), MessageFragment(), MineFragment())
 
     override fun loadData() {
-        UserInfo.getUserInfo()?.let{
-            if (!it.is_zhuanpan_every_day){
-                TodayTrafficDialog.newInstance().show(supportFragmentManager,"TodayTrafficDialog")
-            }
-        }
+
     }
 
     override fun initOther() {

+ 26 - 2
home/src/main/java/com/swago/home/HomeFragment.kt

@@ -5,7 +5,9 @@ import android.content.Context
 import android.content.Intent
 import android.graphics.Color
 import android.graphics.Typeface
+import android.net.Uri
 import android.os.Build
+import android.provider.Settings
 import android.view.View
 import android.widget.Toast
 import androidx.fragment.app.activityViewModels
@@ -17,10 +19,13 @@ import com.swago.baseswago.SwagoAdapter
 import com.swago.baseswago.UserVm
 import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.constant.UrlConstant
+import com.swago.baseswago.dialog.TodayTrafficDialog
 import com.swago.baseswago.fragment.BaseXFragment
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.DpPxUtil
 import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.baseswago.util.SwagoInfo
+import com.swago.baseswago.util.UserInfo
 import com.swago.home.databinding.FragmentHomeBinding
 import com.swago.home.innerhome.FollowFragment
 import com.swago.home.innerhome.HotFragment
@@ -34,6 +39,7 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTit
 import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator
 import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView
 
+
 /**
  *@date 2021/11/20 10:31
  *description:
@@ -51,6 +57,13 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
 
 
     override fun loadData() {
+        UserInfo.getUserInfo()?.let{
+            if (!it.is_zhuanpan_every_day){
+                TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
+            }
+        }.also {
+            TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
+        }
     }
 
     override fun initOther() {
@@ -130,11 +143,17 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
                                 ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
                             } else {
                                 binding.ivLive.isEnabled = true
+                                val intent = Intent()
+                                intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
+                                val uri = Uri.fromParts("package", activity?.packageName, null)
+                                intent.setData(uri)
+                                startActivity(intent)
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    AppContext.getContext().getString(R.string.please_setting_camera_microphone),
                                     Toast.LENGTH_LONG
                                 ).show()
+
                             }
                         }
                 } else {
@@ -146,9 +165,14 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
                                 ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
                             } else {
                                 binding.ivLive.isEnabled = true
+                                val intent = Intent()
+                                intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
+                                val uri = Uri.fromParts("package", activity?.packageName, null)
+                                intent.setData(uri)
+                                startActivity(intent)
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    AppContext.getContext().getString(R.string.please_setting_camera_microphone),
                                     Toast.LENGTH_LONG
                                 ).show()
                             }

+ 2 - 1
room/src/main/java/com/swago/room/reward/GetRewardsDialog.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.view.Gravity
 import com.swago.baseswago.dialog.BaseXDFragment
 import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.room.R
 import com.swago.room.databinding.DialogGetRewardsBinding
 
 class GetRewardsDialog : BaseXDFragment<DialogGetRewardsBinding>() {
@@ -35,7 +36,7 @@ class GetRewardsDialog : BaseXDFragment<DialogGetRewardsBinding>() {
             val nextCoins = it.getInt("nextCoins")
             val nextTimes = it.getInt("nextTimes")
             binding.tvCoins.text = "+${coins}"
-            binding.tvHint.text= "Continue in the room for ${nextTimes} mins to earn another ${nextCoins} coins."
+            binding.tvHint.text= getString(R.string.continue_in_room_earn_coins).format(nextTimes,nextCoins)
 
         }
 

+ 10 - 10
room/src/main/java/com/swago/room/reward/RewardView.kt

@@ -58,7 +58,7 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 if (rewardsModel == null) {
                     Toast.makeText(
                         AppContext.getContext(),
-                        "10级以上用户可以领取",
+                        AppContext.getContext().getString(R.string.user_above_level_10),
                         Toast.LENGTH_SHORT
                     ).show()
                     return
@@ -162,17 +162,17 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                     nextReward()
                 }
                 "ten" -> {
-                    totalTime = totalTime.coerceAtLeast(600)
+                    totalTime = totalTime.coerceAtLeast(900)
                     rewardsModel?.ten = true
                     nextReward()
                 }
                 "fifteen" -> {
-                    totalTime = totalTime.coerceAtLeast(900)
+                    totalTime = totalTime.coerceAtLeast(1800)
                     rewardsModel?.fifteen = true
                     nextReward()
                 }
                 "thirty" -> {
-                    totalTime = totalTime.coerceAtLeast(1800)
+                    totalTime = totalTime.coerceAtLeast(3600)
                     rewardsModel?.thirty = true
                     visibility = View.GONE
                     showChangeRoom = false
@@ -206,10 +206,10 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 binding?.tvCoins?.text = "+${model.coin.ten}"
 
                 //领取奖励倒计时
-                if (totalTime >= 600){
+                if (totalTime >= 900){
                     startGetAnimation()
                 } else {
-                    timeL = 600 - totalTime
+                    timeL = 900 - totalTime
                     binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
                 }
             } else if (!model.fifteen){
@@ -220,10 +220,10 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 nextTime = 30
                 binding?.tvCoins?.text = "+${model.coin.fifteen}"
                 //领取奖励倒计时
-                if (totalTime >= 900){
+                if (totalTime >= 1800){
                     startGetAnimation()
                 } else {
-                    timeL = 900 - totalTime
+                    timeL = 1800 - totalTime
                     binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
                 }
             } else if (!model.thirty){
@@ -234,10 +234,10 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 nextTime = 0
                 binding?.tvCoins?.text = "+${model.coin.thirty}"
                 //领取奖励倒计时
-                if (totalTime >= 1800){
+                if (totalTime >= 3600){
                     startGetAnimation()
                 } else {
-                    timeL = 1800 - totalTime
+                    timeL = 3600 - totalTime
                     binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
                 }
             } else {

+ 6 - 5
room/src/main/java/com/swago/room/user/UserRoomFragment.kt

@@ -50,9 +50,11 @@ import kotlinx.coroutines.launch
  *description:
  */
 class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
-
+    private var isSameDate:Boolean = false
     override fun initOther() {
         super.initOther()
+        isSameDate = SpUtil.readString("last_visit_date") == TimeUtil.getCurrentDate()
+        SpUtil.putString("last_visit_date", TimeUtil.getCurrentDate())
         binding.ivBenefit.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {
                 openBenefitBagDialog()
@@ -279,10 +281,9 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
                 AudioNoticeUserDialog.newInstance().show(childFragmentManager,"AudioNoticeUserDialog")
             }
         }
-        UserInfo.getUserInfo()?.let {
-            if (it.isFirst_charge){
-                openBenefitBagDialog()
-            }
+        if (!isSameDate){
+            isSameDate = true
+            openBenefitBagDialog()
         }
     }
 

+ 1 - 1
room/src/main/java/com/swago/room/vm/RoomVm.kt

@@ -547,7 +547,7 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
                  getRewardsSuccess.value = true
                 Toast.makeText(
                     AppContext.getContext(),
-                    "success",
+                    AppContext.getContext().getString(R.string.successful_collection),
                     Toast.LENGTH_SHORT
                 ).show()
             }

+ 2 - 2
room/src/main/res/layout/dialog_get_rewards.xml

@@ -22,7 +22,7 @@
             android:textSize="16sp"
             android:textStyle="bold"
             android:textColor="@color/_ffffff"
-            android:text="Congratulations!"
+            android:text="@string/congratulations"
             android:drawablePadding="2dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"/>
@@ -34,7 +34,7 @@
             android:layout_marginTop="12dp"
             android:textSize="14sp"
             android:textColor="@color/_ffffff"
-            android:text="You get"
+            android:text="@string/you_get"
             android:drawablePadding="2dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"/>

+ 1 - 1
room/src/main/res/layout/fragment_base_com.xml

@@ -111,7 +111,7 @@
         android:id="@+id/ivRewards"
         app:layout_constraintTop_toBottomOf="@+id/ivBenefit"
         app:layout_constraintEnd_toEndOf="parent"
-        android:layout_marginEnd="10dp"
+        android:layout_marginEnd="6dp"
         tools:visibility="visible"
         android:visibility="gone"
         android:layout_marginTop="@dimen/dp_10"

+ 1 - 1
room/src/main/res/layout/view_rewards.xml

@@ -35,7 +35,7 @@
         android:textSize="10dp"
         android:textColor="#fff"
         tools:text="0"
-        android:text="50"
+        android:text="20"
         android:layout_marginEnd="@dimen/dp_4"
         android:gravity="center"
         android:drawableLeft="@mipmap/ic_coin_store"

+ 1 - 6
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -3,24 +3,19 @@ package com.swago.user.store
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
-import android.view.View.OnClickListener
 import android.widget.Toast
-import androidx.activity.viewModels
 import androidx.fragment.app.viewModels
 import com.opensource.svgaplayer.SVGADrawable
 import com.opensource.svgaplayer.SVGAParser
-import com.opensource.svgaplayer.SVGASoundManager
 import com.opensource.svgaplayer.SVGAVideoEntity
-import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.dialog.BaseStoreDFragment
 import com.swago.baseswago.model.mine.StoreItemBean
 import com.swago.baseswago.util.AppContext
-import com.swago.baseswago.util.LogUtil
 import com.swago.baseswago.util.NoDoubleClickListener
 import com.swago.loadUrl
 import com.swago.user.R
 import com.swago.user.databinding.DialogStoreDetailBinding
 import com.swago.user.vm.StoreVm
-import java.io.File
 import java.net.URL
 
 class StoreBuyDialog : BaseStoreDFragment<DialogStoreDetailBinding>() {

+ 1 - 1
user/src/main/java/com/swago/user/task/TaskActivity.kt

@@ -54,7 +54,7 @@ class TaskActivity : BaseXActivity<ActivityTaskBinding>(){
                 val simplePagerTitleView = SimplePagerTitleView(context)
                 simplePagerTitleView.text = listTitles[index]
                 val padding = DpPxUtil.dip2px(15f).toFloat()
-                simplePagerTitleView.textSize = 16f
+                simplePagerTitleView.textSize = 14f
                 simplePagerTitleView.typeface = Typeface.createFromAsset(AppContext.getContext().assets,"bold.otf")
                 simplePagerTitleView.setPadding(padding.toInt(), 0, padding.toInt(), 0)
                 simplePagerTitleView.normalColor = Color.parseColor("#828C9D")

+ 9 - 10
user/src/main/res/layout/item_task.xml

@@ -20,40 +20,39 @@
 
     <TextView
         android:id="@+id/tvReward"
-        android:textSize="14dp"
+        android:textSize="12sp"
         android:textColor="#868686"
         android:text = "@string/reward"
-        android:layout_marginTop="5dp"
         android:layout_marginBottom="10dp"
         android:layout_marginStart="15dp"
+        android:layout_marginTop="@dimen/dp_4"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/tvTitle"
-        app:layout_constraintBottom_toBottomOf="parent"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
     <TextView
         android:id="@+id/tvRewardType"
-        android:textSize="14dp"
+        android:textSize="12sp"
         android:textColor="#868686"
         tools:text="经验"
-        android:layout_marginTop="5dp"
+        android:layout_marginStart="15dp"
         android:layout_marginBottom="10dp"
-        app:layout_constraintStart_toEndOf="@+id/tvReward"
-        app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tvReward"
         app:layout_constraintBottom_toBottomOf="parent"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
     <TextView
         android:id="@+id/tvRewardTypeValue"
-        android:textSize="14dp"
+        android:textSize="12sp"
         android:text="+10"
         android:textColor="#FF9300"
-        android:layout_marginTop="5dp"
         android:layout_marginBottom="10dp"
+        android:layout_marginStart="@dimen/dp_4"
         app:layout_constraintStart_toEndOf="@+id/tvRewardType"
-        app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+        app:layout_constraintTop_toBottomOf="@+id/tvReward"
         app:layout_constraintBottom_toBottomOf="parent"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>