| @@ -19,8 +19,8 @@ android { | |||||
| // minSdkVersion 26 | // minSdkVersion 26 | ||||
| minSdkVersion 21 | minSdkVersion 21 | ||||
| targetSdkVersion 25 | targetSdkVersion 25 | ||||
| versionCode 30001 | |||||
| versionName "3.0.1" | |||||
| versionCode 30003 | |||||
| versionName "3.0.3" | |||||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
| ndk { | ndk { | ||||
| @@ -87,11 +87,11 @@ android { | |||||
| shrinkResources false | shrinkResources false | ||||
| // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | ||||
| // buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | // buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | ||||
| buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | |||||
| // buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | |||||
| buildConfigField "String", "OA_URL", '"https://oa.live.educlouddata.com"' | buildConfigField "String", "OA_URL", '"https://oa.live.educlouddata.com"' | ||||
| // buildConfigField "String", "OA_URL", '"http://192.168.69.114:3000"' | // buildConfigField "String", "OA_URL", '"http://192.168.69.114:3000"' | ||||
| buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | ||||
| // buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com/api"' | |||||
| buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com/api"' | |||||
| buildConfigField "String", "APP_NAME", '"一体化平台(开发)"' | buildConfigField "String", "APP_NAME", '"一体化平台(开发)"' | ||||
| buildConfigField "String", "MP_APPID", '"wxbb397ddae71bb14c"' | buildConfigField "String", "MP_APPID", '"wxbb397ddae71bb14c"' | ||||
| // buildConfigField "String", "WS_URL", '"ws://192.168.69.114:9801/"' | // buildConfigField "String", "WS_URL", '"ws://192.168.69.114:9801/"' | ||||
| @@ -136,6 +136,7 @@ class ClassBrandFragment : BaseFragment<ClassBrandPresenter>(), ClassBrandView { | |||||
| getOtherData() | getOtherData() | ||||
| dialog.dismiss() | dialog.dismiss() | ||||
| classNameTv.text = "${currClass.grade_name}${currClass.class_name}" | classNameTv.text = "${currClass.grade_name}${currClass.class_name}" | ||||
| classStar.setStar(currClass.star_num) | |||||
| SPUtils.getInstance().put("local_class_id", currClass.class_id) | SPUtils.getInstance().put("local_class_id", currClass.class_id) | ||||
| } | } | ||||
| } | } | ||||
| @@ -216,7 +217,7 @@ class ClassBrandFragment : BaseFragment<ClassBrandPresenter>(), ClassBrandView { | |||||
| getClassInfo() | getClassInfo() | ||||
| mClassInfoHandler.postDelayed(mClassInfoRunnable,mClassInfoLoopTime) | mClassInfoHandler.postDelayed(mClassInfoRunnable,mClassInfoLoopTime) | ||||
| classNameTv.text = "${currClass.grade_name}${currClass.class_name}" | classNameTv.text = "${currClass.grade_name}${currClass.class_name}" | ||||
| classStar.setStar(currClass.star_num) | |||||
| classSwIcon.visibility = if (list.size > 1) { | classSwIcon.visibility = if (list.size > 1) { | ||||
| View.VISIBLE | View.VISIBLE | ||||
| } else { | } else { | ||||
| @@ -18,8 +18,8 @@ data class ClassTeacher( | |||||
| ) | ) | ||||
| data class UserPhoto( | data class UserPhoto( | ||||
| val head_portrait: String = "", | |||||
| val identity: String = "" | |||||
| val head_portrait: String ?= "", | |||||
| val identity: String ?= "" | |||||
| ) | ) | ||||
| data class ClassTeaInfo( | data class ClassTeaInfo( | ||||
| @@ -72,4 +72,5 @@ data class HeadClassInfo( | |||||
| val class_name: String = "", | val class_name: String = "", | ||||
| val grade_id: Int = 0, | val grade_id: Int = 0, | ||||
| val grade_name: String = "", | val grade_name: String = "", | ||||
| val star_num: Int = 0, | |||||
| ) | ) | ||||
| @@ -54,7 +54,7 @@ class ClassBrandPresenter(view: ClassBrandView) : BasePresenter<ClassBrandView>( | |||||
| LogUtils.d(response) | LogUtils.d(response) | ||||
| if (response?.isSuccessful == true) { | if (response?.isSuccessful == true) { | ||||
| val info = response.body().data | val info = response.body().data | ||||
| mView?.onAvatarSuccess(info.user_photo.identity,info.user_photo.head_portrait) | |||||
| mView?.onAvatarSuccess(info.user_photo.identity?:"",info.user_photo.head_portrait?:"") | |||||
| mView?.onClassInfoSuccess(response.body().data) | mView?.onClassInfoSuccess(response.body().data) | ||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,74 @@ | |||||
| package com.yzx.ebrand.widget | |||||
| import android.annotation.SuppressLint | |||||
| import android.content.Context | |||||
| import android.util.AttributeSet | |||||
| import android.view.LayoutInflater | |||||
| import android.view.animation.AlphaAnimation | |||||
| import android.view.animation.Animation | |||||
| import android.view.animation.LinearInterpolator | |||||
| import android.widget.FrameLayout | |||||
| import android.widget.ImageView | |||||
| import androidx.appcompat.widget.LinearLayoutCompat | |||||
| import com.yzx.ebrand.R | |||||
| import kotlinx.android.synthetic.main.view_time.view.* | |||||
| import org.jetbrains.anko.dip | |||||
| class ClassStar(context: Context, attrs: AttributeSet) : | |||||
| FrameLayout(context, attrs) { | |||||
| lateinit var p: LinearLayoutCompat | |||||
| init { | |||||
| p = LayoutInflater.from(context).inflate(R.layout.class_star, null) as LinearLayoutCompat | |||||
| addView(p) | |||||
| // setStar() | |||||
| } | |||||
| @SuppressLint("SetTextI18n") | |||||
| fun setStar(num: Int = 1) { | |||||
| for (i in 0 until p.childCount) { | |||||
| val child = p.getChildAt(i) | |||||
| child.clearAnimation() | |||||
| } | |||||
| p.removeAllViews() | |||||
| p.clearAnimation() | |||||
| if (num <= 0) { | |||||
| return | |||||
| } | |||||
| val resId = when { | |||||
| num >= 6 -> R.mipmap.icon_gold | |||||
| num == 5 -> R.mipmap.icon_silvery | |||||
| else -> R.mipmap.icon_coppery | |||||
| } | |||||
| for (i in 1..num) { | |||||
| val startView = ImageView(context) | |||||
| val lp = LinearLayoutCompat.LayoutParams(dip(35), dip(32)) | |||||
| lp.leftMargin = dip(15) | |||||
| lp.setMargins(dip(15), 0, 0, 0) | |||||
| startView.setImageResource(resId) | |||||
| startView.clearAnimation() | |||||
| // startView.setBackgroundResource(R.drawable.gold_shadow) | |||||
| // (startView.background as AnimationDrawable).start() | |||||
| if (num >= 6) { | |||||
| flicker(startView, i, num) | |||||
| } | |||||
| p.addView(startView, lp) | |||||
| } | |||||
| p.requestLayout() | |||||
| } | |||||
| private fun flicker(startView: ImageView, index: Int, total: Int) { | |||||
| val anim = AlphaAnimation(0.3f, 1f) | |||||
| anim.duration = 200L | |||||
| anim.interpolator = LinearInterpolator() | |||||
| anim.repeatCount = Animation.INFINITE | |||||
| anim.repeatMode = Animation.REVERSE | |||||
| anim.startOffset = (index - 1) * (200L/total) | |||||
| startView.animation = anim | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,5 @@ | |||||
| <animation-list xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:oneshot="false"> | |||||
| <item android:drawable="@color/gold" android:duration="300" /> | |||||
| <item android:drawable="@android:color/transparent" android:duration="300" /> | |||||
| </animation-list> | |||||
| @@ -0,0 +1,32 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal"> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| <!-- <ImageView--> | |||||
| <!-- android:src="@mipmap/icon_gold"--> | |||||
| <!-- style="@style/star_item"--> | |||||
| <!-- />--> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| @@ -0,0 +1,7 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <ImageView xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="35dp" | |||||
| android:layout_height="32dp" | |||||
| android:layout_marginStart="20dp"> | |||||
| </ImageView> | |||||
| @@ -67,6 +67,12 @@ | |||||
| android:layout_height="32dp" | android:layout_height="32dp" | ||||
| android:layout_marginStart="@dimen/d_20" | android:layout_marginStart="@dimen/d_20" | ||||
| android:src="@mipmap/icon_class_sw" /> | android:src="@mipmap/icon_class_sw" /> | ||||
| <com.yzx.ebrand.widget.ClassStar | |||||
| android:id="@+id/classStar" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="32dp"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | </androidx.appcompat.widget.LinearLayoutCompat> | ||||
| <ImageView | <ImageView | ||||
| @@ -13,7 +13,7 @@ | |||||
| android:id="@+id/lessonNoTv" | android:id="@+id/lessonNoTv" | ||||
| android:layout_width="0dp" | android:layout_width="0dp" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:layout_weight="2" | |||||
| android:layout_weight="1" | |||||
| android:text="第一节" | android:text="第一节" | ||||
| android:textColor="@color/white" | android:textColor="@color/white" | ||||
| android:textSize="@dimen/d_20" /> | android:textSize="@dimen/d_20" /> | ||||
| @@ -22,7 +22,7 @@ | |||||
| android:id="@+id/lessonNameTv" | android:id="@+id/lessonNameTv" | ||||
| android:layout_width="0dp" | android:layout_width="0dp" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:layout_weight="1" | |||||
| android:layout_weight="2" | |||||
| android:text="语文" | android:text="语文" | ||||
| android:textColor="@color/white" | android:textColor="@color/white" | ||||
| android:textSize="@dimen/d_20" /> | android:textSize="@dimen/d_20" /> | ||||
| @@ -107,4 +107,5 @@ | |||||
| <color name="nb.read.menu.bg">#ffffff</color> | <color name="nb.read.menu.bg">#ffffff</color> | ||||
| <color name="nb.read.menu.text">#CBCBCB</color> | <color name="nb.read.menu.text">#CBCBCB</color> | ||||
| <color name="nb.read.bar.translucent">#88000000</color> | <color name="nb.read.bar.translucent">#88000000</color> | ||||
| <color name="gold">#33fff87d</color> | |||||
| </resources> | </resources> | ||||
| @@ -227,4 +227,10 @@ | |||||
| <item name="android:textSize">@dimen/d_28</item> | <item name="android:textSize">@dimen/d_28</item> | ||||
| <item name="android:textStyle">bold</item> | <item name="android:textStyle">bold</item> | ||||
| </style> | </style> | ||||
| <style name="star_item"> | |||||
| <item name="android:layout_width">35dp</item> | |||||
| <item name="android:layout_height">32dp</item> | |||||
| <item name="android:layout_marginStart">20dp</item> | |||||
| </style> | |||||
| </resources> | </resources> | ||||