Initial commit
This commit is contained in:
commit
e9986ef8c3
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/caches
|
||||||
|
/.idea/libraries
|
||||||
|
/.idea/modules.xml
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/navEditor.xml
|
||||||
|
/.idea/assetWizardSettings.xml
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
|
.cxx
|
||||||
|
local.properties
|
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
1
.idea/.name
Normal file
1
.idea/.name
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Cloud_music
|
6
.idea/compiler.xml
Normal file
6
.idea/compiler.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="17" />
|
||||||
|
</component>
|
||||||
|
</project>
|
20
.idea/gradle.xml
Normal file
20
.idea/gradle.xml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="GRADLE" />
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="jbr-17" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
17
.idea/inspectionProfiles/Project_Default.xml
Normal file
17
.idea/inspectionProfiles/Project_Default.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,android.app.DownloadManager,query" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="DataFlowIssue" enabled="false" level="WARNING" enabled_by_default="false">
|
||||||
|
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
|
||||||
|
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
|
<option name="processCode" value="true" />
|
||||||
|
<option name="processLiterals" value="true" />
|
||||||
|
<option name="processComments" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
6
.idea/kotlinc.xml
Normal file
6
.idea/kotlinc.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KotlinJpsPluginSettings">
|
||||||
|
<option name="version" value="1.6.20" />
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/misc.xml
Normal file
9
.idea/misc.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
1
app/.gitignore
vendored
Normal file
1
app/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/build
|
83
app/build.gradle
Normal file
83
app/build.gradle
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
plugins {
|
||||||
|
id 'com.android.application'
|
||||||
|
id 'org.jetbrains.kotlin.android'
|
||||||
|
id 'maven-publish'
|
||||||
|
}
|
||||||
|
android {
|
||||||
|
namespace 'com.muqingbfq'
|
||||||
|
compileSdk 33
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.muqingbfq"
|
||||||
|
minSdk 23
|
||||||
|
//noinspection OldTargetApi
|
||||||
|
targetSdk 31
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.5.0"
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
viewBinding true
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
android.applicationVariants.configureEach {
|
||||||
|
variant ->
|
||||||
|
variant.outputs.configureEach {
|
||||||
|
//在这里修改apk文件名
|
||||||
|
outputFileName = "Cloud_music-${variant.name}-v${variant.versionName}.apk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
signingConfigs {
|
||||||
|
signConfig {
|
||||||
|
storeFile file('F:/muqing.jks')
|
||||||
|
// 证书存放位置和名字
|
||||||
|
storePassword 'muqing153'
|
||||||
|
// 密码
|
||||||
|
keyAlias 'muqing'
|
||||||
|
// 别名
|
||||||
|
keyPassword 'muqing153'
|
||||||
|
// 别名对应的密码
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
v1SigningEnabled true //正式版时对应的签名规则 true使用 false不适用
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
|
implementation 'com.google.android.material:material:1.9.0'
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.3.0'
|
||||||
|
implementation 'com.google.code.gson:gson:2.9.1'
|
||||||
|
|
||||||
|
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
||||||
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||||
|
|
||||||
|
api "com.github.cy745:EaseView:e11c3208a9"
|
||||||
|
implementation "androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03"
|
||||||
|
}
|
||||||
|
afterEvaluate {
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
release(MavenPublication) {
|
||||||
|
groupId = 'com.github.Moriafly'
|
||||||
|
artifactId = 'LyricViewX'
|
||||||
|
version = '1.4.0-alpha02'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
app/proguard-rules.pro
vendored
Normal file
21
app/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
102
app/src/main/AndroidManifest.xml
Normal file
102
app/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:ignore="CoarseFineLocation,WrongManifestParent">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 存储权限 -->
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||||
|
tools:ignore="ScopedStorage" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" /> <!-- 网络权限 -->
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- 申请通知栏权限 -->
|
||||||
|
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_NOTIFICATIONS" /> <!-- 蓝牙连接 -->
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".main"
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/Theme.云音乐"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
tools:targetApi="32">
|
||||||
|
<activity
|
||||||
|
android:name=".start"
|
||||||
|
android:configChanges="uiMode"
|
||||||
|
android:exported="true"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/Theme.main">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter tools:ignore="AppLinkUrlError">
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<data android:mimeType="text/plain" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".login.enroll" />
|
||||||
|
<activity
|
||||||
|
android:name=".activity_search" />
|
||||||
|
<activity
|
||||||
|
android:name=".bfq"
|
||||||
|
android:noHistory="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:theme="@style/fragment_dialog">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="transparent.text.SECONDACTIVITY" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".fragment.mp3"
|
||||||
|
android:noHistory="true" />
|
||||||
|
<activity
|
||||||
|
android:name=".activity_about_software" />
|
||||||
|
<activity
|
||||||
|
android:name=".login.user_logs" />
|
||||||
|
<activity
|
||||||
|
android:name=".sz" />
|
||||||
|
<activity
|
||||||
|
android:name=".home"
|
||||||
|
android:configChanges="screenSize|smallestScreenSize|orientation|screenLayout"
|
||||||
|
android:exported="false"
|
||||||
|
android:launchMode="singleTask" />
|
||||||
|
<activity android:name=".mq.llq" />
|
||||||
|
<activity android:name=".yc" />
|
||||||
|
|
||||||
|
<service android:name=".bfqkz"
|
||||||
|
android:exported="false"
|
||||||
|
android:permission="TODO">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.media.browse.MediaBrowserService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
<receiver
|
||||||
|
android:name=".MyButtonClickReceiver"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
|
<action android:name="com.example.MY_BUTTON_CLICKED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
257
app/src/main/java/com/dirror/lyricviewx/ILyricViewX.kt
Normal file
257
app/src/main/java/com/dirror/lyricviewx/ILyricViewX.kt
Normal file
|
@ -0,0 +1,257 @@
|
||||||
|
package com.dirror.lyricviewx
|
||||||
|
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.text.Layout
|
||||||
|
import androidx.annotation.ColorInt
|
||||||
|
import androidx.annotation.FloatRange
|
||||||
|
import androidx.annotation.Px
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
const val GRAVITY_CENTER = 0 // 居中
|
||||||
|
const val GRAVITY_LEFT = 1 // 左
|
||||||
|
const val GRAVITY_RIGHT = 2 // 右
|
||||||
|
|
||||||
|
fun Int.toLayoutAlign(): Layout.Alignment {
|
||||||
|
return when (this) {
|
||||||
|
GRAVITY_LEFT -> Layout.Alignment.ALIGN_NORMAL
|
||||||
|
GRAVITY_CENTER -> Layout.Alignment.ALIGN_CENTER
|
||||||
|
GRAVITY_RIGHT -> Layout.Alignment.ALIGN_OPPOSITE
|
||||||
|
else -> Layout.Alignment.ALIGN_CENTER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LyricViewX 接口
|
||||||
|
* 从 LyricViewX 提取,方便管理
|
||||||
|
*
|
||||||
|
* @author Moriafly
|
||||||
|
* @since 2021年1月28日16:29:16
|
||||||
|
*/
|
||||||
|
interface LyricViewXInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置整句之间的间隔高度
|
||||||
|
* @param height px
|
||||||
|
*/
|
||||||
|
fun setSentenceDividerHeight(@Px height: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置原句与翻译之间的间隔高度
|
||||||
|
* @param height px
|
||||||
|
*/
|
||||||
|
fun setTranslateDividerHeight(@Px height: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置歌词整体的垂直偏移值,配合[setHorizontalOffsetPercent]使用
|
||||||
|
* @param offset px
|
||||||
|
*
|
||||||
|
* @see [setHorizontalOffsetPercent]
|
||||||
|
*/
|
||||||
|
fun setHorizontalOffset(@Px offset: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置歌词整体的垂直偏移,相对于控件高度的百分比,0.5f即表示居中,配合[setHorizontalOffset]使用
|
||||||
|
*
|
||||||
|
* @param percent 0.0f ~ 1.0f
|
||||||
|
*
|
||||||
|
* @see [setHorizontalOffset]
|
||||||
|
*/
|
||||||
|
fun setHorizontalOffsetPercent(@FloatRange(from = 0.0, to = 1.0) percent: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置翻译相对与原词之间的缩放比例值
|
||||||
|
* @param scaleValue 一般来说 0.8f 是个不错的值
|
||||||
|
*/
|
||||||
|
fun setTranslateTextScaleValue(@FloatRange(from = 0.1, to = 2.0) scaleValue: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置文字的对齐方向
|
||||||
|
*/
|
||||||
|
fun setTextGravity(gravity: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置非当前行歌词字体颜色 [normalColor]
|
||||||
|
*/
|
||||||
|
fun setNormalColor(@ColorInt normalColor: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通歌词文本字体大小 [size],单位 px
|
||||||
|
*/
|
||||||
|
fun setNormalTextSize(@Px size: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前歌词文本字体大小
|
||||||
|
*/
|
||||||
|
fun setCurrentTextSize(size: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置当前行歌词的字体颜色
|
||||||
|
*/
|
||||||
|
fun setCurrentColor(currentColor: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置拖动歌词时选中歌词的字体颜色
|
||||||
|
*/
|
||||||
|
fun setTimelineTextColor(timelineTextColor: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置拖动歌词时时间线的颜色
|
||||||
|
*/
|
||||||
|
fun setTimelineColor(timelineColor: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置拖动歌词时右侧时间字体颜色
|
||||||
|
*/
|
||||||
|
fun setTimeTextColor(timeTextColor: Int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置歌词为空时屏幕中央显示的文字 [label],如“暂无歌词”
|
||||||
|
*/
|
||||||
|
fun setLabel(label: String)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载歌词文本
|
||||||
|
* 两种语言的歌词时间戳需要一致
|
||||||
|
*
|
||||||
|
* @param mainLyricText 第一种语言歌词文本
|
||||||
|
* @param secondLyricText 可选,第二种语言歌词文本
|
||||||
|
*/
|
||||||
|
fun loadLyric(mainLyricText: String?, secondLyricText: String? = null)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载歌词 [LyricEntry] 集合
|
||||||
|
* 如果你在 Service 等地方自行解析歌词包装成 [LyricEntry] 集合,那么可以使用此方法载入歌词
|
||||||
|
*
|
||||||
|
* @param lyricEntries 歌词集合
|
||||||
|
* @since 1.3.1
|
||||||
|
*/
|
||||||
|
fun loadLyric(lyricEntries: List<LyricEntry>)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新歌词
|
||||||
|
*
|
||||||
|
* @param time 当前播放时间
|
||||||
|
*/
|
||||||
|
fun updateTime(time: Long, force: Boolean = false)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置歌词是否允许拖动
|
||||||
|
*
|
||||||
|
* @param draggable 是否允许拖动
|
||||||
|
* @param onPlayClickListener 设置歌词拖动后播放按钮点击监听器,如果允许拖动,则不能为 null
|
||||||
|
*/
|
||||||
|
fun setDraggable(draggable: Boolean, onPlayClickListener: OnPlayClickListener?)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置单击
|
||||||
|
*/
|
||||||
|
fun setOnSingerClickListener(onSingerClickListener: OnSingleClickListener?)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前歌词每句实体,可用于歌词分享
|
||||||
|
*
|
||||||
|
* @return LyricEntry 集合
|
||||||
|
*/
|
||||||
|
fun getLyricEntryList(): List<LyricEntry>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置当前歌词每句实体
|
||||||
|
*/
|
||||||
|
fun setLyricEntryList(newList: List<LyricEntry>)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前行歌词
|
||||||
|
*/
|
||||||
|
fun getCurrentLineLyricEntry(): LyricEntry?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词设置自定义的字体
|
||||||
|
*
|
||||||
|
* @param file 字体文件
|
||||||
|
*/
|
||||||
|
fun setLyricTypeface(file: File)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词设置自定义的字体
|
||||||
|
*
|
||||||
|
* @param path 字体文件路径
|
||||||
|
*/
|
||||||
|
fun setLyricTypeface(path: String)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词设置自定义的字体,可为空,若为空则应清除字体
|
||||||
|
*
|
||||||
|
* @param typeface 字体对象
|
||||||
|
*/
|
||||||
|
fun setLyricTypeface(typeface: Typeface?)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词的过渡动画设置阻尼比(数值越大,回弹次数越多)
|
||||||
|
*
|
||||||
|
* @param dampingRatio 阻尼比 详见[androidx.dynamicanimation.animation.SpringForce]
|
||||||
|
*/
|
||||||
|
fun setDampingRatioForLyric(dampingRatio: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词视图的滚动动画设置阻尼比(数值越大,回弹次数越多)
|
||||||
|
*
|
||||||
|
* @param dampingRatio 阻尼比 详见[androidx.dynamicanimation.animation.SpringForce]
|
||||||
|
*/
|
||||||
|
fun setDampingRatioForViewPort(dampingRatio: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词的过渡动画设置刚度(数值越大,动画越短)
|
||||||
|
*
|
||||||
|
* @param stiffness 刚度 详见[androidx.dynamicanimation.animation.SpringForce]
|
||||||
|
*/
|
||||||
|
fun setStiffnessForLyric(stiffness: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为歌词视图的滚动动画设置刚度(数值越大,动画越短)
|
||||||
|
*
|
||||||
|
* @param stiffness 刚度 详见[androidx.dynamicanimation.animation.SpringForce]
|
||||||
|
*/
|
||||||
|
fun setStiffnessForViewPort(stiffness: Float)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置跳转播放按钮
|
||||||
|
*/
|
||||||
|
fun setPlayDrawable(drawable: Drawable)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置是否绘制歌词翻译
|
||||||
|
*/
|
||||||
|
fun setIsDrawTranslation(isDrawTranslation: Boolean)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启特定的模糊效果
|
||||||
|
*/
|
||||||
|
fun setIsEnableBlurEffect(isEnableBlurEffect: Boolean)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置元素的偏移百分比,0.5f即表示居中
|
||||||
|
*
|
||||||
|
* @param itemOffsetPercent 0f ~ 1f 偏移百分比
|
||||||
|
*/
|
||||||
|
fun setItemOffsetPercent(@FloatRange(from = 0.0, to = 1.0) itemOffsetPercent: Float)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放按钮点击监听器,点击后应该跳转到指定播放位置
|
||||||
|
*/
|
||||||
|
interface OnPlayClickListener {
|
||||||
|
/**
|
||||||
|
* 播放按钮被点击,应该跳转到指定播放位置
|
||||||
|
*
|
||||||
|
* @return 是否成功消费该事件,如果成功消费,则会更新UI
|
||||||
|
*/
|
||||||
|
fun onPlayClick(time: Long): Boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击歌词布局
|
||||||
|
*/
|
||||||
|
interface OnSingleClickListener {
|
||||||
|
fun onClick()
|
||||||
|
}
|
82
app/src/main/java/com/dirror/lyricviewx/LyricEntry.kt
Normal file
82
app/src/main/java/com/dirror/lyricviewx/LyricEntry.kt
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
package com.dirror.lyricviewx
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import android.text.Layout
|
||||||
|
import android.text.StaticLayout
|
||||||
|
import android.text.TextPaint
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一行歌词实体
|
||||||
|
* @since 2021年1月19日09:51:40 Moriafly 基于 LrcEntry 改造,转换为 kt ,移除部分过时方法
|
||||||
|
* @param time 歌词时间
|
||||||
|
* @param text 歌词文本
|
||||||
|
*/
|
||||||
|
class LyricEntry(val time: Long, val text: String) : Comparable<LyricEntry> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二文本
|
||||||
|
*/
|
||||||
|
var secondText: String? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* staticLayout
|
||||||
|
*/
|
||||||
|
var staticLayout: StaticLayout? = null
|
||||||
|
private set
|
||||||
|
|
||||||
|
var secondStaticLayout: StaticLayout? = null
|
||||||
|
private set
|
||||||
|
|
||||||
|
@Deprecated("存在不显示翻译的情况,会导致offset发生改变,故不再固定存储offset")
|
||||||
|
/**
|
||||||
|
* 歌词距离视图顶部的距离
|
||||||
|
*/
|
||||||
|
var offset = Float.MIN_VALUE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
* @param textPaint 文本画笔
|
||||||
|
* @param width 宽度
|
||||||
|
* @param align 位置
|
||||||
|
*/
|
||||||
|
fun init(
|
||||||
|
textPaint: TextPaint,
|
||||||
|
secondTextPaint: TextPaint,
|
||||||
|
width: Int, align: Layout.Alignment
|
||||||
|
) {
|
||||||
|
staticLayout = createStaticLayout(text, textPaint, width, align)
|
||||||
|
secondStaticLayout = createStaticLayout(secondText, secondTextPaint, width, align)
|
||||||
|
offset = Float.MIN_VALUE
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继承 Comparable 比较
|
||||||
|
* @param other LyricEntry
|
||||||
|
* @return 时间差
|
||||||
|
*/
|
||||||
|
override fun compareTo(other: LyricEntry): Int {
|
||||||
|
return (time - other.time).toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun createStaticLayout(
|
||||||
|
text: String?,
|
||||||
|
paint: TextPaint,
|
||||||
|
width: Number,
|
||||||
|
align: Layout.Alignment
|
||||||
|
): StaticLayout? {
|
||||||
|
if (text == null || text.isEmpty()) return null
|
||||||
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
StaticLayout.Builder
|
||||||
|
.obtain(text, 0, text.length, paint, width.toInt())
|
||||||
|
.setAlignment(align)
|
||||||
|
.setLineSpacing(0f, 1f)
|
||||||
|
.setIncludePad(false)
|
||||||
|
.build()
|
||||||
|
} else {
|
||||||
|
StaticLayout(text, paint, width.toInt(), align, 1f, 0f, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
289
app/src/main/java/com/dirror/lyricviewx/LyricUtil.kt
Normal file
289
app/src/main/java/com/dirror/lyricviewx/LyricUtil.kt
Normal file
|
@ -0,0 +1,289 @@
|
||||||
|
package com.dirror.lyricviewx
|
||||||
|
|
||||||
|
import android.animation.ArgbEvaluator
|
||||||
|
import android.animation.ValueAnimator
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.text.TextUtils
|
||||||
|
import android.text.format.DateUtils
|
||||||
|
import android.view.MotionEvent
|
||||||
|
import java.io.*
|
||||||
|
import java.net.HttpURLConnection
|
||||||
|
import java.net.URL
|
||||||
|
import java.nio.charset.StandardCharsets
|
||||||
|
import java.util.*
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工具类
|
||||||
|
* 原 LrcUtils 转 Kotlin
|
||||||
|
*/
|
||||||
|
object LyricUtil {
|
||||||
|
|
||||||
|
private val PATTERN_LINE = Pattern.compile("((\\[\\d\\d:\\d\\d\\.\\d{2,3}])+)(.+)")
|
||||||
|
private val PATTERN_TIME = Pattern.compile("\\[(\\d\\d):(\\d\\d)\\.(\\d{2,3})]")
|
||||||
|
private val argbEvaluator = ArgbEvaluator()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从文件解析双语歌词
|
||||||
|
*/
|
||||||
|
fun parseLrc(lrcFiles: Array<out File?>?): List<LyricEntry>? {
|
||||||
|
if (lrcFiles == null || lrcFiles.size != 2 || lrcFiles[0] == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
val mainLrcFile = lrcFiles[0]
|
||||||
|
val secondLrcFile = lrcFiles[1]
|
||||||
|
val mainEntryList = parseLrc(mainLrcFile)
|
||||||
|
val secondEntryList = parseLrc(secondLrcFile)
|
||||||
|
if (mainEntryList != null && secondEntryList != null) {
|
||||||
|
for (mainEntry in mainEntryList) {
|
||||||
|
for (secondEntry in secondEntryList) {
|
||||||
|
if (mainEntry.time == secondEntry.time) {
|
||||||
|
mainEntry.secondText = secondEntry.text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mainEntryList
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从文件解析歌词
|
||||||
|
*/
|
||||||
|
private fun parseLrc(lrcFile: File?): List<LyricEntry>? {
|
||||||
|
if (lrcFile == null || !lrcFile.exists()) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
val entryList: MutableList<LyricEntry> = ArrayList()
|
||||||
|
try {
|
||||||
|
val br =
|
||||||
|
BufferedReader(InputStreamReader(FileInputStream(lrcFile), StandardCharsets.UTF_8))
|
||||||
|
var line: String
|
||||||
|
while (br.readLine().also { line = it } != null) {
|
||||||
|
val list = parseLine(line)
|
||||||
|
if (list != null && list.isNotEmpty()) {
|
||||||
|
entryList.addAll(list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
br.close()
|
||||||
|
} catch (e: IOException) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
entryList.sort()
|
||||||
|
return entryList
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从文本解析双语歌词
|
||||||
|
*/
|
||||||
|
fun parseLrc(lrcTexts: Array<out String?>?): List<LyricEntry>? {
|
||||||
|
if (lrcTexts == null || lrcTexts.size != 2 || TextUtils.isEmpty(lrcTexts[0])) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
val mainLrcText = lrcTexts[0]
|
||||||
|
val secondLrcText = lrcTexts[1]
|
||||||
|
val mainEntryList = mainLrcText?.let { parseLrc(it) }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当输入的secondLrcText为空时,按如下格式解析歌词
|
||||||
|
* (音乐标签下载的第二种歌词格式)
|
||||||
|
*
|
||||||
|
* [00:21.11]いつも待ち合わせより15分前集合
|
||||||
|
* [00:21.11]总会比相约时间早15分钟集合
|
||||||
|
* [00:28.32]駅の改札ぬける
|
||||||
|
* [00:28.32]穿过车站的检票口
|
||||||
|
* [00:31.39]ざわめきにわくわくだね
|
||||||
|
* [00:31.39]嘈杂声令内心兴奋不已
|
||||||
|
* [00:35.23]どこへ向かうかなんて
|
||||||
|
* [00:35.23]不在意接下来要去哪里
|
||||||
|
*/
|
||||||
|
if (TextUtils.isEmpty(secondLrcText)) {
|
||||||
|
var lastEntry: LyricEntry? = null
|
||||||
|
return mainEntryList?.filter { now ->
|
||||||
|
if (lastEntry == null) {
|
||||||
|
lastEntry = now
|
||||||
|
return@filter true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastEntry!!.time == now.time) {
|
||||||
|
lastEntry!!.secondText = now.text
|
||||||
|
lastEntry = null
|
||||||
|
return@filter false
|
||||||
|
}
|
||||||
|
|
||||||
|
lastEntry = now
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val secondEntryList = secondLrcText?.let { parseLrc(it) }
|
||||||
|
if (mainEntryList != null && secondEntryList != null) {
|
||||||
|
for (mainEntry in mainEntryList) {
|
||||||
|
for (secondEntry in secondEntryList) {
|
||||||
|
if (mainEntry.time == secondEntry.time) {
|
||||||
|
mainEntry.secondText = secondEntry.text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mainEntryList
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从文本解析歌词
|
||||||
|
*/
|
||||||
|
private fun parseLrc(lrcText: String): List<LyricEntry>? {
|
||||||
|
var lyricText = lrcText.trim()
|
||||||
|
if (TextUtils.isEmpty(lyricText)) return null
|
||||||
|
|
||||||
|
if (lyricText.startsWith("\uFEFF")) {
|
||||||
|
lyricText = lyricText.replace("\uFEFF", "")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 针对传入 Language="Media Monkey Format"; Lyrics="......"; 的情况
|
||||||
|
lyricText = lyricText.substringAfter("Lyrics=\"")
|
||||||
|
.substringBeforeLast("\";")
|
||||||
|
|
||||||
|
val entryList: MutableList<LyricEntry> = ArrayList()
|
||||||
|
val array = lyricText.split("\\n".toRegex()).toTypedArray()
|
||||||
|
for (line in array) {
|
||||||
|
val list = parseLine(line)
|
||||||
|
if (!list.isNullOrEmpty()) {
|
||||||
|
entryList.addAll(list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entryList.sort()
|
||||||
|
return entryList
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取网络文本,需要在工作线程中执行
|
||||||
|
*/
|
||||||
|
fun getContentFromNetwork(url: String?, charset: String?): String? {
|
||||||
|
var lrcText: String? = null
|
||||||
|
try {
|
||||||
|
val url = URL(url)
|
||||||
|
val conn = url.openConnection() as HttpURLConnection
|
||||||
|
conn.requestMethod = "GET"
|
||||||
|
conn.connectTimeout = 10000
|
||||||
|
conn.readTimeout = 10000
|
||||||
|
if (conn.responseCode == 200) {
|
||||||
|
val `is` = conn.inputStream
|
||||||
|
val bos = ByteArrayOutputStream()
|
||||||
|
val buffer = ByteArray(1024)
|
||||||
|
var len: Int
|
||||||
|
while (`is`.read(buffer).also { len = it } != -1) {
|
||||||
|
bos.write(buffer, 0, len)
|
||||||
|
}
|
||||||
|
`is`.close()
|
||||||
|
bos.close()
|
||||||
|
lrcText = bos.toString(charset)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
return lrcText
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析一行歌词
|
||||||
|
*/
|
||||||
|
private fun parseLine(line: String): List<LyricEntry>? {
|
||||||
|
var lyricLine = line
|
||||||
|
if (TextUtils.isEmpty(lyricLine)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
lyricLine = lyricLine.trim { it <= ' ' }
|
||||||
|
// [00:17.65]让我掉下眼泪的
|
||||||
|
val lineMatcher = PATTERN_LINE.matcher(lyricLine)
|
||||||
|
if (!lineMatcher.matches()) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
val times = lineMatcher.group(1)!!
|
||||||
|
val text = lineMatcher.group(3)!!
|
||||||
|
val entryList: MutableList<LyricEntry> = ArrayList()
|
||||||
|
|
||||||
|
// [00:17.65]
|
||||||
|
val timeMatcher = PATTERN_TIME.matcher(times)
|
||||||
|
while (timeMatcher.find()) {
|
||||||
|
val min = timeMatcher.group(1)!!.toLong()
|
||||||
|
val sec = timeMatcher.group(2)!!.toLong()
|
||||||
|
val milString = timeMatcher.group(3)!!
|
||||||
|
var mil = milString.toLong()
|
||||||
|
// 如果毫秒是两位数,需要乘以 10,when 新增支持 1 - 6 位毫秒,很多获取的歌词存在不同的毫秒位数
|
||||||
|
when (milString.length) {
|
||||||
|
1 -> mil *= 100
|
||||||
|
2 -> mil *= 10
|
||||||
|
4 -> mil /= 10
|
||||||
|
5 -> mil /= 100
|
||||||
|
6 -> mil /= 1000
|
||||||
|
}
|
||||||
|
val time = min * DateUtils.MINUTE_IN_MILLIS + sec * DateUtils.SECOND_IN_MILLIS + mil
|
||||||
|
entryList.add(LyricEntry(time, text))
|
||||||
|
}
|
||||||
|
return entryList
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转为[分:秒]
|
||||||
|
*/
|
||||||
|
fun formatTime(milli: Long): String {
|
||||||
|
val m = (milli / DateUtils.MINUTE_IN_MILLIS).toInt()
|
||||||
|
val s = (milli / DateUtils.SECOND_IN_MILLIS % 60).toInt()
|
||||||
|
val mm = String.format(Locale.getDefault(), "%02d", m)
|
||||||
|
val ss = String.format(Locale.getDefault(), "%02d", s)
|
||||||
|
return "$mm:$ss"
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BUG java.lang.NoSuchFieldException: No field sDurationScale in class Landroid/animation/ValueAnimator; #3
|
||||||
|
*/
|
||||||
|
@SuppressLint("SoonBlockedPrivateApi")
|
||||||
|
@Deprecated("")
|
||||||
|
fun resetDurationScale() {
|
||||||
|
try {
|
||||||
|
val mField = ValueAnimator::class.java.getDeclaredField("sDurationScale")
|
||||||
|
mField.isAccessible = true
|
||||||
|
mField.setFloat(null, 1f)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结合fraction,计算两个值之间的比例
|
||||||
|
*/
|
||||||
|
fun calcScaleValue(a: Float, b: Float, f: Float, reverse: Boolean = false): Float {
|
||||||
|
if (b == 0f) return 1f
|
||||||
|
return 1f + ((a - b) / b) * (if (reverse) 1f - f else f)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 颜色值插值函数
|
||||||
|
*/
|
||||||
|
fun lerpColor(a: Int, b: Int, f: Float): Int {
|
||||||
|
return argbEvaluator.evaluate(f, a, b) as Int
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简单的插值函数
|
||||||
|
*/
|
||||||
|
fun lerp(from: Float, to: Float, fraction: Float): Float {
|
||||||
|
return from + (to - from) * fraction
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断MotionEvent是否发生在Rect中
|
||||||
|
*/
|
||||||
|
fun MotionEvent.insideOf(rect: Rect?): Boolean {
|
||||||
|
rect ?: return false
|
||||||
|
return rect.contains(x.toInt(), y.toInt())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun normalize(min: Float, max: Float, value: Float, limit: Boolean = false): Float {
|
||||||
|
if (min == max) return 1f
|
||||||
|
return ((value - min) / (max - min)).let {
|
||||||
|
if (limit) it.coerceIn(0f, 1f) else it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1099
app/src/main/java/com/dirror/lyricviewx/LyricViewX.kt
Normal file
1099
app/src/main/java/com/dirror/lyricviewx/LyricViewX.kt
Normal file
File diff suppressed because it is too large
Load Diff
51
app/src/main/java/com/dirror/lyricviewx/ReadyHelper.kt
Normal file
51
app/src/main/java/com/dirror/lyricviewx/ReadyHelper.kt
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
package com.dirror.lyricviewx
|
||||||
|
|
||||||
|
import androidx.annotation.IntDef
|
||||||
|
|
||||||
|
const val STATE_CREATED = 1
|
||||||
|
const val STATE_INITIALIZING = 2
|
||||||
|
const val STATE_INITIALIZED = 3
|
||||||
|
const val STATE_ERROR = 4
|
||||||
|
|
||||||
|
@IntDef(
|
||||||
|
STATE_CREATED,
|
||||||
|
STATE_INITIALIZING,
|
||||||
|
STATE_INITIALIZED,
|
||||||
|
STATE_ERROR
|
||||||
|
)
|
||||||
|
@Retention(AnnotationRetention.SOURCE)
|
||||||
|
annotation class ReadyState
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简单的状态机,根据 [readyState] 的状态决定当前任务的执行或延后与否
|
||||||
|
*/
|
||||||
|
open class ReadyHelper {
|
||||||
|
private var readyCallback: (Boolean) -> Unit = {}
|
||||||
|
|
||||||
|
@ReadyState
|
||||||
|
var readyState: Int = STATE_CREATED
|
||||||
|
set(value) {
|
||||||
|
if (field == value) return
|
||||||
|
when (value) {
|
||||||
|
STATE_INITIALIZED,
|
||||||
|
STATE_ERROR -> synchronized(readyCallback) {
|
||||||
|
field = value
|
||||||
|
readyCallback.invoke(value != STATE_ERROR)
|
||||||
|
}
|
||||||
|
else -> field = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun whenReady(performAction: (Boolean) -> Unit): Boolean {
|
||||||
|
return when (readyState) {
|
||||||
|
STATE_CREATED, STATE_INITIALIZING -> {
|
||||||
|
readyCallback = performAction
|
||||||
|
false
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
performAction(readyState != STATE_ERROR)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.dirror.lyricviewx
|
||||||
|
|
||||||
|
import android.animation.TimeInterpolator
|
||||||
|
import kotlin.math.pow
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smooth 插值器
|
||||||
|
* @author Moriafly
|
||||||
|
*/
|
||||||
|
@Deprecated("过时")
|
||||||
|
class SmoothInterpolator: TimeInterpolator {
|
||||||
|
override fun getInterpolation(input: Float): Float {
|
||||||
|
val a = 1.11571230005336
|
||||||
|
val b = -1.99852071205059
|
||||||
|
val c = 0.272428743837376
|
||||||
|
val d = -1.15835562067601E-05
|
||||||
|
return ((a - d) / (1.0 + (input.toDouble() / c).pow(b)) + d).toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.dirror.lyricviewx.extension
|
||||||
|
|
||||||
|
import android.graphics.BlurMaskFilter
|
||||||
|
import android.util.SparseArray
|
||||||
|
|
||||||
|
class BlurMaskFilterExt {
|
||||||
|
private val maskFilterCache = SparseArray<BlurMaskFilter>()
|
||||||
|
|
||||||
|
fun get(radius: Int): BlurMaskFilter? {
|
||||||
|
if (radius == 0 || radius > 25) return null
|
||||||
|
|
||||||
|
return maskFilterCache[radius] ?: BlurMaskFilter(radius.toFloat(), BlurMaskFilter.Blur.NORMAL)
|
||||||
|
.also { maskFilterCache.put(radius, it) }
|
||||||
|
}
|
||||||
|
}
|
138
app/src/main/java/com/muqingbfq/MediaPlayer.java
Normal file
138
app/src/main/java/com/muqingbfq/MediaPlayer.java
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.DataSource;
|
||||||
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
|
import com.bumptech.glide.request.RequestListener;
|
||||||
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.fragment.mp3;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
public class MediaPlayer extends android.media.MediaPlayer {
|
||||||
|
public MediaPlayer() {
|
||||||
|
this.setOnCompletionListener(mediaPlayer -> {
|
||||||
|
if (!home.db.view.isShown()) {
|
||||||
|
home.db.view.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
int i = bfqkz.getmti(bfqkz.ms);
|
||||||
|
bfqkz.xm = bfqkz.list.get(i);
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
bfqkz.mp3(url.hq(bfqkz.xm));
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
});
|
||||||
|
this.setOnErrorListener((mediaPlayer, i, i1) -> {
|
||||||
|
bfqkz.list.remove(bfqkz.xm);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
resumeTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pause() throws IllegalStateException {
|
||||||
|
if (isPlaying()) {
|
||||||
|
super.pause();
|
||||||
|
//暂停
|
||||||
|
if (bfq.kg != null) {
|
||||||
|
bfq.kg.setImageResource(R.drawable.zt);
|
||||||
|
}
|
||||||
|
home.db.txa.setImageResource(R.drawable.zt);
|
||||||
|
bfqkz.updateNotification();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timer timer;
|
||||||
|
public TimerTask timerTask;
|
||||||
|
public void pauseTimer() {
|
||||||
|
if (timer != null) {
|
||||||
|
timer.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void resumeTimer() {
|
||||||
|
timer = new Timer();//定时器
|
||||||
|
timerTask = new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (bfqkz.mt.isPlaying() && bfq.getVisibility()) {
|
||||||
|
int currentPosition = bfqkz.mt.getCurrentPosition();
|
||||||
|
bfq.tdt.setProgress(currentPosition);
|
||||||
|
bfq.lrcView.updateTime(currentPosition, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.scheduleAtFixedRate(timerTask, 0, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() throws IllegalStateException {
|
||||||
|
super.start();
|
||||||
|
if (bfqkz.xm == null) {
|
||||||
|
bfq_an.xyq();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//开始
|
||||||
|
if (bfq.kg != null) {
|
||||||
|
bfq.kg.setImageResource(R.drawable.bf);
|
||||||
|
}
|
||||||
|
home.db.txa.setImageResource(R.drawable.bf);
|
||||||
|
bfqkz.updateNotification();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@Override
|
||||||
|
public void setDataSource(String path) throws IOException, IllegalArgumentException, IllegalStateException, SecurityException {
|
||||||
|
super.setDataSource(path);
|
||||||
|
prepare();
|
||||||
|
bfqkz.tdt_max = getDuration();
|
||||||
|
bfqkz.tdt_wz = getCurrentPosition();
|
||||||
|
Glide.with(main.context)
|
||||||
|
.asBitmap()
|
||||||
|
.load(bfqkz.xm.picurl)
|
||||||
|
.addListener(new RequestListener<Bitmap>() {
|
||||||
|
@Override
|
||||||
|
public boolean onLoadFailed(@Nullable GlideException e, Object model,
|
||||||
|
@NonNull Target<Bitmap> target, boolean isFirstResource) {
|
||||||
|
bfqkz.notify.setBitmap(null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onResourceReady(@NonNull Bitmap bitmap, @NonNull Object model, Target<Bitmap> target,
|
||||||
|
@NonNull DataSource dataSource, boolean isFirstResource) {
|
||||||
|
bfqkz.notify.setBitmap(bitmap);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.submit();
|
||||||
|
start();
|
||||||
|
main.handler.post(() -> {
|
||||||
|
if (bfq.name != null) {
|
||||||
|
bfq.tdt.setMax((int) bfqkz.tdt_max);
|
||||||
|
bfq.tdt.setProgress((int) bfqkz.tdt_wz);
|
||||||
|
bfq.time_a.setText(bfq_an.getTime(bfqkz.tdt_max));
|
||||||
|
bfq.name.setText(bfqkz.xm.name);
|
||||||
|
bfq.zz.setText(bfqkz.xm.zz);
|
||||||
|
bfq_an.islike(bfq.like.getContext());
|
||||||
|
}
|
||||||
|
home.db.name.setText(bfqkz.xm.name);
|
||||||
|
home.db.zz.setText(bfqkz.xm.zz);
|
||||||
|
if (mp3.lbspq != null) {
|
||||||
|
mp3.lbspq.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
155
app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java
Normal file
155
app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java
Normal file
|
@ -0,0 +1,155 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
public class MyButtonClickReceiver extends BroadcastReceiver {
|
||||||
|
private Timer timer = new Timer();
|
||||||
|
private static int clickCount;
|
||||||
|
|
||||||
|
public MyButtonClickReceiver() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
if (action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
|
||||||
|
int bluetoothState = intent.getIntExtra(BluetoothAdapter.EXTRA_CONNECTION_STATE, 0);
|
||||||
|
//蓝牙断开
|
||||||
|
if (bluetoothState == BluetoothAdapter.STATE_DISCONNECTED) {
|
||||||
|
receiverPause();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (action.equals("android.intent.action.HEADSET_PLUG")) {
|
||||||
|
if (intent.hasExtra("state")) {
|
||||||
|
if (intent.getIntExtra("state", 2) == 0) {
|
||||||
|
//拔出
|
||||||
|
if (bfqkz.mt.isPlaying()) {
|
||||||
|
receiverPause();
|
||||||
|
}
|
||||||
|
} else if (intent.getIntExtra("state", 2) == 1) {
|
||||||
|
receiverPlay();
|
||||||
|
//插入
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
|
||||||
|
KeyEvent keyEvent = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
|
||||||
|
if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK && keyEvent.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
clickCount = clickCount + 1;
|
||||||
|
if (clickCount == 1) {
|
||||||
|
HeadsetTimerTask headsetTimerTask = new HeadsetTimerTask();
|
||||||
|
timer.schedule(headsetTimerTask, 500);
|
||||||
|
}
|
||||||
|
} else if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_NEXT && keyEvent.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
handler(2);
|
||||||
|
} else if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PREVIOUS && keyEvent.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
handler(3);
|
||||||
|
} else if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PAUSE && keyEvent.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
handler(4);
|
||||||
|
} else if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PLAY && keyEvent.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
handler(5);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case "kg":
|
||||||
|
playOrPause();
|
||||||
|
break;
|
||||||
|
case "syq":
|
||||||
|
bfq_an.syq();
|
||||||
|
break;
|
||||||
|
case "xyq":
|
||||||
|
bfq_an.xyq();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 处理按钮点击事件的逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
class HeadsetTimerTask extends TimerTask {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
if (clickCount == 1) {
|
||||||
|
handler(1);
|
||||||
|
} else if (clickCount == 2) {
|
||||||
|
handler(2);
|
||||||
|
} else if (clickCount >= 3) {
|
||||||
|
handler(3);
|
||||||
|
}
|
||||||
|
clickCount = 0;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void handler(int a) {
|
||||||
|
switch (a) {
|
||||||
|
case 1:
|
||||||
|
playOrPause();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
playNext();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
playPrevious();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
receiverPause();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
receiverPlay();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * 对蓝牙 播放
|
||||||
|
public void receiverPlay() {
|
||||||
|
bfqkz.mt.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// * 对蓝牙 暂停
|
||||||
|
public void receiverPause() {
|
||||||
|
bfqkz.mt.pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对蓝牙 播放-暂停
|
||||||
|
*/
|
||||||
|
public static void playOrPause() {
|
||||||
|
// gj.sc(isMusicServiceBound);
|
||||||
|
// 播放/暂停按钮点击事件 if (isMusicServiceBound)
|
||||||
|
if (bfqkz.mt.isPlaying()) {
|
||||||
|
bfqkz.mt.pause();
|
||||||
|
} else {
|
||||||
|
bfqkz.mt.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对蓝牙 下一首
|
||||||
|
*/
|
||||||
|
public void playNext() {
|
||||||
|
bfq_an.xyq();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对蓝牙 上一首
|
||||||
|
*/
|
||||||
|
public void playPrevious() {
|
||||||
|
bfq_an.syq();
|
||||||
|
}
|
||||||
|
}
|
36
app/src/main/java/com/muqingbfq/activity_about_software.java
Normal file
36
app/src/main/java/com/muqingbfq/activity_about_software.java
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
|
public class activity_about_software extends AppCompatActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_about_software);
|
||||||
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
|
try {
|
||||||
|
String versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
|
||||||
|
toolbar.setSubtitle(versionName + " Base");
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
yc.start(this, e);
|
||||||
|
}
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
|
if (itemId == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
270
app/src/main/java/com/muqingbfq/activity_search.java
Normal file
270
app/src/main/java/com/muqingbfq/activity_search.java
Normal file
|
@ -0,0 +1,270 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.muqingbfq.fragment.search;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class activity_search extends AppCompatActivity {
|
||||||
|
private EditText editText;
|
||||||
|
private ArrayAdapter<String> adapter;
|
||||||
|
|
||||||
|
private JSONObject json = new JSONObject();
|
||||||
|
private List<String> json_list = new ArrayList<>();
|
||||||
|
private final List<String> list = new ArrayList<>();
|
||||||
|
ListView listPopupWindow;
|
||||||
|
public static AppCompatActivity appCompatActivity;
|
||||||
|
|
||||||
|
@SuppressLint({"RestrictedApi", "NotifyDataSetChanged"})
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_search);
|
||||||
|
appCompatActivity = this;
|
||||||
|
setSupportActionBar(findViewById(R.id.toolbar));
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = findViewById(R.id.list_recycler);
|
||||||
|
SearchRecordAdapter recordAdapter = new SearchRecordAdapter();
|
||||||
|
recyclerView.setAdapter(recordAdapter);
|
||||||
|
|
||||||
|
editText = findViewById(R.id.editview);
|
||||||
|
editText.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||||
|
String str = v.getText().toString();
|
||||||
|
if (!str.equals("")) {
|
||||||
|
// 退出activity并返回str数据
|
||||||
|
start(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
findViewById(R.id.deleat).setOnClickListener(v -> new MaterialAlertDialogBuilder(v.getContext())
|
||||||
|
.setTitle("删除")
|
||||||
|
.setMessage("清空历史记录?")
|
||||||
|
.setNegativeButton("取消", null)
|
||||||
|
.setPositiveButton("确定", (dialogInterface, i) -> {
|
||||||
|
wj.sc(wj.filesdri + wj.lishi_json);
|
||||||
|
json = new JSONObject();
|
||||||
|
json_list.clear();
|
||||||
|
recordAdapter.notifyDataSetChanged();
|
||||||
|
findViewById(R.id.xxbj1).setVisibility(View.GONE);
|
||||||
|
})
|
||||||
|
.show());
|
||||||
|
listPopupWindow = findViewById(R.id.search_recycler);
|
||||||
|
|
||||||
|
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);
|
||||||
|
listPopupWindow.setAdapter(adapter);
|
||||||
|
|
||||||
|
//设置项点击监听
|
||||||
|
listPopupWindow.setOnItemClickListener((adapterView, view, i, l) -> {
|
||||||
|
editText.clearFocus();
|
||||||
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
|
View v = getWindow().peekDecorView();
|
||||||
|
if (null != v) {
|
||||||
|
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
editText.setText(list.get(i));//把选择的选项内容展示在EditText上
|
||||||
|
dismiss();//如果已经选择了,隐藏起来
|
||||||
|
start(editText.getText().toString());
|
||||||
|
|
||||||
|
});
|
||||||
|
editText.setOnFocusChangeListener((view, b) -> {
|
||||||
|
if (b) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
editText.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
list.clear();
|
||||||
|
if (s.length() < 1) {
|
||||||
|
list.clear();
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
editText.clearFocus();
|
||||||
|
dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!editText.hasFocus()) {
|
||||||
|
dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listPopupWindow.setVisibility(View.VISIBLE);
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String hq = wl.hq("/search/suggest?keywords=" + s + "&type=mobile");
|
||||||
|
try {
|
||||||
|
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||||
|
.getJSONArray("allMatch");
|
||||||
|
int length = jsonArray.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
|
String keyword = jsonObject.getString("keyword");
|
||||||
|
list.add(keyword);
|
||||||
|
}
|
||||||
|
main.handler.post(() -> adapter.notifyDataSetChanged());
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.ts(activity_search.this, e);
|
||||||
|
}
|
||||||
|
super.run();
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fragmentManager = getSupportFragmentManager();
|
||||||
|
fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dismiss() {
|
||||||
|
listPopupWindow.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSearchRecord(String name) {
|
||||||
|
try {
|
||||||
|
if (!json.has("list")) {
|
||||||
|
json.put("list", new JSONArray());
|
||||||
|
}
|
||||||
|
if (!json_list.contains(name)) {
|
||||||
|
json_list.add(name);
|
||||||
|
JSONObject record = new JSONObject();
|
||||||
|
record.put("name", name);
|
||||||
|
json.getJSONArray("list").put(record);
|
||||||
|
wj.xrwb(wj.filesdri + wj.lishi_json, json.toString());
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.home, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
|
if (itemId == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
} else if (itemId == R.id.menu_search) {
|
||||||
|
start(editText.getText().toString());
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FragmentManager fragmentManager;
|
||||||
|
FragmentTransaction fragmentTransaction;
|
||||||
|
|
||||||
|
com.muqingbfq.fragment.search search;
|
||||||
|
public void start(String name) {
|
||||||
|
dismiss();
|
||||||
|
if (name.equals("")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (search == null) {
|
||||||
|
search = new search(name);
|
||||||
|
}
|
||||||
|
if (!search.isVisible()) {
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.add(R.id.search_fragment, search)
|
||||||
|
.addToBackStack(null).commit();
|
||||||
|
} else {
|
||||||
|
search.setStart(name);
|
||||||
|
}
|
||||||
|
addSearchRecord(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchRecordAdapter extends RecyclerView.Adapter<SearchRecordAdapter.ViewHolder> {
|
||||||
|
public SearchRecordAdapter() {
|
||||||
|
String dqwb = wj.dqwb(wj.filesdri + wj.lishi_json);
|
||||||
|
if (dqwb != null) {
|
||||||
|
try {
|
||||||
|
json = new JSONObject(dqwb);
|
||||||
|
JSONArray list1 = json.getJSONArray("list");
|
||||||
|
int length = list1.length();
|
||||||
|
for (int i = length - 1; i >= 0; i--) {
|
||||||
|
json_list.add(list1.
|
||||||
|
getJSONObject(i).getString("name"));
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
yc.start(activity_search.this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (json_list.isEmpty()) {
|
||||||
|
findViewById(R.id.xxbj1).setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = View.inflate(parent.getContext(), android.R.layout.simple_list_item_1, null);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
String keyword = json_list.get(position);
|
||||||
|
holder.recordTextView.setText(keyword);
|
||||||
|
holder.recordTextView.setOnClickListener(v -> {
|
||||||
|
editText.setText(keyword);
|
||||||
|
start(keyword);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return json_list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
TextView recordTextView;
|
||||||
|
|
||||||
|
public ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
recordTextView = itemView.findViewById(android.R.id.text1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
124
app/src/main/java/com/muqingbfq/api/playlist.java
Normal file
124
app/src/main/java/com/muqingbfq/api/playlist.java
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
package com.muqingbfq.api;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.fragment.gd;
|
||||||
|
import com.muqingbfq.fragment.mp3;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class playlist extends Thread {
|
||||||
|
public static final String api = "/playlist/track/all?id=";
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
public playlist(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
public static boolean hq(List<xm> list, String uid) {
|
||||||
|
list.clear();
|
||||||
|
try {
|
||||||
|
String hq;
|
||||||
|
if (wj.cz(wj.gd + uid)) {
|
||||||
|
hq = wj.dqwb(wj.gd + uid);
|
||||||
|
} else {
|
||||||
|
hq = wl.hq(api + uid + "&limit=30");
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject(hq);
|
||||||
|
JSONArray songs = json.getJSONArray("songs");
|
||||||
|
int length = songs.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject jsonObject = songs.getJSONObject(i);
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
|
||||||
|
JSONObject al = jsonObject.getJSONObject("al");
|
||||||
|
JSONArray ar = jsonObject.getJSONArray("ar");
|
||||||
|
StringBuilder zz = new StringBuilder();
|
||||||
|
int length_a = ar.length();
|
||||||
|
for (int j = 0; j < length_a; j++) {
|
||||||
|
zz.append(ar.getJSONObject(j).getString("name"))
|
||||||
|
.append("/");
|
||||||
|
}
|
||||||
|
zz.append("-").append(al.getString("name"));
|
||||||
|
String picUrl = al.getString("picUrl");
|
||||||
|
list.add(new xm(id, name, zz.toString(), picUrl));
|
||||||
|
}
|
||||||
|
// main.handler.post(new mp3.lbspq_sx());
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("失败的错误 " + e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hq_like(List<xm> list) {
|
||||||
|
list.clear();
|
||||||
|
try {
|
||||||
|
JSONObject json = gd.like;
|
||||||
|
for (Iterator<String> it = json.keys(); it.hasNext(); ) {
|
||||||
|
String id = it.next();
|
||||||
|
JSONObject jsonObject = json.getJSONObject(id);
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
String zz = jsonObject.getString("zz");
|
||||||
|
String picUrl = jsonObject.getString("picUrl");
|
||||||
|
list.add(new xm(id, name, zz, picUrl));
|
||||||
|
}
|
||||||
|
main.handler.post(new mp3.lbspq_sx());
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("失败的错误 " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hq_xz(List<xm> list) {
|
||||||
|
list.clear();
|
||||||
|
try {
|
||||||
|
JSONArray json = new JSONObject(wj.dqwb(wj.mp3_xz))
|
||||||
|
.getJSONArray("songs");
|
||||||
|
int length = json.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject jsonObject = json.getJSONObject(i);
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
String zz = jsonObject.getString("zz");
|
||||||
|
String picUrl = jsonObject.getString("picUrl");
|
||||||
|
list.add(new xm(id, name, zz, picUrl));
|
||||||
|
}
|
||||||
|
// main.handler.post(new mp3.lbspq_sx());
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("失败的错误 " + e);
|
||||||
|
wj.sc(wj.mp3_xz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
/* if (uid.equals(wj.mp3_xz)) {
|
||||||
|
playlist.hq_xz(mp3.list);
|
||||||
|
} else if (uid.equals(wj.mp3_like)) {
|
||||||
|
playlist.hq_like(mp3
|
||||||
|
.list);
|
||||||
|
} else {
|
||||||
|
playlist.hq(mp3.list, uid);
|
||||||
|
}
|
||||||
|
if (bfqkz.list == null || bfqkz.list.isEmpty()) {
|
||||||
|
int size = mp3.list.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
bfqkz.list.add(mp3.list.get(i));
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
107
app/src/main/java/com/muqingbfq/api/resource.java
Normal file
107
app/src/main/java/com/muqingbfq/api/resource.java
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
package com.muqingbfq.api;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.start;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
public class resource {
|
||||||
|
|
||||||
|
public static void recommend(List<xm> list) {
|
||||||
|
String hq;
|
||||||
|
JSONObject json;
|
||||||
|
try {
|
||||||
|
if (wj.cz(wj.gd_json)&& start.time>System.currentTimeMillis()-3600000) {
|
||||||
|
hq = wj.dqwb(wj.gd_json);
|
||||||
|
json = new JSONObject(hq);
|
||||||
|
} else {
|
||||||
|
hq = wl.hq("/recommend/resource?cookie="+wl.Cookie);
|
||||||
|
if (hq == null && wj.cz(wj.gd_json)) {
|
||||||
|
hq = wj.dqwb(wj.gd_json);
|
||||||
|
json = new JSONObject(hq);
|
||||||
|
}
|
||||||
|
json = new JSONObject(hq);
|
||||||
|
if (json.getInt("code") == 200) {
|
||||||
|
wj.xrwb(wj.gd_json, hq);
|
||||||
|
start.time = System.currentTimeMillis();
|
||||||
|
main.edit.putLong(main.Time, start.time);
|
||||||
|
main.edit.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONArray recommend = json.getJSONArray("recommend");
|
||||||
|
int length = recommend.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject jsonObject = recommend.getJSONObject(i);
|
||||||
|
add(jsonObject, list);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("resource tuijian" + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void 排行榜(List<xm> list) {
|
||||||
|
String hq;
|
||||||
|
try {
|
||||||
|
if (wj.cz(wj.gd_phb)) {
|
||||||
|
hq = wj.dqwb(wj.gd_phb);
|
||||||
|
} else {
|
||||||
|
hq = wl.hq("/toplist");
|
||||||
|
if (hq == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wj.xrwb(wj.gd_phb, hq);
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = new JSONObject(hq);
|
||||||
|
if (jsonObject.getInt("code") == 200) {
|
||||||
|
JSONArray list_array = jsonObject.getJSONArray("list");
|
||||||
|
int length = list_array.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject get = list_array.getJSONObject(i);
|
||||||
|
String id = get.getString("id");
|
||||||
|
String name = get.getString("name") + "\n" + get.getString("description");
|
||||||
|
boolean cz = wj.cz(wj.gd + id);
|
||||||
|
String coverImgUrl = get.getString("coverImgUrl");
|
||||||
|
list.add(new xm(id, name, coverImgUrl, cz));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void 下载(List<xm> list) {
|
||||||
|
// list.add(new xm("hc.json", "缓存", R.drawable.icon, true));
|
||||||
|
list.add(new xm("mp3_like.json", "喜欢", R.mipmap.like, true));
|
||||||
|
list.add(new xm("mp3_xz.json", "下载", R.drawable.icon, true));
|
||||||
|
try {
|
||||||
|
// JSONArray date = jsonObject.getJSONArray("");
|
||||||
|
JSONObject date = new JSONObject(wj.dqwb(wj.gd_xz));
|
||||||
|
for (Iterator<String> it = date.keys(); it.hasNext(); ) {
|
||||||
|
String id = it.next();
|
||||||
|
boolean cz = wj.cz(wj.gd + id);
|
||||||
|
JSONObject jsonObject = date.getJSONObject(id);
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
String picUrl = jsonObject.getString("picUrl");
|
||||||
|
list.add(new xm(id, name, picUrl, cz));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void add(JSONObject jsonObject, List<xm> list) throws Exception {
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
boolean cz = wj.cz(wj.gd + id);
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
String picUrl = jsonObject.getString("picUrl");
|
||||||
|
list.add(new xm(id, name, picUrl, cz));
|
||||||
|
}
|
||||||
|
}
|
99
app/src/main/java/com/muqingbfq/api/url.java
Normal file
99
app/src/main/java/com/muqingbfq/api/url.java
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muqingbfq.api;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.home;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class url extends Thread {
|
||||||
|
public static String api = "/song/url/v1";
|
||||||
|
xm x;
|
||||||
|
|
||||||
|
public url(xm x) {
|
||||||
|
this.x = x;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String hq(xm x) {
|
||||||
|
if (bfq.getVisibility() && bfq.lrcView != null && bfq.lrcView.getVisibility() == View.VISIBLE) {
|
||||||
|
gc(x.id);
|
||||||
|
} else {
|
||||||
|
lrc = null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (wj.cz(wj.mp3 + x.id)) {
|
||||||
|
return wj.mp3 + x.id;
|
||||||
|
}
|
||||||
|
String level = "standard";
|
||||||
|
if (gj.isWiFiConnected()) {
|
||||||
|
level = "exhigh";
|
||||||
|
}
|
||||||
|
String hq = wl.hq(api + "?id=" + x.id + "&level=" +
|
||||||
|
level + "&cookie=" + wl.Cookie);
|
||||||
|
gj.sc(hq);
|
||||||
|
if (hq == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject(hq);
|
||||||
|
JSONArray data = json.getJSONArray("data");
|
||||||
|
JSONObject jsonObject = data.getJSONObject(0);
|
||||||
|
|
||||||
|
String url = jsonObject.getString("url");
|
||||||
|
if (wl.xz(url, x)) {
|
||||||
|
url = wj.mp3 + x.id;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
} catch (JSONException e) {
|
||||||
|
yc.start("url hq :" + e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
com.muqingbfq.bfqkz.mp3(hq(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String lrc, tlyric;
|
||||||
|
|
||||||
|
public static void gc(String id) {
|
||||||
|
lrc = null;
|
||||||
|
tlyric = null;
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
try {
|
||||||
|
jsonObject = new JSONObject(wl.hq("/lyric?id=" + id));
|
||||||
|
lrc = jsonObject.getJSONObject("lrc").getString("lyric");
|
||||||
|
} catch (JSONException e) {
|
||||||
|
gj.sc("url gc(int id) lrc: " + e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
tlyric = jsonObject.getJSONObject("tlyric").getString("lyric");
|
||||||
|
} catch (JSONException e) {
|
||||||
|
gj.sc("url gc(int id) tlyric: " + e);
|
||||||
|
}
|
||||||
|
bfq.lrcView.loadLyric(lrc, tlyric);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String picurl(String id) {
|
||||||
|
String hq = wl.hq("/song/detail?ids=" + id);
|
||||||
|
try {
|
||||||
|
return new JSONObject(hq).getJSONArray("songs").getJSONObject(0)
|
||||||
|
.getJSONObject("al").getString("picUrl");
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(main.context, e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
196
app/src/main/java/com/muqingbfq/bfq.java
Normal file
196
app/src/main/java/com/muqingbfq/bfq.java
Normal file
|
@ -0,0 +1,196 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.SeekBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class bfq extends AppCompatActivity {
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static SeekBar tdt;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static TextView name, zz, time_a, time_b;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static ImageView tx;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static ImageView kg, syq, xyq, like;
|
||||||
|
public static com.dirror.lyricviewx.LyricViewX lrcView;
|
||||||
|
@SuppressLint("ResourceType")
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
FrameLayout frameLayout = new FrameLayout(this);
|
||||||
|
// 设置 FrameLayout 的布局参数(可以根据自己的需要进行设置)
|
||||||
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT, // 宽度为 Match Parent
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT); // 高度为 Match Parent
|
||||||
|
frameLayout.setLayoutParams(params);
|
||||||
|
frameLayout.setId(1);
|
||||||
|
setContentView(frameLayout);
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.add(frameLayout.getId(), new fragment(this))
|
||||||
|
.commit();
|
||||||
|
/* TypedValue typedValue = new TypedValue();
|
||||||
|
getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||||
|
// 设置背景颜色
|
||||||
|
bj = typedValue.data;*/
|
||||||
|
}
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static View inflate;
|
||||||
|
private static AppCompatActivity context;
|
||||||
|
public static Bitmap bitmap;
|
||||||
|
public static class fragment extends Fragment {
|
||||||
|
|
||||||
|
public fragment(AppCompatActivity context) {
|
||||||
|
bfq.context = context;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
if (inflate != null) {
|
||||||
|
tx.setImageBitmap(bitmap);
|
||||||
|
return inflate;
|
||||||
|
}
|
||||||
|
inflate = inflater.inflate(R.layout.fragment_bfq, container, false);
|
||||||
|
lrcView = inflate.findViewById(R.id.gc);
|
||||||
|
Toolbar toolbar = inflate.findViewById(R.id.toolbar);
|
||||||
|
name = inflate.findViewById(R.id.name);
|
||||||
|
zz = inflate.findViewById(R.id.zz);
|
||||||
|
kg = inflate.findViewById(R.id.kg);
|
||||||
|
xyq = inflate.findViewById(R.id.xyq);
|
||||||
|
syq = inflate.findViewById(R.id.syq);
|
||||||
|
tx = inflate.findViewById(R.id.mttx);
|
||||||
|
tdt = inflate.findViewById(R.id.tdt);
|
||||||
|
time_a = inflate.findViewById(R.id.time_a);
|
||||||
|
time_b = inflate.findViewById(R.id.time_b);
|
||||||
|
|
||||||
|
// lrcView.setIsEnableBlurEffect(true);
|
||||||
|
View kp = inflate.findViewById(R.id.kp1);
|
||||||
|
kp.setOnClickListener(v -> {
|
||||||
|
if (lrcView != null) {
|
||||||
|
v.setVisibility(View.GONE);
|
||||||
|
lrcView.setVisibility(View.VISIBLE);
|
||||||
|
if (com.muqingbfq.api.url.lrc == null) {
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
com.muqingbfq.api.url.gc(bfqkz.xm.id);
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
toolbar.setNavigationIcon(R.drawable.end);
|
||||||
|
toolbar.setNavigationOnClickListener(view1 -> context.finish());
|
||||||
|
toolbar.inflateMenu(R.menu.bfq);
|
||||||
|
toolbar.setOnMenuItemClickListener(item -> {
|
||||||
|
if (item.getItemId() == R.id.fx) {
|
||||||
|
com.muqingbfq.mq.gj.fx(context,
|
||||||
|
"音乐名称:" + name.getText().toString() +
|
||||||
|
"\n 作者:" + zz.getText().toString() +
|
||||||
|
"\n 链接:https://music.163.com/#/song?id=" + bfqkz.id);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
lrcView.setDraggable(true, (time) -> {
|
||||||
|
com.muqingbfq.bfqkz.mt.seekTo(Math.toIntExact(time));
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
lrcView.setOnSingerClickListener(() -> {
|
||||||
|
lrcView.setVisibility(View.GONE);
|
||||||
|
kp.setVisibility(View.VISIBLE);
|
||||||
|
});
|
||||||
|
inflate.findViewById(R.id.layout).setOnClickListener(view1 -> {
|
||||||
|
lrcView.setVisibility(View.GONE);
|
||||||
|
kp.setVisibility(View.VISIBLE);
|
||||||
|
});
|
||||||
|
inflate.findViewById(R.id.bfq_list_mp3).
|
||||||
|
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(context));
|
||||||
|
|
||||||
|
bfq_an.kz kz = new bfq_an.kz();
|
||||||
|
kg.setOnClickListener(kz);
|
||||||
|
syq.setOnClickListener(kz);
|
||||||
|
xyq.setOnClickListener(kz);
|
||||||
|
like = inflate.findViewById(R.id.like);
|
||||||
|
ImageView control = inflate.findViewById(R.id.control);
|
||||||
|
control.setOnClickListener(new bfq_an.control(control));
|
||||||
|
UI(inflate);
|
||||||
|
return inflate;
|
||||||
|
}
|
||||||
|
private void UI(View view) {
|
||||||
|
// tdt.getProgressDrawable().
|
||||||
|
// setColorFilter(ContextCompat.getColor(this, R.color.text_tm), PorterDuff.Mode.MULTIPLY);
|
||||||
|
// tdt.getThumb().
|
||||||
|
// setColorFilter(ContextCompat.getColor(this, R.color.text), PorterDuff.Mode.SRC_IN);
|
||||||
|
tdt.setOnSeekBarChangeListener(new bfq_an.tdt());
|
||||||
|
|
||||||
|
like.setOnClickListener(view1 -> {
|
||||||
|
try {
|
||||||
|
if (bfqkz.like_bool) {
|
||||||
|
like.setImageTintList(ContextCompat.getColorStateList(view.getContext(), R.color.text));
|
||||||
|
com.muqingbfq.fragment.gd.like.remove(String.valueOf(bfqkz.xm.id));
|
||||||
|
} else {
|
||||||
|
like.setImageTintList(ContextCompat.
|
||||||
|
getColorStateList(view.getContext(), android.R.color.holo_red_dark));
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("name", bfqkz.xm.name);
|
||||||
|
json.put("zz", bfqkz.xm.zz);
|
||||||
|
json.put("picUrl", bfqkz.xm.picurl);
|
||||||
|
com.muqingbfq.fragment.gd.like.put(String.valueOf(bfqkz.xm.id), json);
|
||||||
|
}
|
||||||
|
com.muqingbfq.mq.wj.xrwb(com.muqingbfq.mq.wj.mp3_like,
|
||||||
|
com.muqingbfq.fragment.gd.like.toString());
|
||||||
|
bfqkz.like_bool = !bfqkz.like_bool;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (bfqkz.xm != null) {
|
||||||
|
xm xm = bfqkz.xm;
|
||||||
|
name.setText(xm.name);
|
||||||
|
zz.setText(xm.zz);
|
||||||
|
time_a.setText(bfq_an.getTime(bfqkz.tdt_max));
|
||||||
|
tdt.setMax((int) bfqkz.tdt_max);
|
||||||
|
if (bfqkz.mt.isPlaying()) {
|
||||||
|
kg.setImageResource(R.drawable.bf);
|
||||||
|
}
|
||||||
|
bfq_an.islike(context);
|
||||||
|
Glide.with(context).load(xm.picurl)
|
||||||
|
.placeholder(R.drawable.icon)
|
||||||
|
.into(tx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(AppCompatActivity context) {
|
||||||
|
Intent intent = new Intent(context, bfq.class);
|
||||||
|
context.startActivity(intent);
|
||||||
|
// home.dialog.show(context.getSupportFragmentManager(), "bfq");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getVisibility() {
|
||||||
|
if (inflate == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return inflate.isShown();
|
||||||
|
}
|
||||||
|
}
|
146
app/src/main/java/com/muqingbfq/bfq_an.java
Normal file
146
app/src/main/java/com/muqingbfq/bfq_an.java
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.SeekBar;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.fragment.gd;
|
||||||
|
import com.muqingbfq.fragment.mp3;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class bfq_an {
|
||||||
|
public static class kz implements View.OnClickListener {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
int id = view.getId();
|
||||||
|
if (id == R.id.kg) {
|
||||||
|
MyButtonClickReceiver.playOrPause();
|
||||||
|
} else if (id == R.id.syq) {
|
||||||
|
syq();
|
||||||
|
} else if (id == R.id.xyq) {
|
||||||
|
xyq();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void syq() {
|
||||||
|
bfqkz.mt.pause();
|
||||||
|
int i = bfqkz.list.indexOf(bfqkz.xm) - 1;
|
||||||
|
if (i < 0) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
bfqkz.xm = bfqkz.list.get(i);
|
||||||
|
new url(bfqkz.xm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void xyq() {
|
||||||
|
bfqkz.mt.pause();
|
||||||
|
int ms = bfqkz.ms;
|
||||||
|
if (bfqkz.ms == 0) {
|
||||||
|
ms = 1;
|
||||||
|
}
|
||||||
|
bfqkz.xm = bfqkz.list.get(bfqkz.getmti(ms));
|
||||||
|
new url(bfqkz.xm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class tdt implements SeekBar.OnSeekBarChangeListener {
|
||||||
|
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
|
||||||
|
@Override
|
||||||
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
bfq.time_b.setText(getTime(progress));
|
||||||
|
|
||||||
|
// bfq.time_b.setText(simpleDateFormat.format(new Date(progress)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
// 暂停播放
|
||||||
|
bfqkz.mt.pauseTimer();
|
||||||
|
// bfqkz.mt.pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
// 播放音乐到指定位置
|
||||||
|
bfqkz.mt.seekTo(seekBar.getProgress());
|
||||||
|
bfqkz.mt.resumeTimer();
|
||||||
|
// bfqkz.mt.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class control implements View.OnClickListener {
|
||||||
|
public control(ImageView imageView) {
|
||||||
|
switch (bfqkz.ms) {
|
||||||
|
case 0:
|
||||||
|
imageView.setImageResource(R.drawable.mt_xh);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
imageView.setImageResource(R.drawable.mt_sx);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
imageView.setImageResource(R.drawable.mt_sj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
ImageView imageView = (ImageView) v;
|
||||||
|
switch (bfqkz.ms) {
|
||||||
|
case 0:
|
||||||
|
bfqkz.ms = 1;
|
||||||
|
imageView.setImageResource(R.drawable.mt_sx);
|
||||||
|
// 顺序
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
bfqkz.ms = 2;
|
||||||
|
imageView.setImageResource(R.drawable.mt_sj);
|
||||||
|
// 随机
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
bfqkz.ms = 0;
|
||||||
|
imageView.setImageResource(R.drawable.mt_xh);
|
||||||
|
// 循环
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
main.edit.putInt("ms", bfqkz.ms);
|
||||||
|
main.edit.commit();
|
||||||
|
// imageView.setImageDrawable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
|
||||||
|
public static String getTime(long time) {
|
||||||
|
return simpleDateFormat.format(new Date(time));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UI(boolean bool) {
|
||||||
|
if (bfq.getVisibility()) {
|
||||||
|
bfq.xyq.setEnabled(bool);
|
||||||
|
bfq.syq.setEnabled(bool);
|
||||||
|
bfq.kg.setEnabled(bool);
|
||||||
|
bfq.tdt.setEnabled(bool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void islike(Context context) {
|
||||||
|
try {
|
||||||
|
gd.like.getJSONObject(String.valueOf(bfqkz.xm.id));
|
||||||
|
bfq.like.setImageTintList(ContextCompat.
|
||||||
|
getColorStateList(context, android.R.color.holo_red_dark));
|
||||||
|
bfqkz.like_bool = true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
bfq.like.setImageTintList(ContextCompat.getColorStateList(context, R.color.text));
|
||||||
|
gj.sc("bfq_an islike() :" + e);
|
||||||
|
bfqkz.like_bool = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
131
app/src/main/java/com/muqingbfq/bfqkz.java
Normal file
131
app/src/main/java/com/muqingbfq/bfqkz.java
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.media.MediaBrowserCompat;
|
||||||
|
import android.support.v4.media.MediaMetadataCompat;
|
||||||
|
import android.support.v4.media.session.MediaControllerCompat;
|
||||||
|
import android.support.v4.media.session.MediaSessionCompat;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.media.MediaBrowserServiceCompat;
|
||||||
|
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class bfqkz extends MediaBrowserServiceCompat {
|
||||||
|
public static com.muqingbfq.MediaPlayer mt = new com.muqingbfq.MediaPlayer();
|
||||||
|
public static String id;
|
||||||
|
public static List<xm> list = new ArrayList<>();
|
||||||
|
public static long tdt_max, tdt_wz;
|
||||||
|
public static int ms;
|
||||||
|
// 0 循环 1 顺序 2 随机
|
||||||
|
public static xm xm;
|
||||||
|
public static boolean like_bool;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static com.muqingbfq.mq.NotificationManagerCompat notify;
|
||||||
|
public static int getmti(int s) {
|
||||||
|
int i = bfqkz.list.indexOf(xm);
|
||||||
|
if (s == 1) {
|
||||||
|
i = bfqkz.list.indexOf(xm) + 1;
|
||||||
|
if (i >= bfqkz.list.size()) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
} else if (s == 2) {
|
||||||
|
i = new Random().nextInt(bfqkz.list.size());
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
public static void mp3(String id) {
|
||||||
|
try {
|
||||||
|
if (id == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (xm.picurl == null || xm.picurl.equals("")) {
|
||||||
|
xm.picurl = url.picurl(xm.id);
|
||||||
|
}
|
||||||
|
mt.reset();
|
||||||
|
mt.setDataSource(id);
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("bfqkz mp3(String id) :" + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static MediaSessionCompat mSession;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
mSession = new MediaSessionCompat(this,"MusicService");
|
||||||
|
mSession.setCallback(new MediaSessionCompat.Callback() {
|
||||||
|
@Override
|
||||||
|
public void onPlay() {
|
||||||
|
mt.start();
|
||||||
|
// 处理播放音乐逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
// 处理暂停音乐逻辑
|
||||||
|
mt.pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSkipToNext() {
|
||||||
|
// 处理切换到下一首音乐逻辑
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onSkipToPrevious() {
|
||||||
|
// 处理切换到上一首音乐逻辑
|
||||||
|
}
|
||||||
|
});//设置回调
|
||||||
|
/* Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
|
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
|
intent.setComponent(new ComponentName(this, start.class));//用ComponentName得到class对象
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步,设置启动模式,两种情况
|
||||||
|
MediaButtonReceiver.handleIntent(mSession,intent);*/
|
||||||
|
|
||||||
|
MediaMetadataCompat build = new MediaMetadataCompat.Builder()
|
||||||
|
.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, "歌手名称")
|
||||||
|
.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, "专辑名称")
|
||||||
|
.putString(MediaMetadataCompat.METADATA_KEY_TITLE, "歌曲名称")
|
||||||
|
.build();
|
||||||
|
mSession.setMetadata(build);
|
||||||
|
mSession.setActive(true);
|
||||||
|
setSessionToken(mSession.getSessionToken());
|
||||||
|
notify = new com.muqingbfq.mq.NotificationManagerCompat(this);
|
||||||
|
/* ;
|
||||||
|
// 激活MediaSessionCompat
|
||||||
|
*/
|
||||||
|
// 初始化通知栏
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public BrowserRoot onGetRoot(@NonNull String clientPackageName, int clientUid, @Nullable Bundle rootHints) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadChildren(@NonNull String parentId, @NonNull Result<List<MediaBrowserCompat.MediaItem>> result) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateNotification() {
|
||||||
|
try {
|
||||||
|
// 更新通知栏的播放状态
|
||||||
|
if (notify.notificationBuilder != null) {
|
||||||
|
notify.tzl_an();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("bfqkz updateNotification:" + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
101
app/src/main/java/com/muqingbfq/fragment/bflb_db.java
Normal file
101
app/src/main/java/com/muqingbfq/fragment/bflb_db.java
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
public class bflb_db extends BottomSheetDialog {
|
||||||
|
public static String gdid;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.fragment_bflb_db);
|
||||||
|
// 获取对话框窗口
|
||||||
|
/* Window window = getWindow();
|
||||||
|
if (window != null) {
|
||||||
|
// 设置高度为默认值(例如:500dp)
|
||||||
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
|
params.height =
|
||||||
|
window.setAttributes(params);
|
||||||
|
}*/
|
||||||
|
// 设置默认弹出高度和最大上拉高度为 400dp
|
||||||
|
int height = main.g - main.g / 2 / 2;
|
||||||
|
getBehavior().setPeekHeight(height);
|
||||||
|
getBehavior().setMaxHeight(height);
|
||||||
|
|
||||||
|
try {
|
||||||
|
RecyclerView lb = findViewById(R.id.lb);
|
||||||
|
lb.setAdapter(new spq());
|
||||||
|
if (bfqkz.xm != null) {
|
||||||
|
lb.smoothScrollToPosition(bfqkz.list.indexOf(bfqkz.xm));
|
||||||
|
}
|
||||||
|
findViewById(R.id.xxbj).
|
||||||
|
setOnClickListener(v -> {
|
||||||
|
if (bfqkz.xm != null) {
|
||||||
|
lb.smoothScrollToPosition(bfqkz.list.indexOf(bfqkz.xm));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(getContext(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bflb_db(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(Context context) {
|
||||||
|
new bflb_db(context).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
||||||
|
return new MyViewHoder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
|
xm x = bfqkz.list.get(position);
|
||||||
|
holder.name.setText(x.name);
|
||||||
|
holder.zz.setText(x.zz);
|
||||||
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
|
}
|
||||||
|
holder.name.setTextColor(color);
|
||||||
|
holder.zz.setTextColor(color);
|
||||||
|
holder.view.setOnClickListener(view -> {
|
||||||
|
bfqkz.id = x.id;
|
||||||
|
if (bfqkz.xm != x) {
|
||||||
|
bfqkz.xm = x;
|
||||||
|
new url(x);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return bfqkz.list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
57
app/src/main/java/com/muqingbfq/fragment/bfq_db.java
Normal file
57
app/src/main/java/com/muqingbfq/fragment/bfq_db.java
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.bfq_an;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.home;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class bfq_db extends Fragment {
|
||||||
|
public View view;
|
||||||
|
public TextView name, zz;
|
||||||
|
public ImageView txa;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
view = inflater.inflate(R.layout.fragment_bfq_db, container, false);
|
||||||
|
name = view.findViewById(R.id.name);
|
||||||
|
zz = view.findViewById(R.id.zz);
|
||||||
|
txa = view.findViewById(R.id.kg);
|
||||||
|
txa.setOnClickListener(new bfq_an.kz());
|
||||||
|
|
||||||
|
view.findViewById(R.id.txb).setOnClickListener(view -> bflb_db.start(getContext()));
|
||||||
|
view.setOnClickListener(view12 -> bfq.start(home.appCompatActivity));
|
||||||
|
|
||||||
|
// 恢复列表数据
|
||||||
|
SharedPreferences sharedPreferences = this.getContext().getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
|
||||||
|
String jsonList = sharedPreferences.getString("listData", ""); // 获取保存的 JSON 字符串
|
||||||
|
if (!jsonList.isEmpty()) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<xm>>() {
|
||||||
|
}.getType();
|
||||||
|
bfqkz.list = gson.fromJson(jsonList, type); // 将 JSON 字符串转换回列表数据
|
||||||
|
} else {
|
||||||
|
view.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
203
app/src/main/java/com/muqingbfq/fragment/gd.java
Normal file
203
app/src/main/java/com/muqingbfq/fragment/gd.java
Normal file
|
@ -0,0 +1,203 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.GridView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
|
import com.google.android.material.card.MaterialCardView;
|
||||||
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.api.playlist;
|
||||||
|
import com.muqingbfq.api.resource;
|
||||||
|
import com.muqingbfq.bfq_an;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.list.list_gd;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
public class gd extends Fragment {
|
||||||
|
public static String gdid;
|
||||||
|
public static BaseAdapter lbspq;
|
||||||
|
public static List<xm> list = new ArrayList<>();
|
||||||
|
public static JSONObject like = new JSONObject();
|
||||||
|
GridView gridView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_gd, container, false);
|
||||||
|
lbspq = new baseadapter(view.getContext());
|
||||||
|
gridView = view.findViewById(R.id.wgbj);
|
||||||
|
gridView.setAdapter(lbspq);
|
||||||
|
if (gdid == null) {
|
||||||
|
gdid = main.mp3_csh;
|
||||||
|
}
|
||||||
|
TabLayout tabLayout = view.findViewById(R.id.tablayout);
|
||||||
|
// tabLayout.removeAllTabs();
|
||||||
|
for (String name : new String[]{"推荐", "排行榜", "下载"}) {
|
||||||
|
TabLayout.Tab tab = tabLayout.newTab();
|
||||||
|
tab.setText(name);
|
||||||
|
tabLayout.addTab(tab);
|
||||||
|
}
|
||||||
|
new thread("推荐");
|
||||||
|
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
list.clear();
|
||||||
|
lbspq.notifyDataSetChanged();
|
||||||
|
new thread(tab.getText().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
if (wj.cz(wj.mp3_like)) {
|
||||||
|
like = new JSONObject(wj.dqwb(wj.mp3_like));
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
class baseadapter extends BaseAdapter {
|
||||||
|
Context context;
|
||||||
|
LayoutInflater layoutInflater;
|
||||||
|
|
||||||
|
public baseadapter(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
layoutInflater = LayoutInflater.from(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int i) {
|
||||||
|
return list.get(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int i) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint({"ResourceAsColor", "InflateParams", "ClickableViewAccessibility"})
|
||||||
|
@Override
|
||||||
|
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||||
|
ViewHoder viewHoder;
|
||||||
|
xm xm = list.get(i);
|
||||||
|
if (view == null) {
|
||||||
|
viewHoder = new ViewHoder();
|
||||||
|
view = layoutInflater.inflate(R.layout.list_gd, null, false);
|
||||||
|
viewHoder.textView = view.findViewById(R.id.wb1);
|
||||||
|
viewHoder.imageView = view.findViewById(R.id.fh);
|
||||||
|
viewHoder.cardView = view.findViewById(R.id.cardview);
|
||||||
|
viewHoder.kg = view.findViewById(R.id.kg);
|
||||||
|
view.setTag(viewHoder);
|
||||||
|
} else {
|
||||||
|
viewHoder = (ViewHoder) view.getTag();
|
||||||
|
}
|
||||||
|
list_gd gd = new list_gd(xm);
|
||||||
|
viewHoder.cardView.setOnClickListener(gd);
|
||||||
|
viewHoder.cardView.setOnLongClickListener(gd);
|
||||||
|
viewHoder.textView.setText(xm.name);
|
||||||
|
viewHoder.kg.setOnClickListener(view1 -> {
|
||||||
|
ImageView tx = (ImageView) view1;
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
boolean an=playlist.hq(bfqkz.list, xm.id);
|
||||||
|
main.handler.post(() -> {
|
||||||
|
if (an) {
|
||||||
|
bfq_an.xyq();
|
||||||
|
tx.setImageResource(R.drawable.bf);
|
||||||
|
main.edit.putString(main.mp3, xm.id);
|
||||||
|
main.edit.commit();
|
||||||
|
main.mp3_csh = gdid = xm.id;
|
||||||
|
}
|
||||||
|
com.muqingbfq.fragment.gd.lbspq.notifyDataSetChanged();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
});
|
||||||
|
int color = ContextCompat.getColor(context, R.color.text);
|
||||||
|
Drawable color_kg = ContextCompat.getDrawable(context, R.drawable.zt);
|
||||||
|
if (xm.id.equals(gdid)) {
|
||||||
|
color = ContextCompat.getColor(context, R.color.text_cz);
|
||||||
|
color_kg = ContextCompat.getDrawable(context, R.drawable.bf);
|
||||||
|
} else if (xm.cz) {
|
||||||
|
color = ContextCompat.getColor(context, R.color.text_cz_tm);
|
||||||
|
}
|
||||||
|
viewHoder.kg.setImageDrawable(color_kg);
|
||||||
|
viewHoder.textView.setTextColor(color);
|
||||||
|
Glide.with(context).load(xm.picurl).apply(new RequestOptions().placeholder(R.drawable.icon))
|
||||||
|
.into(viewHoder.imageView);
|
||||||
|
// new wl(xm.picurl, Glide.with(context)).loadImage(bitmap -> viewHoder.imageView.setImageBitmap(bitmap));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHoder {
|
||||||
|
TextView textView;
|
||||||
|
ImageView imageView, kg;
|
||||||
|
MaterialCardView cardView;
|
||||||
|
}
|
||||||
|
|
||||||
|
class thread extends Thread {
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public thread(String name) {
|
||||||
|
this.name = name;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
switch (name) {
|
||||||
|
case "推荐":
|
||||||
|
resource.recommend(list);
|
||||||
|
break;
|
||||||
|
case "下载":
|
||||||
|
resource.下载(list);
|
||||||
|
break;
|
||||||
|
case "排行榜":
|
||||||
|
resource.排行榜(list);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
main.handler.post(() -> lbspq.notifyDataSetChanged());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
141
app/src/main/java/com/muqingbfq/fragment/mp3.java
Normal file
141
app/src/main/java/com/muqingbfq/fragment/mp3.java
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.api.playlist;
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class mp3 extends AppCompatActivity {
|
||||||
|
private final List<xm> list = new ArrayList<>();
|
||||||
|
public static RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.fragment_mp3);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
|
toolbar.setTitle(intent.getStringExtra("name"));
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
lbspq = new spq();
|
||||||
|
RecyclerView lb = findViewById(R.id.lb);
|
||||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
|
||||||
|
lb.setLayoutManager(layoutManager);
|
||||||
|
lb.setAdapter(lbspq);
|
||||||
|
String id = intent.getStringExtra("id");
|
||||||
|
new start(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
class start extends Thread {
|
||||||
|
String id;
|
||||||
|
|
||||||
|
public start(String id) {
|
||||||
|
this.id = id;
|
||||||
|
list.clear();
|
||||||
|
mp3.lbspq.notifyDataSetChanged();
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
if (id.equals("mp3_xz.json")) {
|
||||||
|
playlist.hq_xz(list);
|
||||||
|
} else if (id.equals("mp3_like.json")) {
|
||||||
|
playlist.hq_like(list);
|
||||||
|
} else {
|
||||||
|
playlist.hq(list, id);
|
||||||
|
}
|
||||||
|
main.handler.post(new lbspq_sx());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class lbspq_sx implements Runnable {
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
lbspq.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
||||||
|
return new MyViewHoder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
|
xm x = list.get(position);
|
||||||
|
holder.name.setText(x.name);
|
||||||
|
holder.zz.setText(x.zz);
|
||||||
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
|
}
|
||||||
|
holder.name.setTextColor(color);
|
||||||
|
holder.zz.setTextColor(color);
|
||||||
|
holder.view.setOnClickListener(view -> {
|
||||||
|
bfqkz.id = x.id;
|
||||||
|
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||||
|
bfqkz.xm = x;
|
||||||
|
new url(x);
|
||||||
|
}
|
||||||
|
// if (!gd.gdid.equals(bflb_db.gdid)) {
|
||||||
|
bfqkz.list.clear();
|
||||||
|
int size = list.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
bfqkz.list.add(list.get(i));
|
||||||
|
}
|
||||||
|
bfq.start(mp3.this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void startactivity(Context context, String id) {
|
||||||
|
context.startActivity(new Intent(context, mp3.class).putExtra("id", id));
|
||||||
|
}
|
||||||
|
}
|
149
app/src/main/java/com/muqingbfq/fragment/search.java
Normal file
149
app/src/main/java/com/muqingbfq/fragment/search.java
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.activity_search;
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class search extends Fragment {
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public search(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
View view;
|
||||||
|
RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||||
|
List<xm> list = new ArrayList<>();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
view = inflater.inflate(R.layout.fragment_search, container, false);
|
||||||
|
TypedValue typedValue = new TypedValue();
|
||||||
|
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||||
|
// 设置背景颜色
|
||||||
|
view.setBackgroundColor(typedValue.data);
|
||||||
|
RecyclerView lb = view.findViewById(R.id.recyclerview);
|
||||||
|
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
||||||
|
lb.setLayoutManager(manager);
|
||||||
|
lbspq = new spq();
|
||||||
|
lb.setAdapter(lbspq);
|
||||||
|
new start().start();
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
public void setStart(String name) {
|
||||||
|
this.name = name;
|
||||||
|
list.clear();
|
||||||
|
lbspq.notifyDataSetChanged();
|
||||||
|
new start().start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class start extends Thread {
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String hq = wl.hq("/search?keywords=" + name);
|
||||||
|
try {
|
||||||
|
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||||
|
.getJSONArray("songs");
|
||||||
|
int length = jsonArray.length();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
String name = jsonObject.getString("name");
|
||||||
|
JSONArray artists = jsonObject.getJSONArray("artists");
|
||||||
|
int length1 = artists.length();
|
||||||
|
StringBuilder zz = null;
|
||||||
|
for (int j = 0; j < length1; j++) {
|
||||||
|
JSONObject josn = artists.getJSONObject(j);
|
||||||
|
String name_zz = josn.getString("name");
|
||||||
|
if (zz == null) {
|
||||||
|
zz = new StringBuilder(name_zz);
|
||||||
|
} else {
|
||||||
|
zz.append("/").append(name_zz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.add(new xm(id, name, zz.toString(), null));
|
||||||
|
}
|
||||||
|
main.handler.post(() -> lbspq.notifyDataSetChanged());
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
||||||
|
return new MyViewHoder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
|
xm x = list.get(position);
|
||||||
|
holder.name.setText(x.name);
|
||||||
|
holder.zz.setText(x.zz);
|
||||||
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
|
}
|
||||||
|
holder.name.setTextColor(color);
|
||||||
|
holder.zz.setTextColor(color);
|
||||||
|
holder.view.setOnClickListener(view1 -> {
|
||||||
|
bfqkz.id = x.id;
|
||||||
|
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||||
|
bfqkz.xm = x;
|
||||||
|
new url(x);
|
||||||
|
}
|
||||||
|
if (!com.muqingbfq.fragment.gd.gdid.equals(bflb_db.gdid)) {
|
||||||
|
bfqkz.list.clear();
|
||||||
|
int size = list.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
bfqkz.list.add(list.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bfqkz.mt.start();
|
||||||
|
bfq.start(activity_search.appCompatActivity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
74
app/src/main/java/com/muqingbfq/fragment/sz.java
Normal file
74
app/src/main/java/com/muqingbfq/fragment/sz.java
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
package com.muqingbfq.fragment;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.activity_about_software;
|
||||||
|
import com.muqingbfq.login.user_logs;
|
||||||
|
import com.muqingbfq.login.user_message;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
|
||||||
|
public class sz {
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static TextView name, jieshao;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static ImageView imageView;
|
||||||
|
Context context;
|
||||||
|
|
||||||
|
public sz(Context context, View view) {
|
||||||
|
this.context = context;
|
||||||
|
name = view.findViewById(R.id.sz_text1);
|
||||||
|
jieshao = view.findViewById(R.id.sz_text2);
|
||||||
|
imageView = view.findViewById(R.id.image);
|
||||||
|
view.findViewById(R.id.xdbj).
|
||||||
|
setOnClickListener(v -> {
|
||||||
|
if (name.getText().equals("登录")) {
|
||||||
|
context.startActivity(new Intent(context, user_logs.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new user_message();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void switch_sz(Context context, int id) {
|
||||||
|
if (id == R.id.a) {
|
||||||
|
gj.llq(context, "https://rust.coldmint.top/ftp/muqing/");
|
||||||
|
} else if (id == R.id.b) {
|
||||||
|
context.startActivity(new Intent(context, com.muqingbfq.sz.class));
|
||||||
|
// 设置中心
|
||||||
|
} else if (id == R.id.c) {
|
||||||
|
// 储存清理
|
||||||
|
} else if (id == R.id.d) {
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW,
|
||||||
|
Uri.parse("mqqapi://card/show_pslcard?card_type=group&uin="
|
||||||
|
+ 674891685));
|
||||||
|
context.startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(context, "无法打开 QQ", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
// 如果没有安装 QQ 客户端或无法打开 QQ,您可以在此处理异常
|
||||||
|
// 官方聊群
|
||||||
|
} else if (id == R.id.e) {
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(
|
||||||
|
"mqqwpa://im/chat?chat_type=wpa&uin=" + "1966944300"));
|
||||||
|
context.startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 如果没有安装 QQ 或无法跳转,则会抛出异常
|
||||||
|
Toast.makeText(context, "无法打开 QQ", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
// 联系作者
|
||||||
|
} else if (id == R.id.f) {
|
||||||
|
context.startActivity(new Intent(context, activity_about_software.class));
|
||||||
|
// 关于软件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
178
app/src/main/java/com/muqingbfq/home.java
Normal file
178
app/src/main/java/com/muqingbfq/home.java
Normal file
|
@ -0,0 +1,178 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.media.AudioManager;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.support.v4.media.MediaBrowserCompat;
|
||||||
|
import android.support.v4.media.session.MediaControllerCompat;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.LeadingMarginSpan;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
|
||||||
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.muqingbfq.fragment.bfq_db;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
|
||||||
|
public class home extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static Toolbar toolbar;
|
||||||
|
public static AppCompatActivity appCompatActivity;
|
||||||
|
|
||||||
|
@SuppressLint("CommitTransaction")
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_home);
|
||||||
|
appCompatActivity = this;
|
||||||
|
try {
|
||||||
|
toolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
DrawerLayout drawerLayout = findViewById(R.id.chct);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, drawerLayout, toolbar, R.string.app_name, R.string.app_name);
|
||||||
|
drawerLayout.addDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
NavigationView chb = findViewById(R.id.chb);
|
||||||
|
chb.setNavigationItemSelectedListener(this);
|
||||||
|
Menu menu = chb.getMenu();
|
||||||
|
for (int i = 0; i < menu.size(); i++) {
|
||||||
|
MenuItem item = menu.getItem(i);
|
||||||
|
SpannableString spannableString = new SpannableString(item.getTitle());
|
||||||
|
spannableString.setSpan(new LeadingMarginSpan.Standard(
|
||||||
|
26, 26), 0, spannableString.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||||
|
item.setTitle(spannableString);
|
||||||
|
}
|
||||||
|
new com.muqingbfq.fragment.sz(this, chb.getHeaderView(0));
|
||||||
|
|
||||||
|
db = new bfq_db();
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.add(R.id.bfq_db, db).commit();
|
||||||
|
mediaBrowser = new MediaBrowserCompat(this,
|
||||||
|
new ComponentName(this, bfqkz.class), connectionCallbacks, null);
|
||||||
|
mediaBrowser.connect();
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private MediaBrowserCompat mediaBrowser;
|
||||||
|
private final MediaBrowserCompat.ConnectionCallback connectionCallbacks =
|
||||||
|
new MediaBrowserCompat.ConnectionCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConnected() {
|
||||||
|
// 连接成功后执行的操作
|
||||||
|
MediaControllerCompat mediaController;
|
||||||
|
try {
|
||||||
|
mediaController = new MediaControllerCompat(home.this,
|
||||||
|
mediaBrowser.getSessionToken());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
MediaControllerCompat.setMediaController(home.this, mediaController);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionSuspended() {
|
||||||
|
// 连接暂停时执行的操作
|
||||||
|
// gj.ts(home.this,"zangting");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionFailed() {
|
||||||
|
// 连接失败时执行的操作
|
||||||
|
// gj.ts(home.this,"shibai");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static bfq_db db;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
// 保存列表数据
|
||||||
|
SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String jsonList = gson.toJson(bfqkz.list); // 将列表数据转换为 JSON 字符串
|
||||||
|
editor.putString("listData", jsonList); // 保存 JSON 字符串到 SharedPreferences
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
mediaBrowser.disconnect();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
// (see "stay in sync with the MediaSession")
|
||||||
|
if (MediaControllerCompat.getMediaController(home.this) != null) {
|
||||||
|
// MediaControllerCompat.getMediaController(home.this).unregisterCallback(controllerCallback);
|
||||||
|
}
|
||||||
|
mediaBrowser.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private long time;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (bfqkz.mt.isPlaying()) {
|
||||||
|
Intent home = new Intent(Intent.ACTION_MAIN);
|
||||||
|
home.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
startActivity(home);
|
||||||
|
} else {
|
||||||
|
if (time < System.currentTimeMillis() - 1000) {
|
||||||
|
time = System.currentTimeMillis();
|
||||||
|
gj.ts(this, "再按一次退出软件");
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.home, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.menu_search) {
|
||||||
|
Intent intent = new Intent(this, activity_search.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||||
|
com.muqingbfq.fragment.sz.switch_sz(this, item.getItemId());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
app/src/main/java/com/muqingbfq/list/MyViewHoder.java
Normal file
26
app/src/main/java/com/muqingbfq/list/MyViewHoder.java
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muqingbfq.list;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
|
||||||
|
public class MyViewHoder extends RecyclerView.ViewHolder {
|
||||||
|
public TextView name, zz;
|
||||||
|
public View view;
|
||||||
|
|
||||||
|
public MyViewHoder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
view = itemView;
|
||||||
|
name = itemView.findViewById(R.id.wb1);
|
||||||
|
zz = itemView.findViewById(R.id.zz);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Context getContext() {
|
||||||
|
return view.getContext();
|
||||||
|
}
|
||||||
|
}
|
5
app/src/main/java/com/muqingbfq/list/file_list.java
Normal file
5
app/src/main/java/com/muqingbfq/list/file_list.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package com.muqingbfq.list;
|
||||||
|
|
||||||
|
public class file_list {
|
||||||
|
|
||||||
|
}
|
95
app/src/main/java/com/muqingbfq/list/list_gd.java
Normal file
95
app/src/main/java/com/muqingbfq/list/list_gd.java
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
package com.muqingbfq.list;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.api.playlist;
|
||||||
|
import com.muqingbfq.fragment.gd;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class list_gd implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
xm xm;
|
||||||
|
|
||||||
|
public list_gd(com.muqingbfq.xm xm) {
|
||||||
|
this.xm = xm;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
// if (!gd.gdid.equals(xm.id)) {
|
||||||
|
// gd.gdid = xm.id;
|
||||||
|
Context context = view.getContext();
|
||||||
|
Intent intent = new Intent(context, com.muqingbfq.fragment.mp3.class);
|
||||||
|
intent.putExtra("id", xm.id);
|
||||||
|
intent.putExtra("name", xm.name);
|
||||||
|
context.startActivity(intent);
|
||||||
|
// mp3.startactivity(view.getContext(),xm.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View view) {
|
||||||
|
String[] stringArray = view.getResources()
|
||||||
|
.getStringArray(R.array.gd_list);
|
||||||
|
new MaterialAlertDialogBuilder(view.getContext()).setItems(stringArray, (dialog, id) -> {
|
||||||
|
new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (id == 0) {
|
||||||
|
String hq = wl.hq(playlist.api + xm.id + "&limit=30");
|
||||||
|
if (hq != null) {
|
||||||
|
wj.xrwb(wj.gd + xm.id, hq);
|
||||||
|
xm.cz = true;
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if (wj.cz(wj.gd_xz)) {
|
||||||
|
jsonObject = new JSONObject(Objects.requireNonNull(wj.dqwb(wj.gd_xz)));
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("name", xm.name);
|
||||||
|
json.put("picUrl", xm.picurl);
|
||||||
|
jsonObject.put(xm.id, json);
|
||||||
|
wj.xrwb(wj.gd_xz, jsonObject.toString());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
gj.sc("list gd onclick thear " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (id == 2) {
|
||||||
|
wj.sc(wj.gd + xm.id);
|
||||||
|
if (xm.id.equals("mp3_xz.json")) {
|
||||||
|
wj.sc(new File(wj.mp3));
|
||||||
|
}
|
||||||
|
xm.cz = false;
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wj.dqwb(wj.gd_xz)));
|
||||||
|
jsonObject.remove(xm.id);
|
||||||
|
wj.xrwb(wj.gd_xz, jsonObject.toString());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
main.handler.post(() -> gd.lbspq.notifyDataSetChanged());
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
// 在这里处理菜单项的点击事件
|
||||||
|
dialog.dismiss();
|
||||||
|
}).show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
25
app/src/main/java/com/muqingbfq/list/yylb.java
Normal file
25
app/src/main/java/com/muqingbfq/list/yylb.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package com.muqingbfq.list;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.api.url;
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.fragment.bflb_db;
|
||||||
|
import com.muqingbfq.fragment.mp3;
|
||||||
|
import com.muqingbfq.home;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class yylb {
|
||||||
|
}
|
85
app/src/main/java/com/muqingbfq/login/enroll.java
Normal file
85
app/src/main/java/com/muqingbfq/login/enroll.java
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
package com.muqingbfq.login;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class enroll extends AppCompatActivity {
|
||||||
|
EditText eduser,edpassword;
|
||||||
|
String user, password;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_enroll);
|
||||||
|
setSupportActionBar(findViewById(R.id.toolbar));
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
eduser = findViewById(R.id.edit_user);
|
||||||
|
eduser.setText(
|
||||||
|
intent.getStringExtra("user"));
|
||||||
|
edpassword = findViewById(R.id.edit_password);
|
||||||
|
findViewById(R.id.edit_cookie).setOnClickListener(view -> new user_logs.erweima(view.getContext()));
|
||||||
|
findViewById(R.id.enroll).setOnClickListener(view -> a());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a() {
|
||||||
|
user = eduser.getText().toString();
|
||||||
|
password = edpassword.getText().toString();
|
||||||
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
|
View v = getWindow().peekDecorView();
|
||||||
|
if (null != v) {
|
||||||
|
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
new thread().start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void end() {
|
||||||
|
Intent intent = new Intent(); // 创建一个新意图
|
||||||
|
Bundle bundle = new Bundle(); // 创建一个新包裹
|
||||||
|
// 往包裹存入名叫response_time的字符串
|
||||||
|
bundle.putString("user", user);
|
||||||
|
// 往包裹存入名叫response_content的字符串
|
||||||
|
bundle.putString("password", password);
|
||||||
|
intent.putExtras(bundle); // 把快递包裹塞给意图
|
||||||
|
|
||||||
|
// 携带意图返回上一个页面。RESULT_OK表示处理成功
|
||||||
|
setResult(Activity.RESULT_OK, intent);
|
||||||
|
|
||||||
|
finish(); // 结束当前的活动页面
|
||||||
|
}
|
||||||
|
|
||||||
|
class thread extends Thread {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String s = wl.get("http://139.196.224.229/muqing/enroll.php?user=" + user + "&password=" + password
|
||||||
|
+ "&cookie" + wl.Cookie);
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(s);
|
||||||
|
int code = jsonObject.getInt("code");
|
||||||
|
String msg = jsonObject.getString("msg");
|
||||||
|
main.handler.post(() -> gj.ts(enroll.this, msg));
|
||||||
|
if (code == 200) {
|
||||||
|
end();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
222
app/src/main/java/com/muqingbfq/login/user_logs.java
Normal file
222
app/src/main/java/com/muqingbfq/login/user_logs.java
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
package com.muqingbfq.login;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Base64;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class user_logs extends AppCompatActivity {
|
||||||
|
|
||||||
|
EditText edituser, editpassword;
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_user_logs);
|
||||||
|
toolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||||
|
edituser = findViewById(R.id.edit_user);
|
||||||
|
editpassword = findViewById(R.id.edit_password);
|
||||||
|
findViewById(R.id.login).setOnClickListener(view -> new CloudUser(edituser.getText().toString()
|
||||||
|
, editpassword.getText().toString()));
|
||||||
|
findViewById(R.id.enroll).setOnClickListener(view -> {
|
||||||
|
Intent intent = new Intent(user_logs.this, enroll.class);
|
||||||
|
intent.putExtra("user", edituser.getText().toString());
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (data != null && requestCode == 0 && resultCode == Activity.RESULT_OK) {
|
||||||
|
Bundle bundle = data.getExtras();
|
||||||
|
String user = bundle.getString("user");
|
||||||
|
String password = bundle.getString("password");
|
||||||
|
edituser.setText(user);
|
||||||
|
editpassword.setText(password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//some statement
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Bitmap stringToBitmap(String string) {
|
||||||
|
Bitmap bitmap = null;
|
||||||
|
try {
|
||||||
|
byte[] bitmapArray = Base64.decode(string.split(",")[1], Base64.DEFAULT);
|
||||||
|
bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CloudUser extends Thread {
|
||||||
|
String user, password;
|
||||||
|
|
||||||
|
public CloudUser(String user, String password) {
|
||||||
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
|
View v = getWindow().peekDecorView();
|
||||||
|
if (null != v) {
|
||||||
|
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
this.user = user;
|
||||||
|
this.password = password;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String s = wl.get(main.http + "/user.php?" + "user=" + user + "&password=" + password);
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(s);
|
||||||
|
int code = jsonObject.getInt("code");
|
||||||
|
String msg = jsonObject.getString("msg");
|
||||||
|
main.handler.post(() -> gj.ts(user_logs.this, msg));
|
||||||
|
if (code == 200) {
|
||||||
|
String cookie = jsonObject.getString("cookie");
|
||||||
|
if (wl.iskong()) {
|
||||||
|
new visitor();
|
||||||
|
}
|
||||||
|
wl.setcookie(cookie);
|
||||||
|
new user_message();
|
||||||
|
user_logs.this.finish();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class erweima extends Thread {
|
||||||
|
int code = 800;
|
||||||
|
String unikey, qrimg, hq;
|
||||||
|
private long time=0;
|
||||||
|
ImageView imageView;
|
||||||
|
TextView textView;
|
||||||
|
MaterialAlertDialogBuilder materialAlertDialogBuilder;
|
||||||
|
|
||||||
|
public erweima(Context context) {
|
||||||
|
View inflate = LayoutInflater.from(context).inflate(R.layout.erweima, null);
|
||||||
|
imageView = inflate.findViewById(R.id.image);
|
||||||
|
textView = inflate.findViewById(R.id.text);
|
||||||
|
// 创建布局参数对象
|
||||||
|
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(main.g, main.k);
|
||||||
|
// 设置视图的布局参数
|
||||||
|
imageView.setLayoutParams(layoutParams);
|
||||||
|
materialAlertDialogBuilder = new MaterialAlertDialogBuilder(context) {
|
||||||
|
};
|
||||||
|
materialAlertDialogBuilder.setOnDismissListener(dialog -> {
|
||||||
|
// 对话框消失时触发的操作
|
||||||
|
// 可以在这里处理一些额外的逻辑
|
||||||
|
code = 0;
|
||||||
|
});
|
||||||
|
materialAlertDialogBuilder.setView(inflate).setTitle("请使用网易云音乐扫码");
|
||||||
|
materialAlertDialogBuilder.show();
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
while (code != 0) {
|
||||||
|
try {
|
||||||
|
hq = wl.hq("/login/qr/check?key=" + unikey + Time());
|
||||||
|
if (hq != null) {
|
||||||
|
JSONObject json = new JSONObject(hq);
|
||||||
|
code = json.getInt("code");
|
||||||
|
switch (code) {
|
||||||
|
case 800:
|
||||||
|
case 400:
|
||||||
|
setwb("二维码过期");
|
||||||
|
hqkey();
|
||||||
|
break;
|
||||||
|
case 801:
|
||||||
|
setwb("等待扫码");
|
||||||
|
break;
|
||||||
|
case 802:
|
||||||
|
setwb("等待确认");
|
||||||
|
break;
|
||||||
|
case 803:
|
||||||
|
setwb("登录成功");
|
||||||
|
wl.setcookie(json.getString("cookie"));
|
||||||
|
main.handler.postDelayed(() -> materialAlertDialogBuilder.create().cancel(),
|
||||||
|
500);
|
||||||
|
code = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
code = 0;
|
||||||
|
// 默认情况下的操作
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sleep(1000);
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hqkey() throws Exception {
|
||||||
|
unikey = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/key"))).
|
||||||
|
getJSONObject("data").getString("unikey");
|
||||||
|
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/create?key=" +
|
||||||
|
unikey +
|
||||||
|
"&qrimg=base64")));
|
||||||
|
qrimg = jsonObject.getJSONObject("data").getString("qrimg");
|
||||||
|
main.handler.post(() -> imageView.setImageBitmap(stringToBitmap(qrimg)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String Time() {
|
||||||
|
if (time < System.currentTimeMillis() - 1000) {
|
||||||
|
time = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
return "×tamp" + time;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setwb(String wb) {
|
||||||
|
main.handler.post(() -> textView.setText(wb));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
40
app/src/main/java/com/muqingbfq/login/user_message.java
Normal file
40
app/src/main/java/com/muqingbfq/login/user_message.java
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muqingbfq.login;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.fragment.sz;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class user_message extends Thread {
|
||||||
|
|
||||||
|
public user_message() {
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String hq = wl.hq("/user/account" + "?cookie=" + wl.Cookie);
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(hq).getJSONObject("profile");
|
||||||
|
String nickname = jsonObject.getString("nickname");
|
||||||
|
String signature = jsonObject.getString("signature");
|
||||||
|
String avatarUrl = jsonObject.getString("avatarUrl");
|
||||||
|
main.handler.post(() -> {
|
||||||
|
sz.name.setText(nickname);
|
||||||
|
sz.jieshao.setText(signature);
|
||||||
|
Glide.with(sz.imageView)
|
||||||
|
.load(avatarUrl)
|
||||||
|
.placeholder(R.drawable.icon)//图片加载出来前,显示的图片
|
||||||
|
.error(R.drawable.deleat)//图片加载失败后,显示的图片
|
||||||
|
.into(sz.imageView);
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
53
app/src/main/java/com/muqingbfq/login/visitor.java
Normal file
53
app/src/main/java/com/muqingbfq/login/visitor.java
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muqingbfq.login;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class visitor extends Thread {
|
||||||
|
|
||||||
|
AppCompatActivity activity;
|
||||||
|
Intent intent;
|
||||||
|
public visitor(AppCompatActivity activity, Intent intent) {
|
||||||
|
this.activity = activity;
|
||||||
|
this.intent = intent;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public visitor() {
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String hq = wl.hq("/register/anonimous");
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(hq);
|
||||||
|
wl.setcookie(jsonObject.getString("cookie"));
|
||||||
|
if (wj.filesdri == null) {
|
||||||
|
new wj(activity);
|
||||||
|
}
|
||||||
|
if (activity != null) {
|
||||||
|
activity.startActivity(intent);
|
||||||
|
activity.finish();
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
yc.start(activity, e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
yc.start(activity,e);
|
||||||
|
}
|
||||||
|
if (activity != null) {
|
||||||
|
activity.finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
66
app/src/main/java/com/muqingbfq/main.java
Normal file
66
app/src/main/java/com/muqingbfq/main.java
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
|
||||||
|
import com.muqingbfq.mq.MyExceptionHandler;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
public class main extends Application {
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
public static Context context;
|
||||||
|
public static Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
public static String api = "http://139.196.224.229:3000";
|
||||||
|
public static String http = "http://139.196.224.229/muqing";
|
||||||
|
public static int k, g;
|
||||||
|
public static SharedPreferences sp;
|
||||||
|
public static SharedPreferences.Editor edit;
|
||||||
|
|
||||||
|
public static String mp3 = "mp3", mp3_csh,
|
||||||
|
Time = "Time", Cookie = "Cookie";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
context = this;
|
||||||
|
new wj(this);
|
||||||
|
sp = getSharedPreferences("Set_up", MODE_PRIVATE);
|
||||||
|
edit = sp.edit();
|
||||||
|
if (sp.getLong(Time, 0) == 0) {
|
||||||
|
edit.putLong(Time, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
start.time = sp.getLong(Time, System.currentTimeMillis());
|
||||||
|
boolean bj = false;
|
||||||
|
try {
|
||||||
|
mp3_csh = sp.getString(mp3, "");
|
||||||
|
} catch (Exception e) {
|
||||||
|
edit.putString(mp3, "");
|
||||||
|
edit.commit();
|
||||||
|
mp3_csh = "";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
com.muqingbfq.bfqkz.ms = sp.getInt("ms", 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
edit.putInt("ms", 1);
|
||||||
|
bj = true;
|
||||||
|
com.muqingbfq.bfqkz.ms = 1;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
wl.Cookie = sp.getString(Cookie, "");
|
||||||
|
} catch (Exception e) {
|
||||||
|
edit.putString(Cookie, "");
|
||||||
|
wl.Cookie = "";
|
||||||
|
bj = true;
|
||||||
|
}
|
||||||
|
if (bj) {
|
||||||
|
edit.commit();
|
||||||
|
}
|
||||||
|
// 创建全局异常处理器实例 设置全局异常处理器
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.media.AudioManager;
|
||||||
|
import android.support.v4.media.session.MediaSessionCompat;
|
||||||
|
|
||||||
|
import com.muqingbfq.MyButtonClickReceiver;
|
||||||
|
|
||||||
|
public class BluetoothMusicController {
|
||||||
|
private Context context;
|
||||||
|
private MediaSessionCompat mediaSession;
|
||||||
|
|
||||||
|
public BluetoothMusicController(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
// bluetoothReceiver.setOnHeadsetListener(this);
|
||||||
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
|
intentFilter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
|
||||||
|
|
||||||
|
intentFilter.addAction("android.intent.action.HEADSET_PLUG");
|
||||||
|
context.registerReceiver(new MyButtonClickReceiver(), intentFilter);
|
||||||
|
registerHeadsetReceiver();
|
||||||
|
// audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
// setupMediaSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
unregisterHeadsetReceiver();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注册媒体按钮事件接收器
|
||||||
|
@SuppressLint("ObsoleteSdkInt")
|
||||||
|
public void registerHeadsetReceiver() {
|
||||||
|
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
ComponentName name = new ComponentName(context.getPackageName(), MyButtonClickReceiver.class.getName());
|
||||||
|
audioManager.registerMediaButtonEventReceiver(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注销媒体按钮事件接收器
|
||||||
|
public void unregisterHeadsetReceiver() {
|
||||||
|
if (mediaSession != null) {
|
||||||
|
mediaSession.setActive(false);
|
||||||
|
mediaSession.release();
|
||||||
|
mediaSession = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
app/src/main/java/com/muqingbfq/mq/MyExceptionHandler.java
Normal file
32
app/src/main/java/com/muqingbfq/mq/MyExceptionHandler.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
public class MyExceptionHandler implements Thread.UncaughtExceptionHandler {
|
||||||
|
public static Throwable throwable;
|
||||||
|
private Context mContext;
|
||||||
|
public MyExceptionHandler(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(@NonNull Thread thread, @NonNull Throwable throwable) {
|
||||||
|
// 将异常信息打印到日志中
|
||||||
|
MyExceptionHandler.throwable = throwable;
|
||||||
|
String TAG = "MyExceptionHandler";
|
||||||
|
Log.e(TAG, "UncaughtException: ", throwable);
|
||||||
|
// 在这里执行生成错误报告的逻辑,例如将错误信息保存到文件或发送给服务器
|
||||||
|
// 可以使用第三方库,如ACRA、Bugsnag等,或者自行实现错误报告的处理逻辑
|
||||||
|
// 生成错误报告的逻辑
|
||||||
|
// 发送 Intent 重启应用
|
||||||
|
yc.start(mContext, throwable);
|
||||||
|
// 这里可以进行一些其他的操作,例如记录错误日志、弹出错误提示框等
|
||||||
|
// 终止程序
|
||||||
|
// android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
|
// System.exit(0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import static com.muqingbfq.bfqkz.xm;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.support.v4.media.session.PlaybackStateCompat;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
import androidx.media.session.MediaButtonReceiver;
|
||||||
|
|
||||||
|
import com.muqingbfq.MyButtonClickReceiver;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.bfq;
|
||||||
|
import com.muqingbfq.bfqkz;
|
||||||
|
import com.muqingbfq.start;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
public class NotificationManagerCompat {
|
||||||
|
Service context;
|
||||||
|
public NotificationCompat.Builder notificationBuilder;
|
||||||
|
public androidx.core.app.NotificationManagerCompat notificationManager;
|
||||||
|
|
||||||
|
public NotificationManagerCompat(Service context) {
|
||||||
|
this.context = context;
|
||||||
|
CharSequence name = context.getString(R.string.app_name);
|
||||||
|
String zz = context.getString(R.string.zz);
|
||||||
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name,
|
||||||
|
NotificationManager.IMPORTANCE_LOW);
|
||||||
|
channel.setDescription(zz);
|
||||||
|
NotificationManager systemService = context.getSystemService(NotificationManager.class);
|
||||||
|
systemService.createNotificationChannel(channel);
|
||||||
|
if (!systemService.areNotificationsEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 适配12.0及以上
|
||||||
|
int flag;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
|
flag = PendingIntent.FLAG_IMMUTABLE;
|
||||||
|
} else {
|
||||||
|
flag = PendingIntent.FLAG_UPDATE_CURRENT;
|
||||||
|
}
|
||||||
|
// 设置启动的程序,如果存在则找出,否则新的启动
|
||||||
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
|
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
|
intent.setComponent(new ComponentName(context, start.class));//用ComponentName得到class对象
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步,设置启动模式,两种情况
|
||||||
|
|
||||||
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, flag);
|
||||||
|
pendingIntent_kg = pendingIntent(context, new Intent(context, MyButtonClickReceiver.class).
|
||||||
|
setAction("kg"));
|
||||||
|
pendingIntent_syq = pendingIntent(context, new Intent(context, MyButtonClickReceiver.class).
|
||||||
|
setAction("syq"));
|
||||||
|
pendingIntent_xyq = pendingIntent(context, new Intent(context, MyButtonClickReceiver.class).
|
||||||
|
setAction("xyq"));
|
||||||
|
// 取消操作的PendingIntent
|
||||||
|
// 取消操作的PendingIntent
|
||||||
|
PendingIntent cancelIntent = MediaButtonReceiver.buildMediaButtonPendingIntent(context,
|
||||||
|
PlaybackStateCompat.ACTION_STOP);
|
||||||
|
androidx.media.app.NotificationCompat.MediaStyle style =
|
||||||
|
new androidx.media.app.NotificationCompat.MediaStyle()
|
||||||
|
.setShowActionsInCompactView(0, 1, 2)
|
||||||
|
.setMediaSession(bfqkz.mSession.getSessionToken())
|
||||||
|
.setShowCancelButton(true)
|
||||||
|
.setCancelButtonIntent(cancelIntent);
|
||||||
|
//
|
||||||
|
notificationBuilder = getNotificationBuilder(context)
|
||||||
|
.setSmallIcon(R.drawable.icon)
|
||||||
|
.setContentTitle(name).setContentText(zz)
|
||||||
|
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||||
|
.setOngoing(true).setAutoCancel(false).setOnlyAlertOnce(true)
|
||||||
|
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setStyle(style);
|
||||||
|
notificationManager = androidx.core.app.NotificationManagerCompat.from(context);
|
||||||
|
tzl_an();
|
||||||
|
// context.startForeground(1, notificationBuilder.build());
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(context, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private PendingIntent pendingIntent_kg,
|
||||||
|
pendingIntent_syq,
|
||||||
|
pendingIntent_xyq;
|
||||||
|
private final String CHANNEL_ID = "muqing_yy_id";
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
|
public void tzl_an() {
|
||||||
|
notificationBuilder.mActions.clear();
|
||||||
|
notificationBuilder
|
||||||
|
/* .addAction(R.drawable.syq, "syq", pendingIntent_syq) // #0
|
||||||
|
.addAction(bfqkz.mt.isPlaying() ? R.drawable.bf : R.drawable.zt
|
||||||
|
, "kg", pendingIntent_kg) // #1
|
||||||
|
.addAction(R.drawable.xyq, "xyq", pendingIntent_xyq);*/
|
||||||
|
.addAction(android.R.drawable.ic_media_previous, "syq", pendingIntent_syq) // #0
|
||||||
|
.addAction(bfqkz.mt.isPlaying() ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play
|
||||||
|
, "kg", pendingIntent_kg) // #1
|
||||||
|
.addAction(android.R.drawable.ic_media_next, "xyq", pendingIntent_xyq);
|
||||||
|
notificationBuilder.setOngoing(bfqkz.mt.isPlaying());
|
||||||
|
notificationManager_notify();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notificationManager_notify() {
|
||||||
|
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
notificationManager.notify(1, notificationBuilder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint({"MissingPermission", "RestrictedApi"})
|
||||||
|
public void setBitmap(Bitmap bitmap) {
|
||||||
|
bfq.bitmap = bitmap;
|
||||||
|
if (bitmap == null) {
|
||||||
|
bitmap = BitmapFactory.decodeResource(context.getResources(),
|
||||||
|
R.drawable.icon);
|
||||||
|
}
|
||||||
|
if (notificationManager != null) {
|
||||||
|
notificationBuilder.setContentTitle(xm.name);
|
||||||
|
notificationBuilder.setContentText(xm.zz);
|
||||||
|
notificationBuilder.setLargeIcon(bitmap);
|
||||||
|
notificationManager.notify(1, notificationBuilder.build());
|
||||||
|
}
|
||||||
|
if (bfq.tx != null) {
|
||||||
|
bfq.tx.setImageBitmap(bitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private NotificationCompat.Builder getNotificationBuilder(Context context) {
|
||||||
|
// 适用于Android 8.0及以上版本
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
return new NotificationCompat.Builder(context, CHANNEL_ID);
|
||||||
|
} else {
|
||||||
|
// Android 7.1及以下版本
|
||||||
|
return new NotificationCompat.Builder(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("UnspecifiedImmutableFlag")
|
||||||
|
private PendingIntent pendingIntent(Context context, Intent intent) {
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||||
|
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
} else {
|
||||||
|
return PendingIntent.getBroadcast(context, 0, intent, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
94
app/src/main/java/com/muqingbfq/mq/gj.java
Normal file
94
app/src/main/java/com/muqingbfq/mq/gj.java
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
public class gj {
|
||||||
|
public static void ts(Context a, Object b) {
|
||||||
|
Toast.makeText(a, b.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void xcts(Context context, Object b) {
|
||||||
|
main.handler.post(() -> Toast.makeText(context, b.toString(), Toast.LENGTH_SHORT).show());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sc(Object a) {
|
||||||
|
if (a == null) {
|
||||||
|
a = "null";
|
||||||
|
}
|
||||||
|
Log.d("云音乐", String.valueOf(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void llq(Context context, String str) {
|
||||||
|
context.startActivity(new Intent(context, llq.class).putExtra("url", str));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fx(Context context, String str) {
|
||||||
|
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||||
|
shareIntent.setType("text/plain");
|
||||||
|
shareIntent.putExtra(Intent.EXTRA_TEXT, str);
|
||||||
|
context.startActivity(shareIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int isDarkTheme(Context context) {
|
||||||
|
return context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||||
|
// return flag == Configuration.UI_MODE_NIGHT_YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWiFiConnected() {
|
||||||
|
try {
|
||||||
|
for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
|
||||||
|
if (networkInterface.isUp() && !networkInterface.isLoopback()) {
|
||||||
|
if (networkInterface.getDisplayName().contains("wlan")) {
|
||||||
|
return true; // Wi-Fi网络
|
||||||
|
} else if (networkInterface.getDisplayName().contains("rmnet")) {
|
||||||
|
return false; // 流量网络
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (SocketException e) {
|
||||||
|
yc.start(main.context, e);
|
||||||
|
}
|
||||||
|
return false; // 默认为流量网络
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int cornerRadius) {
|
||||||
|
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(output);
|
||||||
|
|
||||||
|
final int color = 0xff424242;
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
final RectF rectF = new RectF(rect);
|
||||||
|
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawRoundRect(rectF, cornerRadius, cornerRadius, paint);
|
||||||
|
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
199
app/src/main/java/com/muqingbfq/mq/llq.java
Normal file
199
app/src/main/java/com/muqingbfq/mq/llq.java
Normal file
|
@ -0,0 +1,199 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.DownloadManager;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.webkit.WebChromeClient;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.muqingbfq.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class llq extends AppCompatActivity {
|
||||||
|
WebView web;
|
||||||
|
Toolbar toolbar;
|
||||||
|
@SuppressLint({"DefaultLocale", "ObsoleteSdkInt"})
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_llq);
|
||||||
|
|
||||||
|
Intent intent = getIntent();
|
||||||
|
|
||||||
|
toolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
web = findViewById(R.id.webview);
|
||||||
|
web.getSettings().setJavaScriptEnabled(true);
|
||||||
|
web.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
super.onPageFinished(view, url);
|
||||||
|
String title = view.getTitle();
|
||||||
|
toolbar.setTitle(title);
|
||||||
|
toolbar.setSubtitle(url);
|
||||||
|
// 在这里获取到了网页的标题
|
||||||
|
}
|
||||||
|
});
|
||||||
|
web.setDownloadListener((url1, userAgent, contentDisposition, mimetype, contentLength) -> {
|
||||||
|
String size = "0B";
|
||||||
|
if (contentLength > 0) {
|
||||||
|
final String[] units = new String[]{"B", "KB", "MB", "GB", "TB"};
|
||||||
|
int digitGroups = (int) (Math.log10(contentLength) / Math.log10(1024));
|
||||||
|
size = String.format("%.1f %s", contentLength
|
||||||
|
/ Math.pow(1024, digitGroups), units[digitGroups]);
|
||||||
|
}
|
||||||
|
final String filename = url1.substring(url1.lastIndexOf('/') + 1);
|
||||||
|
new MaterialAlertDialogBuilder(llq.this)
|
||||||
|
.setTitle(filename)
|
||||||
|
.setMessage("文件链接:" + url1 +
|
||||||
|
"\n文件大小:" + size)
|
||||||
|
.setNegativeButton("取消", null)
|
||||||
|
.setNegativeButton("下载", (dialogInterface, i) -> {
|
||||||
|
// 检查权限
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||||
|
ContextCompat.checkSelfPermission(llq.this,
|
||||||
|
Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// 如果没有写入存储的权限,则请求权限
|
||||||
|
ActivityCompat.requestPermissions(llq.this,
|
||||||
|
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||||
|
1);
|
||||||
|
} else {
|
||||||
|
// 执行文件下载操作
|
||||||
|
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url1));
|
||||||
|
// 设置下载保存路径和文件名
|
||||||
|
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);
|
||||||
|
// 允许使用的网络类型,手机、WIFI
|
||||||
|
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_MOBILE | DownloadManager.Request.NETWORK_WIFI);
|
||||||
|
// 设置通知栏标题和描述信息
|
||||||
|
request.setTitle(filename);
|
||||||
|
request.setDescription("正在下载");
|
||||||
|
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
|
||||||
|
// 注册下载完成的广播接收器
|
||||||
|
long enqueue = downloadManager.enqueue(request);
|
||||||
|
BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (filename.endsWith(".apk")) {
|
||||||
|
// 打开安装界面
|
||||||
|
Cursor cursor = downloadManager.query(
|
||||||
|
new DownloadManager.Query().setFilterById(enqueue));
|
||||||
|
if (cursor.moveToFirst()) {
|
||||||
|
int columnIndex = cursor.getColumnIndex(DownloadManager.COLUMN_STATUS);
|
||||||
|
int status = cursor.getInt(columnIndex);
|
||||||
|
if (status == DownloadManager.STATUS_SUCCESSFUL) {
|
||||||
|
// 下载成功
|
||||||
|
columnIndex = cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI);
|
||||||
|
String localUri = cursor.getString(columnIndex);
|
||||||
|
if (localUri != null) {
|
||||||
|
Uri uri = Uri.parse(localUri);
|
||||||
|
String filePath = uri.getPath();
|
||||||
|
File file = new File(filePath);
|
||||||
|
// 获取下载文件的路径
|
||||||
|
Intent installIntent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
installIntent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
|
||||||
|
installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
startActivity(installIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
registerReceiver(receiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||||
|
}
|
||||||
|
}).show();
|
||||||
|
|
||||||
|
});
|
||||||
|
final ProgressBar progressBar = findViewById(R.id.webViewProgressBar);
|
||||||
|
web.setWebChromeClient(new WebChromeClient() {
|
||||||
|
@Override
|
||||||
|
public void onProgressChanged(WebView view, int newProgress) {
|
||||||
|
super.onProgressChanged(view, newProgress);
|
||||||
|
gj.sc(newProgress);
|
||||||
|
if (newProgress == 100) {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
progressBar.setProgress(newProgress);
|
||||||
|
if (!progressBar.isShown()) {
|
||||||
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadUrl(intent.getStringExtra("url"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadUrl(String url) {
|
||||||
|
web.loadUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == 1 && grantResults.length > 0 &&
|
||||||
|
grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// 权限已授予,执行文件下载操作
|
||||||
|
gj.ts(this, "权限已授予,请重新执行文件下载操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.llq, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (web.canGoBack()) {
|
||||||
|
web.goBack();
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
|
if (itemId == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
} else if (itemId == R.id.fx) {
|
||||||
|
gj.fx(this, web.getUrl());
|
||||||
|
// 服务中心
|
||||||
|
} else if (itemId == R.id.sx) {
|
||||||
|
web.reload();
|
||||||
|
} else if (itemId == R.id.menu_web) {
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW,
|
||||||
|
Uri.parse(web.getUrl())));
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
164
app/src/main/java/com/muqingbfq/mq/wj.java
Normal file
164
app/src/main/java/com/muqingbfq/mq/wj.java
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.muqingbfq.yc;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
public class wj {
|
||||||
|
public static String filesdri;
|
||||||
|
public static String mp3 = "mp3/";
|
||||||
|
public static String lishi_json = "lishi.json";
|
||||||
|
public static String gd = "gd/";
|
||||||
|
public static String tx = "image/";
|
||||||
|
public static String gd_json = "gd.json", mp3_xz = "mp3_xz.json", gd_xz = "gd_xz.json",
|
||||||
|
gd_phb = "gd_phb.json", mp3_like = "like.json";
|
||||||
|
|
||||||
|
public wj(Context context) {
|
||||||
|
try {
|
||||||
|
wj.filesdri = context.getExternalFilesDir("").getAbsolutePath() + "/";
|
||||||
|
// context.getFilesDir().toString() + "/";
|
||||||
|
gd_json = filesdri + gd_json;
|
||||||
|
mp3 = filesdri + mp3;
|
||||||
|
gd = filesdri + gd;
|
||||||
|
gd_xz = filesdri + gd_xz;
|
||||||
|
gd_phb = filesdri + gd_phb;
|
||||||
|
mp3_xz = gd + mp3_xz;
|
||||||
|
mp3_like = gd + mp3_like;
|
||||||
|
tx = filesdri + tx;
|
||||||
|
if (!new File(mp3).exists()) {
|
||||||
|
new File(mp3).mkdirs();
|
||||||
|
}
|
||||||
|
if (!new File(gd).exists()) {
|
||||||
|
new File(gd).mkdirs();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(context, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean new_wj(String string) {
|
||||||
|
File file = new File(string);
|
||||||
|
if (file.getParentFile().exists()) {
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return file.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 这里定义的是一个文件保存的方法,写入到文件中,所以是输出流
|
||||||
|
* */
|
||||||
|
public static boolean xrwb(String url, String text) {
|
||||||
|
File file = new File(url);
|
||||||
|
//如果文件不存在,创建文件
|
||||||
|
try {
|
||||||
|
if (file.getParentFile().exists()) {
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
if (!file.exists())
|
||||||
|
file.createNewFile();
|
||||||
|
//创建FileOutputStream对象,写入内容
|
||||||
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
|
//向文件中写入内容
|
||||||
|
fos.write(text.getBytes());
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String dqwb(String url) {
|
||||||
|
try {
|
||||||
|
File file = new File(url);
|
||||||
|
FileInputStream fis = new FileInputStream(file);
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
|
||||||
|
StringBuilder str = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
str.append(line);
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
fis.close();
|
||||||
|
return str.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean cz(String url) {
|
||||||
|
return new File(url).exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean sc(String url) {
|
||||||
|
File file = new File(url);
|
||||||
|
return file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sc(File url) {
|
||||||
|
if (url.exists()) {
|
||||||
|
File[] files = url.listFiles();
|
||||||
|
if (files != null) {
|
||||||
|
for (File file : files) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
// 递归调用,删除子文件夹及其内容
|
||||||
|
sc(file);
|
||||||
|
} else {
|
||||||
|
file.delete(); // 删除文件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url.delete(); // 删除当前文件夹
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String convertToMd5(String url) {
|
||||||
|
try {
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] messageDigest = md.digest(url.getBytes());
|
||||||
|
StringBuilder hexString = new StringBuilder();
|
||||||
|
for (byte value : messageDigest) {
|
||||||
|
String hex = Integer.toHexString(0xFF & value);
|
||||||
|
if (hex.length() == 1) {
|
||||||
|
hexString.append('0');
|
||||||
|
}
|
||||||
|
hexString.append(hex);
|
||||||
|
}
|
||||||
|
return hexString.toString();
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class xrwb extends Thread {
|
||||||
|
String url, text;
|
||||||
|
|
||||||
|
public xrwb(String url, String text) {
|
||||||
|
this.url = url;
|
||||||
|
this.text = text;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
xrwb(url, text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
130
app/src/main/java/com/muqingbfq/mq/wl.java
Normal file
130
app/src/main/java/com/muqingbfq/mq/wl.java
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
import com.muqingbfq.xm;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
public class wl {
|
||||||
|
public static String Cookie;
|
||||||
|
|
||||||
|
public static void setcookie(String cookie) {
|
||||||
|
wl.Cookie = cookie;
|
||||||
|
main.edit.putString(main.Cookie, cookie);
|
||||||
|
main.edit.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean iskong() {
|
||||||
|
return Cookie.equals("") || Cookie == null;
|
||||||
|
}
|
||||||
|
public static String hq(String url) {
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(main.api + url)
|
||||||
|
.build();
|
||||||
|
Response response = client.newCall(request).execute();
|
||||||
|
if (response.body() != null) {
|
||||||
|
return response.body().string();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("wl hq(Strnig) " + e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String url) {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.build();
|
||||||
|
try {
|
||||||
|
Response response = client.newCall(request).execute();
|
||||||
|
if (response.body() != null) {
|
||||||
|
return response.body().string();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("wl get(Strnig) " + e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class xz extends Thread {
|
||||||
|
String url;
|
||||||
|
xm x;
|
||||||
|
|
||||||
|
public xz(String url, xm x) {
|
||||||
|
this.url = url;
|
||||||
|
this.x = x;
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
xz(url, x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean xz(String url, final xm x) {
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
//访问路径
|
||||||
|
.url(url)
|
||||||
|
.build();
|
||||||
|
Call call = client.newCall(request);
|
||||||
|
Response response = call.execute();
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
ResponseBody body = response.body();
|
||||||
|
if (body != null) {
|
||||||
|
File file = new File(wj.mp3, String.valueOf(x.id));
|
||||||
|
InputStream inputStream = body.byteStream();
|
||||||
|
FileOutputStream fileOutputStream =
|
||||||
|
new FileOutputStream(file);
|
||||||
|
// 替换为实际要保存的文件路径
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
fileOutputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
fileOutputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if (wj.cz(wj.mp3_xz)) {
|
||||||
|
jsonObject = new JSONObject(wj.dqwb(wj.mp3_xz));
|
||||||
|
} else {
|
||||||
|
jsonObject.put("songs", new JSONArray());
|
||||||
|
}
|
||||||
|
JSONArray songs = jsonObject.getJSONArray("songs");
|
||||||
|
if (songs.length() > 30) {
|
||||||
|
songs.remove(0);
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("id", x.id);
|
||||||
|
json.put("name", x.name);
|
||||||
|
json.put("zz", x.zz);
|
||||||
|
json.put("picUrl", x.picurl);
|
||||||
|
songs.put(json);
|
||||||
|
wj.xrwb(wj.mp3_xz, jsonObject.toString());
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc("wl xz " + e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
172
app/src/main/java/com/muqingbfq/start.java
Normal file
172
app/src/main/java/com/muqingbfq/start.java
Normal file
|
@ -0,0 +1,172 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.media.MediaPlayer;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.muqingbfq.login.visitor;
|
||||||
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
public class start extends AppCompatActivity {
|
||||||
|
public static int ztl, dhl;
|
||||||
|
Intent home;
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
try {
|
||||||
|
home = new Intent(this, home.class);
|
||||||
|
ztl = getNavigationBarHeight(this);
|
||||||
|
dhl = getStatusBarHeight(this);
|
||||||
|
DisplayMetrics dm = getResources().getDisplayMetrics();
|
||||||
|
main.k = dm.widthPixels;
|
||||||
|
main.g = dm.heightPixels;
|
||||||
|
} catch (Exception e) {
|
||||||
|
yc.start(this, e);
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= 33) {
|
||||||
|
int checkPermission =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS);
|
||||||
|
if (checkPermission != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
//动态申请
|
||||||
|
ActivityCompat.requestPermissions(this, new String[]{
|
||||||
|
Manifest.permission.POST_NOTIFICATIONS}, REQUEST_EXTERNAL_STORAGE);
|
||||||
|
} else {
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
// checkPermission();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long time;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getStatusBarHeight(Context context) {
|
||||||
|
int result = 0;
|
||||||
|
@SuppressLint({"InternalInsetResource", "DiscouragedApi"}) int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||||
|
if (resourceId > 0) {
|
||||||
|
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getNavigationBarHeight(Context context) {
|
||||||
|
Resources resources = context.getResources();
|
||||||
|
@SuppressLint({"InternalInsetResource", "DiscouragedApi"}) int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||||
|
return resources.getDimensionPixelSize(resourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int REQUEST_EXTERNAL_STORAGE = 1;
|
||||||
|
private static final String[] PERMISSIONS_STORAGE = {android.Manifest.permission.READ_EXTERNAL_STORAGE, android.Manifest.permission.WRITE_EXTERNAL_STORAGE};
|
||||||
|
|
||||||
|
private AlertDialog dialog;
|
||||||
|
|
||||||
|
@SuppressLint("ObsoleteSdkInt")
|
||||||
|
private void checkPermission() {
|
||||||
|
//检查权限(NEED_PERMISSION)是否被授权 PackageManager.PERMISSION_GRANTED表示同意授权
|
||||||
|
if (Build.VERSION.SDK_INT >= 30) {
|
||||||
|
if (!Environment.isExternalStorageManager()) {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
dialog = new AlertDialog.Builder(this).setTitle("提示")//设置标题
|
||||||
|
.setMessage("请开启文件访问权限,否则无法正常使用本应用!").setNegativeButton("取消", (dialog, i) -> dialog.dismiss()).setPositiveButton("确定", (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
|
||||||
|
startActivity(intent);
|
||||||
|
}).create();
|
||||||
|
dialog.show();
|
||||||
|
} else {
|
||||||
|
gj.sc("Android 11以上,当前已有权限");
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
//申请权限
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
dialog = new AlertDialog.Builder(this).setTitle("提示")//设置标题
|
||||||
|
.setMessage("请开启文件访问权限,否则无法正常使用本应用!").setPositiveButton("确定", (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
ActivityCompat.requestPermissions(this, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
|
||||||
|
}).create();
|
||||||
|
dialog.show();
|
||||||
|
} else {
|
||||||
|
gj.sc("Android 6.0以上,11以下,当前已有权限");
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gj.sc("Android 6.0以下,已获取权限");
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == REQUEST_EXTERNAL_STORAGE) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
Toast.makeText(this, "授权成功!", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "授权被拒绝!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startApp() {
|
||||||
|
|
||||||
|
SharedPreferences theme = getSharedPreferences("theme", MODE_PRIVATE);
|
||||||
|
@SuppressLint("CommitPrefEdits") SharedPreferences.Editor edit = theme.edit();
|
||||||
|
int i = theme.getInt("theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||||
|
if (i == -1) {
|
||||||
|
edit.putInt("theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||||
|
}
|
||||||
|
AppCompatDelegate.setDefaultNightMode(i);
|
||||||
|
|
||||||
|
wl.Cookie = main.sp.getString(main.Cookie, "");
|
||||||
|
if (wl.Cookie.equals("")) {
|
||||||
|
new visitor(this, home);
|
||||||
|
} else {
|
||||||
|
if (wj.filesdri == null) {
|
||||||
|
new wj(this);
|
||||||
|
}
|
||||||
|
startActivity(home);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
73
app/src/main/java/com/muqingbfq/sz.java
Normal file
73
app/src/main/java/com/muqingbfq/sz.java
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
|
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||||
|
|
||||||
|
public class sz extends AppCompatActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_sz);
|
||||||
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
UI();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ApplySharedPref")
|
||||||
|
private void UI() {
|
||||||
|
MaterialSwitch a1 = findViewById(R.id.switch_a1);
|
||||||
|
MaterialSwitch a2 = findViewById(R.id.switch_a2);
|
||||||
|
SharedPreferences theme = getSharedPreferences("theme", MODE_PRIVATE);
|
||||||
|
@SuppressLint("CommitPrefEdits") SharedPreferences.Editor edit = theme.edit();
|
||||||
|
int i = theme.getInt("theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||||
|
if (i == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) {
|
||||||
|
a1.setChecked(true);
|
||||||
|
a2.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
a1.setChecked(false);
|
||||||
|
a2.setEnabled(true);
|
||||||
|
a2.setChecked(i == AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
}
|
||||||
|
a1.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||||
|
if (b) {
|
||||||
|
// 跟随系统设置切换颜色模式
|
||||||
|
int ms = AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
|
||||||
|
AppCompatDelegate.setDefaultNightMode(ms);
|
||||||
|
edit.putInt("theme", ms);
|
||||||
|
edit.commit();
|
||||||
|
}
|
||||||
|
a2.setEnabled(!b);
|
||||||
|
});
|
||||||
|
a2.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||||
|
if (compoundButton.isEnabled()) {
|
||||||
|
int ms;
|
||||||
|
if (b) {
|
||||||
|
ms = AppCompatDelegate.MODE_NIGHT_YES;
|
||||||
|
} else {
|
||||||
|
ms = AppCompatDelegate.MODE_NIGHT_NO;
|
||||||
|
}
|
||||||
|
AppCompatDelegate.setDefaultNightMode(ms);
|
||||||
|
edit.putInt("theme", ms);
|
||||||
|
edit.commit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
25
app/src/main/java/com/muqingbfq/xm.java
Normal file
25
app/src/main/java/com/muqingbfq/xm.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
public class xm {
|
||||||
|
public String id, name, zz;
|
||||||
|
public Object picurl;
|
||||||
|
public boolean cz;
|
||||||
|
public xm(String id, String name, String zz, String picurl) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.zz = zz;
|
||||||
|
this.picurl = picurl;
|
||||||
|
}
|
||||||
|
public xm(String id, String name, String picurl, boolean cz) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.picurl = picurl;
|
||||||
|
this.cz = cz;
|
||||||
|
}
|
||||||
|
public xm(String id, String name, int picurl, boolean cz) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.picurl = picurl;
|
||||||
|
this.cz = cz;
|
||||||
|
}
|
||||||
|
}
|
34
app/src/main/java/com/muqingbfq/yc.java
Normal file
34
app/src/main/java/com/muqingbfq/yc.java
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
package com.muqingbfq;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class yc extends AppCompatActivity {
|
||||||
|
public static Object exception;
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_yc);
|
||||||
|
TextView text = findViewById(R.id.text);
|
||||||
|
try {
|
||||||
|
text.setText(exception.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(this, e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(Object e) {
|
||||||
|
start(main.context, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(Context context, Object e) {
|
||||||
|
yc.exception = e;
|
||||||
|
context.startActivity(new Intent(context,yc.class));
|
||||||
|
}
|
||||||
|
}
|
BIN
app/src/main/logo-playstore.png
Normal file
BIN
app/src/main/logo-playstore.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
6
app/src/main/res/anim/slide_in.xml
Normal file
6
app/src/main/res/anim/slide_in.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate
|
||||||
|
android:fromXDelta="0"
|
||||||
|
android:toXDelta="-100%"
|
||||||
|
android:duration="300" />
|
||||||
|
</set>
|
6
app/src/main/res/anim/slide_out.xml
Normal file
6
app/src/main/res/anim/slide_out.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate
|
||||||
|
android:fromXDelta="0"
|
||||||
|
android:toXDelta="100%"
|
||||||
|
android:duration="300" />
|
||||||
|
</set>
|
10
app/src/main/res/drawable/abc_ic_menu_share_mtrl_alpha.xml
Normal file
10
app/src/main/res/drawable/abc_ic_menu_share_mtrl_alpha.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/text"
|
||||||
|
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
|
||||||
|
</vector>
|
16
app/src/main/res/drawable/app_warning.xml
Normal file
16
app/src/main/res/drawable/app_warning.xml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M512,427.7c-33.1,0 -60,26.9 -60,60v226.7c0,33.1 26.9,60 60,60s60,-26.9 60,-60V487.7c0,-33.1 -26.9,-60 -60,-60z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M512,309.7m-60,0a60,60 0,1 0,120 0,60 60,0 1,0 -120,0Z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M512,14C237,14 14,237 14,512s223,498 498,498 498,-223 498,-498S787,14 512,14zM512,910c-219.8,0 -398,-178.2 -398,-398S292.2,114 512,114 910,292.2 910,512 731.8,910 512,910z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
</vector>
|
10
app/src/main/res/drawable/background.xml
Normal file
10
app/src/main/res/drawable/background.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="80dp"
|
||||||
|
android:height="80dp"
|
||||||
|
android:viewportWidth="80"
|
||||||
|
android:viewportHeight="80">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/bj"
|
||||||
|
android:pathData="M0,0h80v80h-80z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/bf.xml
Normal file
9
app/src/main/res/drawable/bf.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/text"
|
||||||
|
android:pathData="M244.8,226h203.3c17.8,0 31.8,14 31.8,31.6v508.6c0,17.6 -14,31.8 -31.8,31.8L244.8,798c-17.6,0 -31.6,-14.2 -31.6,-31.8L213.2,257.6c0,-17.6 14,-31.6 31.6,-31.6zM575.7,226h203.3c17.8,0 31.8,14 31.8,31.6v508.6c0,17.6 -14,31.8 -31.8,31.8L575.7,798c-17.6,0 -32,-14.2 -32,-31.8L543.6,257.6c0,-17.6 14.4,-31.6 32,-31.6zM747.1,289.2L607.2,289.2v445.4h139.9L747.1,289.2zM416.3,289.2L276.4,289.2v445.4h139.9L416.3,289.2z" />
|
||||||
|
</vector>
|
8
app/src/main/res/drawable/bw.xml
Normal file
8
app/src/main/res/drawable/bw.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/text_tm">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
10
app/src/main/res/drawable/cd.xml
Normal file
10
app/src/main/res/drawable/cd.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="200dp"
|
||||||
|
android:width="200dp"
|
||||||
|
android:viewportWidth="1024.0"
|
||||||
|
android:viewportHeight="1024.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/text"
|
||||||
|
android:pathData="M332.4,813.5h545.2c17.8,0 31.3,-13.3 31.3,-31.3s-13.3,-31.3 -31.3,-31.3L332.4,750.8c-17.8,0 -31.3,13.3 -31.3,31.3 0,13.3 13.5,31.3 31.3,31.3zM332.4,545.2h545.2c22.3,0 35.8,-13.3 35.8,-31.3s-13.3,-31.3 -31.3,-31.3L332.4,482.5c-17.8,-4.5 -31.3,9 -31.3,31.3 0,18 13.5,31.3 31.3,31.3zM332.4,281.6h545.2c22.3,0 35.8,-17.8 35.8,-35.8 0,-17.8 -13.3,-31.3 -31.3,-31.3L332.4,214.4c-17.8,0 -31.3,13.3 -31.3,31.3 0,17.8 13.5,35.8 31.3,35.8zM158.1,826.8c26.8,0 49.2,-22.3 49.2,-49.2s-22.3,-49.2 -49.2,-49.2 -49.2,22.3 -49.2,49.2 22.3,49.2 49.2,49.2zM207.3,513.8c0,-26.8 -22.3,-49.2 -49.2,-49.2 -26.8,-4.5 -49.2,17.8 -49.2,49.2 0,26.8 22.3,49.2 49.2,49.2s49.2,-22.3 49.2,-49.2zM158.1,294.9c26.8,0 49.2,-22.3 49.2,-49.2s-22.3,-49.2 -49.2,-49.2 -49.2,22.3 -49.2,49.2 22.3,49.2 49.2,49.2zM158.1,294.9" />
|
||||||
|
</vector>
|
13
app/src/main/res/drawable/deleat.xml
Normal file
13
app/src/main/res/drawable/deleat.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M840,288H688v-56c0,-40 -32,-72 -72,-72h-208C368,160 336,192 336,232V288h-152c-12.8,0 -24,11.2 -24,24s11.2,24 24,24h656c12.8,0 24,-11.2 24,-24s-11.2,-24 -24,-24zM384,288v-56c0,-12.8 11.2,-24 24,-24h208c12.8,0 24,11.2 24,24V288H384zM758.4,384c-12.8,0 -24,11.2 -24,24v363.2c0,24 -19.2,44.8 -44.8,44.8H332.8c-24,0 -44.8,-19.2 -44.8,-44.8V408c0,-12.8 -11.2,-24 -24,-24s-24,11.2 -24,24v363.2c0,51.2 41.6,92.8 92.8,92.8h358.4c51.2,0 92.8,-41.6 92.8,-92.8V408c-1.6,-12.8 -12.8,-24 -25.6,-24z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M444.8,744v-336c0,-12.8 -11.2,-24 -24,-24s-24,11.2 -24,24v336c0,12.8 11.2,24 24,24s24,-11.2 24,-24zM627.2,744v-336c0,-12.8 -11.2,-24 -24,-24s-24,11.2 -24,24v336c0,12.8 11.2,24 24,24s24,-11.2 24,-24z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/end.xml
Normal file
9
app/src/main/res/drawable/end.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M515.6,695.4l-364.3,-364.3c-20,-20.1 -52.6,-20.1 -72.6,-0 -20,20 -20,52.5 0,72.6L478,803c20,20 52.5,20 72.6,0 1.6,-1.6 2.8,-3.4 4.2,-5.1 0.3,-0.3 0.7,-0.5 1,-0.8l389.9,-389.9c19.6,-19.6 19.6,-51.3 0,-70.9s-51.3,-19.6 -70.9,0L515.6,695.4z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/fuwuzhongxing.xml
Normal file
9
app/src/main/res/drawable/fuwuzhongxing.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M512,0a512,512 0,1 0,512 512A512.4,512.4 0,0 0,512 0zM512,938.1A554.5,554.5 0,0 1,390.5 745.4a775.4,775.4 0,0 1,121.5 -9.5,725.5 725.5,0 0,1 117.2,9.5 544.1,544.1 0,0 1,-117.2 192.7zM512,666.5a834,834 0,0 0,-143.6 12.6,661.3 661.3,0 0,1 -20.4,-133.2h321.5a681.2,681.2 0,0 1,-19.5 130.2,790.6 790.6,0 0,0 -138,-9.5zM71.2,545.8h208.3a728.5,728.5 0,0 0,22.6 149.3,450 450,0 0,0 -151.9,71.6 439.5,439.5 0,0 1,-79 -220.9zM507.7,85.9a554.1,554.1 0,0 1,120.2 190.5,683 683,0 0,1 -115.9,10 722.9,722.9 0,0 1,-121.9 -10.4,542.8 542.8,0 0,1 117.6,-190zM512,355.8a749.3,749.3 0,0 0,137.1 -13,661.3 661.3,0 0,1 21.3,134.5L348.9,477.3a680.8,680.8 0,0 1,20.4 -134.5,787.5 787.5,0 0,0 142.8,13zM279.4,475.6h-208.3a439.5,439.5 0,0 1,81.1 -221.3,462.1 462.1,0 0,0 149.7,72.5 748.5,748.5 0,0 0,-22.6 148.8zM739.8,547.6l213,3a439.5,439.5 0,0 1,-79.8 216.9A466.4,466.4 0,0 0,718.1 694.2a748,748 0,0 0,21.7 -146.7zM739.8,478.2a728.5,728.5 0,0 0,-23.4 -151.4,477.3 477.3,0 0,0 153.6,-75.1 439.5,439.5 0,0 1,83.3 228.7zM826.6,199.6a417.8,417.8 0,0 1,-130.2 61.6,650.8 650.8,0 0,0 -103.7,-183.1 441.7,441.7 0,0 1,232.1 121.5zM422.2,78.1A642.6,642.6 0,0 0,322.4 260.3a397.5,397.5 0,0 1,-125.4 -58.6A442.1,442.1 0,0 1,422.2 78.1zM194,819.2a384,384 0,0 1,130.2 -58.6A650.8,650.8 0,0 0,425.2 945.9a442.1,442.1 0,0 1,-231.3 -126.7zM596.2,945.9a643.5,643.5 0,0 0,101.5 -185.7,401.8 401.8,0 0,1 130.2,60.3 441.7,441.7 0,0 1,-231.7 125.4z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
10
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
10
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="80"
|
||||||
|
android:viewportHeight="80">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/bj"
|
||||||
|
android:pathData="M0,0h80v80h-80z" />
|
||||||
|
</vector>
|
17
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
17
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<group android:scaleX="0.4888889"
|
||||||
|
android:scaleY="0.4888889"
|
||||||
|
android:translateX="261.6889"
|
||||||
|
android:translateY="261.6889">
|
||||||
|
<path
|
||||||
|
android:pathData="M995,538.7c-13.8,-8.9 -30.3,-12 -46.4,-8.5l-182.9,39.3c-28.2,6.1 -48.6,31.4 -48.6,60.2v224.6c0,21.8 -17.7,39.5 -39.6,39.5 -21.8,0 -39.5,-17.7 -39.5,-39.5s17.7,-39.6 39.5,-39.6c15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.4,0 -95.1,42.7 -95.1,95.2 0,52.4 42.7,95.1 95.1,95.1 52.5,0 95.1,-42.7 95.1,-95.1V629.8c0,-2.9 2,-5.3 4.8,-5.9l182.9,-39.3c1.9,-0.5 3.6,0.2 4.5,0.8 1,0.6 2.2,1.8 2.7,5V814c0,21.8 -17.7,39.6 -39.6,39.6 -10.5,0 -20.5,-4.1 -27.9,-11.6 -7.5,-7.5 -11.6,-17.4 -11.6,-28 0,-21.8 17.7,-39.6 39.6,-39.6 15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.5,0 -95.1,42.7 -95.1,95.1 0,25.4 9.9,49.3 27.9,67.3s41.8,27.9 67.2,27.9c52.5,0 95.1,-42.7 95.1,-95.1V590.5c0,-4.4 -0.5,-8.7 -1.4,-12.9 -3.4,-16.1 -12.9,-29.9 -26.7,-38.9z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M338.3,315.1c35.3,-63.9 90.4,-114.1 158.6,-143.6 81.4,-35.2 171.7,-36.6 254.1,-3.9 106.7,42.3 183,134.9 204.1,247.8 3.1,16.7 17.7,28.4 34.1,28.4 2.1,0 4.3,-0.2 6.4,-0.6 18.9,-3.5 31.3,-21.7 27.8,-40.5C997.9,266.2 905.7,154.1 776.6,103c-99.7,-39.5 -208.8,-37.8 -307.3,4.7 -92.5,40 -165.1,111.6 -206.4,202.8 -48.9,3.6 -96.2,19.8 -137.8,48C62.2,400.9 19.7,465.3 5.3,539.7c-14.4,74.4 1,150 43.5,212.9 52.9,78.3 140.8,125 235.2,125h153.3c19.2,0 34.7,-15.6 34.7,-34.7s-15.6,-34.7 -34.7,-34.7H284c-71.3,0 -137.7,-35.3 -177.7,-94.4C74.2,666.3 62.6,609.3 73.5,553c10.9,-56.2 43,-104.8 90.5,-136.9 47.5,-32.1 104.5,-43.7 160.8,-32.8 56.2,10.9 104.8,43 136.9,90.5 10.7,15.9 32.3,20.1 48.2,9.3 15.9,-10.7 20.1,-32.3 9.3,-48.2 -42.4,-62.8 -106.6,-105.3 -180.9,-119.8z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
12
app/src/main/res/drawable/icon.xml
Normal file
12
app/src/main/res/drawable/icon.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M995,538.7c-13.8,-8.9 -30.3,-12 -46.4,-8.5l-182.9,39.3c-28.2,6.1 -48.6,31.4 -48.6,60.2v224.6c0,21.8 -17.7,39.5 -39.6,39.5 -21.8,0 -39.5,-17.7 -39.5,-39.5s17.7,-39.6 39.5,-39.6c15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.4,0 -95.1,42.7 -95.1,95.2 0,52.4 42.7,95.1 95.1,95.1 52.5,0 95.1,-42.7 95.1,-95.1V629.8c0,-2.9 2,-5.3 4.8,-5.9l182.9,-39.3c1.9,-0.5 3.6,0.2 4.5,0.8 1,0.6 2.2,1.8 2.7,5V814c0,21.8 -17.7,39.6 -39.6,39.6 -10.5,0 -20.5,-4.1 -27.9,-11.6 -7.5,-7.5 -11.6,-17.4 -11.6,-28 0,-21.8 17.7,-39.6 39.6,-39.6 15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.5,0 -95.1,42.7 -95.1,95.1 0,25.4 9.9,49.3 27.9,67.3s41.8,27.9 67.2,27.9c52.5,0 95.1,-42.7 95.1,-95.1V590.5c0,-4.4 -0.5,-8.7 -1.4,-12.9 -3.4,-16.1 -12.9,-29.9 -26.7,-38.9z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M338.3,315.1c35.3,-63.9 90.4,-114.1 158.6,-143.6 81.4,-35.2 171.7,-36.6 254.1,-3.9 106.7,42.3 183,134.9 204.1,247.8 3.1,16.7 17.7,28.4 34.1,28.4 2.1,0 4.3,-0.2 6.4,-0.6 18.9,-3.5 31.3,-21.7 27.8,-40.5C997.9,266.2 905.7,154.1 776.6,103c-99.7,-39.5 -208.8,-37.8 -307.3,4.7 -92.5,40 -165.1,111.6 -206.4,202.8 -48.9,3.6 -96.2,19.8 -137.8,48C62.2,400.9 19.7,465.3 5.3,539.7c-14.4,74.4 1,150 43.5,212.9 52.9,78.3 140.8,125 235.2,125h153.3c19.2,0 34.7,-15.6 34.7,-34.7s-15.6,-34.7 -34.7,-34.7H284c-71.3,0 -137.7,-35.3 -177.7,-94.4C74.2,666.3 62.6,609.3 73.5,553c10.9,-56.2 43,-104.8 90.5,-136.9 47.5,-32.1 104.5,-43.7 160.8,-32.8 56.2,10.9 104.8,43 136.9,90.5 10.7,15.9 32.3,20.1 48.2,9.3 15.9,-10.7 20.1,-32.3 9.3,-48.2 -42.4,-62.8 -106.6,-105.3 -180.9,-119.8z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
16
app/src/main/res/drawable/liaoqun.xml
Normal file
16
app/src/main/res/drawable/liaoqun.xml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M924.7,675.9h-96v-21.9h96c7.1,0 12.9,-5.2 12.9,-11.6V178.5c0,-6.4 -5.8,-11.6 -12.9,-11.6H219.2c-7.1,0 -12.9,5.2 -12.9,11.6v105.9h-21.9V178.5c0,-18.5 15.6,-33.5 34.8,-33.5h705.5c19.2,0 34.8,15 34.8,33.5v463.9c-0,18.5 -15.6,33.5 -34.8,33.5z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M443.5,890.3c-6.2,0 -11.9,-2.4 -16.2,-6.7l-1.5,-1.8L380,811c-4.6,-4.3 -11,-6.7 -17.5,-6.7H99.3c-19.2,0 -34.8,-15 -34.8,-33.5V307c0,-18.5 15.6,-33.5 34.8,-33.5h705.5c19.2,0 34.8,15 34.8,33.5v463.9c0,18.5 -15.6,33.5 -34.8,33.5H523.4c-6.7,0 -13.1,2.5 -17.7,6.8l-45.8,72.3c-4.3,4.4 -10,6.8 -16.3,6.8 -0,-0 -0.1,0 -0.1,0zM99.3,295.3c-7.1,0 -12.9,5.2 -12.9,11.6v463.9c0,6.4 5.8,11.6 12.9,11.6h263.2c12.7,0 25,5 33.8,13.8l1.5,1.8 45.2,69.9 46.4,-71.3c8.8,-9 21.2,-14.2 34.1,-14.2h281.4c7.1,0 12.9,-5.2 12.9,-11.6V307c0,-6.4 -5.8,-11.6 -12.9,-11.6H99.3z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M252.4,419.3h376.6v21.9h-376.6zM252.4,514.3h376.6v21.9h-376.6zM252.4,609.5h376.6v21.9h-376.6z"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
</vector>
|
8
app/src/main/res/drawable/logo.xml
Normal file
8
app/src/main/res/drawable/logo.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 背景 Drawable -->
|
||||||
|
<item android:drawable="@drawable/background" />
|
||||||
|
<!-- 图标 Drawable -->
|
||||||
|
<item
|
||||||
|
android:gravity="center"
|
||||||
|
android:drawable="@drawable/icon" />
|
||||||
|
</layer-list>
|
10
app/src/main/res/drawable/mt_sj.xml
Normal file
10
app/src/main/res/drawable/mt_sj.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M844.8,665.6c-6.4,-6.4 -16,-12.8 -25.6,-9.6 -19.2,0 -35.2,16 -35.2,35.2 0,9.6 6.4,19.2 12.8,25.6l41.6,41.6c-44.8,-6.4 -86.4,-22.4 -121.6,-51.2 -3.2,0 -3.2,-3.2 -6.4,-6.4L332.8,304C268.8,233.6 192,195.2 99.2,195.2c-19.2,0 -35.2,16 -35.2,35.2s16,32 35.2,32c73.6,0 134.4,32 182.4,86.4l384,400 6.4,6.4c48,38.4 108.8,64 172.8,70.4l-48,44.8c-9.6,6.4 -16,19.2 -16,28.8 0,19.2 19.2,35.2 38.4,32 9.6,0 19.2,-6.4 25.6,-12.8l99.2,-92.8c16,-16 16,-41.6 0,-57.6l-99.2,-102.4zM841.6,108.8c-12.8,-16 -32,-19.2 -48,-6.4 -9.6,6.4 -12.8,16 -12.8,25.6 0,12.8 3.2,22.4 16,28.8l41.6,41.6c-73.6,9.6 -140.8,38.4 -192,89.6l-115.2,118.4c-12.8,12.8 -12.8,32 0,44.8 6.4,6.4 16,9.6 25.6,9.6s19.2,-3.2 25.6,-9.6l112,-118.4c41.6,-38.4 92.8,-64 147.2,-70.4l-44.8,44.8c-6.4,6.4 -12.8,16 -12.8,25.6 0,19.2 16,35.2 32,35.2 9.6,0 19.2,-3.2 28.8,-9.6L950.4,256c12.8,-12.8 12.8,-35.2 0,-48l-108.8,-99.2m-438.4,448c-9.6,0 -19.2,3.2 -25.6,9.6l-118.4,121.6c-48,44.8 -96,67.2 -160,67.2L96,755.2c-19.2,0 -35.2,16 -35.2,35.2s16,32 35.2,32h3.2c83.2,0 147.2,-32 211.2,-86.4l121.6,-124.8c6.4,-6.4 9.6,-12.8 9.6,-22.4 0,-9.6 -3.2,-16 -9.6,-22.4 -9.6,-6.4 -19.2,-9.6 -28.8,-9.6z"
|
||||||
|
android:fillColor="#2c2c2c"/>
|
||||||
|
</vector>
|
10
app/src/main/res/drawable/mt_sx.xml
Normal file
10
app/src/main/res/drawable/mt_sx.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M162.6,491.9c-52.6,0 -95.4,-42.8 -95.4,-95.4L67.2,180.2c0,-19.8 6,-38.7 17.4,-54.9 14.7,-20.8 36.5,-34.7 61.7,-39.1 25.1,-4.4 50.4,1.3 71.2,16l153.8,108.2c9,6.3 16.8,14.1 23.1,23.1 14.7,20.8 20.3,46.1 16,71.2 -4.4,25.1 -18.2,47 -39.1,61.7l-153.8,108.2c-16.2,11.4 -35.1,17.4 -54.9,17.4zM162.6,142.4c-2.2,0 -4.4,0.2 -6.6,0.6 -9.9,1.7 -18.6,7.2 -24.4,15.5 -4.5,6.4 -6.9,13.9 -6.9,21.7v216.4c0,20.8 16.9,37.8 37.8,37.8 7.8,0 15.3,-2.4 21.7,-6.9l153.8,-108.2c8.3,-5.8 13.7,-14.5 15.5,-24.4 1.7,-9.9 -0.5,-20 -6.3,-28.2a37.9,37.9 0,0 0,-9.1 -9.1l-153.8,-108.2c-6.4,-4.5 -13.9,-6.9 -21.6,-6.9zM927.4,920.8L96,920.8c-15.9,0 -28.8,-12.9 -28.8,-28.8s12.9,-28.8 28.8,-28.8h831.4c15.9,0 28.8,12.9 28.8,28.8s-12.9,28.8 -28.8,28.8zM928.8,654.9L96,654.9c-15.9,0 -28.8,-12.9 -28.8,-28.8s12.9,-28.8 28.8,-28.8h832.8c15.9,0 28.8,12.9 28.8,28.8s-12.9,28.8 -28.8,28.8zM923.6,153.8L569.7,153.8c-15.9,0 -28.8,-12.9 -28.8,-28.8s12.9,-28.8 28.8,-28.8L923.6,96.2c15.9,0 28.8,12.9 28.8,28.8s-12.9,28.8 -28.8,28.8zM923.6,389L569.7,389c-15.9,0 -28.8,-12.9 -28.8,-28.8s12.9,-28.8 28.8,-28.8L923.6,331.4c15.9,0 28.8,12.9 28.8,28.8s-12.9,28.8 -28.8,28.8z"
|
||||||
|
android:fillColor="#616266"/>
|
||||||
|
</vector>
|
13
app/src/main/res/drawable/mt_xh.xml
Normal file
13
app/src/main/res/drawable/mt_xh.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M773.6,203.8l-0.3,0.4a33.6,33.6 0,0 0,-20.3 -6.5c-19,0.8 -33.7,16.7 -33,35.8a33.8,33.8 0,0 0,15.6 26.8l-0.1,0.2a375.2,375.2 0,0 1,166.3 311.9c0,207 -168.4,375.5 -375.5,375.5 -27.8,0 -27.8,0 -54.3,-2.9 -90.5,-9.9 -152.6,-59 -155.5,-61.2a375.3,375.3 0,0 1,-165.6 -311.4c0,-201.4 159.5,-365.8 358.8,-374.6l-42,40.8 0.8,0.9a33.9,33.9 0,0 0,-15.3 29.2c0.8,19 16.7,33.8 35.7,33a33.8,33.8 0,0 0,26 -14.5l0.3,0.3 128.6,-125L515.7,34.1l-0.4,0.4a33.7,33.7 0,0 0,-26.3 -11.4c-18.9,0.8 -33.7,16.7 -33,35.7a33.9,33.9 0,0 0,13 25.2l45.2,45.3C275.2,135.7 82.6,331.7 82.6,572.3c0,147.6 73.1,285.1 193.2,366.1 3.1,2.6 77.6,62.2 188.8,74.3 29.4,3.2 31.1,3.3 61.8,3.3 244.7,0 443.7,-199.1 443.7,-443.7A443.4,443.4 0,0 0,773.6 203.8"
|
||||||
|
android:fillColor="#2c2c2c"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M542.1,400.8a33.3,33.3 0,0 0,-17.1 6.1l-0.2,-0.3 -106.8,69.7 0.2,0.3a34,34 0,0 0,-15.8 29.7c0.8,18.9 16.7,33.7 35.7,33a33.1,33.1 0,0 0,17.1 -6l0.2,0.3 54,-35.3v249.9h0c0,0.5 -0.2,0.9 -0.2,1.4a34.2,34.2 0,1 0,68.4 -1.4h0v-0.2c0,-0.4 0.2,-0.8 0.2,-1.2 0,-0.3 -0.2,-0.5 -0.2,-0.8V435.2c0,-0.5 0.2,-0.9 0.2,-1.3a34.4,34.4 0,0 0,-35.7 -33"
|
||||||
|
android:fillColor="#2c2c2c"/>
|
||||||
|
</vector>
|
11
app/src/main/res/drawable/progress_bar_horizontal.xml
Normal file
11
app/src/main/res/drawable/progress_bar_horizontal.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Progress color of the progress bar -->
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<clip>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/text_cz" />
|
||||||
|
</shape>
|
||||||
|
</clip>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
9
app/src/main/res/drawable/qq.xml
Normal file
9
app/src/main/res/drawable/qq.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/text"
|
||||||
|
android:pathData="M538,902l-52,0c-12.7,0 -21,2.3 -25,7 -12.7,12.7 -30,22.2 -52,28.5s-47.3,9.5 -76,9.5c-36.7,0 -71,-6.3 -103,-19 -4,-2 -7.8,-4.2 -11.5,-6.5s-6.8,-4.5 -9.5,-6.5 -5.2,-4.3 -7.5,-7 -4.2,-5.2 -5.5,-7.5 -2.3,-5 -3,-8 -1,-6.2 -1,-9.5c0,-9.3 3.5,-17.5 10.5,-24.5S221,844.7 237,838c9.3,-2.7 15.8,-6 19.5,-10s5.5,-9 5.5,-15c0,-17.3 -2,-28 -6,-32 -3.3,-4 -6.7,-9 -10,-15l-12,-16c-3.3,-6 -6.7,-10.7 -10,-14 -6.7,-12.7 -17.3,-19 -32,-19 -4,0 -7.5,0.5 -10.5,1.5s-6.8,2.8 -11.5,5.5 -8,4.7 -10,6c-12.7,12 -21.3,18.3 -26,19 -7.3,0 -11.3,-15.3 -12,-46l0,-5c0,-21.3 4,-57.7 12,-109 13.3,-38.7 34.7,-73 64,-103 8.7,-8 13,-18.7 13,-32l0,-12c0,-19.3 6.3,-38.7 19,-58 3.3,-2.7 5.3,-5.5 6,-8.5s1,-6.5 1,-10.5l0,-7c0,-15.3 1,-30.2 3,-44.5s5.2,-28.2 9.5,-41.5 9.8,-26.3 16.5,-39 14.5,-25.2 23.5,-37.5 19.2,-24.2 30.5,-35.5c49.3,-55.3 113.3,-83 192,-83 12.7,0 25,0.7 37,2s23.8,3.5 35.5,6.5 23,6.8 34,11.5 21.7,10 32,16 20.5,13 30.5,21 19.7,16.7 29,26c18,20 33,40 45,60s21.5,41.8 28.5,65.5S794,333.3 794,358l0,7c0,8.7 2,15 6,19 12.7,19.3 19,38.7 19,58l0,12c0,17.3 4.3,28 13,32 30,30 51.3,64.3 64,103 14,43.3 18.3,79.7 13,109 0,15.3 -1.5,26.8 -4.5,34.5s-7.8,13.2 -14.5,16.5c-4.7,0 -13.3,-6.3 -26,-19 -8.7,-8.7 -19.3,-13 -32,-13l-12,0c-1.3,0 -2.7,0.3 -4,1s-2.8,1.2 -4.5,1.5 -3.2,1.2 -4.5,2.5l-4,2 -3.5,3.5c0,0 -1,1.3 -3,4s-2.8,4.2 -2.5,4.5c-4.7,12.7 -15.3,27.7 -32,45 -10,10 -12.3,20.7 -7,32 0,6 5.3,13.3 16,22l3,3c29.3,13.3 44.3,28.3 45,45 0,9.3 -3,17.5 -9,24.5s-15.7,13.8 -29,20.5c-12.7,6 -28,10.7 -46,14s-37,5 -57,5c-53.3,0 -96,-12.7 -128,-38 4.7,0 3.7,-1.3 -3,-4L538,902zM685,1024c64,0 115,-12.7 153,-38 20.7,-14 36.5,-29.3 47.5,-46s16.5,-35.7 16.5,-57c0,-23.3 -6.3,-44.7 -19,-64l9,0c2,0 4.8,-0.5 8.5,-1.5s6.5,-2.5 8.5,-4.5c36,-12 57.3,-44 64,-96 6,-44.7 -0.3,-96 -19,-154 -2.7,-8.7 -5.8,-17.3 -9.5,-26s-7.7,-17 -12,-25 -9.2,-16 -14.5,-24 -10.8,-15.7 -16.5,-23 -11.8,-15 -18.5,-23c0,-28 -6.3,-58 -19,-90 0,-32 -3.7,-62.5 -11,-91.5s-18.5,-56.8 -33.5,-83.5 -34.2,-51.7 -57.5,-75c-10,-10 -20.3,-19.2 -31,-27.5s-21.5,-16 -32.5,-23 -22.3,-13.3 -34,-19S640.8,22 628.5,18 603.7,10.7 591,8s-25.5,-4.7 -38.5,-6S526,0 512,0c-32,0 -62.5,3.7 -91.5,11S363.7,29.5 337,44.5s-51.7,34.2 -75,57.5c-68,76 -102,159.3 -102,250 -12.7,25.3 -19,55.3 -19,90l0,6c-9.3,7.3 -17.8,15.8 -25.5,25.5s-14.3,19.7 -20,30 -10.3,20.2 -14,29.5S74,552.3 70,563c-18.7,58 -25,109.3 -19,154 3.3,24.7 10.7,45.2 22,61.5s25.3,27.8 42,34.5c2,0 6.3,1 13,3s11,3 13,3c-12.7,19.3 -19,40.7 -19,64 0,44 21.3,78.3 64,103 9.3,6 19.5,11.5 30.5,16.5s22.8,9 35.5,12 25.7,5.3 39,7c13.3,1.7 27.3,2.5 42,2.5 70.7,0 124,-15 160,-45l32,0C567,1009 620.3,1024 685,1024z"/>
|
||||||
|
</vector>
|
15
app/src/main/res/drawable/set_up.xml
Normal file
15
app/src/main/res/drawable/set_up.xml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:width="100dp"
|
||||||
|
android:height="100dp"
|
||||||
|
android:tint="@color/text"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M913.9,431.8c-4.9,-25.8 -20.7,-42.5 -40.9,-42.5l-3.5,0c-54.7,0 -99.2,-44.5 -99.2,-99.3 0,-17.3 8.3,-37 8.6,-37.8 10.1,-22.7 2.3,-50.6 -18.1,-64.9l-102.7,-57.2 -1.5,-0.7c-20.5,-8.9 -48.7,-3.2 -64,12.8 -11.1,11.4 -49.3,44 -78.5,44 -29.5,0 -67.8,-33.3 -79,-44.9 -15.3,-16.1 -43.1,-22.1 -63.9,-13.2l-106.4,58.3 -1.6,1c-20.4,14.2 -28.2,42.1 -18.2,64.7 0.3,0.8 8.7,20.4 8.7,37.9 0,54.7 -44.5,99.3 -99.2,99.3l-4.1,0c-19.6,0 -35.4,16.7 -40.3,42.5 -0.4,1.8 -8.6,45.4 -8.6,80.4 0,34.9 8.2,78.6 8.6,80.4 4.9,25.8 20.7,42.5 40.9,42.5l3.5,0c54.7,0 99.2,44.5 99.2,99.2 0,17.4 -8.3,37.1 -8.6,37.8 -10.1,22.8 -2.3,50.6 18,64.8l100.8,56.5 1.5,0.7c20.8,9.2 49,3.2 64.3,-13.5 14.1,-15.2 52.2,-46.8 80.2,-46.8 30.4,0 69.4,35.3 80.7,47.8 10.4,11.4 26.3,18.2 42.7,18.2 7.6,0 14.9,-1.5 21.5,-4.4l104.5,-57.6 1.5,-1c20.4,-14.3 28.2,-42.1 18.1,-64.7 -0.3,-0.8 -8.7,-20.4 -8.7,-37.9 0,-54.7 44.5,-99.2 99.2,-99.2l4.1,0c19.6,0 35.5,-16.7 40.4,-42.5 0.3,-1.8 8.6,-45.4 8.6,-80.4C922.5,477.3 914.3,433.6 913.9,431.8M863,512.3c0,22.6 -4.5,51.7 -6.6,63.8 -82.1,6.7 -145.7,75.3 -145.7,158.3 0,23.4 7.4,45.9 11.4,56.2l-89.1,49.2c-4.4,-4.6 -17.3,-17.6 -34.9,-30.8 -30.9,-22.9 -60.6,-34.6 -88.1,-34.6 -27.3,0 -56.7,11.4 -87.5,34.1 -17.5,12.8 -30.3,25.5 -34.8,30.2l-85.7,-48c4.2,-10.8 11.4,-33 11.4,-56.2 0,-83 -63.6,-151.6 -145.7,-158.3 -2.1,-12.1 -6.6,-41.2 -6.6,-63.8 0,-22.7 4.5,-51.7 6.6,-63.8 82.1,-6.7 145.7,-75.3 145.7,-158.3 0,-23.3 -7.4,-45.8 -11.4,-56.1l91.3,-50.2c4,4 17,16.7 34.8,29.4 30.4,21.7 59.3,32.6 86,32.6 26.5,0 55.2,-10.8 85.3,-32 18,-12.6 31,-25.2 34.7,-28.8l87.9,48.8c-4,10.2 -11.4,32.7 -11.4,56.2 0,83 63.6,151.6 145.7,158.3C858.5,460.6 863,489.8 863,512.3"
|
||||||
|
android:fillColor="#515151"
|
||||||
|
tools:ignore="VectorPath" />
|
||||||
|
<path
|
||||||
|
android:pathData="M510.2,365.6c-80.5,0 -146.1,65.5 -146.1,146.1 0,80.5 65.5,146 146.1,146 80.5,0 146.1,-65.5 146.1,-146C656.3,431.2 590.7,365.6 510.2,365.6M596.7,511.7c0,47.7 -38.8,86.5 -86.5,86.5 -47.7,0 -86.5,-38.8 -86.5,-86.5 0,-47.7 38.8,-86.5 86.5,-86.5C557.9,425.2 596.7,464 596.7,511.7"
|
||||||
|
android:fillColor="#515151"/>
|
||||||
|
</vector>
|
7
app/src/main/res/drawable/shape_sheet_dialog_bg.xml
Normal file
7
app/src/main/res/drawable/shape_sheet_dialog_bg.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="15dp"
|
||||||
|
android:topRightRadius="15dp" />
|
||||||
|
<solid android:color="@color/bj" />
|
||||||
|
</shape>
|
10
app/src/main/res/drawable/sousuo.xml
Normal file
10
app/src/main/res/drawable/sousuo.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="100dp"
|
||||||
|
android:width="100dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/text"
|
||||||
|
android:pathData="M15.5,14l-0.8,0l-0.3,-0.3c1,-1.1 1.6,-2.6 1.6,-4.2C16,5.9 13.1,3 9.5,3C5.9,3 3,5.9 3,9.5S5.9,16 9.5,16c1.6,0 3.1,-0.6 4.2,-1.6l0.3,0.3l0,0.8l5,5l1.5,-1.5L15.5,14zM9.5,14C7,14 5,12 5,9.5S7,5 9.5,5C12,5 14,7 14,9.5S12,14 9.5,14z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/start.xml
Normal file
9
app/src/main/res/drawable/start.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/background" />
|
||||||
|
<item android:top="88.0dip">
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center|top"
|
||||||
|
android:src="@mipmap/logo" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
9
app/src/main/res/drawable/syq.xml
Normal file
9
app/src/main/res/drawable/syq.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M256,224a32,32 0,0 1,32 32v512a32,32 0,0 1,-64 0L224,256a32,32 0,0 1,32 -32zM642,254.6a96,96 0,0 1,157.4 73.8v366.7a96,96 0,0 1,-157.4 73.8l-220,-183.4a96,96 0,0 1,0 -147.5zM728,307.9a32,32 0,0 0,-45.1 -4.1l-220,183.4a32,32 0,0 0,-4.1 4.1l-2.4,3.2a32,32 0,0 0,6.5 41.8l220,183.4a32,32 0,0 0,52.5 -24.6v-366.7a32,32 0,0 0,-7.4 -20.5z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ui_editview.xml
Normal file
9
app/src/main/res/drawable/ui_editview.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="26dp"/>
|
||||||
|
<stroke android:width="1dp" android:color="@color/text_tm"/>
|
||||||
|
<!-- 边框宽度和颜色 -->
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
9
app/src/main/res/drawable/user_end.xml
Normal file
9
app/src/main/res/drawable/user_end.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M768.8,702.2c-8,0 -16,-3.2 -22.4,-9.6 -12.8,-12.8 -12.8,-32 0,-44.7l137.4,-137.4 -137.3,-137.4c-12.8,-12.8 -12.8,-32 0,-44.7s32,-12.8 44.7,0L951,488.1c12.8,12.8 12.8,32 0,44.7L791.2,692.6c-6.4,6.4 -14.4,9.6 -22.4,9.6zM321.5,510.5c0,-17.6 14.4,-32 32,-32h559.2c17.6,0 32,14.4 32,32s-14.4,32 -32,32H353.5c-17.6,-0.1 -32,-14.4 -32,-32zM65.9,830V191c0,-52.7 43.1,-95.9 95.9,-95.9h351.5c52.7,0 95.9,43.1 95.9,95.9v127.8c0,17.6 -14.4,32 -32,32s-32,-14.4 -32,-32V191c0,-17.6 -14.4,-32 -32,-32H161.7c-17.6,0 -32,14.4 -32,32v639c0,17.6 14.4,32 32,32h351.5c17.6,0 32,-14.4 32,-32V702.2c0,-17.6 14.4,-32 32,-32s32,14.4 32,32V830c0,52.7 -43.1,95.9 -95.9,95.9H161.7c-52.7,0 -95.8,-43.1 -95.8,-95.9z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/xyq.xml
Normal file
9
app/src/main/res/drawable/xyq.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M768,224a32,32 0,0 1,32 32v512a32,32 0,0 1,-64 0L736,256a32,32 0,0 1,32 -32zM381.7,255.4l220,183.4a96,96 0,0 1,0 147.5l-220,183.4a96,96 0,0 1,-157.4 -73.8v-366.7a96,96 0,0 1,157.4 -73.8zM295.6,308.6a32,32 0,0 0,-7.4 20.5v366.7a32,32 0,0 0,52.5 24.6l220,-183.4a32,32 0,0 0,6.5 -41.8l-2.4,-3.3a32,32 0,0 0,-4.1 -4.1l-220,-183.4a32,32 0,0 0,-45.1 4.1z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/zt.xml
Normal file
9
app/src/main/res/drawable/zt.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M748.2,539.7L528,666.5 307.8,793.7c-14.9,8.8 -34.5,3.6 -43.3,-11.7 -2.9,-5 -4.1,-10.4 -4.1,-15.8h-0.5L259.9,257.6c0,-17.6 14.4,-31.6 32,-31.6 6.3,0 12.4,1.8 17.6,5.4L528,357.3 748.2,484.6c15.3,8.6 20.3,28.4 11.5,43.3 -2.9,5 -6.5,8.8 -11.5,11.7zM496.4,611.6l172.4,-99.9 -172.4,-99.5 -172.9,-99.5v398.7l172.9,-99.7z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
59
app/src/main/res/layout/activity_about_software.xml
Normal file
59
app/src/main/res/layout/activity_about_software.xml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".activity_about_software">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/about"/>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:src="@drawable/icon"
|
||||||
|
tools:ignore="ImageContrastCheck" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/hell"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:padding="16dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="6dp">
|
||||||
|
<Button
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/juanzeng"
|
||||||
|
android:textColor="@color/bj"
|
||||||
|
tools:ignore="VisualLintButtonSize" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
73
app/src/main/res/layout/activity_enroll.xml
Normal file
73
app/src/main/res/layout/activity_enroll.xml
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".login.user_logs">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="注册" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/user1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:hint="用户名/账号">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit_user"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textEmailAddress" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:hint="密码">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit_password"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/edit_cookie"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="绑定网易云音乐"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:layout_gravity="end"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/enroll"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:text="注册"
|
||||||
|
android:textColor="@color/bj" />
|
||||||
|
</LinearLayout>=
|
||||||
|
</LinearLayout>
|
49
app/src/main/res/layout/activity_home.xml
Normal file
49
app/src/main/res/layout/activity_home.xml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?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:id="@+id/home"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context=".home">
|
||||||
|
<androidx.drawerlayout.widget.DrawerLayout
|
||||||
|
android:id="@+id/chct"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/Playlist">
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
android:id="@+id/hdct"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:name="com.muqingbfq.fragment.gd"
|
||||||
|
tools:layout="@layout/fragment_gd" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/bfq_db"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<com.google.android.material.navigation.NavigationView
|
||||||
|
android:id="@+id/chb"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
app:headerLayout="@layout/fragment_sz"
|
||||||
|
app:itemTextColor="@color/text"
|
||||||
|
app:menu="@menu/sz"
|
||||||
|
tools:ignore="VisualLintBounds" />
|
||||||
|
</androidx.drawerlayout.widget.DrawerLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
22
app/src/main/res/layout/activity_llq.xml
Normal file
22
app/src/main/res/layout/activity_llq.xml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?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"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/webViewProgressBar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="6dp"
|
||||||
|
android:indeterminate="false"
|
||||||
|
android:max="100"
|
||||||
|
android:progressDrawable="@drawable/progress_bar_horizontal" />
|
||||||
|
<WebView
|
||||||
|
android:id="@+id/webview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</LinearLayout>
|
79
app/src/main/res/layout/activity_search.xml
Normal file
79
app/src/main/res/layout/activity_search.xml
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<?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:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".activity_search">
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:background="@drawable/ui_editview"
|
||||||
|
android:hint="@string/search"
|
||||||
|
android:imeOptions="actionSearch"
|
||||||
|
android:inputType="text"
|
||||||
|
android:minHeight="48dp"
|
||||||
|
android:paddingStart="3dp"
|
||||||
|
android:paddingEnd="3dp"
|
||||||
|
tools:ignore="TextContrastCheck,VisualLintTextFieldSize" />
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/xxbj1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/toolbar"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/xxbj2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="6dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/lishijilu"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/deleat"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/deleat"
|
||||||
|
android:src="@drawable/deleat" />
|
||||||
|
</LinearLayout>
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/list_recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_below="@id/xxbj2"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/search_fragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/search_recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/toolbar"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:background="@color/bj"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
51
app/src/main/res/layout/activity_sz.xml
Normal file
51
app/src/main/res/layout/activity_sz.xml
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".sz">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/sz" />
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="主题模式"
|
||||||
|
android:textSize="20dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/switch_a1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="根据系统" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/switch_a2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="26dp"
|
||||||
|
android:enabled="false"
|
||||||
|
android:text="深色模式" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
83
app/src/main/res/layout/activity_user_logs.xml
Normal file
83
app/src/main/res/layout/activity_user_logs.xml
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".login.user_logs">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/login" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/user1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_logo"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:src="@drawable/icon" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:hint="用户名/账号">
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit_user"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textEmailAddress" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:hint="密码">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit_password"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="登录"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="@color/bj" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/enroll"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:text="注册"
|
||||||
|
android:textColor="@color/bj" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
19
app/src/main/res/layout/activity_yc.xml
Normal file
19
app/src/main/res/layout/activity_yc.xml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<!-- activity_error.xml -->
|
||||||
|
<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="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="16dp"
|
||||||
|
tools:context=".yc">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/holo_red_dark"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
tools:text="出现异常" />
|
||||||
|
</LinearLayout>
|
19
app/src/main/res/layout/erweima.xml
Normal file
19
app/src/main/res/layout/erweima.xml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?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="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textSize="26sp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/icon" />
|
||||||
|
</LinearLayout>
|
47
app/src/main/res/layout/fragment_bflb_db.xml
Normal file
47
app/src/main/res/layout/fragment_bflb_db.xml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/bflb_db"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/shape_sheet_dialog_bg"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/xxbj"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="6dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/bflb"
|
||||||
|
android:textColor="@color/text" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sc"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/deleat" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.divider.MaterialDivider
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:dividerInsetStart="16dp"
|
||||||
|
app:dividerInsetEnd="16dp"/>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/lb"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
android:padding="6dp" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
156
app/src/main/res/layout/fragment_bfq.xml
Normal file
156
app/src/main/res/layout/fragment_bfq.xml
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/bfq"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/name"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/zz"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@string/zz" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
<com.dirror.lyricviewx.LyricViewX
|
||||||
|
android:id="@+id/gc"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:lrcCurrentTextColor="@color/text"
|
||||||
|
app:lrcNormalTextSize="16sp"
|
||||||
|
app:lrcPadding="16dp"
|
||||||
|
app:lrcTextSize="20sp"
|
||||||
|
app:lrcLabel="@string/app_name"
|
||||||
|
app:lrcTimelineTextColor="@color/text_tm"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/kp1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mttx"
|
||||||
|
android:layout_width="260dp"
|
||||||
|
android:layout_height="260dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@drawable/icon" />
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingStart="16dp">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/like"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@mipmap/like"
|
||||||
|
app:tint="@color/text" />
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="3dp"
|
||||||
|
android:paddingEnd="3dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/time_a"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/_00_00"/>
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/tdt"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clickable="true"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:focusable="true" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/time_b"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/_00_00"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingBottom="26dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/control"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginEnd="26dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/mt_sx" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/syq"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/syq" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/kg"
|
||||||
|
android:layout_width="46dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/zt" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/xyq"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/xyq" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/bfq_list_mp3"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="26dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/cd" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user