| | |
| | | setStyle(STYLE_NO_FRAME, R.style.FadeDialog) |
| | | } |
| | | |
| | | private val sHead by lazy { |
| | | "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>" |
| | | } |
| | | private val privacy by lazy { |
| | | arguments?.getString("privacy")?:"" |
| | | } |
| | |
| | | settings.defaultTextEncodingName = "utf-8" |
| | | settings.domStorageEnabled = true |
| | | sc_content.webChromeClient = object : WebChromeClient() {} |
| | | sc_content.loadData(user,"text/html; charset=utf-8", "utf-8") |
| | | sc_content.loadDataWithBaseURL( |
| | | null, |
| | | sHead + user, |
| | | "text/html", |
| | | "utf-8", |
| | | null |
| | | ) |
| | | tv_cancel.setOnClickListener { |
| | | dismiss() |
| | | } |
| | | |
| | | rg_title.setOnCheckedChangeListener { _, i -> |
| | | if (i == R.id.rb_privacy){ |
| | | sc_content.loadData(privacy,"text/html; charset=utf-8", "utf-8") |
| | | sc_content.loadDataWithBaseURL( |
| | | null, |
| | | sHead + privacy, |
| | | "text/html", |
| | | "utf-8", |
| | | null |
| | | ) |
| | | v_2.visible() |
| | | v_1.gone() |
| | | } |
| | | else{ |
| | | sc_content.loadData(user,"text/html; charset=utf-8", "utf-8") |
| | | sc_content.loadDataWithBaseURL( |
| | | null, |
| | | sHead + user, |
| | | "text/html", |
| | | "utf-8", |
| | | null |
| | | ) |
| | | v_2.gone() |
| | | v_1.visible() |
| | | } |
| | |
| | | package com.sinata.xqmuse.utils; |
| | | |
| | | import android.content.Context; |
| | | import android.media.AudioManager; |
| | | import android.media.MediaPlayer; |
| | | import android.media.MediaRecorder; |
| | | import android.net.Uri; |
| | |
| | | import android.os.Handler; |
| | | import android.util.Log; |
| | | |
| | | import com.google.android.exoplayer2.ExoPlayer; |
| | | import com.google.android.exoplayer2.MediaItem; |
| | | import com.sinata.xqmuse.utils.exo.ExoMediaPlayer; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import xyz.doikki.videoplayer.player.AbstractPlayer; |
| | | |
| | | public class AudioUtils { |
| | | |
| | |
| | | isPause = false; |
| | | try { |
| | | Log.e("mmp", "开始播放 path:" + filePath); |
| | | |
| | | mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); |
| | | mMediaPlayer.setDataSource(context, Uri.parse(filePath)); |
| | | mMediaPlayer.prepareAsync(); |
| | | mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
| | |
| | | @Override |
| | | public void onCompletion(MediaPlayer mp) { |
| | | stopPlayMusic(true); |
| | | // BaseEvent baseEvent = new BaseEvent(BaseEvent.SEND_AODIO_PLAY_OVER); |
| | | // baseEvent.setMsg(filePath); |
| | | // EventBus.getDefault().post(baseEvent); |
| | | } |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="20dp" |
| | | android:text="当前能量值" |
| | | android:text="累计总能量值" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:alpha="0.8" |
| | |
| | | app:layout_constraintEnd_toEndOf="@id/task_1" |
| | | android:layout_marginEnd="9dp" |
| | | android:layout_height="25dp" |
| | | android:text="前往疗愈" |
| | | android:text="前往学习" |
| | | android:enabled="true" |
| | | android:gravity="center" |
| | | android:textSize="12sp" |
| | |
| | | app:layout_constraintEnd_toEndOf="@id/task_1" |
| | | android:layout_marginEnd="9dp" |
| | | android:layout_height="25dp" |
| | | android:text="前往疗愈" |
| | | android:text="前往学习" |
| | | android:enabled="true" |
| | | android:gravity="center" |
| | | android:textSize="12sp" |