Commit 5b259dd7 by konghaorui

调试环境注释埋点代码,titlebar 新增属性 pa_left_start_icon_color

parent f69402af
...@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android' ...@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'trace-point' //apply plugin: 'trace-point'
kapt { kapt {
arguments { arguments {
...@@ -191,21 +191,21 @@ dependencies { ...@@ -191,21 +191,21 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
} }
//
noTracePoint { //noTracePoint {
outputModifyFile = false // outputModifyFile = false
targetPackages = ['com.cxzapp.yidianling', // targetPackages = ['com.cxzapp.yidianling',
'com.yidianling.consultant', // 'com.yidianling.consultant',
'com.yidianling.course', // 'com.yidianling.course',
'com.yidianling.dynamic', // 'com.yidianling.dynamic',
'com.ydl.home_module', // 'com.ydl.home_module',
'com.yidianling.fm', // 'com.yidianling.fm',
'com.yidianling.im', // 'com.yidianling.im',
'com.yidianling.avchatkit', // 'com.yidianling.avchatkit',
'com.yidianling.uikit', // 'com.yidianling.uikit',
'com.yidianling.phonecall', // 'com.yidianling.phonecall',
'com.yidianling.tests', // 'com.yidianling.tests',
'com.yidianling.user', // 'com.yidianling.user',
'com.yidianling.ydlcommon', // 'com.yidianling.ydlcommon',
] // ]
} //}
...@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.mvp.lce.BaseLceActivity ...@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import com.yidianling.tests.home.TestHomeActivity
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
/** /**
...@@ -76,6 +77,9 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -76,6 +77,9 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_music.setOnClickListener { bt_to_music.setOnClickListener {
startActivity(Intent(this, MusicPlayActivity::class.java)) startActivity(Intent(this, MusicPlayActivity::class.java))
} }
bt_to_tests.setOnClickListener {
startActivity(Intent(this, TestHomeActivity::class.java))
}
bt_to_muse.setOnClickListener { bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE, YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3") YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3")
......
...@@ -154,7 +154,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -154,7 +154,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
break; break;
case R.id.iv_play: case R.id.iv_play:
play(); play();
if(PlayerFloatHelper.Companion.isShow(getActivity())) { if(!PlayerFloatHelper.Companion.isShow(getActivity())) {
PlayerFloatHelper.Companion.show(getActivity(), PlayTypeEnum.PLAY_TYPE_FM,new HashMap<>()); PlayerFloatHelper.Companion.show(getActivity(), PlayTypeEnum.PLAY_TYPE_FM,new HashMap<>());
}else { }else {
PlayerFloatHelper.Companion.showIfPlaying(getActivity()); PlayerFloatHelper.Companion.showIfPlaying(getActivity());
......
...@@ -109,6 +109,20 @@ ...@@ -109,6 +109,20 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt_to_tests"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:text="Jump to Tests" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView <com.ydl.ydlcommon.mvp.lce.view.YDLStateView
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<item name="colorPrimary">@color/consultant_main_theme</item> <item name="colorPrimary">@color/consultant_main_theme</item>
<item name="colorPrimaryDark">@color/consultant_main_theme</item> <item name="colorPrimaryDark">@color/consultant_main_theme</item>
<item name="colorAccent">@color/consultant_main_theme</item> <item name="colorAccent">@color/consultant_main_theme</item>
</style> </style>
<style name="consultant_expert_service_popupwindow_filter_anim_style"> <style name="consultant_expert_service_popupwindow_filter_anim_style">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<activity <activity
android:name=".list.view.TestCategoryListActivity" android:name=".list.view.TestCategoryListActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" android:theme="@style/tests_NoTitleTheme"
/> />
<activity <activity
android:name=".SelectConversationActivity" android:name=".SelectConversationActivity"
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<activity <activity
android:name=".search.TestSearchActivity" android:name=".search.TestSearchActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" android:theme="@style/tests_NoTitleTheme"
/> />
<!--测评首页--> <!--测评首页-->
<activity <activity
......
...@@ -10,7 +10,7 @@ import android.view.View ...@@ -10,7 +10,7 @@ import android.view.View
import android.widget.TextView import android.widget.TextView
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.MainUtils import com.ydl.ydlcommon.utils.MainUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
...@@ -256,8 +256,7 @@ class TestHomeUtils { ...@@ -256,8 +256,7 @@ class TestHomeUtils {
* 只有当和上一次优惠券金额不一致时才会发事件通知更新 * 只有当和上一次优惠券金额不一致时才会发事件通知更新
*/ */
fun updateCouponMoney(){ fun updateCouponMoney(){
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo() var userId = ModularServiceManager.getPlatformUserService()?.getUser()?.userId?: "";
var userId = loginBean?.userId ?: "";
TestRetrofitApi.getTestRetrofitApi() TestRetrofitApi.getTestRetrofitApi()
.fetchMaxCoupon(userId) .fetchMaxCoupon(userId)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
......
...@@ -6,14 +6,14 @@ import com.ydl.ydl_router.manager.YDLRouterManager ...@@ -6,14 +6,14 @@ import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.tests.api.service.ITestsApiSerivice import com.yidianling.tests.api.service.ITestsApiService
/** /**
* Created by haorui on 2019-10-31 . * Created by haorui on 2019-10-31 .
* Des: * Des:
*/ */
@Route(path = "/tests/TestsApiService") @Route(path = "/tests/TestsApiService")
public class TestsApiServiceImp : ITestsApiSerivice { public class TestsApiServiceImp : ITestsApiService {
override fun init(context: Context?) { override fun init(context: Context?) {
} }
......
...@@ -2,7 +2,7 @@ package com.yidianling.tests.api.service ...@@ -2,7 +2,7 @@ package com.yidianling.tests.api.service
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
interface ITestsApiSerivice : IProvider { interface ITestsApiService : IProvider {
fun testDetailH5(testId: String) fun testDetailH5(testId: String)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<com.ydl.ydlcommon.view.TitleBar <com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height" android:layout_height="@dimen/platform_title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back" app:pa_left_start_icon_color="@color/tests_main_theme"
app:pa_title_text="最新联系人" /> app:pa_title_text="最新联系人" />
<RelativeLayout <RelativeLayout
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height" android:layout_height="@dimen/platform_title_bar_height"
app:pa_bm_line_color="@color/transparent" app:pa_bm_line_color="@color/transparent"
app:pa_left_start_icon="@drawable/platform_toolbar_back" app:pa_left_start_icon_color="@color/tests_main_theme"
app:pa_right_iv="@drawable/platform_more12x" app:pa_right_iv="@drawable/platform_more12x"
app:pa_right_start_icon="@drawable/tests_icon_navsearch_green" app:pa_right_start_icon="@drawable/tests_icon_navsearch_green"
app:pa_title_text="心理测试" /> app:pa_title_text="心理测试" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout" android:id="@+id/swipe_refresh_layout"
...@@ -19,7 +20,10 @@ ...@@ -19,7 +20,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" /> android:visibility="gone" />
<include layout="@layout/tests_testhome_bar" /> <include layout="@layout/tests_testhome_bar" />
</FrameLayout> </FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout> </FrameLayout>
...@@ -19,4 +19,15 @@ ...@@ -19,4 +19,15 @@
<item name="android:paddingLeft">15dp</item> <item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item> <item name="android:paddingRight">15dp</item>
</style> </style>
<style name="tests_NoTitleTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowActionBar">false</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/tests_main_theme</item>
<item name="colorPrimaryDark">@color/tests_main_theme</item>
<item name="colorAccent">@color/tests_main_theme</item>
</style>
</resources> </resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--主题色-->
<color name="tests_main_theme">#fdbd00</color>
<!--主题浅色-->
<color name="tests_main_theme_light">#FFEC8C</color>
<!--主题亮色-->
<color name="tests_main_theme_bright">#fffae0</color>
<!--确认按钮背景颜色-->
<color name="tests_confirm_bg_color">#FFDD33</color>
<!--确认按钮字体颜色-->
<color name="tests_confirm_text_color">#242424</color>
<!--确认按钮提示字体颜色-->
<color name="tests_confirm_text_hint_color">#666666</color>
<!--筛选条件选择框字体颜色-->
<color name="tests_filter_content_text_color_en">#242424</color>
<color name="tests_filter_content_text_color_un">#555555</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--主题色-->
<color name="tests_main_theme">#1da1f2</color>
<!--主题浅色-->
<color name="tests_main_theme_light">#60BDF5</color>
<!--主题亮色-->
<color name="tests_main_theme_bright">#E8F6FF</color>
<!--确认按钮背景颜色-->
<color name="tests_confirm_bg_color">#1da1f2</color>
<!--确认按钮颜色-->
<color name="tests_confirm_text_color">#ffffff</color>
<!--确认提示颜色-->
<color name="tests_confirm_text_hint_color">#60ffffff</color>
<!--筛选条件选择框字体颜色-->
<color name="tests_filter_content_text_color_en">#1da1f2</color>
<color name="tests_filter_content_text_color_un">#242424</color>
</resources>
...@@ -2,7 +2,11 @@ package com.ydl.ydlcommon.view; ...@@ -2,7 +2,11 @@ package com.ydl.ydlcommon.view;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
...@@ -13,8 +17,9 @@ import android.widget.ImageView; ...@@ -13,8 +17,9 @@ import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.yidianling.common.tools.RxImageTool;
import com.ydl.ydlcommon.R; import com.ydl.ydlcommon.R;
import com.ydl.ydlcommon.utils.bitmap.BitmapUtils;
import com.yidianling.common.tools.RxImageTool;
/** /**
...@@ -31,6 +36,8 @@ public class TitleBar extends RelativeLayout { ...@@ -31,6 +36,8 @@ public class TitleBar extends RelativeLayout {
int mTextColor, mSideTextColor; int mTextColor, mSideTextColor;
//底部线颜色 //底部线颜色
int buttom_color; int buttom_color;
//左侧图标颜色
int mLeftStartIconColor ;
//文字内容 //文字内容
String mLeftText, mTitle, mRightText; String mLeftText, mTitle, mRightText;
...@@ -206,6 +213,10 @@ public class TitleBar extends RelativeLayout { ...@@ -206,6 +213,10 @@ public class TitleBar extends RelativeLayout {
mSideTextColor = a.getColor(R.styleable.Platform_TitleBar_pa_side_text_color, 0xff3c3c3c); mSideTextColor = a.getColor(R.styleable.Platform_TitleBar_pa_side_text_color, 0xff3c3c3c);
//底部线颜色 //底部线颜色
buttom_color = a.getColor(R.styleable.Platform_TitleBar_pa_bm_line_color, getResources().getColor(R.color.platform_divide_color)); buttom_color = a.getColor(R.styleable.Platform_TitleBar_pa_bm_line_color, getResources().getColor(R.color.platform_divide_color));
//左侧图标颜色
mLeftStartIconColor = a.getColor(R.styleable.Platform_TitleBar_pa_left_start_icon_color, 0xffffff);
a.recycle(); a.recycle();
setGravity(Gravity.CENTER_VERTICAL); setGravity(Gravity.CENTER_VERTICAL);
} }
...@@ -229,11 +240,10 @@ public class TitleBar extends RelativeLayout { ...@@ -229,11 +240,10 @@ public class TitleBar extends RelativeLayout {
} }
void setupView() { void setupView() {
//左侧部分 //左侧部分
tv_left_text.setText(mLeftText); tv_left_text.setText(mLeftText);
tv_left_text.setTextColor(mSideTextColor); tv_left_text.setTextColor(mSideTextColor);
tv_left_text.setCompoundDrawablesWithIntrinsicBounds(mLeftStartIcon, null, mLeftEndIcon, null); tv_left_text.setCompoundDrawablesWithIntrinsicBounds(getLeftStartIcon(), null, mLeftEndIcon, null);
//中间部分 //中间部分
tv_center_title.setText(mTitle); tv_center_title.setText(mTitle);
tv_center_title.setTextColor(mTextColor); tv_center_title.setTextColor(mTextColor);
...@@ -252,6 +262,18 @@ public class TitleBar extends RelativeLayout { ...@@ -252,6 +262,18 @@ public class TitleBar extends RelativeLayout {
} }
Drawable getLeftStartIcon(){
if(mLeftStartIconColor != 0xffffff && mLeftStartIcon == null) {
//动态设置返回图标颜色
Resources resources = this.getResources();
Bitmap bmp = BitmapFactory.decodeResource(resources, R.drawable.platform_toolbar_back);
Bitmap colorBmp = BitmapUtils.tintBitmap(bmp, mLeftStartIconColor);
return new BitmapDrawable(resources, colorBmp);
}else {
return mLeftStartIcon;
}
}
public void setDivideHidden(boolean hide) { public void setDivideHidden(boolean hide) {
if (hide) { if (hide) {
iv_title_divide.setVisibility(View.GONE); iv_title_divide.setVisibility(View.GONE);
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<attr name="pa_side_text_color" format="color" /> <attr name="pa_side_text_color" format="color" />
<attr name="pa_title_bar_text_color" format="color|reference" /> <attr name="pa_title_bar_text_color" format="color|reference" />
<attr name="pa_bm_line_color" format="color" /> <attr name="pa_bm_line_color" format="color" />
<attr name="pa_right_iv" format="reference" /> <attr name="pa_right_iv" format="reference" />
<attr name="pa_left_start_icon_color" format="color" />
</declare-styleable> </declare-styleable>
<attr name="pa_left_text" format="string" /> <attr name="pa_left_text" format="string" />
<attr name="pa_right_text" format="string" /> <attr name="pa_right_text" format="string" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment