Commit c2a4f935 by konghaorui

Merge branch 'dev' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into dev

# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/ydl/component/MainActivity.kt
#	删除测评、课程模块友盟埋点代码
parents 5b259dd7 1fdac5a6
......@@ -167,10 +167,10 @@ dependencies {
if (rootProject.ext.dev_mode) {
//开发模式
api project(':m-consultant')
api project(':m-user')
//api project(':m-fm')
api project(':m-tests')
api project(':m-muse')
api project(':m-consultant')
api (project(':ydl-platform')){
transitive = true
}
......@@ -181,7 +181,7 @@ dependencies {
api 'com.ydl:m-user-module-ydl:0.0.6'
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-m-muse-api"]
api rootProject.ext.dependencies["ydl-m-fm-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......@@ -191,7 +191,6 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2'
}
//
//noTracePoint {
// outputModifyFile = false
// targetPackages = ['com.cxzapp.yidianling',
......
......@@ -22,7 +22,6 @@ import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import com.yidianling.tests.home.TestHomeActivity
import kotlinx.android.synthetic.main.activity_main.*
......@@ -65,15 +64,15 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.withBoolean("isFromGuide", true)
.navigation()
}
bt_to_consultant.setOnClickListener {
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
HOT_SEARCH_DOCTOR_NAME,
this.resources?.getString(R.string.platform_search_hint)
)
.navigation()
}
// bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
// .build("/consult/hot_search")
// .withString(
// HOT_SEARCH_DOCTOR_NAME,
// this.resources?.getString(R.string.platform_search_hint)
// )
// .navigation()
// }
bt_to_music.setOnClickListener {
startActivity(Intent(this, MusicPlayActivity::class.java))
}
......@@ -101,6 +100,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
" }]\n" +
" }"))
}
bt_to_fm.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_FM_LIST)
}
}
......
......@@ -108,6 +108,20 @@
android:text="Jump to 冥想" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt_to_fm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:text="Jump to FM" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
......
......@@ -371,9 +371,6 @@ public class CourseListFragment extends BaseLazyFragment implements PtrHandler,
h5Params.setShareData(shareData);
}
UMEventUtils.umEvent("列表页分类点击", "分类id", course.id + "");
UMEventUtils.umEvent("列表页分类点击", "分类名称", course.title);
NewH5Activity.start(getActivity(), h5Params);
BuryPointUtils.getInstance().createMap()
.put("curriculum_name", course.title == null ? "" : course.title)
......
......@@ -335,8 +335,7 @@ public class MyCourseListFragment extends BaseLazyFragment implements PtrHandler
h5Params.setShareData(shareData);
}
UMEventUtils.umEvent("列表页分类点击", "分类id", course.id + "");
UMEventUtils.umEvent("列表页分类点击", "分类名称", course.title);
NewH5Activity.start(getActivity(), h5Params);
BuryPointUtils.getInstance().createMap()
......
......@@ -101,8 +101,6 @@ public class CourseHeadPagerAdapter extends PagerAdapter {
@Override
public void onClick(View v) {
UMEventUtils.umEvent("banner点击", "banner链接", banners.get(position).linkUrl);
ActionCountUtils.Companion.count(BIConstants.CourseHomeEvent.POSITION_COURSE_HOME_BANNER_CLICK, position + "");
LinkUrlRouterProtocol.jump(container.getContext(), banners.get(position).linkUrl);
......
......@@ -67,7 +67,6 @@ class CourseTopicActivity : BaseActivity(), View.OnClickListener, SwipeRefreshLa
swl.setColorSchemeResources(R.color.google_green)
swl.setOnRefreshListener(this)
tv_left_menu.setOnClickListener {
UMEventUtils.umEvent("专题详情", "分享", "分享")
//分享
share()
......
......@@ -77,9 +77,6 @@ class CourseTopicAdapter(val context: Context, var mDatas: List<Course>) : Recyc
(holder.getItemView() as CourseItemNewView).setBottomLineGone()
}
holder.itemView.setOnClickListener { view ->
UMEventUtils.umEvent("列表点击", "专题id", course.id.toString())
UMEventUtils.umEvent("列表点击", "专题名称", course.title)
NewH5Activity.start(context, H5Params(CourseConstants.COURSE_DETAIL_H5 + course.id, null))
}
}
......
......@@ -161,8 +161,6 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
h5Params.shareData = shareData
}
UMEventUtils.umEvent("列表页分类点击", "分类id", course.id.toString() + "")
UMEventUtils.umEvent("列表页分类点击", "分类名称", course.title)
NewH5Activity.start(this@CourseListContainerActivity, h5Params)
}
......
......@@ -114,7 +114,6 @@ class CourseHomeFragment : BaseFragment(), ICourseHomeView, SwipeRefreshLayout.O
tv_left_menu.setOnClickListener {
ActionCountUtils.count(BIConstants.CourseHomeEvent.POSITION_COURSE_HOME_MY_COUSE_CLICK)
UMEventUtils.umEvent("我的课程点击", "我的课程", "我的课程")
if (CourseIn.isLogin()) {
MyCourseActivity.start(activity)
......
......@@ -134,9 +134,7 @@ public class MyCourseActivity extends BaseActivity {
@Override
public Fragment getItem(int position) {
if (position == 0) {
UMEventUtils.umEvent("我的课程", "收藏", "收藏");
} else {
UMEventUtils.umEvent("我的课程", "已购", "已购");
}
return mFragments[position];
......
......@@ -95,9 +95,6 @@ public class CategorySection extends Section {
ciView.setImage(category.image);
ciView.setOnClickListener(view -> {
UMEventUtils.umEvent("课程分类点击", "分类id", category.linkUrl);
UMEventUtils.umEvent("课程分类点击", "分类名称", category.title);
ActionCountUtils.Companion.count(BIConstants.CourseHomeEvent.POSITION_COURSE_HOME_CLASSIFICATION_CLICK, category.title);
if (!TextUtils.isEmpty(category.linkUrl)) {
LinkUrlRouterProtocol.jump(itemView.getContext(), category.linkUrl);
......
......@@ -45,7 +45,6 @@ public class ClassifiedCourseSection extends Section {
if (holder instanceof FooterMoreViewHolder) {
((FooterMoreViewHolder) holder).titleView.setText(data.footer.title);
((FooterMoreViewHolder) holder).linearLayout.setOnClickListener(view -> {
UMEventUtils.umEvent(data.head.title, "更多课程", "更多课程");
LinkUrlRouterProtocol.jump(context, data.footer.linkUrl);
if (!TextUtils.isEmpty(data.head.title)) {
......@@ -71,7 +70,6 @@ public class ClassifiedCourseSection extends Section {
realHolder.courseItemNewView.setData(courseBean);
holder.itemView.setOnClickListener(view -> {
UMEventUtils.umEvent(data.head.title, data.head.title + "链接", course.linkUrl);
LinkUrlRouterProtocol.jump(context, courseBean.linkUrl);
......
......@@ -61,7 +61,6 @@ public class QulityCourseSection extends Section {
if (holder instanceof FooterMoreViewHolder) {
((FooterMoreViewHolder) holder).titleView.setText(data.footer.title);
((FooterMoreViewHolder) holder).linearLayout.setOnClickListener(v -> {
UMEventUtils.umEvent("更多课程", "更多课程", "更多课程");
LinkUrlRouterProtocol.jump(context, data.footer.linkUrl + "?childId=" + (type + 1));
......@@ -94,7 +93,6 @@ public class QulityCourseSection extends Section {
realHolder.courseItemNewView.setData(courseBean);
holder.itemView.setOnClickListener(view -> {
UMEventUtils.umEvent("精品课程", "精品课程链接", courseBean.linkUrl);
LinkUrlRouterProtocol.jump(context, courseBean.linkUrl);
......@@ -216,7 +214,6 @@ public class QulityCourseSection extends Section {
tv_tab2 = itemView.findViewById(R.id.tv_tab2);
iv_tab2 = itemView.findViewById(R.id.iv_tab2);
itemView.findViewById(R.id.ll_tab1).setOnClickListener(v -> {
UMEventUtils.umEvent("精品课程", "免费课程", "免费课程");
tv_tab1.setTextColor(ContextCompat.getColor(itemView.getContext(), R.color.green_34cd65));
iv_tab1.setVisibility(View.VISIBLE);
......@@ -225,7 +222,6 @@ public class QulityCourseSection extends Section {
section.setType(FREE);
});
itemView.findViewById(R.id.ll_tab2).setOnClickListener(v -> {
UMEventUtils.umEvent("精品课程", "付费课程", "付费课程");
tv_tab2.setTextColor(ContextCompat.getColor(itemView.getContext(), R.color.green_34cd65));
iv_tab2.setVisibility(View.VISIBLE);
......
......@@ -49,7 +49,6 @@ public class TopicsCoursesSection extends Section {
((SingleTitleHeaderViewHolder) holder).subTitleView.setVisibility(View.VISIBLE);
((SingleTitleHeaderViewHolder) holder).subTitleView.setText(data.head.subTitle);
((SingleTitleHeaderViewHolder) holder).subTitleView.setOnClickListener(v -> {
UMEventUtils.umEvent("专题课程", "更多点击", "更多点击");
if (null != mContext) {
CourseLinkUrl.Companion.jump(mContext, data.head.subLinkUrl);
}
......@@ -155,7 +154,6 @@ public class TopicsCoursesSection extends Section {
public void onBindViewHolder(BaseViewHolder holder, int position) {
holder.setImageWithUrl(R.id.img, data.get(position).image);
holder.setOnClickListener(R.id.img, view -> {
UMEventUtils.umEvent("专题课程", "专题链接", data.get(position).linkUrl);
LinkUrlRouterProtocol.jump(mContext, data.get(position).linkUrl);
......
......@@ -125,11 +125,9 @@ class CoursePlayActivity : BaseActivity() {
fun initView() {
iv_back.setOnClickListener {
UMEventUtils.umEvent("返回点击", "返回", "返回")
onBackPressed()
}
iv_share.setOnClickListener {
UMEventUtils.umEvent("分享点击", "分享", "分享")
//分享
share(courPlayBean?.courseExtra?.shareData)
}
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
flavorDimensions "versionCode"
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
api project(':m-user')
implementation project(':ydl-media')
implementation modularPublication('com.ydl:m-user-api')
} else {
//发布时使用
api rootProject.ext.dependencies["ydl-m-user-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
}
modular {
//模块包名
packageName "com.yidianling.fm"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-fm-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.1"
}
ydl{
groupId = "com.ydl"
artifactId = "m-fm-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.1"
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-fm-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.ydl.ydl_fm;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ydl.ydl_fm.test", appContext.getPackageName());
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yidianling.fm">
<application>
<activity android:name=".FMActivity"
android:label="电台页面"
android:screenOrientation="portrait"/>
<activity android:name=".FMDetailActivity"
android:label="电台详情页面"
android:launchMode="singleTask"
android:screenOrientation="portrait"/>
</application>
</manifest>
package com.yidianling.fm;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.widget.PopupWindow;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.ydl.media.view.PlayTypeEnum;
import com.ydl.media.view.PlayerFloatHelper;
import com.ydl.ydlcommon.adapter.FragmentWithTabPagerAdapter;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.utils.PopUtils;
import com.ydl.ydlcommon.view.SlidingTabLayout;
import com.ydl.ydlcommon.view.TitleBar;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* 电台
* Created by softrice on 15/12/11.
*/
@Route(path = "/fm/list")
public class FMActivity extends BaseActivity {
private TitleBar tb_title;
private SlidingTabLayout stl_tab;
private ViewPager vp_content;
private List<String> titleList = new ArrayList<>();
private List<Fragment> fragmentList = new ArrayList<>();
private PopupWindow popupWindow;
@Override
protected int layoutResId() {
return R.layout.activity_fm;
}
@Override
protected void initDataAndEvent() {
tb_title = findViewById(R.id.tb_title);
stl_tab = findViewById(R.id.stl_tab);
vp_content = findViewById(R.id.vp_content);
initTags();
tb_title.setRightImageListener(v -> popupWindow = PopUtils.showMoreItem(FMActivity.this,
tb_title.getRootView(),
0,
0));
tb_title.setRightImageIfShouldSee();
}
@Override
public void onBackPressed() {
if (popupWindow != null && popupWindow.isShowing()) {
popupWindow.dismiss();
return;
}
super.onBackPressed();
}
/**
* 初始化tab
*/
private void initTags() {
titleList.add("全部");
titleList.add("我喜欢的");
for (int i = 0; i < 2; i++) {
fragmentList.add(new FMListViewFragment().setTagId(i));
}
FragmentWithTabPagerAdapter adapter = new FragmentWithTabPagerAdapter(getSupportFragmentManager(), titleList, fragmentList);
stl_tab.setBackgroundColor(Color.WHITE);
vp_content.setAdapter(adapter);
stl_tab.setIsDoubleTab(true);
stl_tab.setSelectedIndicatorColors(0xFF1da1f2);
stl_tab.setDividerColors(Color.TRANSPARENT);
stl_tab.setViewPager(vp_content);
vp_content.setCurrentItem(0);
}
@Override
protected void onResume() {
super.onResume();
/* if (FMOut.INSTANCE.isHansUnread()) {
tb_title.setImage_right(getResources().getDrawable(R.drawable.more12r));
} else {
tb_title.setImage_right(getResources().getDrawable(R.drawable.more12x));
}*/
}
@Override
protected void onPause() {
super.onPause();
}
}
package com.yidianling.fm;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import com.ydl.ydlcommon.adapter.CommonAdapter;
import com.yidianling.fm.response.FM;
/**
* Created by softrice on 15/12/11.
*/
public class FMListAdapter extends CommonAdapter<FM> {
private Context context;
public FMListAdapter(Context context) {
this.context = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null){
convertView = new FMListItemView(context);
}
((FMListItemView)convertView).setData(mDataList.get(position));
return convertView;
}
}
package com.yidianling.fm;
import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp;
import com.yidianling.fm.response.FM;
/**
* fm列表项
* Created by softrice on 15/12/11.
*/
public class FMListItemView extends LinearLayout {
// @BindView(R.id.sdv_head)
private ImageView sdv_head;
// @BindView(R.id.tv_title)
private TextView tv_title;
// @BindView(R.id.tv_anchor)
private TextView tv_anchor;
// @BindView(R.id.tv_listen_num)
private TextView tv_listen_num;
public FMListItemView(Context context) {
super(context);
inflate(context, R.layout.ui_fm_list_item, this);
sdv_head = findViewById(R.id.sdv_head);
tv_title = findViewById(R.id.tv_title);
tv_anchor = findViewById(R.id.tv_anchor);
tv_listen_num = findViewById(R.id.tv_listen_num);
}
public void setData(FM fm) {
if (!TextUtils.isEmpty(fm.getImageUrl())) {
GlideApp.with(getContext())
.load(fm.getImageUrl())
.placeholder(R.drawable.default_img)
.into(sdv_head);
}
tv_title.setText(fm.getName());
tv_anchor.setText("主播:" + fm.getAuthor());
tv_listen_num.setText("收听:" + fm.getHits());
}
}
package com.yidianling.fm
import com.yidianling.fm.http.FMHttp
import com.yidianling.fm.http.FMHttpImpl
/**
* @author : Zhangwenchao
* @e-mail : zhangwch@yidianling.com
* @time : 2018/5/15
*/
object FmDataManager {
fun getHttp(): FMHttp = FMHttpImpl.getInstance()
}
\ No newline at end of file
package com.yidianling.fm;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
public class RoundProgressBar extends View {
private Paint paint;
private int roundColor;
private int roundProgressColor;
private int textColor;
private float textSize;
private float roundWidth;
private int max;
private int progress;
private boolean textIsDisplayable;
private int style;
public static final int STROKE = 0;
public static final int FILL = 1;
public RoundProgressBar(Context context) {
this(context, null);
}
public RoundProgressBar(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoundProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
paint = new Paint();
TypedArray mTypedArray = context.obtainStyledAttributes(attrs,
R.styleable.RoundProgressBar);
roundColor = mTypedArray.getColor(
R.styleable.RoundProgressBar_roundColor, 0x558B8B8B);
roundProgressColor = mTypedArray.getColor(
R.styleable.RoundProgressBar_roundProgressColor, 0xFF91E300);
textColor = mTypedArray.getColor(
R.styleable.RoundProgressBar_textColor, Color.GREEN);
textSize = mTypedArray.getDimension(
R.styleable.RoundProgressBar_textSize, 15);
roundWidth = mTypedArray.getDimension(
R.styleable.RoundProgressBar_roundWidth, 5);
max = mTypedArray.getInteger(R.styleable.RoundProgressBar_round_progress_bar_max_num, 100);
textIsDisplayable = mTypedArray.getBoolean(
R.styleable.RoundProgressBar_textIsDisplayable, true);
style = mTypedArray.getInt(R.styleable.RoundProgressBar_style, 0);
mTypedArray.recycle();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int centre = getWidth() / 2;
int radius = (int) (centre - roundWidth / 2);
canvas.save();
canvas.rotate(-90, centre, centre);
paint.setColor(roundColor);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(roundWidth);
paint.setAntiAlias(true);
canvas.drawCircle(centre, centre, radius, paint);
paint.setStrokeWidth(0);
paint.setColor(textColor);
paint.setTextSize(textSize);
paint.setTypeface(Typeface.DEFAULT_BOLD);
int percent = (int) (((float) progress / (float) max) * 100);
float textWidth = paint.measureText(percent + "%");
if (textIsDisplayable && percent != 0 && style == STROKE) {
canvas.drawText(percent + "%", centre - textWidth / 2, centre
+ textSize / 2, paint);
}
paint.setStrokeWidth(roundWidth);
paint.setColor(roundProgressColor);
RectF oval = new RectF(centre - radius, centre - radius, centre
+ radius, centre + radius);
switch (style) {
case STROKE: {
paint.setStyle(Paint.Style.STROKE);
canvas.drawArc(oval, 0, 360 * progress / max, false, paint);
break;
}
case FILL: {
paint.setStyle(Paint.Style.FILL_AND_STROKE);
if (progress != 0)
canvas.drawArc(oval, 0, 360 * progress / max, true, paint);
break;
}
}
canvas.restore();
}
public synchronized int getMax() {
return max;
}
public synchronized void setMax(int max) {
if (max < 0) {
throw new IllegalArgumentException("max not less than 0");
}
this.max = max;
}
public synchronized int getProgress() {
return progress;
}
public synchronized void setProgress(int progress) {
if (progress < 0) {
throw new IllegalArgumentException("progress not less than 0");
}
if (progress > max) {
progress = max;
}
if (progress <= max) {
this.progress = progress;
postInvalidate();
}
}
public int getCricleColor() {
return roundColor;
}
public void setCricleColor(int cricleColor) {
this.roundColor = cricleColor;
}
public int getCricleProgressColor() {
return roundProgressColor;
}
public void setCricleProgressColor(int cricleProgressColor) {
this.roundProgressColor = cricleProgressColor;
}
public int getTextColor() {
return textColor;
}
public void setTextColor(int textColor) {
this.textColor = textColor;
}
public float getTextSize() {
return textSize;
}
public void setTextSize(float textSize) {
this.textSize = textSize;
}
public float getRoundWidth() {
return roundWidth;
}
public void setRoundWidth(float roundWidth) {
this.roundWidth = roundWidth;
}
}
package com.yidianling.fm.http
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.fm.response.FMDetail
import com.yidianling.fm.response.FMList
import com.yidianling.fm.response.FavFM
import io.reactivex.Observable
import retrofit2.http.*
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/05
*/
interface FMApi {
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA)
//获得收藏电台
@GET("fm/list/my")
fun getFavFMs(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<FMList>>
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
//全部电台
@GET("fm/list/all")
fun getAllFMs(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<FMList>>
//电台详情
@FormUrlEncoded
@POST("fm/detail")
fun fmDetail(@FieldMap params: Map<String, String>): Observable<BaseResponse<FMDetail>>
//收藏电台
@FormUrlEncoded
@POST("favorite/like")
fun favFM(@FieldMap params: Map<String, String>): Observable<BaseResponse<FavFM>>
}
\ No newline at end of file
package com.yidianling.fm.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.fm.param.DetailParam
import com.yidianling.fm.param.FMParam
import com.yidianling.fm.param.FavParam
import com.yidianling.fm.response.FMDetail
import com.yidianling.fm.response.FMList
import com.yidianling.fm.response.FavFM
import io.reactivex.Observable
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/05
*/
interface FMHttp {
fun getFavFMs(fmParam: FMParam): Observable<BaseAPIResponse<FMList>>
fun getAllFMs(fmParam: FMParam): Observable<BaseAPIResponse<FMList>>
fun fmDetail(param: DetailParam): Observable<BaseResponse<FMDetail>>
fun favFM(param: FavParam): Observable<BaseResponse<FavFM>>
}
\ No newline at end of file
package com.yidianling.fm.http
import com.ydl.ydlcommon.data.http.*
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.fm.param.DetailParam
import com.yidianling.fm.param.FMParam
import com.yidianling.fm.param.FavParam
import com.yidianling.fm.response.FMDetail
import com.yidianling.fm.response.FMList
import com.yidianling.fm.response.FavFM
import io.reactivex.Observable
import java.util.ArrayList
import java.util.HashMap
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/05
*/
class FMHttpImpl private constructor() : FMHttp {
companion object {
fun getInstance(): FMHttpImpl {
return Holder.INSTANCE
}
fun clearFMApi() {
Holder.INSTANCE.fmApi = null
}
}
private var fmApi: FMApi? = null
private fun getFMApi(): FMApi {
if (fmApi == null) {
fmApi = YDLHttpUtils.obtainApi(FMApi::class.java)
}
return fmApi!!
}
override fun getFavFMs(fmParam: FMParam): Observable<BaseAPIResponse<FMList>> {
return RxUtils.mapObservable(fmParam).flatMap { getFMApi().getFavFMs(it) }
}
override fun getAllFMs(fmParam: FMParam): Observable<BaseAPIResponse<FMList>> {
return RxUtils.mapObservable(fmParam).flatMap { getFMApi().getAllFMs(it) }
}
override fun fmDetail(param: DetailParam): Observable<BaseResponse<FMDetail>> {
return RxUtils.mapObservable(param)
.flatMap { getFMApi().fmDetail(it) }
}
override fun favFM(param: FavParam): Observable<BaseResponse<FavFM>> {
return RxUtils.mapObservable(param)
.flatMap { getFMApi().favFM(it) }
}
private object Holder {
val INSTANCE = FMHttpImpl()
}
}
\ No newline at end of file
package com.yidianling.fm.param
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/06
*/
data class DetailParam(val id: Int)
\ No newline at end of file
package com.yidianling.fm.param;
import com.ydl.ydlcommon.data.http.BaseCommand;
public class FMParam extends BaseCommand {
public String page;
public String perPageRows;
public FMParam(String page, String perPageRows) {
this.page = page;
this.perPageRows = perPageRows;
}
}
\ No newline at end of file
package com.yidianling.fm.param
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/06
*/
data class FavParam internal constructor(val id: Int, val type: Int) {
constructor(id: Int): this(id, 1)
}
\ No newline at end of file
package com.yidianling.fm.response
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/05
*/
data class FM(val id: Int,
val name: String?,
val author: String?,
val imageUrl: String?,
val hits: String?)
\ No newline at end of file
package com.yidianling.fm.response
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/06
*/
data class FMDetail(val next_id: Int,
val id: Int,
val title: String,
val author: String,
val image_url: String,
val fm_url: String,
val share_url: String,
val hits: Int,
val count_favorite: String,
val is_favorite: Int,
val time: Int)
package com.yidianling.fm.response
data class FMList(
val list:List<FM>
)
\ No newline at end of file
package com.yidianling.fm.response
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/06
*/
data class FavFM(val id: Int, val status: Int)
\ No newline at end of file
package com.yidianling.fm.router
import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.user.api.service.IUserService
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/04/25
*/
object FMIn {
fun isLogin(): Boolean {
return ModularServiceManager.provide(IUserService::class.java).isLogin()
// return RouterManager.getUserRouter()?.isLogin()?:false
}
fun mainIntent(activity: Activity): Intent? {
//todo xujian 跳转到MainActivity 待修改
return RouterManager.getAppRouter()?.mainIntent(activity)
}
fun loginWayIntent(activity: Activity): Intent? {
return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
}
/**
* FM分享到心事动态
*/
fun publisFmToTrend(activity: Activity, url: String, cover: String, title: String) : Intent?{
//todo xujian 待修改
return RouterManager.getDynamicRouter()?.publishFmToTrend(activity,url,cover,title)
}
}
\ No newline at end of file
package com.yidianling.fm.router
import android.app.Activity
import android.content.Intent
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.view.PlayerFloatHelper
import com.yidianling.fm.FMDetailActivity
import com.yidianling.router.fm.IFMRouter
class FmRouterImp : IFMRouter{
override fun fmDetailIntent(activity: Activity, id: Int): Intent {
return FMDetailActivity.newIntent(activity, id)
}
override fun fmDetailIntent(activity: Activity, id: Int, isSplash: Boolean): Intent {
return FMDetailActivity.newIntent(activity, id, isSplash)
}
override fun getFmId(): Int {
return PlayerFloatHelper.getFmId()
}
override fun closePlayer() {
if (AudioPlayer.get().isPlaying) {
AudioPlayer.get().stopPlayer()
}
}
override fun isPlaying(): Boolean {
return AudioPlayer.get().isPlaying
}
override fun pause(){
AudioPlayer.get().pausePlayer()
}
override fun replay() {}
}
\ No newline at end of file
package com.yidianling.fm.api.service
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by xj on 2019/11/4.
*/
interface IFMService: IProvider{
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size
android:width="24dp"
android:height="24dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="6.5dp"
android:bottom="6.5dp">
<shape
android:shape="oval">
<size
android:width="7dp"
android:height="7dp" />
<stroke android:color="@color/white" android:width="1dp"/>
<solid android:color="@color/google_green" />
</shape>
</item>
<item>
<shape
android:shape="oval">
<size
android:width="7dp"
android:height="20dp" />
<solid android:color="@color/transparent"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/nim_picker_preview_pressed" android:state_pressed="true"></item>
<item android:drawable="@drawable/nim_picker_preview_disable" android:state_enabled="false"></item>
<item android:drawable="@drawable/nim_picker_preview_normal"></item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<size android:height="1dp" />
<solid android:color="#80FFFFFF"></solid>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<size android:height="1dp" />
<solid android:color="@color/platform_color_FFFFFF"></solid>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="#EE394F5A" />
<size
android:width="20dp"
android:height="20dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="心灵电台" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.SlidingTabLayout
android:id="@+id/stl_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white" />
</FrameLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="@color/divide_color" />
<android.support.v4.view.ViewPager
android:id="@+id/vp_content"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/fm_play_in"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/transparent"
app:pa_left_start_icon="@drawable/fm_back"
app:pa_right_start_icon="@drawable/fm_item"
app:pa_title_bar_text_color="@color/white"
app:pa_title_text="心灵电台" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="74dp"
android:gravity="center_vertical"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.yidianling.fm.widget.FMSurfaceView
android:id="@+id/fmSurfaceView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/ll_last_time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/fm_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardElevation="0dp">
<ImageView
android:id="@+id/fm_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/fm_hint_img"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
</LinearLayout>
<ProgressBar
android:id="@+id/circle_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:background="@drawable/shape_circle_black_bg"
android:visibility="gone"/>
<ImageView
android:id="@+id/refresh_icon"
android:layout_width="@dimen/platform_dp_25"
android:layout_height="@dimen/platform_dp_25"
android:src="@drawable/heart_refresh"
android:layout_centerInParent="true"
android:visibility="gone"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_alignParentBottom="true"
android:gravity="center_vertical">
<ImageView
android:id="@+id/iv_love"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/platform_dp_19"
android:scaleType="fitCenter"
android:src="@drawable/fm_love_n_2" />
<ImageView
android:id="@+id/iv_last"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/platform_dp_36"
android:src="@drawable/fm_last_2" />
<ImageView
android:id="@+id/iv_play"
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:src="@drawable/fm_play_2"/>
<ImageView
android:id="@+id/iv_next"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="36dp"
android:src="@drawable/fm_next_2" />
<ImageView
android:id="@+id/iv_share"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="19dp"
android:src="@drawable/fm_share_2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_above="@+id/ll_bottom"
android:gravity="center"
android:layout_marginBottom="39dp">
<TextView
android:id="@+id/tv_fm_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_anchor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主播:"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_4"
android:layout_marginBottom="@dimen/platform_dp_10"
android:visibility="gone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/platform_dp_6">
<ImageView
android:id="@+id/tv_listen_icon"
android:layout_width="@dimen/platform_dp_15"
android:layout_height="@dimen/platform_dp_12"
android:src="@drawable/fm_listen_2"
android:layout_marginRight="@dimen/platform_dp_5"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_listen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="13dp"
android:layout_marginRight="@dimen/platform_dp_19"
android:visibility="gone" />
<ImageView
android:id="@+id/tv_like_icon"
android:layout_width="@dimen/platform_dp_16"
android:layout_height="@dimen/platform_dp_13"
android:src="@drawable/fm_like_2"
android:layout_marginTop="0.5dp"
android:layout_marginRight="@dimen/platform_dp_5"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="13dp"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_bottom"
android:layout_marginBottom="-12dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_currentTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="@dimen/platform_dp_7"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_weight="1"
android:text=""
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_10" />
<TextView
android:id="@+id/tv_allTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/platform_dp_7"
android:layout_marginRight="@dimen/platform_dp_25"
android:layout_weight="1"
android:text=""
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_10" />
<SeekBar
android:id="@+id/fm_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_currentTime"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_marginRight="@dimen/platform_dp_25"
android:maxHeight="1dp"
android:minHeight="1dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:progressDrawable="@drawable/seekbar_fm_drag"
android:thumb="@drawable/dot_seekbar_fm" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<in.srain.cube.views.ptr.PtrFrameLayout
android:id="@+id/store_house_ptr_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<in.srain.cube.views.loadmore.LoadMoreListViewContainer
android:id="@+id/load_more_list_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/divide_color"
android:dividerHeight="@dimen/divide_line_stroke_width" />
<com.ydl.ydlcommon.ui.LogoLoadingView
android:id="@+id/v_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/empty_video" />
<TextView
android:id="@+id/ll_empty_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_dis_size_huge"
android:text="还没有喜欢的电台内容"
android:textColor="#D6D6D6" />
</LinearLayout>
</in.srain.cube.views.loadmore.LoadMoreListViewContainer>
</in.srain.cube.views.ptr.PtrFrameLayout>
</FrameLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="@dimen/default_dis_size">
<ImageView
android:id="@+id/sdv_head"
android:layout_width="112dp"
android:layout_height="70dp"
android:layout_centerVertical="true"
android:contentDescription="@null"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/iv_next"
android:layout_toRightOf="@+id/sdv_head"
android:padding="@dimen/default_dis_size_small"
android:text=""
android:textSize="@dimen/default_text_size_big" />
<TextView
android:id="@+id/tv_anchor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title"
android:layout_toRightOf="@+id/sdv_head"
android:drawablePadding="@dimen/default_dis_size_micro"
android:padding="@dimen/default_dis_size_small"
android:text="主播:"
android:textColor="@color/default_text_color_hint" />
<TextView
android:id="@+id/tv_listen_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title"
android:layout_toLeftOf="@+id/iv_next"
android:layout_toRightOf="@+id/tv_anchor"
android:drawablePadding="@dimen/default_dis_size_micro"
android:padding="@dimen/default_dis_size_small"
android:text="收听:0"
android:textColor="@color/default_text_color_hint" />
<ImageView
android:id="@+id/iv_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/msg_next" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="15dp">
<ImageView
android:id="@+id/iv_head"
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/platform_header"
android:src="@drawable/default_img" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="2"
android:textColor="@color/default_text_color"
android:textSize="14sp"
tools:text="课课程名称课程名称课程名称课程名称课程名称课" />
<ImageButton
android:id="@+id/btn_pause_play"
style="@android:style/Widget.Holo.Button.Borderless.Small"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/platform_pause_play"
android:scaleType="centerInside"
android:src="@drawable/ic_pause_24dp" />
<ImageButton
android:id="@+id/btn_close"
style="@android:style/Widget.Holo.Button.Borderless.Small"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/platform_close"
android:scaleType="centerInside"
android:src="@drawable/ic_close_24dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--RoundProgressBar-->
<declare-styleable name="RoundProgressBar">
<attr name="roundColor" format="color" />
<attr name="roundProgressColor" format="color" />
<attr name="roundWidth" format="dimension"></attr>
<attr name="textColor" format="color" />
<attr name="textSize" format="dimension" />
<attr name="round_progress_bar_max_num" format="integer"></attr>
<attr name="textIsDisplayable" format="boolean"></attr>
<attr name="style">
<enum name="STROKE" value="0"></enum>
<enum name="FILL" value="1"></enum>
</attr>
</declare-styleable>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="divide_color">#EDEDED</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">FM</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="google_green">#2ca94f</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="google_green">#1da1f2</color>
</resources>
\ No newline at end of file
package com.ydl.ydl_muse;
package com.ydl.ydl_fm;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
......
......@@ -8,7 +8,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.view.dialog.YDLShareDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.muse.R
import com.yidianling.muse.api.bean.MuseModuleBean
import com.yidianling.muse.bean.MuseModuleBean
import io.flutter.app.FlutterActivity
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
......
package com.ydl.ydl_fm;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
......@@ -10,10 +10,12 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.tests.R
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.adapter.AdapterWrapper
import com.yidianling.tests.home.adapter.TestHomeAdapter
import com.yidianling.tests.home.bean.TestHomeDataBean
......@@ -223,7 +225,6 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
}
override fun dailyChange() {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_DAILY_CHANGE_CLICK, "", "")
//埋点
BuryPointUtils.getInstance().createMap()
.burryPoint("ceping_change")
......
......@@ -10,9 +10,7 @@ import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.UMEventUtils
import com.yidianling.router.RouterManager
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.list.view.TestCategoryListActivity
import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity
......@@ -36,7 +34,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 跳转我的界面
*/
override fun jumpMine() {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_MINE_CLICK, "", "")
// TestHomeUtils.buildJumpMine(context!!)
if (!TestsIn.isLogin()) {
......@@ -53,8 +50,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 跳转搜索界面
*/
override fun jumpSearch() {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_SEARCH_CLICK, "", "")
TestSearchActivity.start(context!!)
}
......@@ -62,9 +57,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* banner点击事件
*/
override fun bannerClick(linkUrl: String?, position: Int, title: String?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_BANNER_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_BANNER_URL, linkUrl)
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_BANNER_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_BANNER_NAME, title)
//埋点
BuryPointUtils.getInstance().createMap()
.put("position", position)
......@@ -77,9 +69,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 测评分类点击事件
*/
override fun categoryClick(tabName: String?, position: Int, title: String?, id: String?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_CATEGORY_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_CATEGORY_NAME, title)
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_CATEGORY_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_CATEGORY_ID, id)
//埋点
BuryPointUtils.getInstance().createMap()
.put("position", position)
......@@ -93,7 +82,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 实时测试状态点击事件
*/
override fun realTestClick(linkUrl: String?, title: String?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_LOOP_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_LOOP_NAME, title)
//埋点
BuryPointUtils.getInstance().createMap()
.put("title", title)
......@@ -105,9 +93,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 每日精选点击事件
*/
override fun dailyClick(linkUrl: String?, position: Int, title: String?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_DAILY_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_DAILY_NAME, title)
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_DAILY_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_DAILY_URL, title)
//埋点
BuryPointUtils.getInstance().createMap()
.put("position", position)
......@@ -120,9 +105,6 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 热门推荐点击事件
*/
override fun recommendedClick(linkUrl: String?, position: Int, title: String?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_HOT_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_HOT_URL, linkUrl)
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_HOME_HOT_CLICK, TestsBIConstants.PROPERTY_TEST_HOME_HOT_NAME, title)
//埋点
BuryPointUtils.getInstance().createMap()
.put("position", position)
......
......@@ -108,7 +108,6 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
tabName = intent.getStringExtra(EXTRA_TABNAME)
}
tv_test_search.setOnClickListener {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_SEARCH_CLICK, "", "")
TestSearchActivity.start(this)
}
iv_test_list_back.setOnClickListener {
......@@ -132,7 +131,6 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
override fun onPageSelected(position: Int) {
currentPageIndex = position
setConditionContent();
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_CATEGORY_CLICK, TestsBIConstants.PROPERTY_TEST_LIST_CATEGORY_NAME, testCategory?.get(position)?.name)
click_category()
......
......@@ -10,13 +10,11 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.PopUtils
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.tests.list.model.bean.TestsRedPacketBean
import com.yidianling.tests.list.presenter.TestListActivityPresenter
......@@ -40,11 +38,9 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
tabName = intent.getStringExtra(EXTRA_TABNAME)
}
titleBar.setOnRightTextClick { _, _ ->
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_SEARCH_CLICK, "", "")
TestSearchActivity.start(this)
}
titleBar.setRightImageListener {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_MORE_CLICK, "", "")
popupWindow = PopUtils.showMoreItem(mContext,
titleBar.rootView,
0,
......@@ -57,8 +53,6 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
override fun onPageSelected(position: Int) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_CATEGORY_CLICK, TestsBIConstants.PROPERTY_TEST_LIST_CATEGORY_NAME, testCategorys?.get(position)?.name)
click_category()
LogUtil.d("page selected: " + testCategorys?.get(position)?.name)
......
......@@ -144,7 +144,6 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
}
override fun onItemClickListener(v: View?, position: Int, data: Test?) {
UMEventUtils.umEvent(TestsBIConstants.EVENT_TEST_LIST_TEST_TITLE_CLICK, TestsBIConstants.PROPERTY_TEST_LIST_TEST_NAME, data?.name)
BuryPointUtils.getInstance().createMap()
.put("test_id", data?.id.toString())
......
......@@ -85,7 +85,6 @@ public class LoginActivity extends BaseMvpActivity<LoginContract.View,LoginContr
}
void init() {
UMEventUtils.um_login(this);
if (isSplash == -1) {//启动app进入,无取消
tbTitle.setmLeftText("");
tbTitle.setOnLeftTextClick((view, isActive) -> {
......
......@@ -153,12 +153,10 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
input_iv_next.setOnClickListener {
//下一步
if (STATUS_INPUT_PWD == codeStatus) {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_next")
//密码登录
userLoginByPassword()
} else {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_confirm")
//设置新密码
if (checkPassWord()) {
......@@ -171,24 +169,19 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
et_input_password.setText("")
}
iv_visibility.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_visible")
iv_visibility.isSelected = !iv_visibility.isSelected
//切换密码显示、不显示
switchPwdShowType()
}
tv_msm_login.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_sms")
UMEventUtils.umEvent("密码登录页", "短信登录", "")
//短信登录
VerificationCodeActivity.start(this, userPhoneNumber!!, countryCode!!, VerificationCodeActivity.STATUS_LOGIN_BY_CODE, false, true)
overridePendingTransition(0, 0)
}
tv_forget.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_forget")
UMEventUtils.umEvent("密码登录页", "忘记密码", "")
//忘记密码
VerificationCodeActivity.start(this, userPhoneNumber!!, countryCode!!, VerificationCodeActivity.STATUS_FORGET_PWD)
overridePendingTransition(0, 0)
......
......@@ -354,13 +354,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
//微信登录
iv_weixin.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_wechat")
mPresenter.loginByThird(this, SHARE_MEDIA.WEIXIN)
}
//QQ 登录
iv_qq.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_QQ")
val config = UMShareConfig()
config.isNeedAuthOnGetUserInfo(true)
......@@ -375,9 +373,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
//下一步
iv_next.setOnClickListener {
UMEventUtils.umEvent("登录注册入口页", "", "")
//todo yuwai: 埋点统一命名,方便查看
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_next")
if (checkPhone()) {
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, isUmengLoginState)
......
......@@ -175,7 +175,6 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
}
//下一步
ver_iv_next.setOnClickListener {
UMEventUtils.umEvent("短信登录", "下一步", "")
if (TextUtils.isEmpty(pc_1.phoneCode) || pc_1.phoneCode.length != 4) {
startAnim()
......@@ -186,14 +185,11 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
//重新发送验证码
tv_countdown_time.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_resend")
sendMsgCode()
}
tv_passWord.setOnClickListener {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|click_pwd")
UMEventUtils.umEvent("短信登录", "密码登录", "")
if (ActivityManager.getInstance().getSecondTaskActivity() == null) {
closeAnim(true)
......@@ -218,7 +214,6 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
* 登录
*/
fun login() {
UMEventUtils.umJavaEvent(javaClass.simpleName + "|verify_code")
val msgCode = pc_1.phoneCode
if (codeType == STATUS_LOGIN_BY_CODE) {//验证码登录界面
if (isBindPhone) {
......
......@@ -60,9 +60,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
if (it.data.firstLogin == 1) {//第一次登录:是注册
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury()
UMEventUtils.loginSuccess("InputPassWordActivity|Reg_succ")
} else {
UMEventUtils.loginSuccess("InputPassWordActivity|Login_succ")
}
mView.closeActivity()
}
......@@ -99,10 +97,8 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
mView.baiduActionBury()
UMEventUtils.loginSuccess("InputPassWordActivity|Reg_succ")
} else {
ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_PWD_LOGIN,it.data.uid!!)
UMEventUtils.loginSuccess("InputPassWordActivity|Login_succ")
}
mView.closeActivity()
}
......
......@@ -72,11 +72,9 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Reg_succ")
} else {
ActionCountUtils.count(UserBIConstants.ACTION_TYPE_DIRECT_LOGIN)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Login_succ")
}
mView.autoLoginSuccess()
} else {
......@@ -204,22 +202,18 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
if (media == SHARE_MEDIA.QQ) {
if (it.data.firstLogin == 1) {//第一次登录:是注册
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Reg_succ_byQQ")
} else {
ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN,
UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, "友盟三方登录url无法获取",
"友盟三方登录api无法获取", sign1)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Login_succ_byQQ")
}
} else {
if (it.data.firstLogin == 1) {//第一次登录:是注册
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Reg_succ_byWechat")
} else {
ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN,
UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, "友盟三方登录url无法获取",
"友盟三方登录api无法获取", sign1)
UMEventUtils.loginSuccess("RegisterAndLoginActivity|Login_succ_byWechat")
}
}
}, {
......
......@@ -145,10 +145,8 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
if (it.data.firstLogin == 1) {//第一次登录:是注册
mView.baiduActionBury()
UMEventUtils.loginSuccess("VerificationCodeActivity|Reg_succ")
} else {
ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_CODE_LOGIN,it.data.uid!!)
UMEventUtils.loginSuccess("VerificationCodeActivity|Login_succ")
}
mView.closeActivity()
} else {
......
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