Commit ae6cc69a by konghaorui

删除无用资源

parent d1fcc291
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
......@@ -943,10 +943,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
ConsultantIn.startP2PXiaoYi(this)
}
R.id.ll_free -> {
val h5param = H5Params(HttpConfig.H5_URL + "ct/list", "免费咨询")
NewH5Activity.start(this, h5param)
}
R.id.rl_search -> {
ARouter.getInstance()
.build("/consult/hot_search")
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="@color/main_theme" />
<stroke
android:width="1dp"
android:color="@color/main_theme" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"></corners>
<solid android:color="@color/white" />
<stroke android:width="1dp" android:color="@color/color_grey_999999"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
<solid android:color="@color/white" />
<stroke android:width="1dp" android:color="#ababab"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp"/>
<solid android:color="@android:color/white" />
<stroke android:width="1px" android:color="#F0F0F0"/>
</shape>
\ 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="line">
<size android:height="0.5dp" />
<stroke
android:dashGap="3dp"
android:dashWidth="8dp"
android:width="1dp"
android:color="#E0E0E0" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#3484da"
android:endColor="#05cbfc"
/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#00000000"
android:startColor="#3f000000"
/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_8"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--头像-->
<android.support.v7.widget.CardView
android:id="@+id/cvHead"
android:layout_width="92dp"
android:layout_height="108dp"
android:layout_marginTop="@dimen/dp_15"
app:cardElevation="0px"
app:cardCornerRadius="4dp">
<ImageView
android:id="@+id/imgHead"
android:layout_width="92dp"
android:layout_height="108dp"
android:scaleType="centerCrop"
app:srcCompat="@drawable/avatar_def_circle"/>
</android.support.v7.widget.CardView>
<!--咨询师姓名-->
<TextView
android:id="@+id/tvName"
android:layout_toRightOf="@+id/cvHead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_12"
android:textSize="@dimen/dp_16"
android:textColor="@color/color_242424"
android:layout_marginStart="@dimen/dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="罗静"
android:layout_toEndOf="@+id/cvHead" />
<LinearLayout
android:layout_toRightOf="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:layout_marginLeft="@dimen/dp_2"
android:orientation="horizontal"
android:layout_toEndOf="@+id/tvName"
android:layout_marginStart="@dimen/dp_2">
<!--优质图标-->
<ImageView
android:id="@+id/imgAbilityLevel"
android:layout_width="37dp"
android:layout_height="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_4"
android:scaleType="fitCenter"
tools:background="@drawable/ability_level"
android:layout_marginStart="@dimen/dp_4" />
<!--公益图标-->
<ImageView
android:id="@+id/imgServiceFree"
android:layout_width="26dp"
android:layout_height="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_4"
android:scaleType="centerCrop"
tools:background="@drawable/service_free"
android:layout_marginStart="@dimen/dp_4" />
<!--新驻图标-->
<ImageView
android:id="@+id/imgNewEnter"
android:layout_width="26dp"
android:layout_height="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_4"
android:scaleType="fitCenter"
tools:background="@drawable/new_enter"
android:layout_marginStart="@dimen/dp_4" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_zixunOrderNum"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_16"
android:layout_toRightOf="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_below="@+id/tvName"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_5"
android:orientation="horizontal">
<!--好评率-->
<LinearLayout
android:id="@+id/ll_feedbackRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
</LinearLayout>
<!--61234人点评-->
<TextView
android:id="@+id/tv_zixunOrderNum"
android:layout_marginLeft="@dimen/dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/dp_11"
android:textColor="@color/color_242424"
tools:text="61234人点评"
tools:ignore="SpUsage" />
</LinearLayout>
<!--咨询师简介-->
<TextView
android:id="@+id/tvTeamCertifications"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_zixunOrderNum"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_marginTop="@dimen/dp_4"
android:textSize="@dimen/dp_11"
android:textColor="@color/color_242424"
android:lines="1"
android:ellipsize="end"
tools:text="一级婚姻家庭咨询师,二级心理咨询师"/>
<!--咨询师标签-->
<LinearLayout
android:id="@+id/ll_tags"
android:layout_below="@+id/tvTeamCertifications"
android:layout_toRightOf="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginStart="@dimen/dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
<!--帮助人数-->
<TextView
android:id="@+id/tvOrderNumContent"
android:layout_toRightOf="@+id/cvHead"
android:layout_alignBottom="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginBottom="-2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_11"
android:textColor="@color/color_242424"
tools:ignore="SpUsage"
android:text="帮助人数" />
<TextView
android:id="@+id/tvOrderNum"
android:layout_toRightOf="@+id/tvOrderNumContent"
android:layout_toEndOf="@+id/tvOrderNumContent"
android:layout_alignBottom="@+id/cvHead"
android:layout_marginBottom="-2dp"
android:layout_marginStart="@dimen/dp_2"
android:layout_marginLeft="@dimen/dp_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textColor="@color/color_242424"
android:textStyle="bold"
tools:text="2648"
tools:ignore="SpUsage" />
<!--月售时长-->
<TextView
android:id="@+id/tvSaleDurationForMonthContent"
android:layout_toRightOf="@+id/tvOrderNum"
android:layout_alignBottom="@+id/cvHead"
android:layout_toEndOf="@+id/tvOrderNum"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="-2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_11"
android:textColor="@color/color_242424"
tools:ignore="SpUsage"
android:text="月售时长" />
<TextView
android:id="@+id/tvSaleDurationForMonth"
android:layout_toRightOf="@+id/tvSaleDurationForMonthContent"
android:layout_toEndOf="@+id/tvSaleDurationForMonthContent"
android:layout_alignBottom="@+id/cvHead"
android:layout_marginStart="@dimen/dp_2"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginBottom="-2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textColor="@color/color_242424"
android:textStyle="bold"
tools:text="134h"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tvPrice"
android:layout_alignBottom="@+id/cvHead"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_13"
android:layout_marginRight="@dimen/dp_13"
android:layout_marginBottom="-2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF5040"
android:textSize="@dimen/dp_13"
android:textStyle="bold"
android:gravity="bottom"
tools:ignore="SpUsage"
tools:text="¥250" />
<TextView
android:id="@+id/tvPriceContent"
android:layout_alignBottom="@+id/cvHead"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top"
android:layout_marginBottom="-1dp"
android:textColor="#FF5040"
android:textSize="@dimen/dp_11"
android:text="起"
tools:ignore="SpUsage" />
<View
android:id="@+id/vLine"
android:layout_below="@+id/tvPrice"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginLeft="104dp"
android:layout_marginStart="104dp"
android:layout_marginTop="7dp"
android:layerType="software"
android:background="@drawable/expert_search_dash_line" />
<!--服务套餐-->
<LinearLayout
android:id="@+id/ll_products"
android:layout_below="@+id/vLine"
android:layout_marginLeft="104dp"
android:layout_marginStart="104dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:orientation="vertical">
</LinearLayout>
<!--私聊-->
<TextView
android:id="@+id/tvChat"
android:layout_width="56dp"
android:layout_height="@dimen/dp_26"
android:layout_marginTop="@dimen/dp_15"
android:layout_alignParentRight="true"
android:gravity="center"
android:background="@drawable/expert_search_chat"
android:textColor="@color/white"
android:text="私聊"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:paddingBottom="16dp"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="25dp">
<ImageView
android:id="@+id/ivHead"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:contentDescription="@null"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/avatar_def_circle" />
<TextView
android:id="@+id/tvService"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="8dp"
android:layout_marginStart="16dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#1d1d1d"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/btnChat"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivHead"
app:layout_constraintTop_toTopOf="@+id/ivHead"
app:layout_goneMarginRight="16dp"
tools:text="婚恋家庭关系电话咨询套餐" />
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:textColor="#1d1d1d"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/ivHead"
app:layout_constraintTop_toBottomOf="@+id/tvService"
tools:text="夏一可" />
<TextView
android:id="@+id/tvArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:textColor="#1d1d1d"
app:layout_constraintLeft_toRightOf="@+id/tvName"
app:layout_constraintTop_toBottomOf="@+id/tvService"
tools:text="黑龙江省-齐齐哈尔" />
<TextView
android:id="@+id/tvDesc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#999999"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toRightOf="@+id/ivHead"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvArea"
tools:text="恋爱心理、情感纠葛、失恋、网恋、分手挽留夫妻关系" />
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/flTags"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="16dp"
android:layout_marginStart="0dp"
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tvDesc"
app:layout_constraintTop_toBottomOf="@+id/tvDesc" />
<TextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:textColor="@color/google_red"
app:layout_constraintLeft_toRightOf="@+id/ivHead"
app:layout_constraintTop_toBottomOf="@+id/flTags"
tools:text="25元起" />
<TextView
android:id="@+id/tvConsultTimes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:textColor="#1d1d1d"
app:layout_constraintLeft_toRightOf="@+id/tvPrice"
app:layout_constraintTop_toBottomOf="@+id/flTags"
tools:text="咨询次数 12" />
<TextView
android:id="@+id/tvRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:textColor="#1d1d1d"
app:layout_constraintLeft_toRightOf="@+id/tvConsultTimes"
app:layout_constraintTop_toBottomOf="@+id/flTags"
tools:text="好评率 99%" />
<Button
android:id="@+id/btnChat"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="68dp"
android:layout_height="30dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/bg_radius_line_green_5"
android:drawableLeft="@drawable/ic_chat_green"
android:drawablePadding="6dp"
android:drawableStart="@drawable/ic_chat_green"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="私聊"
android:textColor="@color/main_theme"
android:textSize="@dimen/sp_14"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
\ 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_search"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:tag="tag_search_input"
app:layout_anchor="@+id/middle_but_layout"
app:layout_anchorGravity="top"
android:focusable="true"
android:focusableInTouchMode="true"
>
<!--android:layout_marginTop="@dimen/search_input_margin"-->
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_search_input"
android:tag="tag_search_input_bg"
/>
<ImageView
android:id="@+id/iv_search_icon"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:layout_width="14dp"
android:layout_height="14dp"
android:scaleType="centerCrop"
android:layout_centerVertical="true"
android:tag="tag_search_input_img"
android:src="@drawable/icon_input_search"/>
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp_10"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="搜索心理问题或专家姓名"
android:imeOptions="actionSearch"
android:singleLine="true"
android:textColor="@color/color_444444"
android:textColorHint="#b3b3b3"
android:textSize="12sp"
android:textCursorDrawable="@color/main_theme"
android:tag="tag_search_input_edit"
/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.yidianling.consultant.ui.view.DisInterceptNestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/middle_but_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/head_bg_height"
android:background="@color/colorBg"
android:tag="middle_but_layout"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.434">
<LinearLayout
android:layout_marginBottom="@dimen/dp_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@android:color/white"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingTop="40dp"
android:paddingRight="15dp"
android:paddingBottom="20dp">
<LinearLayout
android:id="@+id/ll_free"
android:layout_width="0dp"
android:layout_height="@dimen/dp_60"
android:layout_weight="1"
android:background="@drawable/bg_free_consult"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="免费咨询"
android:textStyle="bold"
android:textColor="@android:color/white"
android:layout_marginBottom="3.5dp"
android:textSize="17sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="权威大咖 邀你体验"
android:textColor="@android:color/white"
android:textSize="11sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_guide"
android:layout_width="0dp"
android:layout_height="@dimen/dp_60"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/bg_consult_guide"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="咨询指南"
android:textStyle="bold"
android:layout_marginBottom="3.5dp"
android:textColor="@android:color/white"
android:textSize="17sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="心理咨询是什么"
android:textColor="@android:color/white"
android:textSize="11sp"/>
</LinearLayout>
</LinearLayout>
</com.yidianling.consultant.ui.view.DisInterceptNestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--字体大小部分-->
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">4dp</dimen>
<dimen name="default_dis_size_small">6dp</dimen>
<dimen name="default_dis_size">8dp</dimen>
<dimen name="default_dis_size_big">10dp</dimen>
<dimen name="default_dis_size_large">12dp</dimen>
<dimen name="default_dis_size_huge">14dp</dimen>
<dimen name="default_dis_size_huge_more">16dp</dimen>
<!--分割线粗细-->
<dimen name="divide_line_stroke_width">1px</dimen>
......
......@@ -2,21 +2,17 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!--字体大小部分-->
<dimen name="text_size_14">14sp</dimen>
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">5dp</dimen>
<dimen name="default_dis_size_small">7.5dp</dimen>
<dimen name="default_dis_size">10dp</dimen>
<dimen name="default_dis_size_big">12.5dp</dimen>
<dimen name="default_dis_size_large">15dp</dimen>
<dimen name="default_dis_size_huge">17.5dp</dimen>
<dimen name="default_dis_size_huge_more">20dp</dimen>
<!--dialog部分-->
......@@ -35,5 +31,4 @@
<!--进度条-->
<!--照片选择器-->
<dimen name="head_size_big">72dp</dimen>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="msg_system_press">#fff7f7f7</color>
<color name="msg_bg_press">#eeeeeeee</color>
<color name="colorDivider">#ebebeb</color>
<!-- google color-->
<color name="google_red">#ed412c</color>
<color name="google_yellow">#fdbd00</color>
<color name="color_FF9500">#FF9500</color>
<color name="color_grey_d0d0d0">#d0d0d0</color>
<!--app主要颜色-->
<color name="white">#ffffff</color>
<color name="app_background">#fbf9fc</color>
<color name="theme_title_bar_color">#FFFFFF</color>
<color name="theme_bg">#FAFAFA</color>
<color name="default_text_color">#555555</color>
<color name="default_text_color_hint">#333333</color>
<color name="divide_color">#EDEDED</color>
<color name="new_divide_color">#f0f0f0</color>
<color name="new_background_color">#ececec</color>
<color name="place_holder_color">#DDDDDD</color>
<color name="transparent">#00FFFFFF</color>
<color name="price_color">#EC7100</color>
<color name="thx_red_color">#EB5835</color>
<color name="tag_text">#777777</color>
<color name="f5f5f5">#f5f5f5</color>
<color name="fffaec">#fffaec</color>
<color name="black_deep">#FF000000</color>
<color name="line">#e5e5e5</color>
......@@ -33,51 +22,26 @@
<color name="colorTextDefault">#555555</color>
<!-- main bg color -->
<color name="main_bg_color">#FFFFFF</color>
<!-- session -->
<color name="color_message_default_bg">#e9ecf0</color>
<color name="input_panel_text_color_757572">#757572</color>
<color name="color_gray_cbd0d8">#cbd0d8</color>
<!-- image picker -->
<color name="color_split_line_d9d9d9">#d9d9d9</color>
<color name="color_split_line_cccccc">#cccccc</color>
<!-- contact -->
<color name="contact_list_hover">#d9d9d9</color>
<color name="contact_letter_idx_bg">#33000000</color>
<color name="color_grey_ababab">#ababab</color>
<color name="color_yellow_796413">#796413</color>
<color name="color_red_f04c62">#f04c62</color>
<!-- setting -->
<color name="color_black_ff333333">#ff333333</color>
<color name="color_black_ff666666">#ff666666</color>
<color name="color_black_ff999999">#999999</color>
<!--云信 end-->
<color name="text_gray">#B6B6B6</color>
<color name="title_bottom_line_bg">#DDDDDD</color>
<color name="defult_bg">#f3f3f3</color>
<!--动态-->
<color name="text_trend_defult">#999999</color>
<color name="text_trend_black">#444444</color>
<color name="text_trend_title_black">#333333</color>
<!--动态顶部title背景变色-->
<color name="trend_transparent">#00ffffff</color>
<color name="trend_gray">#f3f3f3</color>
<color name="color_grey_555555">#555555</color>
<color name="color_background">#ECF1F5</color>
<color name="bg_top_msg">#f3f3f3</color>
<color name="color_grey_999999">#999999</color>
<color name="color_black_333333">#333333</color>
<color name="colorBg">#f5f5f5</color>
......
......@@ -5,23 +5,12 @@
<!--动态-->
<!--顶部title Size-->
<dimen name="title_height">45dp</dimen>
<dimen name="title_txt_sp">20sp</dimen>
<!-- map -->
<dimen name="text_size_9">9sp</dimen>
<dimen name="text_size_10">10sp</dimen>
<dimen name="text_size_12">12sp</dimen>
<dimen name="text_size_13">13sp</dimen>
<dimen name="text_size_14">14sp</dimen>
<dimen name="text_size_15">15sp</dimen>
<dimen name="text_size_16">16sp</dimen>
<dimen name="text_size_17">17sp</dimen>
<dimen name="text_size_18">18sp</dimen>
<dimen name="text_size_20">20sp</dimen>
<dimen name="title_bar_height">48dp</dimen>
<dimen name="head_bg_height">180dp</dimen>
</resources>
<resources>
<string name="app_name">consultant</string>
<string name="version_update">版本更新</string>
<string name="encourage_us">鼓励一下我们</string>
<string name="update_hint">已经是最新版本咯</string>
<string name="load_new_version">正在下载新版本</string>
<string name="cancel">取消</string>
<string name="service">客服小壹</string>
<string name="trends">动态</string>
<string name="course_recommend">课程推荐</string>
<string name="no_more_data_hint">到底了,陛下,就等你分享了呢</string>
<string name="loading_hint">正在加载中…</string>
<string name="popularity">人气:</string>
<string name="course_detail">课程详情</string>
<string name="attend_course_success">报名成功</string>
<string name="theme">主题</string>
<string name="area">地区</string>
<string name="sort">排序</string>
<string name="filter">筛选</string>
<string name="search">搜索</string>
<string name="show_type">显示方式</string>
<string name="enquiry_type">咨询方式</string>
<string name="age">年龄</string>
<string name="reset">重置</string>
<string name="confirm">确定</string>
<string name="no_more">没有更多了</string>
......@@ -28,36 +12,14 @@
<string name="search_by_category">按主题搜索看看</string>
<string name="search_hint">搜索话题、咨询师姓名</string>
<string name="need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
<string name="register_by_phone">手机号注册</string>
<string name="login_by_phone">手机登录</string>
<string name="login_by_qq">QQ登录</string>
<string name="login_by_wechat">微信登录</string>
<string name="user_protocol">用户协议</string>
<string name="next_step">下一步</string>
<string name="walk_around">随便逛逛</string>
<string name="finish">完成</string>
<string name="nickname_hint">设置一个昵称,方便大家认识你哦(最多10个字)</string>
<string name="please_select_gender">请选择性别</string>
<string name="more">更多</string>
<string name="register_success">注册成功</string>
<string name="private_safe_hint">设置手势密码,保障安全隐私</string>
<string name="header">头像</string>
<string name="pause_play">暂停/播放</string>
<string name="start_test">立即测试</string>
<string name="test_result">测试结果</string>
<string name="test_again">重新测试</string>
<string name="send_to_expert">专家解读</string>
<string name="test_answer">测试回答</string>
<string name="introduction">说明</string>
<string name="last_question">上一题</string>
<string name="no_test_record_hint">还没有测试记录哦</string>
<string name="recommend_test">推荐测试</string>
<string name="test_count">%d人测过</string>
<string name="questions">%d个问题</string>
<string name="wrong_args">参数异常</string>
<string name="no_search_keyword_hint">请输入关键字</string>
<string name="gson_parse_error">解析错误</string>
<string name="test_either">我也要测试</string>
<!--网络提示模块-->
<string name="network_error">请检查网络连接!</string>
......@@ -67,10 +29,7 @@
<string name="loading">正在加载中...</string>
<!-- 个人名片 -->
<string name="other">其他</string>
<string name="set_head_image">设置头像</string>
<string name="appbar_scroll_behavior">com.yidianling.consultant.ui.behavior.SearchAppBarLayoutBehavior</string>
<string name="reload_hint">加载失败,换个网络环境试试吧</string>
</resources>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/main_theme</item>
<item name="colorPrimaryDark">@color/main_theme</item>
<item name="colorAccent">@color/main_theme</item>
</style>
<style name="FilterTextViewStyle">
<item name="android:layout_height">40dp</item>
<item name="android:textSize">14sp</item>
......
<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="3" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="30" android:toXDelta="60"
android:duration="500"
android:interpolator="@anim/cycle"
/>
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:left_start_icon="@drawable/toolbar_back"
app:title_text="更换手机" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="@dimen/default_dis_size_huge"
android:background="@color/divide_color" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="@color/divide_color" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:padding="@dimen/default_dis_size"
android:text="登录密码" />
<EditText
android:id="@+id/check_password"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:inputType="textPassword"
android:padding="@dimen/default_dis_size"
android:textColorHint="@color/default_text_color_hint" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="@color/divide_color" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="@dimen/default_dis_size_huge"
android:background="@color/divide_color" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/change_next"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_dis_size"
android:layout_marginRight="@dimen/default_dis_size"
android:layout_marginTop="@dimen/default_dis_size_huge"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/default_text_size_big"
app:round_btn_active_bg="@color/white"
app:round_btn_bg="@color/main_theme"
app:round_btn_radio_size="5dp" />
</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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:padding="10dp"
android:text="@string/cancel"
android:textColor="#ff3fcd4c"
android:textSize="17sp" />
<TextView
android:id="@+id/tv_walk_around"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?android:attr/selectableItemBackground"
android:padding="10dp"
android:text="@string/walk_around"
android:textColor="#ff3fcd4c"
android:textSize="17sp"
tools:ignore="RelativeOverlap" />
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_alignParentBottom="true"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/login_img" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/login_wechat"
android:layout_width="230dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:drawableLeft="@drawable/login_weixin"
android:drawablePadding="10dp"
android:drawableStart="@drawable/login_weixin"
android:paddingLeft="64dp"
android:paddingRight="64dp"
android:text="@string/login_by_wechat"
android:textColor="#ffffff"
android:textSize="17sp"
app:round_btn_bg="#ff3fcd4c"
app:round_btn_radio_size="50dp" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/login_qq"
android:layout_width="230dp"
android:layout_height="50dp"
android:layout_below="@id/login_wechat"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:drawableLeft="@drawable/login_qq"
android:drawablePadding="10dp"
android:drawableStart="@drawable/login_qq"
android:paddingLeft="64dp"
android:paddingRight="64dp"
android:text="@string/login_by_qq"
android:textColor="#ffffff"
android:textSize="17sp"
app:round_btn_bg="#50befd"
app:round_btn_radio_size="50dp"
tools:visibility="visible" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/login_phone"
android:layout_width="230dp"
android:layout_height="50dp"
android:layout_below="@id/login_qq"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:drawableLeft="@drawable/login_phone"
android:drawablePadding="10dp"
android:drawableStart="@drawable/login_phone"
android:paddingLeft="64dp"
android:paddingRight="64dp"
android:text="@string/login_by_phone"
android:textColor="#ffffff"
android:textSize="17sp"
app:round_btn_bg="#7e8dff"
app:round_btn_radio_size="50dp" />
<TextView
android:id="@+id/tv_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/login_phone"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="33dp"
android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:padding="5dp"
android:text="@string/register_by_phone"
android:textColor="#3fcd4c"
android:textSize="20sp" />
</RelativeLayout>
<resources xmlns:tools="http://schemas.android.com/tools">
<!--字体大小部分-->
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">4dp</dimen>
<dimen name="default_dis_size_small">6dp</dimen>
<dimen name="default_dis_size">8dp</dimen>
<dimen name="default_dis_size_big">10dp</dimen>
<dimen name="default_dis_size_large">12dp</dimen>
<dimen name="default_dis_size_huge">14dp</dimen>
<dimen name="default_dis_size_huge_more">16dp</dimen>
<!--分割线粗细-->
<dimen name="divide_line_stroke_width">1px</dimen>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer-array name="ydl_colors">
<item>@color/main_theme_blue</item>
</integer-array>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="msg_system_press">#fff7f7f7</color>
<color name="msg_bg_press">#eeeeeeee</color>
<color name="colorDivider">#ebebeb</color>
<!-- google color-->
<color name="google_red">#ed412c</color>
<color name="google_yellow">#fdbd00</color>
<color name="color_grey_d0d0d0">#d0d0d0</color>
<!--app主要颜色-->
<color name="white">#ffffff</color>
<color name="theme_title_bar_color">#FFFFFF</color>
<color name="theme_bg">#FAFAFA</color>
<color name="default_text_color">#555555</color>
<color name="default_text_color_hint">#333333</color>
......@@ -18,10 +12,8 @@
<color name="place_holder_color">#DDDDDD</color>
<color name="transparent">#00FFFFFF</color>
<color name="price_color">#EC7100</color>
<color name="thx_red_color">#EB5835</color>
<color name="tag_text">#777777</color>
<color name="f5f5f5">#f5f5f5</color>
<color name="fffaec">#fffaec</color>
<color name="black_deep">#FF000000</color>
......@@ -29,45 +21,23 @@
<color name="colorTextDefault">#555555</color>
<!-- main bg color -->
<color name="main_bg_color">#FFFFFF</color>
<!-- session -->
<color name="color_message_default_bg">#e9ecf0</color>
<color name="input_panel_text_color_757572">#757572</color>
<color name="color_gray_cbd0d8">#cbd0d8</color>
<!-- image picker -->
<color name="color_split_line_d9d9d9">#d9d9d9</color>
<color name="color_split_line_cccccc">#cccccc</color>
<!-- contact -->
<color name="contact_list_hover">#d9d9d9</color>
<color name="contact_letter_idx_bg">#33000000</color>
<color name="color_grey_ababab">#ababab</color>
<color name="color_yellow_796413">#796413</color>
<color name="color_red_f04c62">#f04c62</color>
<!-- setting -->
<color name="color_black_ff333333">#ff333333</color>
<color name="color_black_ff666666">#ff666666</color>
<color name="color_black_ff999999">#999999</color>
<!--云信 end-->
<color name="text_gray">#B6B6B6</color>
<color name="title_bottom_line_bg">#DDDDDD</color>
<color name="defult_bg">#f3f3f3</color>
<!--动态-->
<color name="text_trend_defult">#999999</color>
<color name="text_trend_black">#444444</color>
<color name="text_trend_title_black">#333333</color>
<!--动态顶部title背景变色-->
<color name="trend_transparent">#00ffffff</color>
<color name="trend_gray">#f3f3f3</color>
<color name="color_grey_555555">#555555</color>
<color name="color_background">#ECF1F5</color>
<color name="bg_top_msg">#f3f3f3</color>
</resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_vertical_margin">16dp</dimen>
<!--动态-->
<!--顶部title Size-->
<dimen name="title_height">45dp</dimen>
<dimen name="title_txt_sp">20sp</dimen>
<!-- map -->
<dimen name="text_size_9">9sp</dimen>
<dimen name="text_size_10">10sp</dimen>
<dimen name="text_size_12">12sp</dimen>
<dimen name="text_size_13">13sp</dimen>
<dimen name="text_size_14">14sp</dimen>
<dimen name="text_size_15">15sp</dimen>
<dimen name="text_size_16">16sp</dimen>
<dimen name="text_size_17">17sp</dimen>
<dimen name="text_size_18">18sp</dimen>
<dimen name="text_size_20">20sp</dimen>
</resources>
<resources>
<string name="version_update">版本更新</string>
<string name="encourage_us">鼓励一下我们</string>
<string name="update_hint">已经是最新版本咯</string>
<string name="load_new_version">正在下载新版本</string>
<string name="cancel">取消</string>
<string name="service">客服小壹</string>
<string name="trends">动态</string>
<string name="course_recommend">课程推荐</string>
<string name="no_more_data_hint">到底了,陛下,就等你分享了呢</string>
<string name="loading_hint">正在加载中…</string>
<string name="popularity">人气:</string>
<string name="course_detail">课程详情</string>
<string name="attend_course_success">报名成功</string>
<string name="theme">主题</string>
<string name="area">地区</string>
<string name="sort">排序</string>
<string name="filter">筛选</string>
<string name="search">搜索</string>
<string name="show_type">显示方式</string>
<string name="enquiry_type">咨询方式</string>
<string name="age">年龄</string>
<string name="reset">重置</string>
<string name="confirm">确定</string>
<string name="no_more">没有更多了</string>
......@@ -27,36 +11,14 @@
<string name="search_by_category">按主题搜索看看</string>
<string name="search_hint">搜索话题、咨询师姓名</string>
<string name="need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
<string name="register_by_phone">手机号注册</string>
<string name="login_by_phone">手机登录</string>
<string name="login_by_qq">QQ登录</string>
<string name="login_by_wechat">微信登录</string>
<string name="user_protocol">用户协议</string>
<string name="next_step">下一步</string>
<string name="walk_around">随便逛逛</string>
<string name="finish">完成</string>
<string name="nickname_hint">设置一个昵称,方便大家认识你哦(最多10个字)</string>
<string name="please_select_gender">请选择性别</string>
<string name="more">更多</string>
<string name="register_success">注册成功</string>
<string name="private_safe_hint">设置手势密码,保障安全隐私</string>
<string name="header">头像</string>
<string name="pause_play">暂停/播放</string>
<string name="start_test">立即测试</string>
<string name="test_result">测试结果</string>
<string name="test_again">重新测试</string>
<string name="send_to_expert">专家解读</string>
<string name="test_answer">测试回答</string>
<string name="introduction">说明</string>
<string name="last_question">上一题</string>
<string name="no_test_record_hint">还没有测试记录哦</string>
<string name="recommend_test">推荐测试</string>
<string name="test_count">%d人测过</string>
<string name="questions">%d个问题</string>
<string name="wrong_args">参数异常</string>
<string name="no_search_keyword_hint">请输入关键字</string>
<string name="gson_parse_error">解析错误</string>
<string name="test_either">我也要测试</string>
<!--网络提示模块-->
<string name="network_error">请检查网络连接!</string>
......@@ -64,8 +26,6 @@
<string name="httperror">请求失败</string>
<!--动态模块-->
<string name="trend_foucused">已关注</string>
<string name="trend_foucus">关注</string>
<string name="dialog_loading">加载中…</string>
<string name="edittext_hint"></string>
......
package com.ydl.ydlcommon.actions.player
/**
* 配置文件
* Created by hgw on 2018/3/31.
*/
object Config{
/**
* 进度保存文件名
*/
val HMusicProgress : String = "HMUSIC_PROGRESS"
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player
/**
* 音乐详情
* Created by hgw on 2018/3/31.
*/
class MusicInfoBean{
constructor(url: String?, title: String?, pic: String?, desc: String?) {
this.url = url
this.title = title
this.pic = pic
this.desc = desc
}
constructor(url: String?) {
this.url = url
}
constructor()
var url : String? = null
var title : String? = null
var pic : String?= null
var desc : String? = null
//是否试听
var isTestPlay : Boolean = false
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.Bundle
import com.ydl.ydlcommon.actions.player.player.NotifyClickListener
import com.ydl.ydlcommon.actions.player.service.HMusicPlayService
/**
* 音频播放器辅助类
* Created by hgw on 2018/3/31.
*/
object MusicPlayerHelper {
var listener: NotifyClickListener? = null
fun bindService(context: Context, serviceConnection: ServiceConnection): Boolean {
var intent = Intent(context, HMusicPlayService::class.java)
return context.bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
}
fun unBinderService(activity: Context?, serviceConnection: ServiceConnection) {
activity?.unbindService(serviceConnection)
}
fun start(context: Context) {
var intent = Intent(context, HMusicPlayService::class.java)
var bundle = Bundle()
bundle.putString(HMusicPlayService.ACTION, HMusicPlayService.ONSTART)
intent.putExtra("bundle", bundle)
context.startService(intent)
}
fun start(context: Context, index: Int) {
var intent = Intent(context, HMusicPlayService::class.java)
var bundle = Bundle()
bundle.putString(HMusicPlayService.ACTION, HMusicPlayService.ONSTART_NEW)
bundle.putInt(HMusicPlayService.INDEX, index)
intent.putExtra("bundle", bundle)
context.startService(intent)
}
fun pause(context: Context) {
var intent = Intent(context, HMusicPlayService::class.java)
var bundle = Bundle()
bundle.putString(HMusicPlayService.ACTION, HMusicPlayService.ACTION_PAUSE)
intent.putExtra("bundle", bundle)
context.startService(intent)
}
fun pauseService(context: Context) {
//暂停播放
var intent = Intent(context, HMusicPlayService::class.java)
var bundle = Bundle()
bundle.putString(HMusicPlayService.ACTION, HMusicPlayService.ACTION_STOP)
intent.putExtra("bundle", bundle)
context.startService(intent)
}
fun stopService(context: Context) {
//停止服务
listener = null
var intent = Intent(context, HMusicPlayService::class.java)
context.stopService(intent)
}
/**
* 注册通知栏操作监听器监听器
*/
fun registerListener(listener: NotifyClickListener) {
MusicPlayerHelper.listener = listener
}
/**
* 播放通知栏详情点击
*/
fun notoifyDetailClick() {
listener?.notifyDetailClick()
}
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.launcher.ARouter
/**
* 音乐播放器辅助类
* 兼容原播放逻辑
*/
object YDLMusicHelper {
//公共参数
var title: String? = null
var cover: String? = null
var name: String? = null
//FM跳转参数
var fmId: Int = 0
//课程跳转参数
var course_id: Int = 0//课程id
//播放类型 1:视频 0:音频
var playType = 0
//课程播放地址
var courseVideoUlr: String? = null
//课程是否正在播放
var isVideoPlaying = false
//播放类型
val PLAY_TYPE_FM = "player_type_fm"
val PLAY_TYPE_COURSE = "play_type_course"
val PLAY_TYPE_CONFIDE = "play_type_confide"
val PLAY_TYPE_NONE = "play_type_none"
//当前播放类型 - <电台、倾诉、课程>
var playingType = PLAY_TYPE_NONE
var time: Int = 0
var allTime: Int = 0
//当前音频是否播放完成
var currentComplete: Boolean = false
private var playListener: YDLMusicPlayer.PlayStateChangeListener? = null
/**
* 打开播放中的页面详情
*/
fun startPlayingActivity(context: Context?, fullScreen: Int = 0) {
if (playingType == PLAY_TYPE_FM) {
//FM播放页
startFMPlayActivity(context)
} else if (playingType == PLAY_TYPE_COURSE) {
var url = if (playType == 0) {
getCurrentData()?.url
} else {
courseVideoUlr
}
//课程播放页
startCoursePlayActivity(
context,
1,
fullScreen,
url,
true
)
}
}
fun startCoursePlayActivity(context: Context?, from: Int, fullScreen: Int = 0, coursePlayUrl: String? = "", isFromFloatView: Boolean = false) {
ARouter.getInstance()
.build("/course/play")
.withInt("course_id", course_id)
.withInt("course_type", playType)
.withString("coursePlayUrl", coursePlayUrl)
.withInt("from", from)
.withBoolean("isFromFloatView", isFromFloatView)
.withInt("fullScreen", fullScreen)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.navigation()
}
fun startFMPlayActivity(context: Context?) {
val bundle = Bundle()
bundle.putInt("id", fmId)
ARouter.getInstance().build("/fm/detail")
.withBundle("bundle", bundle)
.navigation()
}
fun isCoursePlaying(): Boolean {
return YDLMusicPlayer.getInstance().isPlaying() && playingType == PLAY_TYPE_COURSE
}
fun isFMPlaying(): Boolean {
return YDLMusicPlayer.getInstance().isPlaying() && playingType == PLAY_TYPE_FM
}
fun isConfidePlaying(): Boolean {
return YDLMusicPlayer.getInstance().isPlaying() && playingType == PLAY_TYPE_CONFIDE
}
fun isPlaying(): Boolean {
return YDLMusicPlayer.getInstance().isPlaying()
}
fun fmPlay(url: String?) {
playingType =
PLAY_TYPE_FM
play(url)
}
fun confidePlay(url: String?) {
playingType =
PLAY_TYPE_CONFIDE
play(url)
}
fun coursePlay(url: String) {
playingType =
PLAY_TYPE_COURSE
play(url)
}
fun pause() {
YDLMusicPlayer.getInstance().pause()
}
fun seekTo(position: Int) {
YDLMusicPlayer.getInstance().seekTo(position)
}
fun play(url: String?, autoSaveProgress: Boolean = false) {
addHelperListener()
YDLMusicPlayer.getInstance().play(url, autoSaveProgress)
}
/**
* 直接播放
* 适用于已设置过播放参数的情景
*/
fun directPlay(index: Int = 0, autoSaveProgress: Boolean = false) {
addHelperListener()
YDLMusicPlayer.getInstance().play(autoSaveProgress, index)
}
private fun addHelperListener() {
if (playListener == null) {
playListener = object :
YDLMusicPlayer.PlayStateChangeListener {
override fun update(time: Int, allTime: Int) {
YDLMusicHelper.time = time
YDLMusicHelper.allTime = allTime
currentComplete = false
}
override fun reset() {
currentComplete = false
}
override fun completion() {
currentComplete = true
}
override fun prepared() {
currentComplete = false
}
}
YDLMusicPlayer.getInstance()
.addListener(playListener!!)
}
}
fun start() {
if (currentComplete) {
YDLMusicPlayer.getInstance().replay()
} else {
YDLMusicPlayer.getInstance().start()
}
}
fun stop() {
YDLMusicPlayer.getInstance().stop()
}
fun replay() {
YDLMusicPlayer.getInstance().replay()
}
fun release() {
YDLMusicPlayer.getInstance().release()
}
fun getCurrentData(): MusicInfoBean? {
return YDLMusicPlayer.getInstance().musicServiceControl?.getCurrentData()
}
/**
* 清除临时数据
*/
fun clearTempData() {
title = null
cover = null
name = null
courseVideoUlr = null
fmId = 0
isVideoPlaying = false
course_id = 0
playType = 0
}
}
package com.ydl.ydlcommon.actions.player
import android.content.ComponentName
import android.content.ServiceConnection
import android.os.IBinder
import android.text.TextUtils
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.actions.player.player.PlayStatusListener
import com.ydl.ydlcommon.actions.player.service.HMusicPlayService
import com.ydl.ydlcommon.utils.AppUtils
import java.util.concurrent.CopyOnWriteArraySet
class YDLMusicPlayer {
companion object {
fun getInstance(): YDLMusicPlayer {
return Holder.INSTANCE
}
}
private object Holder {
val INSTANCE = YDLMusicPlayer()
}
//记录服务是否bind成功,在unbind的时候进行判定,不然未bind成功却进行unbind操作会包错
private var isConnected = false
//常用自定义播放状态监听器
private var listeners: CopyOnWriteArraySet<PlayStateChangeListener> = CopyOnWriteArraySet()
//完整播放状态监听器
private var originalListeners: CopyOnWriteArraySet<PlayStatusListener> = CopyOnWriteArraySet()
//临时播放信息 - 服务未初始化时使用,初始化完成直接播放
var tempMusicInfoBean: MusicInfoBean? = null
var tempMusicList: ArrayList<MusicInfoBean>? = null
//当前播放音乐信息
var currentMusicInfoBean: MusicInfoBean? = null
//音乐列表
var musicList = ArrayList<MusicInfoBean>()
//播放控制器
var musicServiceControl: HMusicPlayService.MusicController? = null
//播放控制器获取回调
var controlTaker: MusicControlTaker? = null
//是否自动保存播放进度
var autoSaveProgress: Boolean = false
private var musicServiceConnection = object : ServiceConnection {
override fun onServiceConnected(componentName: ComponentName?, binder: IBinder?) {
musicServiceControl = binder as HMusicPlayService.MusicController
controlTaker?.onReceiveControl(musicServiceControl!!)
play(tempMusicInfoBean, autoSaveProgress)
play(tempMusicList, autoSaveProgress)
controlTaker = null
}
override fun onServiceDisconnected(p0: ComponentName?) {
}
}
fun addListener(listener: PlayStateChangeListener) {
listeners.add(listener)
}
fun removeListener(listener: PlayStateChangeListener) {
listeners.remove(listener)
}
fun addListener(listener: PlayStatusListener) {
originalListeners.add(listener)
}
fun removeListener(listener: PlayStatusListener) {
originalListeners.remove(listener)
}
fun isPlaying(): Boolean {
return musicServiceControl?.isPlaying() ?: false
}
fun pause() {
musicServiceControl?.pause();
}
fun play(url: String?, autoSaveProgress: Boolean = false) {
if (TextUtils.isEmpty(url)) {
return
}
play(MusicInfoBean(url), autoSaveProgress)
}
fun play(url: String, title: String, cover: String, desc: String, autoSaveProgress: Boolean = false) {
play(MusicInfoBean(url, title, cover, desc), autoSaveProgress)
}
fun play(musicInfoBean: MusicInfoBean?, autoSaveProgress: Boolean = false) {
if (musicInfoBean == null) {
return
}
if (isPrepareComplete(musicInfoBean, null, autoSaveProgress)) {
//如果单音频播放与上次播放内容不同则重新设置
// if (currentMusicInfoBean==null||
// musicInfoBean.url != currentMusicInfoBean?.url){
musicList.clear()
musicList.add(musicInfoBean)
currentMusicInfoBean = musicInfoBean
setData()
// }
play(autoSaveProgress)
}
}
fun play(musicInfoList: ArrayList<MusicInfoBean>?, autoSaveProgress: Boolean = false) {
if (musicInfoList == null || musicInfoList.isEmpty()) {
return
}
if (isPrepareComplete(null, musicInfoList, autoSaveProgress)) {
//如果不是完全相同则重新设置数据
// if (!(musicList.containsAll(musicInfoList) && musicInfoList.containsAll(musicList))){
musicList.clear()
musicList.addAll(musicInfoList)
setData()
// }
play(autoSaveProgress)
}
}
fun setData() {
musicServiceControl?.setData(musicList)
if (tempMusicInfoBean == null && tempMusicInfoBean == null) {
//非首次设置数据
for (listener in listeners) {
//数据重新设置回调
listener.reset()
}
}
tempMusicInfoBean = null
tempMusicList = null
autoSaveProgress = false
}
fun play(autoSaveProgress: Boolean = false, index: Int = 0) {
if (musicServiceControl?.playStatusListener != musicPlayListener) {
//设置播放监听
musicServiceControl?.playStatusListener = musicPlayListener
}
musicServiceControl?.play(index = index, autoSaveProgress = autoSaveProgress)
}
fun start() {
musicServiceControl?.start()
}
/**
* 播放服务是否初始化完毕
*/
private fun isPrepareComplete(musicInfoBean: MusicInfoBean?,
musicInfoList: ArrayList<MusicInfoBean>?,
autoSaveProgress: Boolean = false
): Boolean {
if (musicServiceControl == null
&& !AppUtils.isServiceRunning(BaseApp.getApp(), HMusicPlayService::class.java.name)) {
tempMusicInfoBean = musicInfoBean
tempMusicList = musicInfoList
this.autoSaveProgress = autoSaveProgress
if (!isConnected) {
isConnected = MusicPlayerHelper.bindService(
BaseApp.getApp(),
musicServiceConnection
)
}
return false
} else {
return true
}
}
/**
* 跳转至
*/
fun seekTo(position: Int) {
musicServiceControl?.seekTo(position)
}
/**
* 重新播放
*/
fun replay() {
musicServiceControl?.seekTo(0)
musicServiceControl?.play()
}
/**
* 停止播放
*/
fun stop() {
musicServiceControl?.stop()
}
/**
* 销毁服务、移除监听器并释放内存
*/
fun release() {
musicServiceControl?.stop()
listeners.clear()
originalListeners.clear()
//销毁后台服务
if (isConnected) {
MusicPlayerHelper.unBinderService(
BaseApp.getApp(),
musicServiceConnection
)
isConnected = false
}
MusicPlayerHelper.stopService(BaseApp.getApp())
}
private var musicPlayListener: PlayStatusListener = object :
PlayStatusListener {
override fun beforeStart(index: Int) {
for (listener in originalListeners) {
listener.beforeStart(index)
}
}
override fun onPrepared() {
for (listener in listeners) {
listener.prepared()
}
for (listener in originalListeners) {
listener.onPrepared()
}
}
override fun start() {
for (listener in originalListeners) {
listener.start()
}
}
override fun pause() {
for (listener in originalListeners) {
listener.pause()
}
}
override fun loading() {
for (listener in originalListeners) {
listener.loading()
}
}
override fun onProgressUpdate(progress: Int) {
for (listener in originalListeners) {
listener.onProgressUpdate(progress)
}
for (listener in listeners) {
listener.update(progress, musicServiceControl?.getDuration()!!)
}
}
override fun OnErrorListener(p1: Int, p2: String) {
for (listener in originalListeners) {
listener.OnErrorListener(p1, p2)
}
}
override fun OnBufferingUpdateListener(p1: Int) {
for (listener in originalListeners) {
listener.OnBufferingUpdateListener(p1)
}
}
override fun onCompletionListener() {
for (listener in originalListeners) {
listener.onCompletionListener()
}
for (listener in listeners) {
listener.completion()
}
}
}
/**
* 设置播放器控制器回调
* <课程播放 - HPlayView> 中使用
*/
fun setMusicControlTaker(taker: MusicControlTaker) {
if (isPrepareComplete(null, null)) {
taker.onReceiveControl(musicServiceControl!!)
} else {
this.controlTaker = taker;
}
}
interface MusicControlTaker {
fun onReceiveControl(control: HMusicPlayService.MusicController)
}
/**
* 自定义播放状态监听器
*/
interface PlayStateChangeListener {
fun update(time: Int, allTime: Int)
/**
* 重新设置数据回调
* 只有当和上次设置的数据源不同时才会调用
*
* 「场景:Page1点击音频播放,显示开始播放状态。
* 打开Page2开始播放新音频后,Page1应在会回调中重置播放状态」
*/
fun reset()
fun completion()
fun prepared()
}
}
package com.ydl.ydlcommon.actions.player.notifycation
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import com.ydl.ydlcommon.actions.player.MusicPlayerHelper
import com.ydl.ydlcommon.actions.player.service.HMusicPlayService
import java.lang.reflect.Method
/**
* 播放通知栏状态变化接收器
*/
class MusicPlayerReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
when (intent.action) {
HMusicPlayService.ACTION_PLAY -> {
MusicPlayerHelper.start(context)
collapseStatusBar(context)
}
HMusicPlayService.ACTION_PAUSE -> {
MusicPlayerHelper.pause(context)
collapseStatusBar(context)
}
HMusicPlayService.ACTION_DETAIL -> {
MusicPlayerHelper.notoifyDetailClick()
collapseStatusBar(context)
}
HMusicPlayService.ACTION_STOP -> {
MusicPlayerHelper.pauseService(context)
collapseStatusBar(context)
}
}
}
fun collapseStatusBar(context: Context) {
try {
val statusBarManager = context.getSystemService("statusbar")
var collapse: Method
if (Build.VERSION.SDK_INT <= 16) {
collapse = statusBarManager!!.javaClass.getMethod("collapse")
} else {
collapse = statusBarManager!!.javaClass.getMethod("collapsePanels")
}
collapse.invoke(statusBarManager)
} catch (localException: Exception) {
localException.printStackTrace()
}
}
}
package com.ydl.ydlcommon.actions.player.notifycation
import android.annotation.SuppressLint
import android.app.Notification
import android.content.Context
import android.os.Build
import android.support.annotation.RequiresApi
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.RemoteViews
import android.widget.TextView
import java.util.*
/**
* 获取通知字体颜色
* Created by zqk on 17-11-15.
*/
object NotificationHelper {
private val NOTIFICATION_TITLE = "notification_title"
val INVALID_COLOR = -1 // 无效颜色
private var notificationTitleColor =
INVALID_COLOR // 获取到的颜色缓存
@SuppressLint("NewApi")
/**
* 获取系统通知栏主标题颜色,根据Activity继承自AppCompatActivity或FragmentActivity采取不同策略。
*
* @param context 上下文环境
* @return 系统主标题颜色
*/
fun getNotificationColor(context: Context): Int {
try {
if (notificationTitleColor == INVALID_COLOR) {
if (context is AppCompatActivity) {
notificationTitleColor =
getNotificationColorCompat(
context
)
} else {
notificationTitleColor =
getNotificationColorInternal(
context
)
}
}
} catch (ignored: Exception) {
}
return notificationTitleColor
}
/**
* 通过一个空的Notification拿到Notification.lceContentView,通过[RemoteViews.apply]方法返回通知栏消息根布局实例。
*
* @param context 上下文
* @return 系统主标题颜色
*/
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
private fun getNotificationColorInternal(context: Context): Int {
val builder = Notification.Builder(context)
builder.setContentTitle(NOTIFICATION_TITLE)
val notification = builder.build()
try {
val root = notification.contentView.apply(context, FrameLayout(context)) as ViewGroup
val titleView = root.findViewById<View>(android.R.id.title) as TextView
if (null == titleView) {
iteratorView(
root,
object : Filter {
override fun filter(view: View) {
if (view is TextView) {
val textView = view as TextView
if (NOTIFICATION_TITLE == textView.text.toString()) {
notificationTitleColor =
textView.currentTextColor
}
}
}
})
return notificationTitleColor
} else {
return titleView.currentTextColor
}
} catch (e: Exception) {
return getNotificationColorCompat(
context
)
}
}
/**
* 使用getNotificationColorInternal()方法,Activity不能继承自AppCompatActivity(实测5.0以下机型可以,5.0及以上机型不行),
* 大致的原因是默认通知布局文件中的ImageView(largeIcon和smallIcon)被替换成了AppCompatImageView,
* 而在5.0及以上系统中,AppCompatImageView的setBackgroundResource(int)未被标记为RemotableViewMethod,导致apply时抛异常。
*
* @param context 上下文
* @return 系统主标题颜色
*/
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
private fun getNotificationColorCompat(context: Context): Int {
try {
val builder = Notification.Builder(context)
val notification = builder.build()
val layoutId = notification.contentView.layoutId
val root = LayoutInflater.from(context).inflate(layoutId, null) as ViewGroup
val titleView = root.findViewById<View>(android.R.id.title) as TextView
return titleView?.currentTextColor ?: getTitleColorIteratorCompat(
root
)
} catch (e: Exception) {
}
return INVALID_COLOR
}
private fun iteratorView(view: View?, filter: Filter) {
if (view == null || filter == null) {
return
}
filter.filter(view)
if (view is ViewGroup) {
val viewGroup = view as ViewGroup?
for (i in 0 until viewGroup!!.childCount) {
val child = viewGroup.getChildAt(i)
iteratorView(child, filter)
}
}
}
private fun getTitleColorIteratorCompat(view: View?): Int {
if (view == null) {
return INVALID_COLOR
}
val textViews = getAllTextViews(view)
val maxTextSizeIndex =
findMaxTextSizeIndex(textViews)
return if (maxTextSizeIndex != Integer.MIN_VALUE) {
textViews[maxTextSizeIndex].currentTextColor
} else INVALID_COLOR
}
private fun findMaxTextSizeIndex(textViews: List<TextView>): Int {
var max = Integer.MIN_VALUE.toFloat()
var maxIndex = Integer.MIN_VALUE
var index = 0
for (textView in textViews) {
if (max < textView.textSize) {
// 找到字号最大的字体,默认把它设置为主标题字号大小
max = textView.textSize
maxIndex = index
}
index++
}
return maxIndex
}
/**
* 实现遍历View树中的TextView,返回包含TextView的集合。
*
* @param root 根节点
* @return 包含TextView的集合
*/
private fun getAllTextViews(root: View): List<TextView> {
val textViews = ArrayList<TextView>()
iteratorView(
root,
object : Filter {
override fun filter(view: View) {
if (view is TextView) {
textViews.add(view as TextView)
}
}
})
return textViews
}
private interface Filter {
fun filter(view: View)
}
}
package com.ydl.ydlcommon.actions.player.player
import com.ydl.ydlcommon.actions.player.MusicInfoBean
/**
* 播放状态监听起
* Created by hgw on 2018/4/28.
*/
interface HPlayStatusListener{
//判断是否可以播放
fun isCanPlay(data : MusicInfoBean?):Boolean
//音频初始化完成
fun onPrepared(data : MusicInfoBean?, index:Int=0)
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player.player
/**
* 通知栏操作监听器
* Created by hgw on 2018/4/26.
*/
interface NotifyClickListener{
/**
* 播放通知栏详情点击
*/
fun notifyDetailClick()
}
package com.ydl.ydlcommon.actions.player.player
/**
* 播放状态回调
* Created by hgw on 2018/3/31.
*/
interface PlayStatusListener{
/**
* 开始播放之前
*/
fun beforeStart(index:Int)
fun onPrepared()
fun start()
fun pause()
fun loading()
fun onProgressUpdate(progress : Int)
fun OnErrorListener(p1: Int, p2: String)
fun OnBufferingUpdateListener(p1: Int)
fun onCompletionListener()
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player.service
import android.app.Notification
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
import android.media.AudioManager
import android.net.Uri
import android.os.Binder
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import android.support.v4.content.ContextCompat
import android.widget.RemoteViews
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.NotificationTarget
import com.google.android.exoplayer2.*
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
import com.google.android.exoplayer2.source.ExtractorMediaSource
import com.google.android.exoplayer2.source.TrackGroupArray
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
import com.google.android.exoplayer2.trackselection.TrackSelectionArray
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
import com.google.android.exoplayer2.util.Util
import com.yidianling.common.tools.LogUtil
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.actions.player.MusicInfoBean
import com.ydl.ydlcommon.actions.player.YDLMusicHelper
import com.ydl.ydlcommon.actions.player.notifycation.NotificationHelper
import com.ydl.ydlcommon.actions.player.player.PlayStatusListener
import com.ydl.ydlcommon.actions.player.util.LogH
import com.ydl.ydlcommon.actions.player.util.UtilH
import java.util.*
import kotlin.collections.ArrayList
/**
* Created by hgw on 2018/4/6.
*/
class HMusicPlayService : Service() {
private var timer: Timer = Timer()
private var isPlayWhenLoss = false
// private var media: MediaPlayer? = null
private var player: SimpleExoPlayer? = null
private var musicList: ArrayList<MusicInfoBean> = ArrayList()
private var binder: MusicController? = null
//缓冲进度 百分数
private var bufferProgress = 0
private var currentIndex = 0
//异步初始化完成是否自动播放
private var autoPlay = false
//自动播放下一曲
private var autoPlayNext = false //
//自动保存进度
private var autoSaveProgress = false
//是否加载中
private var loading = false
//是否开启通知栏
private var isOpenNotifyCation = false
//通知栏布局
var remoteViews: RemoteViews? = null
//当前播放URL
var currentUrl: String? = null
var handler = Handler(Looper.getMainLooper())
companion object {
val ONSTART = "harvie_ONSTART"
val ONSTART_NEW = "harvie_ONSTART_NEW" //播放新的音频
val INDEX = "harvie_INDEX" //需要播放的音频下标
val ONDESTROY = "harvie_ONDESTROY"
val ACTION = "harvie_ACTION" //
//通知栏操作action
val TAG = HMusicPlayService::class.java.simpleName!!
val ACTION_PLAY = "harvie_play"
val ACTION_PAUSE = "harvie_pause"
val ACTION_STOP = "harvie_stop"
val ACTION_DETAIL = "harvie_detail"
val REQUEST_CODE = 104
val NOTIFY_ID = 114
}
override fun onCreate() {
super.onCreate()
binder = MusicController()
initPlayer()
initListener()
requestAudioFocus()
handler.postDelayed({
timer.schedule(timerTask, 0, 600)
}, 500)
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
var bundle = intent?.getBundleExtra("bundle")
var action = bundle?.getString(ACTION) ?: ""
when (action) {
ONSTART -> {
startS()
}
ONSTART_NEW -> {
var index = bundle?.getInt(INDEX, -1) ?: -1
if (index > -1) {
playS(index)
}
}
ACTION_PAUSE ->
pauseS(true)
ACTION_STOP -> {
pauseS(false)
//移除通知栏
var myNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
myNotificationManager.cancel(NOTIFY_ID)
}
ONDESTROY ->
onDestroy()
}
return super.onStartCommand(intent, flags, startId)
}
private fun initPlayer() {
//创建带宽对象
val bandwidthMeter = DefaultBandwidthMeter()
//根据当前宽带来创建选择磁道工厂对象
val videoTrackSelectionFactory = AdaptiveTrackSelection.Factory(bandwidthMeter)
//传入工厂对象,以便创建选择磁道对象
var trackSelector = DefaultTrackSelector(videoTrackSelectionFactory)
//根据选择磁道创建播放器对象
player = ExoPlayerFactory.newSimpleInstance(application, trackSelector)
player!!.playWhenReady = false
}
private fun initListener() {
player!!.addListener(object : ExoPlayer.EventListener {
override fun onTracksChanged(trackGroups: TrackGroupArray?, trackSelections: TrackSelectionArray?) {
LogUtil.e("onTracksChanged")
}
override fun onLoadingChanged(isLoading: Boolean) {
LogUtil.e("onLoadingChanged=$isLoading")
}
override fun onPlayerStateChanged(playWhenReady: Boolean, playbackState: Int) {
when (playbackState) {
Player.STATE_ENDED -> {
LogUtil.e("Player.STATE_ENDED")
//播放完成后把当前的时间置为初始状态
if (autoSaveProgress) {
UtilH.saveProgress(applicationContext, musicList[currentIndex]?.url, 0)
}
//因多个状态会回调此方法,故做以下判断保证播放完成在回调
var duration = getDurationS()
var playProgress = getCurrentProgress()
if (duration > 0 && (playProgress / 1000) >= (duration / 1000)) {
// pauseS(true)
binder?.playStatusListener?.onCompletionListener()
if (autoPlayNext && (musicList.size - 1) > currentIndex) {
//播放下一曲
UtilH.saveProgress(applicationContext, musicList[currentIndex + 1]?.url, 0)
playS(currentIndex + 1)
} else {
seekToS(0, autoPlayNext)
}
}
}
Player.STATE_READY -> {
LogUtil.e("Player.STATE_READY")
//初始化完成
if (autoSaveProgress) {
var time = UtilH.getProgress(this@HMusicPlayService, currentUrl)
if (time > 0) {
player?.seekTo(time.toLong())
}
}
binder?.playStatusListener?.onPrepared()
if (autoPlay) {
startS()
autoPlay = false
}
}
Player.STATE_BUFFERING -> {
LogUtil.e("Player.STATE_BUFFERING")
}
Player.STATE_IDLE -> {
LogUtil.e("Player.STATE_IDLE")
}
}
}
override fun onPlayerError(error: ExoPlaybackException) {
binder?.playStatusListener?.OnErrorListener(error.type, error.cause?.message!!)
}
fun onPositionDiscontinuity() {
}
override fun onPlaybackParametersChanged(playbackParameters: PlaybackParameters) {
LogUtil.e("onPlaybackParametersChanged")
}
})
}
private fun requestAudioFocus() {
val audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
audioManager.requestAudioFocus({ focusChange ->
when (focusChange) {
AudioManager.AUDIOFOCUS_GAIN -> {
if (player?.playWhenReady != true && isPlayWhenLoss) {
player?.playWhenReady = true
}
}
AudioManager.AUDIOFOCUS_LOSS -> {
isPlayWhenLoss = player?.playWhenReady ?: false
if (player?.playWhenReady == true) {
player?.playWhenReady = false
}
}
AudioManager.AUDIOFOCUS_LOSS_TRANSIENT -> {
isPlayWhenLoss = player?.playWhenReady ?: false
if (player?.playWhenReady == true) {
player?.playWhenReady = false
}
}
AudioManager.AUDIOFOCUS_REQUEST_GRANTED -> {
isPlayWhenLoss = player?.playWhenReady ?: false
if (player?.playWhenReady == true) {
player?.playWhenReady = false
}
}
AudioManager.AUDIOFOCUS_REQUEST_FAILED -> {
isPlayWhenLoss = player?.playWhenReady ?: false
if (player?.playWhenReady == true) {
player?.playWhenReady = false
}
}
}
}, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT)
}
fun isPlayingS(): Boolean {
return try {
player?.playWhenReady ?: false
} catch (e: Exception) {
e.printStackTrace()
false
}
}
fun getCurrentDataS(): MusicInfoBean? {
if (musicList.size > currentIndex) {
return musicList[currentIndex]
}
return null
}
private fun getCurrentUrlS(): String {
if (musicList.size == 0 || musicList.size <= currentIndex) {
return ""
}
return musicList[currentIndex].url ?: ""
}
fun seekToS(time: Int, autoPlay: Boolean = true) {
this.autoPlay = autoPlay
try {
val seekPosition = (Math.min(
Math.max(0, time),
player!!.duration.toInt()
)).toLong()
player!!.seekTo(seekPosition)
if (autoSaveProgress) {
UtilH.saveProgress(this@HMusicPlayService, currentUrl, seekPosition.toInt())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
fun addDataS(urlLi: ArrayList<MusicInfoBean>) {
musicList.addAll(urlLi)
}
fun setDataS(urlLi: ArrayList<MusicInfoBean>) {
musicList.clear()
musicList.addAll(urlLi)
}
fun playS(index: Int, autoSaveProgress: Boolean) {
this.autoSaveProgress = autoSaveProgress
playS(index)
}
fun playS(index: Int) {
if (index >= musicList.size) return
this.currentIndex = index
this.currentUrl = getCurrentUrlS()
YDLMusicHelper.title = musicList[currentIndex].title
//初始化完成自动播放
autoPlay = true
try {
binder?.playStatusListener?.beforeStart(index)
//定义数据源工厂对象
val mediaDataSourceFactory = DefaultDataSourceFactory(
this,
Util.getUserAgent(this, applicationContext.packageName)
)
//创建Extractor工厂对象,用于提取多媒体文件
val extractorsFactory = DefaultExtractorsFactory()
//创建数据源
val mediaSource = ExtractorMediaSource(
Uri.parse(musicList[index].url),
mediaDataSourceFactory, extractorsFactory, Handler(), null
)
//添加数据源到播放器中
if (player == null) {
initPlayer()
}
player!!.prepare(mediaSource)
} catch (e: Exception) {
e.printStackTrace()
LogH.e("设置资源,准备阶段出错:" + musicList[index].url)
}
}
fun pauseS(isNotify: Boolean) {
try {
player?.playWhenReady = false
if (isNotify) {
updateNOtify()
}
} catch (e: Exception) {
e.printStackTrace()
}
binder?.playStatusListener?.pause()
}
fun stopS() {
player?.playWhenReady = false
player?.stop()
//移除通知栏
val myNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
myNotificationManager.cancel(NOTIFY_ID)
}
fun startS() {
try {
player?.playWhenReady = true
updateNOtify()
} catch (e: Exception) {
e.printStackTrace()
}
binder?.playStatusListener?.start()
}
fun getDurationS(): Int {
return try {
player?.duration?.toInt() ?: 0
} catch (e: Exception) {
e.printStackTrace()
0
}
}
fun getCurrentProgress(): Int {
return try {
player?.currentPosition?.toInt() ?: 0
} catch (e: Exception) {
e.printStackTrace()
0
}
}
override fun onBind(p0: Intent?): IBinder? {
return binder
}
override fun onUnbind(intent: Intent?): Boolean {
binder?.playStatusListener = null
return super.onUnbind(intent)
}
private var timerTask = object : TimerTask() {
override fun run() {
handler.post {
//更新播放进度
var pro = getCurrentProgress()
var isp = isPlayingS()
bufferProgress = player!!.bufferedPercentage
binder?.playStatusListener?.OnBufferingUpdateListener(bufferProgress)
if (isp) {
var buff = bufferProgress * getDurationS() / 100
if (pro >= buff) {
//播放进度已达到缓冲进度,表示网络加载中
binder?.playStatusListener?.loading()
loading = true
} else {
//缓冲大于播放进度,可以继续播放
if (loading) {
startS()
}
loading = false
binder?.playStatusListener?.onProgressUpdate(pro)
//保存进度
if (autoSaveProgress) {
UtilH.saveProgress(this@HMusicPlayService, currentUrl, pro)
}
}
}
}
}
}
/**
* 更新通知栏
*/
private fun updateNOtify() {
sendNotify()
}
/**
* 发送通知
*/
private fun sendNotify() {
if (!isOpenNotifyCation) return
remoteViews = createRemoteViews()
val builder = Notification.Builder(applicationContext)
.setContent(remoteViews)
.setSmallIcon(R.mipmap.ic_music_not) // 设置状态栏内的小图标
.setWhen(System.currentTimeMillis()) // 设置该通知发生的时间
.setOngoing(true) //在运行的
val notification = builder.build() // 获取构建好的Notification
// notification.flags = Notification.FLAG_NO_CLEAR; // 点击清除按钮时就会清除消息通知,但是点击通知栏的通知时不会消失
val target = NotificationTarget(applicationContext, R.id.iv_head, remoteViews, notification,
NOTIFY_ID
)
Glide.with(this)
.asBitmap()
.load(getCurrentDataS()?.pic)
.into(target)
remoteViews?.setTextViewText(R.id.tv_title, getCurrentDataS()?.title)
if (player?.playWhenReady == true) {
val intentPause = Intent(ACTION_PAUSE)
val pIntentPause = PendingIntent.getBroadcast(applicationContext,
REQUEST_CODE, intentPause, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews?.setOnClickPendingIntent(R.id.btn_pause_play, pIntentPause)
remoteViews?.setImageViewResource(R.id.btn_pause_play, R.mipmap.ic_pause_24dp)
} else {
val intentPlay = Intent(ACTION_PLAY)
val pIntentPlay = PendingIntent.getBroadcast(applicationContext,
REQUEST_CODE, intentPlay, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews?.setOnClickPendingIntent(R.id.btn_pause_play, pIntentPlay)
remoteViews?.setImageViewResource(R.id.btn_pause_play, R.mipmap.ic_play_24dp)
}
var myNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
myNotificationManager.notify(NOTIFY_ID, notification)
}
private fun createRemoteViews(): RemoteViews {
val remoteViews = RemoteViews(packageName, R.layout.ui_music_notification)
val intentStop = Intent(ACTION_STOP)
val pIntentStop = PendingIntent.getBroadcast(applicationContext,
REQUEST_CODE, intentStop, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(R.id.btn_close, pIntentStop)
val intentDetail = Intent(ACTION_DETAIL)
val pIntentDetail = PendingIntent.getBroadcast(applicationContext,
REQUEST_CODE, intentDetail, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(R.id.iv_head, pIntentDetail)
remoteViews.setOnClickPendingIntent(R.id.tv_title, pIntentDetail)
val color = getColor()
remoteViews.setTextColor(R.id.tv_title, color)
return remoteViews
}
private fun getColor(): Int {
var color = ContextCompat.getColor(applicationContext, R.color.default_text_color)
val tempColor = NotificationHelper.getNotificationColor(applicationContext)
if (tempColor != NotificationHelper.INVALID_COLOR) {
color = tempColor
}
return color
}
override fun onDestroy() {
super.onDestroy()
timerTask.cancel()
timer.purge()
timer.cancel()
player?.playWhenReady = false
player?.release()
currentUrl = null
player = null
binder = null
musicList.clear()
var myNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
myNotificationManager.cancel(NOTIFY_ID)
}
inner class MusicController : Binder() {
//状态回调
var playStatusListener: PlayStatusListener? = null
fun setData(urlLi: ArrayList<MusicInfoBean>) {
setDataS(urlLi)
}
fun addData(urlLi: ArrayList<MusicInfoBean>) {
addDataS(urlLi)
}
fun getData(): ArrayList<MusicInfoBean> {
return musicList
}
fun getCurrentData(): MusicInfoBean? {
return getCurrentDataS()
}
fun play(index: Int = 0, autoSaveProgress: Boolean = false) {
playS(index, autoSaveProgress)
}
fun getDuration(): Int {
return getDurationS()
}
fun getCurrentUrl(): String {
return currentUrl ?: ""
}
fun getCurrentIndex(): Int {
return currentIndex
}
fun seekTo(time: Int) {
seekToS(time)
}
fun pause() {
pauseS(true)
}
fun stop() {
stopS()
}
fun start() {
startS()
}
fun setAutoPlayNext(next: Boolean) {
autoPlayNext = next
}
/**
* 是否显示通知栏
*/
fun setOpenNotifyCation(isShow: Boolean) {
isOpenNotifyCation = isShow
}
fun isPlaying(): Boolean {
return isPlayingS()
}
/**
* 是否有下一曲
*/
fun isHaveNext(): Boolean {
var size = musicList.size
return currentIndex < size - 1
}
/**
* 是否有上一曲
*/
fun isHavePre(): Boolean {
return currentIndex > 0
}
/**
* 上一曲
*/
fun onPrePlaying() {
if (isHavePre()) {
if (autoSaveProgress) {
UtilH.saveProgress(applicationContext, getData()[currentIndex - 1]?.url, 0)
}
play(currentIndex - 1)
}
}
/**
* 下一曲
*/
fun onNextPlaying() {
if (isHaveNext()) {
if (autoSaveProgress) {
UtilH.saveProgress(applicationContext, getData()[currentIndex + 1]?.url, 0)
}
play(currentIndex + 1)
}
}
}
}
package com.ydl.ydlcommon.actions.player.util
import android.util.Log
/**
* 日志打印
* Created by hgw on 2018/3/31.
*/
object LogH {
private val TAG : String = "harvieMusicPlayer"
fun d(str : String){
Log.d(TAG,str)
}
fun e(str : String){
Log.e(TAG,str)
}
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player.util
import android.content.Context
import android.text.TextUtils
import com.ydl.ydlcommon.actions.player.Config
/**
* 工具类
* Created by hgw on 2018/3/31.
*/
object UtilH {
/**
* 保存播放进度
*/
fun saveProgress(context: Context?,url : String?,progress : Int){
if (TextUtils.isEmpty(url))return
var shared = context?.getSharedPreferences(Config.HMusicProgress,Context.MODE_PRIVATE)
var edit = shared?.edit()
edit?.putInt(url,progress)
edit?.commit()
}
/**
* 获取进度
*/
fun getProgress(context: Context?,url : String?):Int{
if (TextUtils.isEmpty(url))return 0
var shared = context?.getSharedPreferences(Config.HMusicProgress,Context.MODE_PRIVATE)
return shared?.getInt(url,0)?:0
}
}
\ No newline at end of file
package com.ydl.ydlcommon.actions.player.view
import android.app.Activity
import android.os.Handler
import android.view.View
import android.widget.RelativeLayout
import android.widget.SeekBar
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.actions.player.MusicInfoBean
import com.ydl.ydlcommon.actions.player.YDLMusicHelper
import com.ydl.ydlcommon.actions.player.YDLMusicPlayer
import com.ydl.ydlcommon.actions.player.player.HPlayStatusListener
import com.ydl.ydlcommon.actions.player.player.PlayStatusListener
import com.ydl.ydlcommon.actions.player.service.HMusicPlayService
import kotlinx.android.synthetic.main.play_music_view.view.*
/**
* Created by hgw on 2018/4/28.
*/
class HPlayView : RelativeLayout, YDLMusicPlayer.MusicControlTaker {
var control: HMusicPlayService.MusicController? = null
var listener: HPlayStatusListener? = null
var mHandler: Handler? = null
//seekBar 按下标记
var seekBarIsDown = false
var progress = 0
var mContext: Activity? = null
constructor(context1: Activity?) : super(context1) {
this.mContext = context1
mHandler = Handler()
init()
}
fun init() {
if (mContext == null) return
YDLMusicPlayer.getInstance().setMusicControlTaker(this)
View.inflate(context, R.layout.play_music_view, this)
play_icon.setOnClickListener {
if (control?.isPlaying() == true) {
control?.pause()
} else {
control?.start()
}
}
img_gif.setOnClickListener {
if (control?.isPlaying() == false) {
control?.start()
}
}
pro_progress.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
if (p2) {
text_start_time.text = getStringTime(p1)
progress = p1
}
}
override fun onStartTrackingTouch(p0: SeekBar?) {
seekBarIsDown = true
}
override fun onStopTrackingTouch(p0: SeekBar?) {
seekBarIsDown = false
//拖动seekbar时不进行以下操作
if (!seekBarIsDown) {
control?.seekTo(progress)
}
}
})
}
fun showNetNotice(event: () -> Unit) {
ll_net_notice.visibility = View.VISIBLE
img_gif.visibility = View.GONE
iv_net_notice.setOnClickListener {
hideNetNotice()
event()
}
}
fun hideNetNotice() {
ll_net_notice.visibility = View.GONE
img_gif.visibility = View.VISIBLE
}
fun setData(urlLi: ArrayList<MusicInfoBean>): HPlayView {
control?.setData(urlLi)
return this
}
/**
* 后台进入前台view
*/
fun updateView(index: Int) {
if (control?.isPlaying()!!) {
mHandler?.postDelayed({
pro_progress.max = control?.getDuration() ?: 0
text_end_time.text = getStringTime(pro_progress.max)
listener?.onPrepared(control?.getCurrentData(), index)
}, 0)
updateButton()
}
}
/**
* 获取当前播放下标
*/
fun getCurrentIndex(): Int {
return control?.getCurrentIndex() ?: 0
}
/**
* 获取当前播放url
*/
fun getCurrentUrl(): String {
return control?.getCurrentUrl() ?: ""
}
fun play(index: Int) {
updateButton()
YDLMusicHelper.playingType = YDLMusicHelper.PLAY_TYPE_COURSE
YDLMusicHelper.directPlay(index, true)
}
fun setImageBackground(url: String?) {
Glide.with(mContext).load(url).into(img_bg)
}
/**
* 获取播放控制器
*/
fun getPlayControl(): HMusicPlayService.MusicController? {
return control
}
/**
* 设置自动播放下一曲
*/
fun setAutoNext(auto: Boolean) {
control?.setAutoPlayNext(auto)
}
override fun onReceiveControl(control: HMusicPlayService.MusicController) {
this.control = control
setControl1(control)
}
var playStatusListener: PlayStatusListener? = null
private fun setControl1(control: HMusicPlayService.MusicController?) {
control?.setOpenNotifyCation(true)
if (playStatusListener == null) {
playStatusListener = object : PlayStatusListener {
override fun beforeStart(index: Int) {
showBufferLoading(true)
}
override fun onCompletionListener() {
// LogH.d("onCompletionListener")
updateButton()
}
override fun loading() {
// LogH.d("loading")
showBufferLoading(true)
}
override fun onPrepared() {
// LogH.d("onPrepared")
mHandler?.postDelayed({
pro_progress.max = control?.getDuration() ?: 0
text_end_time.text = getStringTime(pro_progress.max)
listener?.onPrepared(control?.getCurrentData(), control?.getCurrentIndex()
?: 0)
}, 0)
}
override fun start() {
// LogH.d("start")
setGifVisibity(true)
}
override fun pause() {
// LogH.d("pause")
setGifVisibity(false)
}
override fun onProgressUpdate(progress: Int) {
mHandler?.postDelayed({
//拖动seekbar时不进行以下操作
if (!seekBarIsDown) {
pro_progress.progress = progress
text_start_time.text = getStringTime(progress)
}
}, 0)
}
override fun OnErrorListener(p1: Int, p2: String) {
// LogH.d("OnErrorListener:$p1 $p2")
setGifVisibity(false)
}
override fun OnBufferingUpdateListener(p1: Int) {
// LogH.d("OnBufferingUpdateListener:$p1")
mHandler?.postDelayed({
pro_progress.secondaryProgress = p1 * pro_progress.max / 100
}, 0)
}
}
YDLMusicPlayer.getInstance().addListener(playStatusListener!!)
}
}
fun showBufferLoading(show: Boolean) {
mHandler?.postDelayed({
if (show) {
if (mContext != null) {
Glide.with(mContext).asGif().load(R.mipmap.loading5).into(img_gif)
}
play_icon.setImageResource(R.drawable.ico_course_play)
} else {
if (mContext != null) {
Glide.with(mContext).asGif().load(R.mipmap.audio_play).into(img_gif)
}
play_icon.setImageResource(R.drawable.ico_course_pause)
}
}, 0)
}
//显示或隐藏播放动画
fun setGifVisibity(show: Boolean) {
if (context == null) return
mHandler?.postDelayed({
if (show) {
if (mContext != null) {
Glide.with(mContext).asGif().load(R.mipmap.audio_play).into(img_gif)
}
play_icon.setImageResource(R.drawable.ico_course_pause)
} else {
if (mContext != null) {
Glide.with(mContext).asBitmap().load(R.drawable.ico_course_bg_pause).into(img_gif)
}
play_icon.setImageResource(R.drawable.ico_course_play)
}
}, 0)
}
//跟新上下音频按钮状态
fun updateButton() {
mHandler?.postDelayed({
if (control?.isPlaying() == true) {
setGifVisibity(true)
}
}, 0)
}
fun getStringTime(time: Int): String {
if (time <= 0) return "00:00"
var min = time / 60000
var ss = (time - min * 60000) / 1000
var mm = "" + min
var SS = "" + ss
if (min < 10) {
mm = "0$mm"
}
if (ss < 10) {
SS = "0$ss"
}
return "$mm:$SS"
}
fun onDestroy() {
mContext = null
mHandler = null
playStatusListener?.let { YDLMusicPlayer.getInstance().removeListener(it) }
}
}
\ No newline at end of file
package com.ydl.ydlcommon.event
/**
* EventBus事件,通知更改FM或课程播放状态
* Created by zqk on 17-11-14.
*/
class UpdatePlayStatusEvent {
}
\ No newline at end of file
package com.ydl.ydlcommon.event;
/**
* Created by zqk on 17-11-15.
*/
public class UpdateSafeTipViewEvent {
}
package com.ydl.ydlcommon.ui.confideredpacket
import android.content.Context
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.ui.confideredpacket.http.ConfideRedPacketHttpImpl
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.confide_redpacket_view.view.*
/**
* @author yuanWai
* @描述:倾诉红包提示View
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/27
*/
class ConfideRedPacketView : RelativeLayout {
private var jumpType: Int =
JUMP_NOT
private var mRedPacketCallBack: RedPacketCallBack? = null
private var onDataRequestFinishedListener: OnDataRequestFinishedListener? = null
//是否显示
private var redPacketVisible: Int = View.VISIBLE
companion object {
/**
* 跳转类型
* 0.不跳转 1.跳转倾诉频道 2.跳转专家详情
*/
const val JUMP_NOT = 0
const val JUMP_CONFIDE_HOME = 1
const val JUMP_EXPERT_INFO = 2
}
constructor(context: Context) : super(context) {
initView()
}
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) {
initView()
}
/**
* 界面初始化
*/
private fun initView() {
View.inflate(context, R.layout.confide_redpacket_view, this)
setOnClickListener {
when (jumpType) {
JUMP_NOT -> {//不跳转
}
JUMP_CONFIDE_HOME -> {//跳转倾诉频道页
// ARouter.getInstance().build("/confide/home").navigation()
YDLRouterManager.router("ydl-user://confide/home")
}
JUMP_EXPERT_INFO -> {//跳转专家详情页
if (null != mRedPacketCallBack) {
mRedPacketCallBack!!.jumpExpertInfo()
}
}
}
visibility = View.GONE
}
imgClose.setOnClickListener {
visibility = View.GONE
}
}
/**
* 请求红包列表数据
*/
fun initData(visible: Int) {
this.redPacketVisible = visible
ConfideRedPacketHttpImpl.getInstance().getCouponMax(
RedListParam(
3
)
).compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
setData(it)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
visibility = View.GONE
}
})
}
//设置不跳转
fun setNot() {
jumpType = JUMP_NOT
}
//设置跳转倾诉列表首页
fun setConfide() {
jumpType = JUMP_CONFIDE_HOME
}
//设置跳转专家详情页
fun setExpertInfo() {
jumpType = JUMP_EXPERT_INFO
}
/**
* 数据赋值
*/
private fun setData(couponMax: String) {
if (TextUtils.isEmpty(couponMax)) {
visibility = View.GONE
return
}
var max = couponMax.toFloat().toInt()
visibility = if (max > 0) {
View.VISIBLE
} else {
View.GONE
}
//因为数据请求是异步的 会出现 MainActivity设置了隐藏 但是到了这里 依然显示的现象
visibility = redPacketVisible
if (max <= 0) {
visibility = View.GONE
}
val sb = StringBuffer()
sb.append("您有")
.append(max)
.append("元的倾诉红包,倾诉享")
tvMsg.text = sb.toString()
if (onDataRequestFinishedListener != null) {
onDataRequestFinishedListener!!.onDataRequestFinishedListener(max)
}
}
fun setCloseHide() {
imgClose.visibility = View.GONE
}
fun setRedPacketCallBack(mRedPacketCallBack: RedPacketCallBack) {
this.mRedPacketCallBack = mRedPacketCallBack
}
interface RedPacketCallBack {
fun jumpExpertInfo()
}
fun setOnDataRequestFinishedListener(onDataRequestFinishedListener: OnDataRequestFinishedListener) {
this.onDataRequestFinishedListener = onDataRequestFinishedListener
}
/**
* 数据请求完成回调
*/
interface OnDataRequestFinishedListener {
fun onDataRequestFinishedListener(max: Int)
}
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.confideredpacket
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/27
*/
data class RedListParam(val serviceType : Int)
\ No newline at end of file
package com.ydl.ydlcommon.ui.confideredpacket.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 io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Query
/**
* @author yuanwai
* @描述:倾诉首页Api
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/10
*/
interface ConfideRedPacketApi{
//倾诉红包接口
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("auth/coupon/max")
fun getCouponMax(@Query("serviceType") serviceType :String ): Observable<BaseAPIResponse<String>>
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.confideredpacket.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.ui.confideredpacket.RedListParam
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
/**
* @author yuanwai
* @描述:倾诉红包接口实现类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/28
*/
class ConfideRedPacketHttpImpl private constructor() :
IConfideRedPacketHttp {
companion object {
fun getInstance(): ConfideRedPacketHttpImpl {
return Holder.INSTANCE
}
}
object Holder {
val INSTANCE = ConfideRedPacketHttpImpl()
}
private val confideHomeApi: ConfideRedPacketApi by lazy {
YDLHttpUtils.obtainApi(ConfideRedPacketApi::class.java)
}
override fun getCouponMax(param: RedListParam): Observable<BaseAPIResponse<String>> {
return RxUtils.mapObservable(param)
.flatMap {
confideHomeApi.getCouponMax(param.serviceType.toString())
}
}
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.confideredpacket.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.ui.confideredpacket.RedListParam
import io.reactivex.Observable
/**
* @author yuanwai
* @描述:倾诉红包接口
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/28
*/
interface IConfideRedPacketHttp{
/**
* 倾诉首页请求
*/
fun getCouponMax(param: RedListParam): Observable<BaseAPIResponse<String>>
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/27
*/
// noThing为无关参数
data class CouponHintParam(val noThing : Int)
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/01/02
*/
class CouponHintResponseBean(val msg:String, val url:String)
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint
import android.content.Context
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.ui.couponhint.http.CouponHintHttpImpl
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.confide_redpacket_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:我的课程优惠码View
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/27
*/
class CouponHintView : RelativeLayout{
private var jumpType : Int =
JUMP_TO_COUPON_LIST
private var mCouponHintCallBack : CouponHintCallBack? = null
//是否显示
private var couponHintVisible : Int = View.VISIBLE
private var couponUrl:String? = null
companion object {
/**
* 跳转类型
* 0.跳转红包
*/
const val JUMP_TO_COUPON_LIST = 0
}
constructor(context:Context):super(context){
initView()
}
constructor(context: Context,attributeSet: AttributeSet):super(context,attributeSet){
initView()
}
/**
* 界面初始化
*/
private fun initView(){
View.inflate(context, R.layout.coupon_hint_view,this)
setOnClickListener {
when(jumpType){
JUMP_TO_COUPON_LIST ->{//我的红包
if (TextUtils.isEmpty(couponUrl)) {
YDLRouterManager.router("ydl-user://mine/redpacket")
}else {
YDLRouterManager.router(couponUrl)
}
}
}
visibility = View.GONE
}
imgClose.setOnClickListener {
visibility = View.GONE
}
}
/**
* 请求红包列表数据
*/
fun initData(visible : Int){
this.couponHintVisible = visible
CouponHintHttpImpl.getInstance().getCouponHint(
CouponHintParam(
0
)
).compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (null != it) {
setData(it)
couponUrl = it.url
}
}, object: ThrowableConsumer() {
override fun accept(msg: String) {
visibility = View.GONE
}
})
}
//设置跳转到我的红包
fun setCouponList(){
jumpType = JUMP_TO_COUPON_LIST
}
/**
* 数据赋值
*/
private fun setData(couponData : CouponHintResponseBean){
if (TextUtils.isEmpty(couponData.msg)){
visibility = View.GONE
return
}
//因为数据请求是异步的 会出现 MainActivity设置了隐藏 但是到了这里 依然显示的现象
visibility = couponHintVisible
val sb = StringBuffer()
sb.append(couponData.msg)
tvMsg.text = sb.toString()
}
fun setCloseHide(){
imgClose.visibility = View.GONE
}
fun setRedPacketCallBack(mRedPacketCallBack : CouponHintCallBack){
this.mCouponHintCallBack = mRedPacketCallBack
}
interface CouponHintCallBack{
fun jumpInfo() //暂未设置跳转
}
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.ui.couponhint.CouponHintResponseBean
import retrofit2.http.GET
import io.reactivex.Observable
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/27
*/
interface CouponHintApi{
//倾诉红包接口
@GET("auth/coupon/courseCoupon/warn")
fun getCouponHint(): Observable<BaseAPIResponse<CouponHintResponseBean>>
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.ui.couponhint.CouponHintParam
import com.ydl.ydlcommon.ui.couponhint.CouponHintResponseBean
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/27
*/
class CouponHintHttpImpl private constructor(): ICouponHintHttp {
companion object {
fun getInstance(): CouponHintHttpImpl {
return Holder.INSTANCE
}
}
object Holder {
val INSTANCE = CouponHintHttpImpl()
}
private val couponHintApi: CouponHintApi by lazy {
YDLHttpUtils.obtainApi(CouponHintApi::class.java)
}
override fun getCouponHint(param: CouponHintParam): Observable<BaseAPIResponse<CouponHintResponseBean>> {
return RxUtils.mapObservable(param)
.flatMap {
couponHintApi.getCouponHint()
}
}
}
\ No newline at end of file
package com.ydl.ydlcommon.ui.couponhint.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.ui.couponhint.CouponHintParam
import com.ydl.ydlcommon.ui.couponhint.CouponHintResponseBean
import io.reactivex.Observable
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/27
*/
interface ICouponHintHttp{
/**
* 倾诉首页请求
*/
fun getCouponHint(param: CouponHintParam): Observable<BaseAPIResponse<CouponHintResponseBean>>
}
\ No newline at end of file
package com.ydl.ydlcommon.utils
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.PixelFormat
import android.graphics.Point
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.yidianling.common.tools.RxImageTool
import com.ydl.ydlcommon.actions.player.YDLMusicHelper
import com.ydl.ydlcommon.view.PlayerFloatView
/**
* 音频播放悬浮窗 帮助类
*
* 需要在Activity onDestroy中调用removeView()方法移除
* 避免内存泄露
*/
class PlayerFloatHelper {
companion object {
@SuppressLint("StaticFieldLeak")
private var mPlayerFloatView: PlayerFloatView? = null
//已添加悬浮窗页面全路径名
private var showingPageName: String? = null
private var wm: WindowManager? = null
/**
* 如果有音频正在播放则显示
*/
fun showIfPlaying(context: Context) {
if (YDLMusicHelper.isFMPlaying()|| YDLMusicHelper.isConfidePlaying() || YDLMusicHelper.isCoursePlaying() || YDLMusicHelper.isVideoPlaying) {
show(context)
mPlayerFloatView?.updatePlayState()
} else {
hide()
}
}
/**
* 显示悬浮控件
*/
fun show(context: Context) {
if (mPlayerFloatView == null) {
mPlayerFloatView =
PlayerFloatView(context)
}
if (showingPageName != context::class.qualifiedName) {
mPlayerFloatView?.resetWm(context)
addFloatToWm(context)
}
mPlayerFloatView?.resetView()
mPlayerFloatView?.visibility = View.VISIBLE
mPlayerFloatView?.setPlayingState()
}
fun hide() {
mPlayerFloatView?.visibility = View.GONE
mPlayerFloatView?.stopVideo()
}
fun addClickListener(listener: PlayerFloatView.FloatViewPlayListener) {
mPlayerFloatView?.addFloatClickListener(listener)
}
fun removeClickListener(listener: PlayerFloatView.FloatViewPlayListener) {
mPlayerFloatView?.removeFloatClickListener(listener)
}
fun isShow(context: Context): Boolean {
return !TextUtils.isEmpty(showingPageName) && showingPageName == context::class.qualifiedName && mPlayerFloatView?.visibility == View.VISIBLE
}
fun removeView(context: Context) {
if (TextUtils.isEmpty(showingPageName) || showingPageName != context::class.qualifiedName) {
return
}
mPlayerFloatView?.stopVideo()
mPlayerFloatView?.visibility = View.GONE
wm?.removeViewImmediate(mPlayerFloatView)
showingPageName = ""
wm = null
}
fun onDestroy() {
if (mPlayerFloatView != null) {
if (!TextUtils.isEmpty(showingPageName)) {
wm?.removeViewImmediate(mPlayerFloatView)
showingPageName = ""
}
mPlayerFloatView?.onDestroy()
mPlayerFloatView?.removeAllViews()
}
}
fun setPlayingState(context: Context) {
if (YDLMusicHelper.playType == 1) {
hide()
YDLMusicHelper.playType = 0
show(context)
}
mPlayerFloatView?.setPlayingState()
}
fun updatePlayState() {
mPlayerFloatView?.updatePlayState()
}
private fun addFloatToWm(context: Context) {
if (wm != null && !TextUtils.isEmpty(showingPageName)) {
wm?.removeViewImmediate(mPlayerFloatView)
wm = null
}
//获取WindowManager
wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
//设置LayoutParams(全局变量)相关参数
val wmParams = mPlayerFloatView?.wmParams
wmParams?.type = WindowManager.LayoutParams.TYPE_APPLICATION //设置window type
wmParams?.format = PixelFormat.RGBA_8888 //设置图片格式,效果为背景透明
//设置Window flag
wmParams?.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
wmParams?.gravity = Gravity.LEFT or Gravity.TOP //调整悬浮窗口至左上角
//以屏幕左上角为原点,设置x、y初始值
val size = Point()
wm?.defaultDisplay?.getSize(size)
if (YDLMusicHelper.playType == 0) {//音频
wmParams?.x = 0
wmParams?.y = size.y * 5 / 6
//设置悬浮窗口长宽数据
wmParams?.width = WindowManager.LayoutParams.MATCH_PARENT
wmParams?.height = RxImageTool.dp2px(56f)
} else {
wmParams?.x = size.x - RxImageTool.dp2px(220f)
wmParams?.y = size.y * 3 / 4
//设置悬浮窗口长宽数据
wmParams?.width = RxImageTool.dp2px(220f)
wmParams?.height = RxImageTool.dp2px(124f)
}
//显示myFloatView图像
wm?.addView(mPlayerFloatView, wmParams)
showingPageName = context::class.qualifiedName!!
}
}
}
package com.ydl.ydlcommon.view
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.os.Handler
import android.os.Message
import android.text.TextUtils
import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import android.view.WindowManager
import android.widget.*
import com.dou361.ijkplayer.widget.PlayStateParams
import com.dou361.ijkplayer.widget.PlayerView
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideRoundTransform
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.actions.player.YDLMusicHelper
import com.ydl.ydlcommon.actions.player.YDLMusicPlayer
import com.ydl.ydlcommon.actions.player.util.UtilH
import tv.danmaku.ijk.media.player.IMediaPlayer
import java.util.*
import java.util.concurrent.CopyOnWriteArraySet
class PlayerFloatView(var mContext: Context) : FrameLayout(mContext) {
//播放类型 1:视频 0:音频
private var playType = 0
private var mTouchStartX: Float = 0.toFloat()
private var mTouchStartY: Float = 0.toFloat()
private var mCurrX: Float = 0.toFloat()
private var mCurrY: Float = 0.toFloat()
private var playState: ImageView? = null
private var mAudioLayout: LinearLayout? = null
private var mVideoLayout: RelativeLayout? = null
private var mInfoLayout: RelativeLayout? = null
private var playClose: ImageView? = null
private var playVideoClose: ImageView? = null
private var playHead: ImageView? = null
private var titleView: TextView? = null
private var nameView: TextView? = null
private var currentPlayingTimeView: TextView? = null
private var durationView: TextView? = null
private var mTouchSlop: Int = 0
private var videoFullScreen: ImageView? = null
private var videoBoxLayout: RelativeLayout? = null
private var time: Int = 0
private var allTime: Int = 0
private var isMove: Boolean = false
//视频播放器view
private var videoView: PlayerView? = null
private var wm: WindowManager? = null
//此wmParams为获取的全局变量,用以保存悬浮窗口的属性
var wmParams = WindowManager.LayoutParams()
private var myHandler: Handler? = null
private val UPDATE_VIEW_STATE = 1
private val UPDATE_VIEW_COMPLETE = 2
private val UPDATE_PLAY_TIME = 3//更新播放时间
private var listeners: CopyOnWriteArraySet<FloatViewPlayListener> = CopyOnWriteArraySet()
private var mStateChangeListener: YDLMusicPlayer.PlayStateChangeListener? = null
private var timer: Timer? = null
private var isCurrentVideoPlaying = true
init {
init(context)
}
fun resetWm(context: Context) {
wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
wmParams = WindowManager.LayoutParams()
}
fun resetView() {
playType = YDLMusicHelper.playType
resetAudioAndVideoView()
}
@SuppressLint("ClickableViewAccessibility")
private fun init(context: Context) {
wm = getContext().getSystemService(Context.WINDOW_SERVICE) as WindowManager
mTouchSlop = ViewConfiguration.get(getContext()).scaledTouchSlop + 8
val view = View.inflate(context, R.layout.platform_item_playing_float_btn, this)
mAudioLayout = view.findViewById(R.id.ll_audio_layout)
mVideoLayout = view.findViewById(R.id.rl_video_layout)
mInfoLayout = view.findViewById(R.id.rl_info)
videoBoxLayout = view.findViewById(R.id.app_video_box)
playType = YDLMusicHelper.playType
playHead = view.findViewById(R.id.play_head)
playState = view.findViewById(R.id.play_state)
playClose = view.findViewById(R.id.play_close)
playVideoClose = view.findViewById(R.id.iv_video_close)
videoFullScreen = view.findViewById(R.id.iv_video_full_screen)
titleView = view.findViewById(R.id.tv_title)
nameView = view.findViewById(R.id.tv_name)
currentPlayingTimeView = view.findViewById(R.id.tv_now_playing_time)
durationView = view.findViewById(R.id.tv_duration)
resetAudioAndVideoView()
if (!TextUtils.isEmpty(YDLMusicHelper.cover)) {
GlideApp.with(context.applicationContext)
.load(YDLMusicHelper.cover)
.transform(GlideRoundTransform(context, 4))
.error(R.drawable.ico_play_float_pic)
.into(playHead!!)
}
myHandler = MyHandler()
playHead!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
YDLMusicHelper.startPlayingActivity(context)
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
titleView!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
YDLMusicHelper.startPlayingActivity(context)
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
nameView!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
YDLMusicHelper.startPlayingActivity(context)
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
playClose!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
this@PlayerFloatView.visibility = View.GONE
YDLMusicHelper.clearTempData()
YDLMusicHelper.stop()
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
playVideoClose!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
this@PlayerFloatView.visibility = View.GONE
this.videoView?.stopPlay()
YDLMusicHelper.clearTempData()
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
videoFullScreen!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
YDLMusicHelper.startPlayingActivity(context, 1)
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
playState!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
if (YDLMusicHelper.isPlaying()) {
playState!!.setImageResource(R.drawable.ico_yyfc_play)
YDLMusicHelper.pause()
for (listener in listeners) {
//数据重新设置回调
listener.onPauseClick()
}
} else {
playState!!.setImageResource(R.drawable.ico_yyfc_pause)
YDLMusicHelper.start()
for (listener in listeners) {
//数据重新设置回调
listener.onStartClick()
}
}
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
if (mStateChangeListener == null) {
mStateChangeListener = object : YDLMusicPlayer.PlayStateChangeListener {
override fun reset() {
}
override fun update(time: Int, allTime: Int) {
this@PlayerFloatView.time = time
this@PlayerFloatView.allTime = allTime
myHandler?.sendEmptyMessage(UPDATE_PLAY_TIME)
}
fun pause() {
}
override fun completion() {
myHandler?.sendEmptyMessage(UPDATE_VIEW_COMPLETE)
}
override fun prepared() {
myHandler?.sendEmptyMessage(UPDATE_VIEW_STATE)
}
fun error() {
}
}
YDLMusicPlayer.getInstance().addListener(mStateChangeListener!!)
}
}
private fun resetAudioAndVideoView() {
if (!TextUtils.isEmpty(YDLMusicHelper.cover)) {
GlideApp.with(context.applicationContext)
.load(YDLMusicHelper.cover)
.transform(GlideRoundTransform(context, 4))
.error(R.drawable.ico_play_float_pic)
.into(playHead!!)
}
if (TextUtils.isEmpty(YDLMusicHelper.title)) {
if (YDLMusicHelper.playingType == YDLMusicHelper.PLAY_TYPE_FM) {
titleView!!.text = "心灵电台"
}
if (YDLMusicHelper.playingType == YDLMusicHelper.PLAY_TYPE_CONFIDE) {
titleView!!.text = "壹点倾诉,心灵寄语"
}
} else {
titleView!!.text = YDLMusicHelper.title
}
if (TextUtils.isEmpty(YDLMusicHelper.name)) {
nameView!!.text = "壹点灵"
} else {
nameView!!.text = YDLMusicHelper.name
}
if (playType == 0) {
mAudioLayout!!.visibility = View.VISIBLE
mVideoLayout!!.visibility = View.GONE
} else {
mAudioLayout!!.visibility = View.GONE
mVideoLayout!!.visibility = View.VISIBLE
try {
initVideoPlayer()
} catch (e: Exception) {
e.printStackTrace()
}
}
}
@SuppressLint("ClickableViewAccessibility")
private fun initVideoPlayer() {
var url = YDLMusicHelper.courseVideoUlr?.replace("https", "http")
var hisTime = UtilH.getProgress(mContext, url)
videoView = PlayerView(mContext as Activity, videoBoxLayout!!)
.setScaleType(PlayStateParams.fitparent)
.hideAllUI()
.setNetWorkTypeTie(false)
.setAutoReConnect(true, 3)
.forbidTouch(true)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
if (what == PlayStateParams.STATE_COMPLETED) {
isCurrentVideoPlaying = false
UtilH.saveProgress(mContext, url, 0)
} else {
isCurrentVideoPlaying = true
}
return true
}
})
.setPlaySource(url)
.startPlay()
.seekTo(hisTime)
videoBoxLayout!!.setOnTouchListener { v, event ->
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> {
Log.i("TAG", "currX" + event.x + "====currY" + event.y)
if (Math.abs(event.x - mTouchStartX) > mTouchSlop || Math.abs(event.y - mTouchStartY) > mTouchSlop) {
Log.i("TAG", "is move")
updateViewPosition()
isMove = true
}
}
MotionEvent.ACTION_UP -> {
if (Math.abs(event.x - mTouchStartX) > mTouchSlop ||
Math.abs(event.y - mTouchStartY) > mTouchSlop || isMove) {
Log.i("TAG", "is move")
updateViewPosition()
} else {
if (!isMove) {
YDLMusicHelper.startPlayingActivity(context, 0)
}
Log.i("TAG", "is click")
}
isMove = false
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
true
}
startTimer(url!!)
}
private fun startTimer(url: String) {
if (timer == null) {
timer = Timer()
}
timer?.schedule(object : TimerTask() {
override fun run() {
if (isCurrentVideoPlaying) {
var time = videoView?.currentPosition ?: 0
if (time < 3000) return
UtilH.saveProgress(context, url, time)
}
}
}, 1000, 1000)
}
fun stopVideo() {
if (videoView != null) {
videoView!!.stopPlay()
videoView = null
}
YDLMusicHelper.isVideoPlaying = false
YDLMusicHelper.playType = 0
if (timer != null) {
timer!!.cancel()
}
timer = null
}
private fun getStringTime(time: Int): String {
if (time <= 0) return "00:00"
var min = time / 60000
var ss = (time - min * 60000) / 1000
var mm = "" + min
var SS = "" + ss
if (min < 10) {
mm = "0$mm"
}
if (ss < 10) {
SS = "0$ss"
}
return "$mm:$SS"
}
private fun updatePlayTime() {
currentPlayingTimeView?.text = getStringTime(time)
durationView?.text = getStringTime(allTime)
}
override fun onTouchEvent(event: MotionEvent): Boolean {
//获取相对屏幕的坐标,即以屏幕左上角为原点
mCurrX = event.rawX
mCurrY = event.rawY - 25
Log.i("currP", "currX$mCurrX====currY$mCurrY")
when (event.action) {
MotionEvent.ACTION_DOWN -> {
//获取相对View的坐标,即以此View左上角为原点
mTouchStartX = event.x
mTouchStartY = event.y
}
MotionEvent.ACTION_MOVE -> updateViewPosition()
MotionEvent.ACTION_UP -> {
updateViewPosition()
mTouchStartY = 0f
mTouchStartX = mTouchStartY
}
}
return true
}
private fun updateViewPosition() {
//更新浮动窗口位置参数
wmParams.x = (mCurrX - mTouchStartX).toInt()
wmParams.y = (mCurrY - mTouchStartY).toInt()
wm!!.updateViewLayout(this, wmParams)
}
fun updatePlayState() {
if (YDLMusicHelper.isPlaying()) {
playState!!.setImageResource(R.drawable.ico_yyfc_pause)
} else {
playState!!.setImageResource(R.drawable.ico_yyfc_play)
for (listener in listeners) {
listener.onPlayFinish()
}
}
}
fun setPlayingState() {
playState!!.setImageResource(R.drawable.ico_yyfc_pause)
resetAudioAndVideoView()
}
fun onDestroy() {
listeners.clear()
mStateChangeListener?.let { YDLMusicPlayer.getInstance().removeListener(it) }
}
fun addFloatClickListener(floatClickListener: FloatViewPlayListener) {
listeners.add(floatClickListener)
}
fun removeFloatClickListener(floatClickListener: FloatViewPlayListener) {
listeners.remove(floatClickListener)
}
interface FloatViewPlayListener {
fun onPauseClick()
fun onStartClick()
fun onPlayFinish()
}
internal inner class MyHandler : Handler() {
override fun handleMessage(msg: Message) {
when (msg.what) {
UPDATE_VIEW_STATE -> updatePlayState()
UPDATE_VIEW_COMPLETE -> {
updatePlayState()
for (listener in listeners) {
//数据重新设置回调
listener.onPlayFinish()
}
}
UPDATE_PLAY_TIME -> {
updatePlayTime()
}
}
}
}
}
\ No newline at end of file
......@@ -20,7 +20,8 @@ import com.yidianling.common.tools.RxImageTool;
* 绘制波纹
* Created by Dog on 2015/7/22.
*/
public class DrawCircleShapeUtil{
public class
DrawCircleShapeUtil{
//点击drawable
ShapeDrawable mClickDrawable;
//消失动画
......
//package com.ydl.ydlcommon.view.widgets;
//
//import android.content.Context;
//import android.content.res.Resources;
//import android.graphics.Bitmap;
//import android.graphics.BitmapShader;
//import android.graphics.Canvas;
//import android.graphics.Paint;
//import android.graphics.RectF;
//import android.support.annotation.NonNull;
//
//import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
//import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
//
//import java.security.MessageDigest;
//
///**
// * @author jiucheng
// * @描述:glide加载图片:只有顶部圆角
// * @Copyright Copyright (c) 2018
// * @Company 壹点灵
// * @date 2018/7/30
// */
//
//public class GlideRoundTopTransform extends BitmapTransformation {
//
// private static float radius = 0f;
//
// public GlideRoundTopTransform(Context contex) {
// this(contex, 4);
// }
//
// public GlideRoundTopTransform(Context context, int dp) {
// super(context);
// this.radius = Resources.getSystem().getDisplayMetrics().density * dp;
//
// }
//
// @Override
// protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
// return roundCrop(pool, toTransform);
// }
//
//
// private static Bitmap roundCrop(BitmapPool pool, Bitmap source) {
// if (source == null) return null;
//
// Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
// if (result == null) {
// result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
// }
//
// Canvas canvas = new Canvas(result);
// Paint paint = new Paint();
// paint.setShader(new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
// paint.setAntiAlias(true);
// RectF rectF = new RectF(0f, 0f, source.getWidth(), source.getHeight());
// canvas.drawRoundRect(rectF, radius, radius, paint);
// canvas.drawRect(new RectF(0, radius, source.getWidth(), source.getHeight()), paint);
// return result;
// }
//
// @Override
// public void updateDiskCacheKey(MessageDigest messageDigest) {
//
// }
//
// public String getId() {
// return getClass().getName() + Math.round(radius);
// }
//
//}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="0"
android:toYDelta="100%p"
android:duration="300"
/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="-100%p"
android:fromYDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="0%"
android:toYDelta="0%" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="100%p"
android:fromYDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="0%"
android:toYDelta="0%" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0"
android:fromYDelta="0%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="-100%p"
android:toYDelta="0%" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0%"
android:fromYDelta="0%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="100%p"
android:toYDelta="0%" />
\ 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:state_enabled="false" android:color="#F0F3F7"/>
<item android:color="@android:color/white" />
</selector>
\ 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:color="#000000" android:state_enabled="true" />
<item android:color="#66000000" android:state_enabled="false"/>
</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"
android:shape="rectangle">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/divide_color" />
</shape>
</item>
<item android:top="1dp">
<shape android:shape="rectangle">
<solid android:color="@color/white" />
</shape>
</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">
<corners android:radius="5dp"></corners>
<solid android:color="#bfc1c5" />
<stroke android:width="1dp" android:color="#bfc1c5"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="@color/main_theme_blue" />
<stroke
android:width="1dp"
android:color="@color/main_theme_blue" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp"></corners>
<solid android:color="@color/white" />
<stroke android:width="1dp" android:color="@color/gray7"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp"/>
<solid android:color="@color/white" />
<stroke android:width="1dp" android:color="@color/color_grey_d0d0d0"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topRightRadius="10dp" android:topLeftRadius="10dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/white" />
</shape>
\ 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:state_checked="true" android:drawable="@drawable/bg_radius_line_green_5"/>
<item android:state_checked="false" android:drawable="@drawable/bg_radius_line_gray"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
<solid android:color="#F4F4F4"/>
</shape>
\ 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="rectangle">
<corners
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp" />
<solid android:color="@color/color_F5F5F8" />
</shape>
\ 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="rectangle">
<corners
android:bottomRightRadius="5dp"
android:topRightRadius="5dp" />
<solid android:color="@color/color_F5F5F8" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 圆角 -->
<corners android:radius="10dp" />
<solid android:color="#EB5835" />
</shape>
\ 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:state_enabled="false">
<shape>
<corners android:radius="4dp" />
<solid android:color="@color/color_BFBFBF" />
</shape>
</item>
<item android:state_enabled="true">
<shape>
<corners android:radius="4dp" />
<solid android:color="@color/color_1DA1F2" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="false"
android:background="#e9ecf0">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp"
android:background="@drawable/bg_chat_radius_gray_10"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/chat_failed"
android:drawablePadding="4dp"
android:text="@string/chat_private_title"
android:textColor="#ffffff"
android:textSize="14dp" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/chat_pivate_content"
android:textColor="#ffffff"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
android:id="@+id/text_cancel"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:paddingTop="17dp"
android:textColor="@color/google_green"
android:textSize="17sp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="取消" />
<TextView
android:id="@+id/text_sure"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:gravity="center_horizontal"
android:textColor="@color/google_green"
android:paddingTop="17dp"
android:textSize="17sp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="发送" />
</RelativeLayout>
<EditText
android:id="@+id/edit_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="15dp"
android:textSize="14sp"
android:gravity="start"
android:padding="4dp"
android:textColorHint="#b3b2b2"
android:textColor="#333333"
android:background="@drawable/bg_radius_f3_10"/>
</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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="150dp"
tools:ignore="MissingDefaultResource"
tools:layout_height="150dp">
<TextView
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@color/color_FF4650" />
</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:scaleType="centerCrop"
android:contentDescription="@string/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/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/close"
android:scaleType="centerInside"
android:src="@drawable/ic_close_24dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="62dp"
tools:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:background="@color/color_F7F7F7" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_to_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:drawableTop="@drawable/ico_btn_top"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:padding="3dp"
android:text="顶部"
android:textColor="@color/color_242424"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_share_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:drawableTop="@drawable/ico_btn_share"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:padding="3dp"
android:text="分享返利"
android:textColor="@color/color_242424"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginTop="6dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="6dp"
android:layout_weight="1"
android:background="@drawable/view_background_course_detail_bottom"
android:gravity="center"
android:textColor="@color/white"
android:textStyle="bold"
tools:text="即将开课" />
</LinearLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_network"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/no_net"
android:layout_centerInParent="true"/>
<TextView
android:id="@+id/tv_network_content"
android:layout_below="@+id/iv_network"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/default_dis_size_huge"
android:text="@string/no_network"
android:layout_gravity="center_horizontal"
android:textColor="#b2b2b2"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="32dp"
android:orientation="horizontal"
android:background="@color/color_FFEEE6">
<ImageView
android:id="@+id/imgTiXing"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="15dp"
android:layout_marginTop="9dp"
android:src="@drawable/confideredpacket_tixing"/>
<TextView
android:id="@+id/tvMsg"
android:layout_toRightOf="@+id/imgTiXing"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginStart="4dp"
android:textColor="#ff821d"
android:textSize="12sp"
tools:text="您有一个30元的倾诉红包未使用,即时倾诉,享"/>
<TextView
android:layout_toRightOf="@+id/tvMsg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textSize="12sp"
android:textColor="#ff3b30"
android:text="立减优惠"/>
<ImageView
android:id="@+id/imgClose"
android:layout_width="29dp"
android:layout_height="29dp"
android:layout_marginTop="9dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_10"
android:padding="@dimen/dp_5"
android:src="@drawable/confideredpacket_close"
tools:ignore="OnClick" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="32dp"
android:orientation="horizontal"
android:background="#ffedcb">
<ImageView
android:id="@+id/imgTiXing"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="15dp"
android:layout_marginTop="9dp"
android:src="@drawable/confideredpacket_tixing"/>
<TextView
android:id="@+id/tvMsg"
android:layout_toRightOf="@+id/imgTiXing"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginStart="4dp"
android:textColor="#ff821d"
android:textSize="12sp"
tools:text="您有个课程优惠码未使用"/>
<!--取消按钮暂时隐藏-->
<ImageView
android:id="@+id/imgClose"
android:layout_width="29dp"
android:layout_height="29dp"
android:layout_marginTop="9dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_10"
android:padding="@dimen/dp_5"
android:src="@drawable/confideredpacket_close"
tools:ignore="OnClick" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="211dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rela_play"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:background="@color/google_green" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.5"
android:background="@color/black"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/img_gif"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:src="@mipmap/audio_play" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp">
<ImageView
android:id="@+id/play_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:padding="14dp"
android:scaleType="centerCrop"
android:src="@drawable/ico_course_play" />
<SeekBar
android:id="@+id/pro_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_marginLeft="-3dp"
android:layout_toLeftOf="@+id/text_start_time"
android:layout_toRightOf="@+id/play_icon"
android:maxHeight="2dp"
android:minHeight="2dp"
android:progressDrawable="@drawable/course_layer_progress"
android:thumb="@drawable/course_dot_seekbar"
tools:progress="0" />
<TextView
android:id="@+id/text_start_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/tv_line"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_line"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/text_end_time"
android:gravity="center"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:text="/"
android:textColor="@color/white"
android:textSize="11sp" />
<TextView
android:id="@+id/text_end_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="11sp" />
</RelativeLayout>
<!-- 网络提示-->
<LinearLayout
android:id="@+id/ll_net_notice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#33000000"
android:clickable="true"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:gravity="center"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="正在使用非Wi-Fi网络,播放将产生流量费用"
android:textColor="@android:color/white"
android:textSize="14sp" />
<ImageView
android:id="@+id/iv_net_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/ico_spfc_play" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
\ 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>
<shape android:shape="rectangle" >
<stroke
android:width="0.5dp"
android:color="@color/color_F0F0F0" />
</shape>
</item>
<item
android:bottom="1dp"
android:right="1dp"
android:top="1dp">
<!-- 在实际使用中我发现1dp达不到显示效果,而2dp正好可以显示边框 -->
<shape android:shape="rectangle" >
<solid android:color="@color/white" />
</shape>
</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">
<corners android:radius="6dp"/>
<stroke android:color="@color/color_F0F0F0" android:width="0.5dp"/>
</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:tools="http://schemas.android.com/tools"
android:id="@+id/ll_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_17"
android:textSize="@dimen/dp_16"
android:textColor="@color/color_3D3D3D"
android:text="@string/redPacket_title"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/color_F0F0F0"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_20"
android:orientation="vertical">
<!--这样写是因为 padding不好用了 调UI好烦-->
<RelativeLayout
android:id="@+id/rl_notUse"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:layout_marginTop="19.5dp"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
android:background="@drawable/redpacket_tv_bg">
<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:gravity="center_vertical"
android:textColor="@color/color_666666"
android:textSize="@dimen/dp_14"
android:text="@string/redPacket_notUse"
android:layout_marginStart="@dimen/dp_15"
tools:ignore="RtlSymmetry" />
<ImageView
android:id="@+id/imgCheck"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_12"
android:layout_alignParentRight="true"
android:visibility="invisible"
android:background="@drawable/ok_h"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:id="@+id/ll_Red"
android:layout_width="114dp"
android:layout_height="90dp"
android:background="@drawable/redpacket_icon"
android:orientation="vertical">
<TextView
android:id="@+id/tvMoney"
android:layout_width="114dp"
android:layout_height="90dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="38dp"
android:textStyle="bold"
tools:text="¥3"/>
</LinearLayout>
<TextView
android:id="@+id/tv_title"
android:layout_toEndOf="@+id/ll_Red"
android:layout_marginTop="17dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_14"
android:textColor="@color/color_666666"
android:textStyle="bold"
tools:text="心理测试专属红包"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tvTimeEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/ll_Red"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_16"
android:textSize="@dimen/dp_10"
android:textColor="@color/color_999999"
tools:text="有效期至2018-08-31"/>
<ImageView
android:id="@+id/imgCheck"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_12"
android:layout_alignParentRight="true"
android:background="@drawable/ok_h"/>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="redPacket_title">可使用红包</string>
<string name="redPacket_notUse">不使用红包</string>
<string name="redpacket_Discount">红包优惠</string>
<string name="redpacket_restPay">还需支付</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="90dp"
android:bottomLeftRadius="90dp"
android:bottomRightRadius="90dp"
android:topRightRadius="90dp"/>
<stroke android:width="5dp" android:color="#6BCEFF"/>
<solid android:color="@color/white"/>
<size android:width="18dp" android:height="18dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_15"
android:background="@drawable/bg_radius_top_white_10"
android:paddingRight="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:id="@+id/text_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="倾诉服务"
android:gravity="center|left"
android:textStyle="bold"
android:textColor="@color/color_242424"
android:textSize="@dimen/dp_17"
android:layout_weight="1"/>
<TextView
android:id="@+id/text_oldmoney"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:text="129.00"
android:textColor="@color/color_242424"
android:textStyle="bold"
android:textSize="@dimen/dp_16"
android:gravity="center_vertical"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_E0E0E0"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="优惠"
android:textSize="@dimen/dp_15"
android:textColor="@color/color_242424"
android:gravity="center|left"
android:layout_weight="1"/>
<TextView
android:id="@+id/text_youhui"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:text="50"
android:textSize="@dimen/dp_15"
android:textColor="@color/color_666666"
android:drawablePadding="5dp"
android:gravity="center_vertical"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_E0E0E0"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="使用余额"
android:textSize="@dimen/dp_15"
android:textColor="@color/color_242424"
android:gravity="center|left"
android:layout_weight="1"/>
<TextView
android:id="@+id/text_yu_e"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:text="-9.00"
android:textSize="@dimen/dp_15"
android:textColor="@color/color_666666"
android:gravity="center_vertical"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_E0E0E0"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="还需支付"
android:textSize="@dimen/dp_15"
android:textColor="@color/color_242424"
android:gravity="center|left"
android:layout_weight="1"/>
<TextView
android:id="@+id/text_money"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:text="129.00"
android:textSize="20dp"
android:textColor="@color/color_FF5A4C"
android:gravity="center_vertical"/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/text_paytip"
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="选择支付方式"
android:textSize="12dp"
android:paddingLeft="15dp"
android:gravity="center_vertical"
android:textColor="@color/color_999999"
android:background="@color/color_F7F7F7"/>
<LinearLayout
android:id="@+id/lin_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_wechat"
android:layout_width="match_parent"
android:layout_height="55dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/wexin_pay" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_dis_size_big"
android:layout_weight="1"
android:text="微信支付"
android:textColor="@color/color_242424"
android:textSize="@dimen/dp_15" />
<ImageView
android:id="@+id/iv_wechat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ok_h" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="@color/divide_color" />
<LinearLayout
android:id="@+id/ll_alipay"
android:layout_width="match_parent"
android:layout_height="55dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ali_pay" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_dis_size_big"
android:layout_weight="1"
android:text="支付宝支付"
android:textColor="@color/color_242424"
android:textSize="@dimen/dp_15" />
<ImageView
android:id="@+id/iv_alipay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ok_n" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/text_pay"
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="确认付款"
android:gravity="center"
android:textColor="@color/white"
android:textSize="17dp"
android:background="#FF3D9EFF"/>
</LinearLayout>
\ No newline at end of file
<?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:orientation="vertical"
android:layout_width="55dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_share"
android:layout_width="55dp"
android:layout_height="55dp" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textColor="@color/color_242424"
android:layout_gravity="center_horizontal"
tools:text="动态"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#56CCF2"
android:endColor="#2F80ED"
android:angle="0" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.Space
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="0px"/>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!--字体大小部分-->
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">4dp</dimen>
<dimen name="default_dis_size_small">6dp</dimen>
<dimen name="default_dis_size">8dp</dimen>
<dimen name="default_dis_size_big">10dp</dimen>
<dimen name="default_dis_size_large">12dp</dimen>
<dimen name="default_dis_size_huge">14dp</dimen>
<dimen name="default_dis_size_huge_more">16dp</dimen>
<!--分割线粗细-->
<dimen name="divide_line_stroke_width">1px</dimen>
......
......@@ -2,21 +2,18 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!--字体大小部分-->
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">5dp</dimen>
<dimen name="default_dis_size_small">7.5dp</dimen>
<dimen name="default_dis_size">10dp</dimen>
<dimen name="default_dis_size_big">12.5dp</dimen>
<dimen name="default_dis_size_large">15dp</dimen>
<dimen name="default_dis_size_huge">17.5dp</dimen>
<dimen name="default_dis_size_huge_more">20dp</dimen>
<!--dialog部分-->
......@@ -35,5 +32,4 @@
<!--进度条-->
<!--照片选择器-->
<dimen name="head_size_big">72dp</dimen>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<integer-array name="ydl_colors">
<item>@color/main_theme_blue</item>
</integer-array>
<!--如果前缀是以下这些 并且是没有子目录的 就表面是专家详情页、课程详情页地址-->
<string-array name="doctorUrls" tools:ignore="ExtraTranslation">
<item>https://testh2.yidianling.com/experts/</item>
......
......@@ -104,20 +104,12 @@
0% — 00-->
<color name="msg_system_press">#fff7f7f7</color>
<color name="msg_bg_press">#eeeeeeee</color>
<color name="colorDivider">#ebebeb</color>
<!-- google color-->
<color name="google_red">#ed412c</color>
<color name="google_blue">#1da1f2</color>
<color name="google_yellow">#fdbd00</color>
<color name="google_green">#1da1f2</color>
<color name="google_green_dark">#1da1f2</color>
<color name="new_divide_color">#f0f0f0</color>
<!--app主要颜色-->
<color name="white">#ffffff</color>
<color name="theme_title_bar_color">#FFFFFF</color>
<color name="theme_bg">#FAFAFA</color>
<color name="main_theme_blue">#1da1f2</color>
<color name="default_button_bg">#1da1f2</color>
......@@ -127,12 +119,8 @@
<color name="place_holder_color">#DDDDDD</color>
<color name="transparent">#00FFFFFF</color>
<color name="price_color">#EC7100</color>
<color name="thx_red_color">#EB5835</color>
<color name="tag_text">#777777</color>
<color name="f5f5f5">#f5f5f5</color>
<color name="fffaec">#fffaec</color>
<color name="bebebe">#bebebe</color>
<color name="color_grey_999999">#999999</color>
<color name="black_deep">#FF000000</color>
......@@ -142,26 +130,14 @@
<!-- session -->
<color name="color_message_default_bg">#e9ecf0</color>
<color name="input_panel_text_color_757572">#757572</color>
<color name="color_gray_cbd0d8">#cbd0d8</color>
<!-- image picker -->
<color name="color_split_line_d9d9d9">#d9d9d9</color>
<color name="color_split_line_cccccc">#cccccc</color>
<color name="line">#e5e5e5</color>
<!-- contact -->
<color name="contact_list_hover">#d9d9d9</color>
<color name="contact_letter_idx_bg">#33000000</color>
<color name="color_grey_ababab">#ababab</color>
<color name="color_yellow_796413">#796413</color>
<color name="color_red_f04c62">#f04c62</color>
<!-- setting -->
<color name="color_black_ff333333">#ff333333</color>
<color name="color_black_ff666666">#ff666666</color>
<color name="color_black_ff999999">#999999</color>
<!--云信 end-->
<color name="text_gray">#B6B6B6</color>
......@@ -169,121 +145,46 @@
<color name="title_bottom_line_bg">#DDDDDD</color>
<color name="color_activity_blue_bg">#389fff</color>
<color name="split_line_grey_color_d9d9d9">#D9D9D9</color>
<color name="color_black_333333">#333333</color>
<color name="main_bg_color">#FFFFFF</color>
<color name="black">#000000</color>
<color name="grey">#333333</color>
<color name="color_blue_0888ff">#0888ff</color>
<color name="color_gray_d9d9d9">#d9d9d9</color>
<color name="grey_white_has_alpha">#66FAFAFA</color>
<color name="color_grey_888888">#888888</color>
<color name="GreyWhite">#F7F7F7</color>
<color name="im_list_select_hover">#dbdbdb</color>
<color name="color_b3b3b3">#b3b3b3</color>
<color name="color_green_disable">#1da1f2</color>
<color name="color_green_00d3a9">#1da1f2</color>
<color name="color_black_b3000000">#b3000000</color>
<color name="color_grey_eaeaea">#eaeaea</color>
<color name="color_blue_3a9efb">#3a9efb</color>
<color name="title_green">#1da1f2</color>
<color name="defult_bg">#f3f3f3</color>
<!--动态-->
<color name="text_trend_defult">#999999</color>
<color name="text_trend_black">#444444</color>
<color name="text_trend_title_black">#333333</color>
<color name="text_user">#5195cb</color>
<!--动态顶部title背景变色-->
<color name="trend_transparent">#00ffffff</color>
<color name="trend_gray">#f3f3f3</color>
<!--消息已读-->
<color name="color_grey_555555">#555555</color>
<color name="color_background">#ECF1F5</color>
<color name="bg_top_msg">#f3f3f3</color>
<color name="color_grey_d0d0d0">#d0d0d0</color>
<color name="color_F5F5F8">#F5F5F8</color>
<color name="color_F5F5F5">#F5F5F5</color>
<!--统一颜色定义-->
<color name="color_666666">#666666</color>
<color name="color_50ffffff">#B3ffffff</color>
<color name="color_FFA061">#FFA061</color>
<color name="color_F79554">#F79554</color>
<color name="color_0CC1F7">#990CC1F7</color>
<color name="color_3D3D3D">#3D3D3D</color>
<color name="color_E0E0E0">#E0E0E0</color>
<color name="color_F0F0F0">#F0F0F0</color>
<color name="color_999999">#999999</color>
<color name="color_333333">#333333</color>
<color name="color_FF4650">#FF4650</color>
<color name="color_F6F6F6">#F6F6F6</color>
<color name="color_FF5B05">#FF5B05</color>
<color name="color_FF5040">#FF5040</color>
<color name="color_FFEBE0">#FFEBE0</color>
<color name="color_80353535">#CC353535</color>
<color name="color_40353535">#66353535</color>
<color name="color_30FFFFFF">#4DFFFFFF</color>
<color name="color_20FFFFFF">#33FFFFFF</color>
<color name="color_50FFFFFF">#80FFFFFF</color>
<color name="color_70FFFFFF">#B3FFFFFF</color>
<color name="color_D8D8D8">#D8D8D8</color>
<color name="color_32D296">#32D296</color>
<color name="color_444444">#444444</color>
<color name="color_42C1FF">#42C1FF</color>
<color name="color_1DA1F2">#1DA1F2</color>
<color name="color_151DA1F2">#261DA1F2</color>
<color name="color_242424" tools:ignore="MissingDefaultResource">#242424</color>
<color name="color_FAFAFA">#FAFAFA</color>
<color name="color_878787">#878787</color>
<color name="color_F7F7F7">#F7F7F7</color>
<color name="color_FC5F5E">#FC5F5E</color>
<color name="color_FF8863">#FF8863</color>
<color name="color_FD6C60">#FD6C60</color>
<color name="color_FFFFFF">#ffffff</color>
<color name="color_ACACAC">#ACACAC</color>
<color name="color_FF6633">#FF6633</color>
<color name="color_BFBFBF">#BFBFBF</color>
<color name="color_FFEEE6">#FFEEE6</color>
<color name="color_f3f3f3">#f3f3f3</color>
<color name="color_c6c3c3">#C6C3C3</color>
<color name="color_33000000">#33000000</color>
<color name="color_2EB0FF">#2EB0FF</color>
<color name="color_075b66">#075b66</color>
<color name="color_E6E6E6">#E6E6E6</color>
<color name="color_34CD65">#34CD65</color>
<color name="color_3DBEF5">#3DBEF5</color>
<color name="color_F4F4F4">#F4F4F4</color>
<color name="color_FFDB26">#FFDB26</color>
<color name="color_8CF22318">#8CF22318</color>
<color name="color_CCCCCC">#CCCCCC</color>
<color name="color_FF5A4C">#FF5A4C</color>
<color name="color_5FF5A4C">#0DFF5A4C</color>
<color name="color_60FF5A4C">#99FF5A4C</color>
<color name="color_222222">#222222</color>
<color name="color_EBEBEB">#EBEBEB</color>
<color name="color_FFDD33">#FFDD33</color>
<color name="color_FFC000">#FFC000</color>
<color name="color_5CC8F7">#5CC8F7</color>
<color name="color_1EA6FA">#1EA6FA</color>
<color name="color_FF8C00">#FF8C00</color>
<color name="color_FF9100">#FF9100</color>
<color name="color_F8FCFF">#F8FCFF</color>
<color name="color_66000000">#66000000</color>
<color name="color_99000000">#99000000</color>
<color name="color_F2F2F2">#F2F2F2</color>
<color name="color_FF3A2F">#FF3A2F</color>
<color name="color_EEEEEE">#EEEEEE</color>
<!--公用搜索框背景颜色-->
......
......@@ -4,17 +4,14 @@
<dimen name="divide_line_stroke_width">0.5dp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">4dp</dimen>
<dimen name="default_dis_size_small">6dp</dimen>
<dimen name="default_dis_size">8dp</dimen>
<dimen name="default_dis_size_big">10dp</dimen>
<dimen name="default_dis_size_large">12dp</dimen>
<dimen name="default_dis_size_huge">14dp</dimen>
<dimen name="default_dis_size_huge_more">16dp</dimen>
<!--字体大小部分-->
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
......@@ -22,29 +19,17 @@
<!--TitleBar高度-->
<dimen name="title_bar_height">45dp</dimen>
<dimen name="action_bar_height">48dip</dimen>
<!--JumpTextView部分-->
<dimen name="jump_text_view_min_height">55dp</dimen>
<dimen name="jump_text_view_icon_size">25dp</dimen>
<!-- dialog -->
<dimen name="normal_text_size">16sp</dimen>
<dimen name="big_text_size">17sp</dimen>
<dimen name="light_line_size">1px</dimen>
<dimen name="dialog_padding_vertical">20dip</dimen>
<dimen name="custom_dialog_padding_vertical">15dip</dimen>
<dimen name="dark_line_size">3px</dimen>
<dimen name="dialog_text_margin_horizontal">15dip</dimen>
<dimen name="very_samll_text_size">9sp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_vertical_margin">16dp</dimen>
<!--动态-->
<!--顶部title Size-->
<dimen name="title_height">45dp</dimen>
<dimen name="title_txt_sp">20sp</dimen>
<!-- map -->
......@@ -69,21 +54,9 @@
<dimen name="dp_18">18dp</dimen>
<dimen name="dp_19">19dp</dimen>
<dimen name="dp_20">20dp</dimen>
<dimen name="dp_22">22dp</dimen>
<dimen name="dp_24">24dp</dimen>
<dimen name="dp_25">25dp</dimen>
<dimen name="dp_26">26dp</dimen>
<dimen name="dp_28">28dp</dimen>
<dimen name="dp_29">29dp</dimen>
<dimen name="dp_32">32dp</dimen>
<dimen name="dp_34">34dp</dimen>
<dimen name="dp_35">35dp</dimen>
<dimen name="dp_36">36dp</dimen>
<dimen name="dp_60">60dp</dimen>
<dimen name="dp_64">64dp</dimen>
<dimen name="dp_88">88dp</dimen>
<dimen name="dp_99">99dp</dimen>
<dimen name="dp_115">115dp</dimen>
<dimen name="dp_127">127dp</dimen>
</resources>
......@@ -4,80 +4,16 @@
<!--异常类别-->
<!-- image picker -->
<string name="picker_image_preview">预览</string>
<string name="picker_image_send">发送</string>
<string name="picker_image_folder">相册</string>
<string name="picker_image_album_loading">相册加载中…</string>
<string name="picker_image_album_empty">相册中没有图片!</string>
<string name="picker_image_folder_info">共%d张</string>
<string name="picker_image_exceed_max_image_select">最多选择%d张图片!</string>
<string name="picker_image_send_select">完成(%d)</string>
<string name="picker_image_preview_original">发送原图</string>
<string name="picker_image_preview_edit">编辑</string>
<string name="picker_image_preview_original_select">发送原图(%s)</string>
<string name="picker_image_error">获取图片出错</string>
<string name="image_compressed_size">该原始图片大小为: %1$s,</string>
<string name="unknow_size">未知大小</string>
<string name="is_send_image">是否发送该原始图片?</string>
<string name="multi_image_compressed_size">原始图片总大小为: %1$s,</string>
<string name="is_send_multi_image">是否发送这些原始图片?</string>
<string name="waitfor_image_local">正在打开相册,请稍候\u2026</string>
<string name="recapture">重拍</string>
<string name="image_show_error">图片显示异常</string>
<string name="memory_out">内存不足</string>
<string name="choose_from_photo_album">从手机相册选择</string>
<string name="choose">选取</string>
<string name="crop">裁剪</string>
<!--common-->
<string name="empty"></string>
<string name="cancel">取消</string>
<!-- 拍照视频 -->
<string name="gallery_invalid">你的手机没有图库程序</string>
<string name="sdcard_not_enough_head_error">SD卡被拔出或存储空间不足,无法保存头像</string>
<string name="sdcard_not_enough_error">存储空间不足,无法保存此次多媒体消息</string>
<string name="download_video">正在下载视频</string>
<string name="download_video_fail">视频下载失败,请重试</string>
<string name="look_video_fail">无法播放该视频</string>
<string name="look_video_fail_try_again">暂时无法播放视频,请重试</string>
<string name="video_record">视频录制</string>
<string name="connect_vedio_device_fail">无法连接视频设备 ,请稍候再试</string>
<string name="capture_video_size_in_kb">视频文件大小为: %1$dKB,</string>
<string name="capture_video_size_in_mb">视频文件大小为: %1$.2fMB,</string>
<string name="is_send_video">是否发送该视频?</string>
<string name="start_camera_to_record_failed">启动摄像头录制视频失败</string>
<string name="stop_fail_maybe_stopped">停止失败,可能已经停止</string>
<string name="video_exception">视频文件异常</string>
<string name="im_choose_video_file_size_too_large">视频文件过大,系统限制为20MB</string>
<string name="im_choose_video">请选择3GP MP4格式的视频文件</string>
<string name="video_record_short">录制视频太短</string>
<string name="download_progress_description">%1$s(%2$s/%3$s)</string>
<string name="send">发送</string>
<string name="ok">确定</string>
<string name="input_panel_take">拍 摄</string>
<string name="version_update">版本更新</string>
<string name="encourage_us">鼓励一下我们</string>
<string name="update_hint">已经是最新版本咯</string>
<string name="load_new_version">正在下载新版本</string>
<string name="service">客服小壹</string>
<string name="trends">动态</string>
<string name="course_recommend">课程推荐</string>
<string name="no_more_data_hint">到底了,陛下,就等你分享了呢</string>
<string name="loading_hint">正在加载中…</string>
<string name="popularity">人气:</string>
<string name="course_detail">课程详情</string>
<string name="attend_course_success">报名成功</string>
<string name="theme">主题</string>
<string name="area">地区</string>
<string name="sort">排序</string>
<string name="filter">筛选</string>
<string name="search">搜索</string>
<string name="show_type">显示方式</string>
<string name="enquiry_type">咨询方式</string>
<string name="age">年龄</string>
<string name="reset">重置</string>
<string name="confirm">确定</string>
<string name="no_more">没有更多了</string>
......@@ -85,36 +21,14 @@
<string name="search_by_category">按主题搜索看看</string>
<string name="search_hint">搜索话题、咨询师姓名</string>
<string name="need_storage_permission_hint">App正常工作需要内部存储使用权限,请开启</string>
<string name="register_by_phone">手机号注册</string>
<string name="login_by_phone">手机登录</string>
<string name="login_by_qq">QQ登录</string>
<string name="login_by_wechat">微信登录</string>
<string name="user_protocol">用户协议</string>
<string name="next_step">下一步</string>
<string name="walk_around">随便逛逛</string>
<string name="finish">完成</string>
<string name="nickname_hint">设置一个昵称,方便大家认识你哦(最多10个字)</string>
<string name="please_select_gender">请选择性别</string>
<string name="more">更多</string>
<string name="register_success">注册成功</string>
<string name="private_safe_hint">设置手势密码,保障安全隐私</string>
<string name="header">头像</string>
<string name="pause_play">暂停/播放</string>
<string name="start_test">立即测试</string>
<string name="test_result">测试结果</string>
<string name="test_again">重新测试</string>
<string name="send_to_expert">专家解读</string>
<string name="test_answer">测试回答</string>
<string name="introduction">说明</string>
<string name="last_question">上一题</string>
<string name="no_test_record_hint">还没有测试记录哦</string>
<string name="recommend_test">推荐测试</string>
<string name="test_count">%d人测过</string>
<string name="questions">%d个问题</string>
<string name="wrong_args">参数异常</string>
<string name="no_search_keyword_hint">请输入关键字</string>
<string name="gson_parse_error">解析错误</string>
<string name="test_either">我也要测试</string>
<!--网络提示模块-->
<string name="network_error">网络不给力!</string>
......@@ -124,23 +38,12 @@
<string name="loadfailed">加载失败</string>
<!--动态模块-->
<string name="trend_foucused">已关注</string>
<string name="trend_foucus">关注</string>
<string name="trend_comments_load_error">评论加载失败</string>
<string name="trend_waitting_for_comment">就等你的评论咯~</string>
<string name="silence_content">因网友举报,你已经被系统禁言,如有疑问,请联系客服小壹处理。</string>
<string name="appeal">我要申诉</string>
<string name="approval">知道了</string>
<string name="dialog_loading">加载中…</string>
<string name="close">关闭</string>
<string name="no_network">网络不给力哦,下拉刷新重试</string>
<string name="chat_private_title">私聊须知</string>
<string name="chat_pivate_content">如系统检测到涉黄、涉爆、涉政等信息,可能会封号处理并追究法律责任!</string>
<string name="notification_error_ssl_cert_invalid">SSL 证书验证错误,是否继续加载?</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Transparent" parent="@style/Base.Theme.AppCompat">
<item name="colorPrimary">@color/main_theme_blue</item>
<item name="colorPrimaryDark">@color/main_theme_blue</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<!--自定义分享-->
<style name="transparentFrameWindowStyle" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/share_choose_bg</item>
......@@ -29,9 +22,6 @@
</style>
<!--四边边距都为0的dialog-->
<style name="commonDialog" parent="android:Theme.Dialog">
<item name="android:windowBackground">@color/design_snackbar_background_color</item>
</style>
<!-- 仿ios普通对话框 -->
<style name="normaldialog_style" parent="@android:style/Theme.Dialog">
......@@ -46,62 +36,8 @@
</style>
<!-- 仿ios普通对话框 -->
<style name="chatdialog_style" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:layout_marginTop">120dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:layout_marginLeft">15dp</item>
<item name="android:windowBackground">@drawable/normaldialog_bg</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:itemTextAppearance">?android:attr/actionMenuTextAppearance</item>
</style>
<!-- toolbar 文本 -->
<style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">16sp</item>
</style>
<style name="dialog_title_text_style">
<item name="android:textSize">@dimen/big_text_size</item>
<item name="android:textColor">@color/color_activity_blue_bg</item>
<item name="android:textStyle">bold</item>
<item name="android:paddingLeft">@dimen/dialog_text_margin_horizontal</item>
<item name="android:paddingRight">@dimen/dialog_text_margin_horizontal</item>
<item name="android:paddingTop">@dimen/dialog_padding_vertical</item>
<item name="android:paddingBottom">@dimen/dialog_padding_vertical</item>
</style>
<style name="dialog_message_text_style">
<item name="android:textSize">@dimen/normal_text_size</item>
<item name="android:textColor">@color/color_black_333333</item>
<item name="android:paddingLeft">@dimen/dialog_text_margin_horizontal</item>
<item name="android:paddingRight">@dimen/dialog_text_margin_horizontal</item>
<item name="android:paddingTop">@dimen/dialog_padding_vertical</item>
<item name="android:paddingBottom">@dimen/dialog_padding_vertical</item>
</style>
<style name="grid_view" parent="@android:style/Widget.GridView"></style>
<style name="list_view" parent="@android:style/Widget.ListView">
<item name="android:scrollbarThumbVertical">@drawable/nim_scrollbar_handle_holo_dark</item>
<item name="android:scrollbarThumbHorizontal">@drawable/nim_scrollbar_handle_holo_dark
</item>
</style>
<style name="dialog_default_style" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<!-- 项目中的分割线 -->
<style name="viewline">
......@@ -110,12 +46,6 @@
<item name="android:layout_height">0.5dp</item>
</style>
<style name="new_divide_color_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0.5dp</item>
<item name="android:background">@color/new_divide_color</item>
</style>
<style name="BottomDialogAnimation">
<item name="android:windowEnterAnimation">@anim/bottom_dialog_slide_show</item>
<item name="android:windowExitAnimation">@anim/bottom_dialog_slide_hide</item>
......
......@@ -207,7 +207,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
protected void onCreate(@Nullable Bundle savedInstanceState) {
initStartTime = System.currentTimeMillis();
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.activity_anim_in,
overridePendingTransition(R.anim.platform_activity_anim_in,
R.anim.activity_anim_out);
}
......
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