Showing
70 changed files
with
4406 additions
and
0 deletions
Too many changes to show.
To preserve performance only 70 of 70+ files are displayed.
.gitignore
0 → 100644
.idea/eclipseCodeFormatter.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="EclipseCodeFormatterProjectSettings"> | ||
| 4 | + <option name="projectSpecificProfile"> | ||
| 5 | + <ProjectSpecificProfile> | ||
| 6 | + <option name="formatter" value="ECLIPSE" /> | ||
| 7 | + <option name="importOrder" value="java;javax;org;android;androidx;com;" /> | ||
| 8 | + <option name="pathToConfigFileJava" value="$PROJECT_DIR$/config/CodeQuality/WonderTek_CodeFormatter_Convention_v1.0.xml" /> | ||
| 9 | + <option name="selectedJavaProfile" value="WonderTek_CodeFormatter_Convention_v1.0" /> | ||
| 10 | + </ProjectSpecificProfile> | ||
| 11 | + </option> | ||
| 12 | + </component> | ||
| 13 | +</project> |
.idea/vcs.xml
0 → 100644
app/.gitignore
0 → 100644
| 1 | +/build |
app/build.gradle
0 → 100644
| 1 | +plugins { | ||
| 2 | + id 'com.android.application' | ||
| 3 | + id 'kotlin-android' | ||
| 4 | + id 'kotlin-android-extensions' | ||
| 5 | +} | ||
| 6 | + | ||
| 7 | +android { | ||
| 8 | + compileSdkVersion var.compileSdkVersion | ||
| 9 | + buildToolsVersion var.buildToolsVersion | ||
| 10 | + | ||
| 11 | + defaultConfig { | ||
| 12 | + applicationId "com.example.myapplication" | ||
| 13 | + minSdkVersion var.minSdkVersion | ||
| 14 | + targetSdkVersion var.targetSdkVersion | ||
| 15 | + versionCode 1 | ||
| 16 | + versionName "1.0" | ||
| 17 | + | ||
| 18 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
| 19 | + multiDexEnabled true | ||
| 20 | + ndk { | ||
| 21 | + // noinspection ChromeOsAbiSupport | ||
| 22 | + abiFilters "armeabi-v7a", "arm64-v8a", "x86" | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + javaCompileOptions { | ||
| 26 | + annotationProcessorOptions { | ||
| 27 | + arguments = [AROUTER_MODULE_NAME: project.getName()] | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + buildTypes { | ||
| 33 | + release { | ||
| 34 | + minifyEnabled false | ||
| 35 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + lintOptions { | ||
| 40 | + abortOnError false | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + compileOptions { | ||
| 44 | + // Java兼容性设置为Java 8 | ||
| 45 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
| 46 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
| 47 | + } | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +repositories { | ||
| 51 | + flatDir { | ||
| 52 | + dirs 'libs' | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +dependencies { | ||
| 57 | +// implementation 'androidx.appcompat:appcompat:1.6.1' | ||
| 58 | + implementation "com.google.android.material:material:1.4.0" | ||
| 59 | +// implementation 'com.wd:startup:1.0.0' | ||
| 60 | +} |
app/proguard-rules.pro
0 → 100644
| 1 | +# Add project specific ProGuard rules here. | ||
| 2 | +# You can control the set of applied configuration files using the | ||
| 3 | +# proguardFiles setting in build.gradle. | ||
| 4 | +# | ||
| 5 | +# For more details, see | ||
| 6 | +# http://developer.android.com/guide/developing/tools/proguard.html | ||
| 7 | + | ||
| 8 | +# If your project uses WebView with JS, uncomment the following | ||
| 9 | +# and specify the fully qualified class name to the JavaScript interface | ||
| 10 | +# class: | ||
| 11 | +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| 12 | +# public *; | ||
| 13 | +#} | ||
| 14 | + | ||
| 15 | +# Uncomment this to preserve the line number information for | ||
| 16 | +# debugging stack traces. | ||
| 17 | +#-keepattributes SourceFile,LineNumberTable | ||
| 18 | + | ||
| 19 | +# If you keep the line number information, uncomment this to | ||
| 20 | +# hide the original source file name. | ||
| 21 | +#-renamesourcefileattribute SourceFile |
app/src/main/AndroidManifest.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + package="com.example.myapplication"> | ||
| 5 | + <!-- 请求网络 --> | ||
| 6 | + <uses-permission android:name="android.permission.INTERNET" /> | ||
| 7 | + <uses-feature | ||
| 8 | + android:name="android.software.leanback" | ||
| 9 | + android:required="false" /> | ||
| 10 | + <application | ||
| 11 | + android:name=".MyApplication" | ||
| 12 | + android:allowBackup="true" | ||
| 13 | + android:fullBackupContent="@xml/backup_rules" | ||
| 14 | + android:icon="@mipmap/ic_launcher" | ||
| 15 | + android:label="@string/app_name" | ||
| 16 | + android:roundIcon="@mipmap/ic_launcher_round" | ||
| 17 | + android:supportsRtl="true" | ||
| 18 | + android:theme="@style/Theme.MyApplication" | ||
| 19 | + tools:targetApi="31"> | ||
| 20 | + | ||
| 21 | + <activity | ||
| 22 | + android:name="com.example.myapplication.MainActivity" | ||
| 23 | + android:exported="true" | ||
| 24 | + android:launchMode="singleTask"> | ||
| 25 | + <intent-filter> | ||
| 26 | + <action android:name="android.intent.action.MAIN" /> | ||
| 27 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
| 28 | + </intent-filter> | ||
| 29 | + </activity> | ||
| 30 | + </application> | ||
| 31 | +</manifest> |
| 1 | + | ||
| 2 | +package com.example.myapplication; | ||
| 3 | + | ||
| 4 | +import android.app.Activity; | ||
| 5 | +import android.os.Bundle; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.Nullable; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @ProjectName: PeopleDailyVideo | ||
| 11 | + * @Package: com.people.displayui.main | ||
| 12 | + * @ClassName: WelcomeActivity | ||
| 13 | + * @Description: 启动APP过渡页面 | ||
| 14 | + * @Author: wd | ||
| 15 | + * @CreateDate: 2022/10/28 17:36 | ||
| 16 | + * @UpdateUser: wd | ||
| 17 | + * @UpdateDate: 2022/10/28 17:36 | ||
| 18 | + * @UpdateRemark: 更新说明: | ||
| 19 | + * @Version: 1.0 | ||
| 20 | + */ | ||
| 21 | +public class MainActivity extends Activity { | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
| 25 | + super.onCreate(savedInstanceState); | ||
| 26 | + // 直接进入首页 | ||
| 27 | + } | ||
| 28 | +} |
| 1 | + | ||
| 2 | +package com.example.myapplication; | ||
| 3 | + | ||
| 4 | +import android.app.Application; | ||
| 5 | +import android.util.Log; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author devel | ||
| 9 | + * @time 2024/8/28 星期三 16:23 | ||
| 10 | + */ | ||
| 11 | +public class MyApplication extends Application { | ||
| 12 | + @Override | ||
| 13 | + public void onCreate() { | ||
| 14 | + super.onCreate(); | ||
| 15 | + Log.e("zzzz","MyApplication onCreate"); | ||
| 16 | + // test | ||
| 17 | + } | ||
| 18 | +} |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:width="108dp" | ||
| 4 | + android:height="108dp" | ||
| 5 | + android:viewportWidth="108" | ||
| 6 | + android:viewportHeight="108"> | ||
| 7 | + <path | ||
| 8 | + android:fillColor="#3DDC84" | ||
| 9 | + android:pathData="M0,0h108v108h-108z" /> | ||
| 10 | + <path | ||
| 11 | + android:fillColor="#00000000" | ||
| 12 | + android:pathData="M9,0L9,108" | ||
| 13 | + android:strokeWidth="0.8" | ||
| 14 | + android:strokeColor="#33FFFFFF" /> | ||
| 15 | + <path | ||
| 16 | + android:fillColor="#00000000" | ||
| 17 | + android:pathData="M19,0L19,108" | ||
| 18 | + android:strokeWidth="0.8" | ||
| 19 | + android:strokeColor="#33FFFFFF" /> | ||
| 20 | + <path | ||
| 21 | + android:fillColor="#00000000" | ||
| 22 | + android:pathData="M29,0L29,108" | ||
| 23 | + android:strokeWidth="0.8" | ||
| 24 | + android:strokeColor="#33FFFFFF" /> | ||
| 25 | + <path | ||
| 26 | + android:fillColor="#00000000" | ||
| 27 | + android:pathData="M39,0L39,108" | ||
| 28 | + android:strokeWidth="0.8" | ||
| 29 | + android:strokeColor="#33FFFFFF" /> | ||
| 30 | + <path | ||
| 31 | + android:fillColor="#00000000" | ||
| 32 | + android:pathData="M49,0L49,108" | ||
| 33 | + android:strokeWidth="0.8" | ||
| 34 | + android:strokeColor="#33FFFFFF" /> | ||
| 35 | + <path | ||
| 36 | + android:fillColor="#00000000" | ||
| 37 | + android:pathData="M59,0L59,108" | ||
| 38 | + android:strokeWidth="0.8" | ||
| 39 | + android:strokeColor="#33FFFFFF" /> | ||
| 40 | + <path | ||
| 41 | + android:fillColor="#00000000" | ||
| 42 | + android:pathData="M69,0L69,108" | ||
| 43 | + android:strokeWidth="0.8" | ||
| 44 | + android:strokeColor="#33FFFFFF" /> | ||
| 45 | + <path | ||
| 46 | + android:fillColor="#00000000" | ||
| 47 | + android:pathData="M79,0L79,108" | ||
| 48 | + android:strokeWidth="0.8" | ||
| 49 | + android:strokeColor="#33FFFFFF" /> | ||
| 50 | + <path | ||
| 51 | + android:fillColor="#00000000" | ||
| 52 | + android:pathData="M89,0L89,108" | ||
| 53 | + android:strokeWidth="0.8" | ||
| 54 | + android:strokeColor="#33FFFFFF" /> | ||
| 55 | + <path | ||
| 56 | + android:fillColor="#00000000" | ||
| 57 | + android:pathData="M99,0L99,108" | ||
| 58 | + android:strokeWidth="0.8" | ||
| 59 | + android:strokeColor="#33FFFFFF" /> | ||
| 60 | + <path | ||
| 61 | + android:fillColor="#00000000" | ||
| 62 | + android:pathData="M0,9L108,9" | ||
| 63 | + android:strokeWidth="0.8" | ||
| 64 | + android:strokeColor="#33FFFFFF" /> | ||
| 65 | + <path | ||
| 66 | + android:fillColor="#00000000" | ||
| 67 | + android:pathData="M0,19L108,19" | ||
| 68 | + android:strokeWidth="0.8" | ||
| 69 | + android:strokeColor="#33FFFFFF" /> | ||
| 70 | + <path | ||
| 71 | + android:fillColor="#00000000" | ||
| 72 | + android:pathData="M0,29L108,29" | ||
| 73 | + android:strokeWidth="0.8" | ||
| 74 | + android:strokeColor="#33FFFFFF" /> | ||
| 75 | + <path | ||
| 76 | + android:fillColor="#00000000" | ||
| 77 | + android:pathData="M0,39L108,39" | ||
| 78 | + android:strokeWidth="0.8" | ||
| 79 | + android:strokeColor="#33FFFFFF" /> | ||
| 80 | + <path | ||
| 81 | + android:fillColor="#00000000" | ||
| 82 | + android:pathData="M0,49L108,49" | ||
| 83 | + android:strokeWidth="0.8" | ||
| 84 | + android:strokeColor="#33FFFFFF" /> | ||
| 85 | + <path | ||
| 86 | + android:fillColor="#00000000" | ||
| 87 | + android:pathData="M0,59L108,59" | ||
| 88 | + android:strokeWidth="0.8" | ||
| 89 | + android:strokeColor="#33FFFFFF" /> | ||
| 90 | + <path | ||
| 91 | + android:fillColor="#00000000" | ||
| 92 | + android:pathData="M0,69L108,69" | ||
| 93 | + android:strokeWidth="0.8" | ||
| 94 | + android:strokeColor="#33FFFFFF" /> | ||
| 95 | + <path | ||
| 96 | + android:fillColor="#00000000" | ||
| 97 | + android:pathData="M0,79L108,79" | ||
| 98 | + android:strokeWidth="0.8" | ||
| 99 | + android:strokeColor="#33FFFFFF" /> | ||
| 100 | + <path | ||
| 101 | + android:fillColor="#00000000" | ||
| 102 | + android:pathData="M0,89L108,89" | ||
| 103 | + android:strokeWidth="0.8" | ||
| 104 | + android:strokeColor="#33FFFFFF" /> | ||
| 105 | + <path | ||
| 106 | + android:fillColor="#00000000" | ||
| 107 | + android:pathData="M0,99L108,99" | ||
| 108 | + android:strokeWidth="0.8" | ||
| 109 | + android:strokeColor="#33FFFFFF" /> | ||
| 110 | + <path | ||
| 111 | + android:fillColor="#00000000" | ||
| 112 | + android:pathData="M19,29L89,29" | ||
| 113 | + android:strokeWidth="0.8" | ||
| 114 | + android:strokeColor="#33FFFFFF" /> | ||
| 115 | + <path | ||
| 116 | + android:fillColor="#00000000" | ||
| 117 | + android:pathData="M19,39L89,39" | ||
| 118 | + android:strokeWidth="0.8" | ||
| 119 | + android:strokeColor="#33FFFFFF" /> | ||
| 120 | + <path | ||
| 121 | + android:fillColor="#00000000" | ||
| 122 | + android:pathData="M19,49L89,49" | ||
| 123 | + android:strokeWidth="0.8" | ||
| 124 | + android:strokeColor="#33FFFFFF" /> | ||
| 125 | + <path | ||
| 126 | + android:fillColor="#00000000" | ||
| 127 | + android:pathData="M19,59L89,59" | ||
| 128 | + android:strokeWidth="0.8" | ||
| 129 | + android:strokeColor="#33FFFFFF" /> | ||
| 130 | + <path | ||
| 131 | + android:fillColor="#00000000" | ||
| 132 | + android:pathData="M19,69L89,69" | ||
| 133 | + android:strokeWidth="0.8" | ||
| 134 | + android:strokeColor="#33FFFFFF" /> | ||
| 135 | + <path | ||
| 136 | + android:fillColor="#00000000" | ||
| 137 | + android:pathData="M19,79L89,79" | ||
| 138 | + android:strokeWidth="0.8" | ||
| 139 | + android:strokeColor="#33FFFFFF" /> | ||
| 140 | + <path | ||
| 141 | + android:fillColor="#00000000" | ||
| 142 | + android:pathData="M29,19L29,89" | ||
| 143 | + android:strokeWidth="0.8" | ||
| 144 | + android:strokeColor="#33FFFFFF" /> | ||
| 145 | + <path | ||
| 146 | + android:fillColor="#00000000" | ||
| 147 | + android:pathData="M39,19L39,89" | ||
| 148 | + android:strokeWidth="0.8" | ||
| 149 | + android:strokeColor="#33FFFFFF" /> | ||
| 150 | + <path | ||
| 151 | + android:fillColor="#00000000" | ||
| 152 | + android:pathData="M49,19L49,89" | ||
| 153 | + android:strokeWidth="0.8" | ||
| 154 | + android:strokeColor="#33FFFFFF" /> | ||
| 155 | + <path | ||
| 156 | + android:fillColor="#00000000" | ||
| 157 | + android:pathData="M59,19L59,89" | ||
| 158 | + android:strokeWidth="0.8" | ||
| 159 | + android:strokeColor="#33FFFFFF" /> | ||
| 160 | + <path | ||
| 161 | + android:fillColor="#00000000" | ||
| 162 | + android:pathData="M69,19L69,89" | ||
| 163 | + android:strokeWidth="0.8" | ||
| 164 | + android:strokeColor="#33FFFFFF" /> | ||
| 165 | + <path | ||
| 166 | + android:fillColor="#00000000" | ||
| 167 | + android:pathData="M79,19L79,89" | ||
| 168 | + android:strokeWidth="0.8" | ||
| 169 | + android:strokeColor="#33FFFFFF" /> | ||
| 170 | +</vector> |
| 1 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + xmlns:aapt="http://schemas.android.com/aapt" | ||
| 3 | + android:width="108dp" | ||
| 4 | + android:height="108dp" | ||
| 5 | + android:viewportWidth="108" | ||
| 6 | + android:viewportHeight="108"> | ||
| 7 | + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
| 8 | + <aapt:attr name="android:fillColor"> | ||
| 9 | + <gradient | ||
| 10 | + android:endX="85.84757" | ||
| 11 | + android:endY="92.4963" | ||
| 12 | + android:startX="42.9492" | ||
| 13 | + android:startY="49.59793" | ||
| 14 | + android:type="linear"> | ||
| 15 | + <item | ||
| 16 | + android:color="#44000000" | ||
| 17 | + android:offset="0.0" /> | ||
| 18 | + <item | ||
| 19 | + android:color="#00000000" | ||
| 20 | + android:offset="1.0" /> | ||
| 21 | + </gradient> | ||
| 22 | + </aapt:attr> | ||
| 23 | + </path> | ||
| 24 | + <path | ||
| 25 | + android:fillColor="#FFFFFF" | ||
| 26 | + android:fillType="nonZero" | ||
| 27 | + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
| 28 | + android:strokeWidth="1" | ||
| 29 | + android:strokeColor="#00000000" /> | ||
| 30 | +</vector> |
app/src/main/res/layout/activity_main.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <background android:drawable="@drawable/ic_launcher_background" /> | ||
| 4 | + <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| 5 | + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| 6 | +</adaptive-icon> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <background android:drawable="@drawable/ic_launcher_background" /> | ||
| 4 | + <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| 5 | + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| 6 | +</adaptive-icon> |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
app/src/main/res/values/colors.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<resources> | ||
| 3 | + <color name="purple_200">#FFBB86FC</color> | ||
| 4 | + <color name="purple_500">#FF6200EE</color> | ||
| 5 | + <color name="purple_700">#FF3700B3</color> | ||
| 6 | + <color name="teal_200">#FF03DAC5</color> | ||
| 7 | + <color name="teal_700">#FF018786</color> | ||
| 8 | + <color name="black">#FF000000</color> | ||
| 9 | + <color name="white">#FFFFFFFF</color> | ||
| 10 | +</resources> |
app/src/main/res/values/strings.xml
0 → 100644
app/src/main/res/values/themes.xml
0 → 100644
| 1 | +<resources xmlns:tools="http://schemas.android.com/tools"> | ||
| 2 | + <!-- Base application theme. --> | ||
| 3 | + <style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
| 4 | + <!-- Primary brand color. --> | ||
| 5 | + <item name="colorPrimary">@color/purple_500</item> | ||
| 6 | + <item name="colorPrimaryVariant">@color/purple_700</item> | ||
| 7 | + <item name="colorOnPrimary">@color/white</item> | ||
| 8 | + <!-- Secondary brand color. --> | ||
| 9 | + <item name="colorSecondary">@color/teal_200</item> | ||
| 10 | + <item name="colorSecondaryVariant">@color/teal_700</item> | ||
| 11 | + <item name="colorOnSecondary">@color/black</item> | ||
| 12 | + <!-- Status bar color. --> | ||
| 13 | + <item name="android:statusBarColor">?attr/colorPrimaryVariant</item> | ||
| 14 | + <!-- Customize your theme here. --> | ||
| 15 | + </style> | ||
| 16 | +</resources> |
app/src/main/res/xml/backup_rules.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?><!-- | ||
| 2 | + Sample backup rules file; uncomment and customize as necessary. | ||
| 3 | + See https://developer.android.com/guide/topics/data/autobackup | ||
| 4 | + for details. | ||
| 5 | + Note: This file is ignored for devices older that API 31 | ||
| 6 | + See https://developer.android.com/about/versions/12/backup-restore | ||
| 7 | +--> | ||
| 8 | +<full-backup-content> | ||
| 9 | + <!-- | ||
| 10 | + <include domain="sharedpref" path="."/> | ||
| 11 | + <exclude domain="sharedpref" path="device.xml"/> | ||
| 12 | +--> | ||
| 13 | +</full-backup-content> |
build.gradle
0 → 100644
| 1 | +apply plugin: 'maven' | ||
| 2 | + | ||
| 3 | +buildscript { | ||
| 4 | + ext.kotlin_version = "1.4.32" | ||
| 5 | + repositories { | ||
| 6 | + mavenLocal() | ||
| 7 | + mavenCentral() | ||
| 8 | + // 以下四行代码为阿里gradle源,需要的人自己放開使用 | ||
| 9 | + maven { url 'https://maven.aliyun.com/repository/google' } | ||
| 10 | + maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } | ||
| 11 | + maven { url 'https://maven.aliyun.com/repository/public' } | ||
| 12 | + maven { url 'https://maven.aliyun.com/repository/jcenter' } | ||
| 13 | + maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' } | ||
| 14 | + //阿里云 maven | ||
| 15 | + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } | ||
| 16 | + maven { url 'https://maven.aliyun.com/repository/releases' } | ||
| 17 | + | ||
| 18 | + google() | ||
| 19 | + | ||
| 20 | + maven { url "https://jitpack.io" } | ||
| 21 | + //华为 | ||
| 22 | + maven { url 'https://developer.huawei.com/repo/' } | ||
| 23 | + //阿里云QuickTracking | ||
| 24 | + maven { url 'https://repo1.maven.org/maven2/' } | ||
| 25 | + | ||
| 26 | + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } | ||
| 27 | + maven { | ||
| 28 | + url 'https://maven.aliyun.com/nexus/content/repositories/google/' | ||
| 29 | + name 'aliyun-google' | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + // TingYun | ||
| 33 | + maven { url "https://nexus2.tingyun.com/nexus/content/repositories/snapshots/" } | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + dependencies { | ||
| 37 | + classpath "com.android.tools.build:gradle:4.0.2" | ||
| 38 | + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| 39 | + classpath 'com.billy.android:autoregister:1.4.2' | ||
| 40 | + // NOTE: Do not place your application dependencies here; they belong | ||
| 41 | + // in the individual module build.gradle files | ||
| 42 | + } | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +allprojects { | ||
| 46 | + repositories { | ||
| 47 | + mavenLocal() | ||
| 48 | + mavenCentral() | ||
| 49 | + // 以下四行代码为阿里gradle源,需要的人自己放開使用 | ||
| 50 | + maven { url 'https://maven.aliyun.com/repository/google' } | ||
| 51 | + maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } | ||
| 52 | + maven { url 'https://maven.aliyun.com/repository/public' } | ||
| 53 | + maven { url 'https://maven.aliyun.com/repository/jcenter' } | ||
| 54 | + maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' } | ||
| 55 | + //阿里云 maven | ||
| 56 | + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } | ||
| 57 | + maven { url 'https://maven.aliyun.com/repository/releases' } | ||
| 58 | + google() | ||
| 59 | + | ||
| 60 | + maven { url "https://jitpack.io" } | ||
| 61 | + //华为 | ||
| 62 | + maven { url 'https://developer.huawei.com/repo/' } | ||
| 63 | + //阿里云QuickTracking | ||
| 64 | + maven { url 'https://repo1.maven.org/maven2/' } | ||
| 65 | + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } | ||
| 66 | + maven { | ||
| 67 | + url 'https://maven.aliyun.com/nexus/content/repositories/google/' | ||
| 68 | + name 'aliyun-google' | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + flatDir { dirs 'src/main/libs' } | ||
| 72 | + | ||
| 73 | + // 快马私库 | ||
| 74 | + maven { | ||
| 75 | + credentials { | ||
| 76 | + username '6708d1cf6f4c940bd257c88d' | ||
| 77 | + password 'Wm51gc4rARyr' | ||
| 78 | + } | ||
| 79 | + url 'https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom' | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + project.configurations.configureEach { | ||
| 84 | + resolutionStrategy.eachDependency { details -> | ||
| 85 | + if (details.requested.group == 'com.android.android.support' && !details.requested.name.contains('multidex')) { | ||
| 86 | + details.useVersion "28.0.0" | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + // 强制依赖 | ||
| 93 | + configurations.configureEach { | ||
| 94 | + exclude group: 'com.alipay.android.phone.thirdparty', module: 'securityguard-build' | ||
| 95 | + resolutionStrategy { | ||
| 96 | + force 'androidx.activity:activity:1.2.1' | ||
| 97 | + force 'androidx.annotation:annotation:1.1.0' | ||
| 98 | + force 'androidx.appcompat:appcompat:1.2.0' | ||
| 99 | + force 'androidx.arch.core:core-common:2.1.0' | ||
| 100 | + force 'androidx.arch.core:core-runtime:2.1.0' | ||
| 101 | + force 'androidx.core:core-ktx:1.6.0' | ||
| 102 | + force 'androidx.core:core:1.5.0' | ||
| 103 | + force 'androidx.collection:collection:1.1.0' | ||
| 104 | + force 'androidx.constraintlayout:constraintlayout:2.0.4' | ||
| 105 | + force 'androidx.constraintlayout:constraintlayout-solver:2.0.4' | ||
| 106 | + force 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' | ||
| 107 | + force 'androidx.fragment:fragment:1.3.1' | ||
| 108 | + force 'androidx.lifecycle:lifecycle-common:2.3.0' | ||
| 109 | + force 'androidx.multidex:multidex:2.0.1' | ||
| 110 | + force 'androidx.recyclerview:recyclerview:1.2.0' | ||
| 111 | + force 'androidx.vectordrawable:vectordrawable:1.1.0' | ||
| 112 | + force 'androidx.vectordrawable:vectordrawable-animated:1.1.0' | ||
| 113 | + force 'com.squareup.okhttp3:okhttp:4.9.1' | ||
| 114 | + force 'com.squareup.okio:okio:2.7.0' | ||
| 115 | + force 'org.jetbrains.kotlin:kotlin-stdlib:1.4.32' | ||
| 116 | + force 'org.jetbrains.kotlin:kotilin-stdlib-jdk8:1.4.32' | ||
| 117 | + force 'org.jetbrains:annotations:15.0' | ||
| 118 | + force 'net.sf.proguard:proguard-base:6.1.0' | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | +ext { | ||
| 124 | + var = [ | ||
| 125 | + // SDK And Tools | ||
| 126 | + applicationId : "com.wondertek.dss", | ||
| 127 | + minSdkVersion : 25, | ||
| 128 | + targetSdkVersion : 30, | ||
| 129 | + compileSdkVersion: 30, | ||
| 130 | + buildToolsVersion: "30.0.3", | ||
| 131 | + // 版本号,正式版本 1.0.0 1000080 后两位,80即标识为发布版本 | ||
| 132 | + // 测试版本 1.0.0_TF1 1000001 后两位,01即为测试版本号,01-79 | ||
| 133 | + // 升级版本 1.0.0_RC1 1000081 后两位,81即为升级版本号,81-99 | ||
| 134 | + versionName : "1.0.0", // release正式 | ||
| 135 | + debugVnName : "", // debug开发模式 用于区分debug模式下上报的日志 | ||
| 136 | + versionCode : 100, | ||
| 137 | + //此版本号是SDK版本,不能随便改 | ||
| 138 | + aar_version : "1.0.0", | ||
| 139 | + ] | ||
| 140 | + | ||
| 141 | +} |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | +<profiles version="12"> | ||
| 3 | + <profile kind="CodeFormatterProfile" name="WonderTek_CodeFormatter_Convention_v1.0" | ||
| 4 | + version="12"> | ||
| 5 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" /> | ||
| 6 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" | ||
| 7 | + value="insert" /> | ||
| 8 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" | ||
| 9 | + value="insert" /> | ||
| 10 | + <setting | ||
| 11 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" | ||
| 12 | + value="do not insert" /> | ||
| 13 | + <setting | ||
| 14 | + id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" | ||
| 15 | + value="insert" /> | ||
| 16 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" | ||
| 17 | + value="common_lines" /> | ||
| 18 | + <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" | ||
| 19 | + value="true" /> | ||
| 20 | + <setting | ||
| 21 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" | ||
| 22 | + value="insert" /> | ||
| 23 | + <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" | ||
| 24 | + value="do not insert" /> | ||
| 25 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" | ||
| 26 | + value="insert" /> | ||
| 27 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" | ||
| 28 | + value="common_lines" /> | ||
| 29 | + <setting | ||
| 30 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" | ||
| 31 | + value="do not insert" /> | ||
| 32 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1" /> | ||
| 33 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" | ||
| 34 | + value="do not insert" /> | ||
| 35 | + <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" | ||
| 36 | + value="insert" /> | ||
| 37 | + <setting | ||
| 38 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" | ||
| 39 | + value="do not insert" /> | ||
| 40 | + <setting | ||
| 41 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" | ||
| 42 | + value="do not insert" /> | ||
| 43 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" | ||
| 44 | + value="common_lines" /> | ||
| 45 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true" /> | ||
| 46 | + <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4" /> | ||
| 47 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" | ||
| 48 | + value="do not insert" /> | ||
| 49 | + <setting | ||
| 50 | + id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" | ||
| 51 | + value="common_lines" /> | ||
| 52 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" | ||
| 53 | + value="insert" /> | ||
| 54 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" | ||
| 55 | + value="insert" /> | ||
| 56 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" | ||
| 57 | + value="do not insert" /> | ||
| 58 | + <setting | ||
| 59 | + id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" | ||
| 60 | + value="do not insert" /> | ||
| 61 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" | ||
| 62 | + value="insert" /> | ||
| 63 | + <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off" /> | ||
| 64 | + <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1" /> | ||
| 65 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="49" /> | ||
| 66 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1" /> | ||
| 67 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" /> | ||
| 68 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" | ||
| 69 | + value="insert" /> | ||
| 70 | + <setting | ||
| 71 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" | ||
| 72 | + value="insert" /> | ||
| 73 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" | ||
| 74 | + value="common_lines" /> | ||
| 75 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" | ||
| 76 | + value="16" /> | ||
| 77 | + <setting | ||
| 78 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" | ||
| 79 | + value="do not insert" /> | ||
| 80 | + <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true" /> | ||
| 81 | + <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" | ||
| 82 | + value="true" /> | ||
| 83 | + <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on" /> | ||
| 84 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" | ||
| 85 | + value="insert" /> | ||
| 86 | + <setting | ||
| 87 | + id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" | ||
| 88 | + value="insert" /> | ||
| 89 | + <setting | ||
| 90 | + id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" | ||
| 91 | + value="20" /> | ||
| 92 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" | ||
| 93 | + value="do not insert" /> | ||
| 94 | + <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" | ||
| 95 | + value="false" /> | ||
| 96 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" | ||
| 97 | + value="insert" /> | ||
| 98 | + <setting | ||
| 99 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" | ||
| 100 | + value="insert" /> | ||
| 101 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" | ||
| 102 | + value="insert" /> | ||
| 103 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" | ||
| 104 | + value="do not insert" /> | ||
| 105 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" | ||
| 106 | + value="1" /> | ||
| 107 | + <setting | ||
| 108 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" | ||
| 109 | + value="do not insert" /> | ||
| 110 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" | ||
| 111 | + value="do not insert" /> | ||
| 112 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" | ||
| 113 | + value="do not insert" /> | ||
| 114 | + <setting | ||
| 115 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" | ||
| 116 | + value="do not insert" /> | ||
| 117 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" | ||
| 118 | + value="insert" /> | ||
| 119 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" | ||
| 120 | + value="do not insert" /> | ||
| 121 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" | ||
| 122 | + value="16" /> | ||
| 123 | + <setting | ||
| 124 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" | ||
| 125 | + value="insert" /> | ||
| 126 | + <setting | ||
| 127 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" | ||
| 128 | + value="do not insert" /> | ||
| 129 | + <setting | ||
| 130 | + id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" | ||
| 131 | + value="insert" /> | ||
| 132 | + <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" | ||
| 133 | + value="false" /> | ||
| 134 | + <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error" /> | ||
| 135 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" | ||
| 136 | + value="insert" /> | ||
| 137 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" | ||
| 138 | + value="insert" /> | ||
| 139 | + <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" | ||
| 140 | + value="true" /> | ||
| 141 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" | ||
| 142 | + value="end_of_line" /> | ||
| 143 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" | ||
| 144 | + value="do not insert" /> | ||
| 145 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" | ||
| 146 | + value="do not insert" /> | ||
| 147 | + <setting | ||
| 148 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" | ||
| 149 | + value="do not insert" /> | ||
| 150 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" | ||
| 151 | + value="insert" /> | ||
| 152 | + <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120" /> | ||
| 153 | + <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false" /> | ||
| 154 | + <setting | ||
| 155 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" | ||
| 156 | + value="do not insert" /> | ||
| 157 | + <setting | ||
| 158 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" | ||
| 159 | + value="insert" /> | ||
| 160 | + <setting | ||
| 161 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" | ||
| 162 | + value="do not insert" /> | ||
| 163 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" | ||
| 164 | + value="insert" /> | ||
| 165 | + <setting | ||
| 166 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" | ||
| 167 | + value="insert" /> | ||
| 168 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" | ||
| 169 | + value="do not insert" /> | ||
| 170 | + <setting | ||
| 171 | + id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" | ||
| 172 | + value="true" /> | ||
| 173 | + <setting | ||
| 174 | + id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" | ||
| 175 | + value="insert" /> | ||
| 176 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" | ||
| 177 | + value="end_of_line" /> | ||
| 178 | + <setting | ||
| 179 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" | ||
| 180 | + value="do not insert" /> | ||
| 181 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" | ||
| 182 | + value="16" /> | ||
| 183 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" | ||
| 184 | + value="insert" /> | ||
| 185 | + <setting | ||
| 186 | + id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" | ||
| 187 | + value="0" /> | ||
| 188 | + <setting | ||
| 189 | + id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" | ||
| 190 | + value="insert" /> | ||
| 191 | + <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" | ||
| 192 | + value="false" /> | ||
| 193 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16" /> | ||
| 194 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" | ||
| 195 | + value="common_lines" /> | ||
| 196 | + <setting | ||
| 197 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" | ||
| 198 | + value="insert" /> | ||
| 199 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" | ||
| 200 | + value="do not insert" /> | ||
| 201 | + <setting | ||
| 202 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" | ||
| 203 | + value="insert" /> | ||
| 204 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" | ||
| 205 | + value="do not insert" /> | ||
| 206 | + <setting | ||
| 207 | + id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" | ||
| 208 | + value="16" /> | ||
| 209 | + <setting | ||
| 210 | + id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" | ||
| 211 | + value="true" /> | ||
| 212 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" | ||
| 213 | + value="insert" /> | ||
| 214 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" | ||
| 215 | + value="do not insert" /> | ||
| 216 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" | ||
| 217 | + value="insert" /> | ||
| 218 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line" /> | ||
| 219 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" | ||
| 220 | + value="end_of_line" /> | ||
| 221 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" | ||
| 222 | + value="end_of_line" /> | ||
| 223 | + <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true" /> | ||
| 224 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" | ||
| 225 | + value="do not insert" /> | ||
| 226 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" | ||
| 227 | + value="insert" /> | ||
| 228 | + <setting | ||
| 229 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" | ||
| 230 | + value="do not insert" /> | ||
| 231 | + <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true" /> | ||
| 232 | + <setting | ||
| 233 | + id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" | ||
| 234 | + value="20" /> | ||
| 235 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16" /> | ||
| 236 | + <setting | ||
| 237 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" | ||
| 238 | + value="insert" /> | ||
| 239 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" | ||
| 240 | + value="16" /> | ||
| 241 | + <setting | ||
| 242 | + id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" | ||
| 243 | + value="20" /> | ||
| 244 | + <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error" /> | ||
| 245 | + <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" | ||
| 246 | + value="true" /> | ||
| 247 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" | ||
| 248 | + value="do not insert" /> | ||
| 249 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" | ||
| 250 | + value="insert" /> | ||
| 251 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" | ||
| 252 | + value="do not insert" /> | ||
| 253 | + <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" | ||
| 254 | + value="true" /> | ||
| 255 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" | ||
| 256 | + value="insert" /> | ||
| 257 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" | ||
| 258 | + value="insert" /> | ||
| 259 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" | ||
| 260 | + value="do not insert" /> | ||
| 261 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" | ||
| 262 | + value="20" /> | ||
| 263 | + <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" | ||
| 264 | + value="true" /> | ||
| 265 | + <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1" /> | ||
| 266 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" | ||
| 267 | + value="common_lines" /> | ||
| 268 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" | ||
| 269 | + value="insert" /> | ||
| 270 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" | ||
| 271 | + value="do not insert" /> | ||
| 272 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" | ||
| 273 | + value="do not insert" /> | ||
| 274 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" | ||
| 275 | + value="insert" /> | ||
| 276 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" | ||
| 277 | + value="do not insert" /> | ||
| 278 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" | ||
| 279 | + value="do not insert" /> | ||
| 280 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" | ||
| 281 | + value="insert" /> | ||
| 282 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" | ||
| 283 | + value="insert" /> | ||
| 284 | + <setting | ||
| 285 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" | ||
| 286 | + value="do not insert" /> | ||
| 287 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true" /> | ||
| 288 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" | ||
| 289 | + value="insert" /> | ||
| 290 | + <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false" /> | ||
| 291 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="20" /> | ||
| 292 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" | ||
| 293 | + value="insert" /> | ||
| 294 | + <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" | ||
| 295 | + value="true" /> | ||
| 296 | + <setting | ||
| 297 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" | ||
| 298 | + value="do not insert" /> | ||
| 299 | + <setting | ||
| 300 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" | ||
| 301 | + value="do not insert" /> | ||
| 302 | + <setting | ||
| 303 | + id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" | ||
| 304 | + value="16" /> | ||
| 305 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" | ||
| 306 | + value="0" /> | ||
| 307 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" | ||
| 308 | + value="16" /> | ||
| 309 | + <setting | ||
| 310 | + id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" | ||
| 311 | + value="do not insert" /> | ||
| 312 | + <setting | ||
| 313 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" | ||
| 314 | + value="do not insert" /> | ||
| 315 | + <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" | ||
| 316 | + value="false" /> | ||
| 317 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" | ||
| 318 | + value="insert" /> | ||
| 319 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" | ||
| 320 | + value="insert" /> | ||
| 321 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" | ||
| 322 | + value="insert" /> | ||
| 323 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" | ||
| 324 | + value="end_of_line" /> | ||
| 325 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" | ||
| 326 | + value="end_of_line" /> | ||
| 327 | + <setting | ||
| 328 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" | ||
| 329 | + value="do not insert" /> | ||
| 330 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false" /> | ||
| 331 | + <setting | ||
| 332 | + id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" | ||
| 333 | + value="16" /> | ||
| 334 | + <setting | ||
| 335 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" | ||
| 336 | + value="do not insert" /> | ||
| 337 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" | ||
| 338 | + value="insert" /> | ||
| 339 | + <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled" /> | ||
| 340 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" | ||
| 341 | + value="do not insert" /> | ||
| 342 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16" /> | ||
| 343 | + <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true" /> | ||
| 344 | + <setting | ||
| 345 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" | ||
| 346 | + value="do not insert" /> | ||
| 347 | + <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" | ||
| 348 | + value="true" /> | ||
| 349 | + <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" | ||
| 350 | + value="true" /> | ||
| 351 | + <setting | ||
| 352 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" | ||
| 353 | + value="do not insert" /> | ||
| 354 | + <setting | ||
| 355 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" | ||
| 356 | + value="do not insert" /> | ||
| 357 | + <setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" | ||
| 358 | + value="2147483647" /> | ||
| 359 | + <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" | ||
| 360 | + value="true" /> | ||
| 361 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" | ||
| 362 | + value="end_of_line" /> | ||
| 363 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" | ||
| 364 | + value="insert" /> | ||
| 365 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="16" /> | ||
| 366 | + <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" | ||
| 367 | + value="false" /> | ||
| 368 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" | ||
| 369 | + value="common_lines" /> | ||
| 370 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" | ||
| 371 | + value="80" /> | ||
| 372 | + <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" | ||
| 373 | + value="false" /> | ||
| 374 | + <setting id="org.eclipse.jdt.core.compiler.source" value="1.8" /> | ||
| 375 | + <setting | ||
| 376 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" | ||
| 377 | + value="do not insert" /> | ||
| 378 | + <setting | ||
| 379 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" | ||
| 380 | + value="insert" /> | ||
| 381 | + <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" /> | ||
| 382 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" | ||
| 383 | + value="insert" /> | ||
| 384 | + <setting | ||
| 385 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" | ||
| 386 | + value="insert" /> | ||
| 387 | + <setting | ||
| 388 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" | ||
| 389 | + value="do not insert" /> | ||
| 390 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" | ||
| 391 | + value="insert" /> | ||
| 392 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true" /> | ||
| 393 | + <setting | ||
| 394 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" | ||
| 395 | + value="insert" /> | ||
| 396 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" | ||
| 397 | + value="do not insert" /> | ||
| 398 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" | ||
| 399 | + value="insert" /> | ||
| 400 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1" /> | ||
| 401 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" | ||
| 402 | + value="do not insert" /> | ||
| 403 | + <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" | ||
| 404 | + value="1" /> | ||
| 405 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" | ||
| 406 | + value="do not insert" /> | ||
| 407 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1" /> | ||
| 408 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" | ||
| 409 | + value="16" /> | ||
| 410 | + <setting | ||
| 411 | + id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" | ||
| 412 | + value="16" /> | ||
| 413 | + <setting | ||
| 414 | + id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" | ||
| 415 | + value="insert" /> | ||
| 416 | + <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" | ||
| 417 | + value="false" /> | ||
| 418 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" | ||
| 419 | + value="do not insert" /> | ||
| 420 | + <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8" /> | ||
| 421 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" | ||
| 422 | + value="end_of_line" /> | ||
| 423 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" | ||
| 424 | + value="do not insert" /> | ||
| 425 | + <setting | ||
| 426 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" | ||
| 427 | + value="insert" /> | ||
| 428 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" | ||
| 429 | + value="do not insert" /> | ||
| 430 | + <setting | ||
| 431 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" | ||
| 432 | + value="do not insert" /> | ||
| 433 | + <setting | ||
| 434 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" | ||
| 435 | + value="do not insert" /> | ||
| 436 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true" /> | ||
| 437 | + <setting | ||
| 438 | + id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" | ||
| 439 | + value="do not insert" /> | ||
| 440 | + <setting | ||
| 441 | + id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" | ||
| 442 | + value="insert" /> | ||
| 443 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" | ||
| 444 | + value="common_lines" /> | ||
| 445 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16" /> | ||
| 446 | + <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false" /> | ||
| 447 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16" /> | ||
| 448 | + <setting | ||
| 449 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" | ||
| 450 | + value="do not insert" /> | ||
| 451 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" | ||
| 452 | + value="do not insert" /> | ||
| 453 | + <setting | ||
| 454 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" | ||
| 455 | + value="do not insert" /> | ||
| 456 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" | ||
| 457 | + value="16" /> | ||
| 458 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" | ||
| 459 | + value="do not insert" /> | ||
| 460 | + <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" | ||
| 461 | + value="true" /> | ||
| 462 | + <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" | ||
| 463 | + value="true" /> | ||
| 464 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" | ||
| 465 | + value="do not insert" /> | ||
| 466 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" | ||
| 467 | + value="insert" /> | ||
| 468 | + <setting | ||
| 469 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" | ||
| 470 | + value="do not insert" /> | ||
| 471 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1" /> | ||
| 472 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" | ||
| 473 | + value="do not insert" /> | ||
| 474 | + <setting | ||
| 475 | + id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" | ||
| 476 | + value="true" /> | ||
| 477 | + <setting | ||
| 478 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" | ||
| 479 | + value="do not insert" /> | ||
| 480 | + <setting | ||
| 481 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" | ||
| 482 | + value="do not insert" /> | ||
| 483 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" | ||
| 484 | + value="insert" /> | ||
| 485 | + <setting | ||
| 486 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" | ||
| 487 | + value="do not insert" /> | ||
| 488 | + <setting | ||
| 489 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" | ||
| 490 | + value="do not insert" /> | ||
| 491 | + <setting | ||
| 492 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" | ||
| 493 | + value="do not insert" /> | ||
| 494 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" | ||
| 495 | + value="do not insert" /> | ||
| 496 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" | ||
| 497 | + value="insert" /> | ||
| 498 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1" /> | ||
| 499 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" | ||
| 500 | + value="do not insert" /> | ||
| 501 | + <setting | ||
| 502 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" | ||
| 503 | + value="do not insert" /> | ||
| 504 | + <setting | ||
| 505 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" | ||
| 506 | + value="do not insert" /> | ||
| 507 | + <setting | ||
| 508 | + id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" | ||
| 509 | + value="16" /> | ||
| 510 | + <setting | ||
| 511 | + id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" | ||
| 512 | + value="do not insert" /> | ||
| 513 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" | ||
| 514 | + value="insert" /> | ||
| 515 | + <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true" /> | ||
| 516 | + <setting | ||
| 517 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" | ||
| 518 | + value="do not insert" /> | ||
| 519 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" | ||
| 520 | + value="do not insert" /> | ||
| 521 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" | ||
| 522 | + value="do not insert" /> | ||
| 523 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" | ||
| 524 | + value="do not insert" /> | ||
| 525 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" | ||
| 526 | + value="do not insert" /> | ||
| 527 | + <setting | ||
| 528 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" | ||
| 529 | + value="do not insert" /> | ||
| 530 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" | ||
| 531 | + value="do not insert" /> | ||
| 532 | + <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true" /> | ||
| 533 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" | ||
| 534 | + value="insert" /> | ||
| 535 | + <setting | ||
| 536 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" | ||
| 537 | + value="do not insert" /> | ||
| 538 | + <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false" /> | ||
| 539 | + <setting | ||
| 540 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" | ||
| 541 | + value="insert" /> | ||
| 542 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" | ||
| 543 | + value="16" /> | ||
| 544 | + <setting | ||
| 545 | + id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" | ||
| 546 | + value="do not insert" /> | ||
| 547 | + <setting | ||
| 548 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" | ||
| 549 | + value="do not insert" /> | ||
| 550 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" | ||
| 551 | + value="do not insert" /> | ||
| 552 | + <setting | ||
| 553 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" | ||
| 554 | + value="insert" /> | ||
| 555 | + <setting | ||
| 556 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" | ||
| 557 | + value="do not insert" /> | ||
| 558 | + <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" | ||
| 559 | + value="true" /> | ||
| 560 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16" /> | ||
| 561 | + <setting | ||
| 562 | + id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" | ||
| 563 | + value="insert" /> | ||
| 564 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" | ||
| 565 | + value="do not insert" /> | ||
| 566 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" | ||
| 567 | + value="end_of_line" /> | ||
| 568 | + <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true" /> | ||
| 569 | + <setting | ||
| 570 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" | ||
| 571 | + value="insert" /> | ||
| 572 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" | ||
| 573 | + value="insert" /> | ||
| 574 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" | ||
| 575 | + value="do not insert" /> | ||
| 576 | + <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8" /> | ||
| 577 | + <setting | ||
| 578 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" | ||
| 579 | + value="do not insert" /> | ||
| 580 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" | ||
| 581 | + value="insert" /> | ||
| 582 | + <setting | ||
| 583 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" | ||
| 584 | + value="do not insert" /> | ||
| 585 | + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" | ||
| 586 | + value="common_lines" /> | ||
| 587 | + <setting | ||
| 588 | + id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" | ||
| 589 | + value="do not insert" /> | ||
| 590 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" | ||
| 591 | + value="do not insert" /> | ||
| 592 | + <setting | ||
| 593 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" | ||
| 594 | + value="do not insert" /> | ||
| 595 | + <setting | ||
| 596 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" | ||
| 597 | + value="insert" /> | ||
| 598 | + <setting | ||
| 599 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" | ||
| 600 | + value="do not insert" /> | ||
| 601 | + <setting | ||
| 602 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" | ||
| 603 | + value="do not insert" /> | ||
| 604 | + <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" | ||
| 605 | + value="true" /> | ||
| 606 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" | ||
| 607 | + value="insert" /> | ||
| 608 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" | ||
| 609 | + value="end_of_line" /> | ||
| 610 | + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" | ||
| 611 | + value="end_of_line" /> | ||
| 612 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1" /> | ||
| 613 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" | ||
| 614 | + value="insert" /> | ||
| 615 | + <setting | ||
| 616 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" | ||
| 617 | + value="insert" /> | ||
| 618 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" | ||
| 619 | + value="do not insert" /> | ||
| 620 | + <setting | ||
| 621 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" | ||
| 622 | + value="do not insert" /> | ||
| 623 | + <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" | ||
| 624 | + value="16" /> | ||
| 625 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" | ||
| 626 | + value="do not insert" /> | ||
| 627 | + <setting | ||
| 628 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" | ||
| 629 | + value="do not insert" /> | ||
| 630 | + <setting | ||
| 631 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" | ||
| 632 | + value="do not insert" /> | ||
| 633 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" | ||
| 634 | + value="do not insert" /> | ||
| 635 | + <setting | ||
| 636 | + id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" | ||
| 637 | + value="do not insert" /> | ||
| 638 | + <setting | ||
| 639 | + id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" | ||
| 640 | + value="true" /> | ||
| 641 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" | ||
| 642 | + value="insert" /> | ||
| 643 | + <setting | ||
| 644 | + id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" | ||
| 645 | + value="insert" /> | ||
| 646 | + <setting | ||
| 647 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" | ||
| 648 | + value="do not insert" /> | ||
| 649 | + <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false" /> | ||
| 650 | + <setting | ||
| 651 | + id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" | ||
| 652 | + value="do not insert" /> | ||
| 653 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" | ||
| 654 | + value="insert" /> | ||
| 655 | + <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" | ||
| 656 | + value="false" /> | ||
| 657 | + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" | ||
| 658 | + value="do not insert" /> | ||
| 659 | + <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" /> | ||
| 660 | + <setting | ||
| 661 | + id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" | ||
| 662 | + value="do not insert" /> | ||
| 663 | + <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1" /> | ||
| 664 | + <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" /> | ||
| 665 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" | ||
| 666 | + value="do not insert" /> | ||
| 667 | + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" | ||
| 668 | + value="insert" /> | ||
| 669 | + </profile> | ||
| 670 | +</profiles> |
gradle.properties
0 → 100644
| 1 | +# Project-wide Gradle settings. | ||
| 2 | +# IDE (e.g. Android Studio) users: | ||
| 3 | +# Gradle settings configured through the IDE *will override* | ||
| 4 | +# any settings specified in this file. | ||
| 5 | +# For more details on how to configure your build environment visit | ||
| 6 | +# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
| 7 | +# Specifies the JVM arguments used for the daemon process. | ||
| 8 | +# The setting is particularly useful for tweaking memory settings. | ||
| 9 | +#org.gradle.jvmargs=-Xmx2048m | ||
| 10 | +# When configured, Gradle will run in incubating parallel mode. | ||
| 11 | +# This option should only be used with decoupled projects. More details, visit | ||
| 12 | +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
| 13 | +# org.gradle.parallel=true | ||
| 14 | +# AndroidX package structure to make it clearer which packages are bundled with the | ||
| 15 | +# Android operating system, and which are packaged with your app's APK | ||
| 16 | +# https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
| 17 | +android.useAndroidX=true | ||
| 18 | +# Automatically convert third-party libraries to use AndroidX | ||
| 19 | +android.enableJetifier=true | ||
| 20 | +android.enableResourceOptimizations=false | ||
| 21 | +#建议您关闭 R8 后再进行混淆 | ||
| 22 | +android.enableR8=false | ||
| 23 | +android.enableR8.libraries=false | ||
| 24 | +# 如果使用最新稳定版本 Android Studio 3.5 或以上,那么您需要在 gradle.properties 里面新增 | ||
| 25 | +android.buildOnlyTargetAbi=false | ||
| 26 | +#网络请求接口版本 202204151851 | ||
| 27 | +requestVersion=107 | ||
| 28 | +#设置组件是否作为app还是lib,true是lib ,false 是app | ||
| 29 | +#分享 | ||
| 30 | +isShareModule=true | ||
| 31 | +#播放器 | ||
| 32 | +isPlayerModule=true | ||
| 33 | +#是否直播模块运行 false可以单独运行 | ||
| 34 | +isLiveModule=true | ||
| 35 | +org.gradle.daemon=true | ||
| 36 | +org.gradle.parallel=true | ||
| 37 | +org.gradle.configureondemand=true | ||
| 38 | +org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
| 39 | +# Kotlin code style for this project: "official" or "obsolete": | ||
| 40 | +kotlin.code.style=official | ||
| 41 | +# Enables namespacing of each library's R class so that its R class includes only the | ||
| 42 | +# resources declared in the library itself and none from the library's dependencies, | ||
| 43 | +# thereby reducing the size of the R class for that library | ||
| 44 | +#android.nonTransitiveRClass=true | ||
| 45 | + | ||
| 46 | + |
gradle/wrapper/gradle-wrapper.jar
0 → 100644
No preview for this file type
gradle/wrapper/gradle-wrapper.properties
0 → 100644
gradlew
0 → 100644
| 1 | +#!/usr/bin/env sh | ||
| 2 | + | ||
| 3 | +############################################################################## | ||
| 4 | +## | ||
| 5 | +## Gradle start up script for UN*X | ||
| 6 | +## | ||
| 7 | +############################################################################## | ||
| 8 | + | ||
| 9 | +# Attempt to set APP_HOME | ||
| 10 | +# Resolve links: $0 may be a link | ||
| 11 | +PRG="$0" | ||
| 12 | +# Need this for relative symlinks. | ||
| 13 | +while [ -h "$PRG" ] ; do | ||
| 14 | + ls=`ls -ld "$PRG"` | ||
| 15 | + link=`expr "$ls" : '.*-> \(.*\)$'` | ||
| 16 | + if expr "$link" : '/.*' > /dev/null; then | ||
| 17 | + PRG="$link" | ||
| 18 | + else | ||
| 19 | + PRG=`dirname "$PRG"`"/$link" | ||
| 20 | + fi | ||
| 21 | +done | ||
| 22 | +SAVED="`pwd`" | ||
| 23 | +cd "`dirname \"$PRG\"`/" >/dev/null | ||
| 24 | +APP_HOME="`pwd -P`" | ||
| 25 | +cd "$SAVED" >/dev/null | ||
| 26 | + | ||
| 27 | +APP_NAME="Gradle" | ||
| 28 | +APP_BASE_NAME=`basename "$0"` | ||
| 29 | + | ||
| 30 | +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 31 | +DEFAULT_JVM_OPTS="" | ||
| 32 | + | ||
| 33 | +# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
| 34 | +MAX_FD="maximum" | ||
| 35 | + | ||
| 36 | +warn () { | ||
| 37 | + echo "$*" | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +die () { | ||
| 41 | + echo | ||
| 42 | + echo "$*" | ||
| 43 | + echo | ||
| 44 | + exit 1 | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +# OS specific support (must be 'true' or 'false'). | ||
| 48 | +cygwin=false | ||
| 49 | +msys=false | ||
| 50 | +darwin=false | ||
| 51 | +nonstop=false | ||
| 52 | +case "`uname`" in | ||
| 53 | + CYGWIN* ) | ||
| 54 | + cygwin=true | ||
| 55 | + ;; | ||
| 56 | + Darwin* ) | ||
| 57 | + darwin=true | ||
| 58 | + ;; | ||
| 59 | + MINGW* ) | ||
| 60 | + msys=true | ||
| 61 | + ;; | ||
| 62 | + NONSTOP* ) | ||
| 63 | + nonstop=true | ||
| 64 | + ;; | ||
| 65 | +esac | ||
| 66 | + | ||
| 67 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
| 68 | + | ||
| 69 | +# Determine the Java command to use to start the JVM. | ||
| 70 | +if [ -n "$JAVA_HOME" ] ; then | ||
| 71 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
| 72 | + # IBM's JDK on AIX uses strange locations for the executables | ||
| 73 | + JAVACMD="$JAVA_HOME/jre/sh/java" | ||
| 74 | + else | ||
| 75 | + JAVACMD="$JAVA_HOME/bin/java" | ||
| 76 | + fi | ||
| 77 | + if [ ! -x "$JAVACMD" ] ; then | ||
| 78 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
| 79 | + | ||
| 80 | +Please set the JAVA_HOME variable in your environment to match the | ||
| 81 | +location of your Java installation." | ||
| 82 | + fi | ||
| 83 | +else | ||
| 84 | + JAVACMD="java" | ||
| 85 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 86 | + | ||
| 87 | +Please set the JAVA_HOME variable in your environment to match the | ||
| 88 | +location of your Java installation." | ||
| 89 | +fi | ||
| 90 | + | ||
| 91 | +# Increase the maximum file descriptors if we can. | ||
| 92 | +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
| 93 | + MAX_FD_LIMIT=`ulimit -H -n` | ||
| 94 | + if [ $? -eq 0 ] ; then | ||
| 95 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
| 96 | + MAX_FD="$MAX_FD_LIMIT" | ||
| 97 | + fi | ||
| 98 | + ulimit -n $MAX_FD | ||
| 99 | + if [ $? -ne 0 ] ; then | ||
| 100 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
| 101 | + fi | ||
| 102 | + else | ||
| 103 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
| 104 | + fi | ||
| 105 | +fi | ||
| 106 | + | ||
| 107 | +# For Darwin, add options to specify how the application appears in the dock | ||
| 108 | +if $darwin; then | ||
| 109 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
| 110 | +fi | ||
| 111 | + | ||
| 112 | +# For Cygwin, switch paths to Windows format before running java | ||
| 113 | +if $cygwin ; then | ||
| 114 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
| 115 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
| 116 | + JAVACMD=`cygpath --unix "$JAVACMD"` | ||
| 117 | + | ||
| 118 | + # We build the pattern for arguments to be converted via cygpath | ||
| 119 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
| 120 | + SEP="" | ||
| 121 | + for dir in $ROOTDIRSRAW ; do | ||
| 122 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
| 123 | + SEP="|" | ||
| 124 | + done | ||
| 125 | + OURCYGPATTERN="(^($ROOTDIRS))" | ||
| 126 | + # Add a user-defined pattern to the cygpath arguments | ||
| 127 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
| 128 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
| 129 | + fi | ||
| 130 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
| 131 | + i=0 | ||
| 132 | + for arg in "$@" ; do | ||
| 133 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
| 134 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
| 135 | + | ||
| 136 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
| 137 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
| 138 | + else | ||
| 139 | + eval `echo args$i`="\"$arg\"" | ||
| 140 | + fi | ||
| 141 | + i=$((i+1)) | ||
| 142 | + done | ||
| 143 | + case $i in | ||
| 144 | + (0) set -- ;; | ||
| 145 | + (1) set -- "$args0" ;; | ||
| 146 | + (2) set -- "$args0" "$args1" ;; | ||
| 147 | + (3) set -- "$args0" "$args1" "$args2" ;; | ||
| 148 | + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
| 149 | + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
| 150 | + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
| 151 | + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
| 152 | + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
| 153 | + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
| 154 | + esac | ||
| 155 | +fi | ||
| 156 | + | ||
| 157 | +# Escape application args | ||
| 158 | +save () { | ||
| 159 | + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
| 160 | + echo " " | ||
| 161 | +} | ||
| 162 | +APP_ARGS=$(save "$@") | ||
| 163 | + | ||
| 164 | +# Collect all arguments for the java command, following the shell quoting and substitution rules | ||
| 165 | +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
| 166 | + | ||
| 167 | +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | ||
| 168 | +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | ||
| 169 | + cd "$(dirname "$0")" | ||
| 170 | +fi | ||
| 171 | + | ||
| 172 | +exec "$JAVACMD" "$@" |
gradlew.bat
0 → 100644
| 1 | +@if "%DEBUG%" == "" @echo off | ||
| 2 | +@rem ########################################################################## | ||
| 3 | +@rem | ||
| 4 | +@rem Gradle startup script for Windows | ||
| 5 | +@rem | ||
| 6 | +@rem ########################################################################## | ||
| 7 | + | ||
| 8 | +@rem Set local scope for the variables with windows NT shell | ||
| 9 | +if "%OS%"=="Windows_NT" setlocal | ||
| 10 | + | ||
| 11 | +set DIRNAME=%~dp0 | ||
| 12 | +if "%DIRNAME%" == "" set DIRNAME=. | ||
| 13 | +set APP_BASE_NAME=%~n0 | ||
| 14 | +set APP_HOME=%DIRNAME% | ||
| 15 | + | ||
| 16 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 17 | +set DEFAULT_JVM_OPTS= | ||
| 18 | + | ||
| 19 | +@rem Find java.exe | ||
| 20 | +if defined JAVA_HOME goto findJavaFromJavaHome | ||
| 21 | + | ||
| 22 | +set JAVA_EXE=java.exe | ||
| 23 | +%JAVA_EXE% -version >NUL 2>&1 | ||
| 24 | +if "%ERRORLEVEL%" == "0" goto init | ||
| 25 | + | ||
| 26 | +echo. | ||
| 27 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 28 | +echo. | ||
| 29 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
| 30 | +echo location of your Java installation. | ||
| 31 | + | ||
| 32 | +goto fail | ||
| 33 | + | ||
| 34 | +:findJavaFromJavaHome | ||
| 35 | +set JAVA_HOME=%JAVA_HOME:"=% | ||
| 36 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
| 37 | + | ||
| 38 | +if exist "%JAVA_EXE%" goto init | ||
| 39 | + | ||
| 40 | +echo. | ||
| 41 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
| 42 | +echo. | ||
| 43 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
| 44 | +echo location of your Java installation. | ||
| 45 | + | ||
| 46 | +goto fail | ||
| 47 | + | ||
| 48 | +:init | ||
| 49 | +@rem Get command-line arguments, handling Windows variants | ||
| 50 | + | ||
| 51 | +if not "%OS%" == "Windows_NT" goto win9xME_args | ||
| 52 | + | ||
| 53 | +:win9xME_args | ||
| 54 | +@rem Slurp the command line arguments. | ||
| 55 | +set CMD_LINE_ARGS= | ||
| 56 | +set _SKIP=2 | ||
| 57 | + | ||
| 58 | +:win9xME_args_slurp | ||
| 59 | +if "x%~1" == "x" goto execute | ||
| 60 | + | ||
| 61 | +set CMD_LINE_ARGS=%* | ||
| 62 | + | ||
| 63 | +:execute | ||
| 64 | +@rem Setup the command line | ||
| 65 | + | ||
| 66 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
| 67 | + | ||
| 68 | +@rem Execute Gradle | ||
| 69 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
| 70 | + | ||
| 71 | +:end | ||
| 72 | +@rem End local scope for the variables with windows NT shell | ||
| 73 | +if "%ERRORLEVEL%"=="0" goto mainEnd | ||
| 74 | + | ||
| 75 | +:fail | ||
| 76 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
| 77 | +rem the _cmd.exe /c_ return code! | ||
| 78 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
| 79 | +exit /b 1 | ||
| 80 | + | ||
| 81 | +:mainEnd | ||
| 82 | +if "%OS%"=="Windows_NT" endlocal | ||
| 83 | + | ||
| 84 | +:omega |
settings.gradle
0 → 100644
wddisplay/.gitignore
0 → 100644
| 1 | +/build |
wddisplay/README.md
0 → 100644
wddisplay/build.gradle
0 → 100644
| 1 | +plugins { | ||
| 2 | + id 'com.android.library' | ||
| 3 | + id 'kotlin-android' | ||
| 4 | + id 'maven' | ||
| 5 | +} | ||
| 6 | + | ||
| 7 | +android { | ||
| 8 | + compileSdkVersion var.compileSdkVersion | ||
| 9 | + | ||
| 10 | + defaultConfig { | ||
| 11 | + minSdkVersion var.minSdkVersion | ||
| 12 | + targetSdkVersion var.targetSdkVersion | ||
| 13 | + versionCode var.versionCode | ||
| 14 | + versionName var.versionName | ||
| 15 | + | ||
| 16 | + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
| 17 | + consumerProguardFiles "consumer-rules.pro" | ||
| 18 | + | ||
| 19 | + buildConfigField "String", "API_VERSION", "\"${requestVersion}\"" | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + buildTypes { | ||
| 23 | + release { | ||
| 24 | + minifyEnabled false | ||
| 25 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + compileOptions { | ||
| 29 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
| 30 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + // 自定义AAR包名 | ||
| 34 | + android.libraryVariants.all { variant -> | ||
| 35 | + variant.outputs.all { | ||
| 36 | + if (outputFileName != null && outputFileName.endsWith(".aar")) { | ||
| 37 | + def fileName = "${project.name}-${buildType.name}-v${var.aar_version}.aar" | ||
| 38 | + outputFileName = fileName | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +dependencies { | ||
| 45 | + implementation 'com.wd:wdkit:1.0.2' | ||
| 46 | + implementation 'com.wd:wdbean:1.0.0' | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +uploadArchives { | ||
| 50 | + repositories { | ||
| 51 | + mavenDeployer { | ||
| 52 | + repository(url: "https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom/") { | ||
| 53 | + authentication(userName: '6708d1cf6f4c940bd257c88d', password: 'Wm51gc4rARyr') | ||
| 54 | + } | ||
| 55 | + pom.project { | ||
| 56 | + artifactId 'display' | ||
| 57 | + version '1.0.0' | ||
| 58 | + groupId 'com.wd' | ||
| 59 | + packaging 'aar' | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | +} |
wddisplay/consumer-rules.pro
0 → 100644
wddisplay/proguard-rules.pro
0 → 100644
| 1 | +# Add project specific ProGuard rules here. | ||
| 2 | +# You can control the set of applied configuration files using the | ||
| 3 | +# proguardFiles setting in build.gradle. | ||
| 4 | +# | ||
| 5 | +# For more details, see | ||
| 6 | +# http://developer.android.com/guide/developing/tools/proguard.html | ||
| 7 | + | ||
| 8 | +# If your project uses WebView with JS, uncomment the following | ||
| 9 | +# and specify the fully qualified class name to the JavaScript interface | ||
| 10 | +# class: | ||
| 11 | +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| 12 | +# public *; | ||
| 13 | +#} | ||
| 14 | + | ||
| 15 | +# Uncomment this to preserve the line number information for | ||
| 16 | +# debugging stack traces. | ||
| 17 | +#-keepattributes SourceFile,LineNumberTable | ||
| 18 | + | ||
| 19 | +# If you keep the line number information, uncomment this to | ||
| 20 | +# hide the original source file name. | ||
| 21 | +#-renamesourcefileattribute SourceFile |
wddisplay/src/main/AndroidManifest.xml
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp; | ||
| 6 | + | ||
| 7 | +import static com.people.common.constant.IntentConstants.PAGE_BACKGROUND_URL; | ||
| 8 | +import static com.people.common.constant.IntentConstants.PAGE_HOME_COLOR; | ||
| 9 | +import static com.people.common.constant.IntentConstants.PAGE_NOTICE_COLOR; | ||
| 10 | +import static com.people.common.constant.IntentConstants.PAGE_STATUS_COLOR; | ||
| 11 | +import static com.people.common.constant.IntentConstants.PARAM_PAGE_ID; | ||
| 12 | +import static com.people.common.constant.IntentConstants.TAB_NEWS_TITLE; | ||
| 13 | + | ||
| 14 | +import android.os.Bundle; | ||
| 15 | + | ||
| 16 | +import androidx.fragment.app.Fragment; | ||
| 17 | + | ||
| 18 | +import com.people.common.constant.IntentConstants; | ||
| 19 | +import com.people.entity.custom.video.VodDetailIntentBean; | ||
| 20 | +import com.people.router.WdRouterRule; | ||
| 21 | +import com.people.router.constants.RouterConstants; | ||
| 22 | +import com.wondertek.wheat.ability.tools.JsonUtils; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * comp组件的相关Service实现<BR> | ||
| 27 | + * | ||
| 28 | + * @author zhangbo | ||
| 29 | + * @version [V1.0.0, 2020/7/23] | ||
| 30 | + * @since V1.0.0 | ||
| 31 | + */ | ||
| 32 | +public class CompServiceImpl implements ICompService { | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + @Override | ||
| 36 | + public Fragment createMainFragment(String id) { | ||
| 37 | + return null; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public Fragment createChannelFragment(String pageId) { | ||
| 42 | + return null; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public Fragment createColumnFragment(String pageId) { | ||
| 47 | + return null; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @Override | ||
| 51 | + public Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId) { | ||
| 52 | + Fragment myFragment = WdRouterRule.getInstance().getFragment(RouterConstants.PATH_HOME_FULL_PLAY); | ||
| 53 | + if (myFragment != null) { | ||
| 54 | + VodDetailIntentBean intentBean = new VodDetailIntentBean(); | ||
| 55 | + intentBean.setGray(isGray); | ||
| 56 | + intentBean.setType(VodDetailIntentBean.Type.COMP); | ||
| 57 | + intentBean.setLevel1ChannelId(level1ChannelId); | ||
| 58 | + intentBean.setPageId(pageId); | ||
| 59 | + intentBean.setChannelId(channelId); | ||
| 60 | + Bundle bundle = new Bundle(); | ||
| 61 | + bundle.putString(IntentConstants.PARAMS_VIDEO_DETAIL, JsonUtils.convertObjectToJson(intentBean)); | ||
| 62 | + myFragment.setArguments(bundle); | ||
| 63 | + return myFragment; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + return new Fragment(); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + @Override | ||
| 71 | + public Fragment createDefaultFragment() { | ||
| 72 | + // 这里默认直接创建Fragment | ||
| 73 | + return new Fragment(); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @Override | ||
| 77 | + public Fragment createFollowFragment(String pageId) { | ||
| 78 | + return null; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + @Override | ||
| 82 | + public Fragment createCommonFragment(String pageId) { | ||
| 83 | + //return CommonFragment.newInstance(pageId); | ||
| 84 | + return null; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @Override | ||
| 88 | + public Fragment createMiFragment(String pageId, String pageName, int statuesBar, String backgroundUrl, String homeColor, String noticeColor) { | ||
| 89 | + Fragment myFragment = | ||
| 90 | + (Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_MODULE_MY_FRAGMENT); | ||
| 91 | + Bundle bundle = new Bundle(); | ||
| 92 | + if (myFragment != null) { | ||
| 93 | + bundle.putString(PARAM_PAGE_ID, pageId); | ||
| 94 | + bundle.putString(TAB_NEWS_TITLE, pageName); | ||
| 95 | + bundle.putString(PAGE_BACKGROUND_URL, backgroundUrl); | ||
| 96 | + bundle.putInt(PAGE_STATUS_COLOR, statuesBar); | ||
| 97 | + bundle.putString(PAGE_HOME_COLOR, homeColor); | ||
| 98 | + bundle.putString(PAGE_NOTICE_COLOR, noticeColor); | ||
| 99 | + myFragment.setArguments(bundle); | ||
| 100 | + return myFragment; | ||
| 101 | + } | ||
| 102 | + return createDefaultFragment(); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + @Override | ||
| 106 | + public Fragment createShortVideoFragment(String pageId, int color) { | ||
| 107 | + Fragment myFragment = (Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_SHORT_VIDEO); | ||
| 108 | + if (myFragment != null) { | ||
| 109 | + VodDetailIntentBean intentBean = new VodDetailIntentBean(); | ||
| 110 | + intentBean.setType(VodDetailIntentBean.Type.COMP); | ||
| 111 | + intentBean.setPageId(pageId); | ||
| 112 | + intentBean.color = color; | ||
| 113 | + intentBean.isImmerse = true; | ||
| 114 | + Bundle bundle = new Bundle(); | ||
| 115 | + bundle.putString(IntentConstants.PARAMS_VIDEO_DETAIL, JsonUtils.convertObjectToJson(intentBean)); | ||
| 116 | + myFragment.setArguments(bundle); | ||
| 117 | + return myFragment; | ||
| 118 | + } | ||
| 119 | + return createDefaultFragment(); | ||
| 120 | + } | ||
| 121 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp; | ||
| 6 | + | ||
| 7 | +import androidx.fragment.app.Fragment; | ||
| 8 | + | ||
| 9 | +import com.wondertek.wheat.ability.scheduler.IService; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * comp服务的相关接口<BR> | ||
| 13 | + * | ||
| 14 | + * @author zhangbo | ||
| 15 | + * @version [V1.0.0, 2020/7/23] | ||
| 16 | + * @since V1.0.0 | ||
| 17 | + */ | ||
| 18 | +public interface ICompService extends IService { | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 创建Fragment,首页带菜单导航的页面 | ||
| 22 | + * | ||
| 23 | + * @param id 导航栏标识 | ||
| 24 | + * @return Fragment实例 | ||
| 25 | + */ | ||
| 26 | + Fragment createMainFragment(String id); | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 创建Fragment,没有菜单导航的,纯内容页面(频道页面) | ||
| 30 | + * | ||
| 31 | + * @param pageId 页面id参数 | ||
| 32 | + * @return Fragment实例 | ||
| 33 | + */ | ||
| 34 | + Fragment createChannelFragment(String pageId); | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 创建Fragment,专题、栏目页面 | ||
| 38 | + * | ||
| 39 | + * @param pageId 页面id参数 | ||
| 40 | + * @return Fragment实例 | ||
| 41 | + */ | ||
| 42 | + Fragment createColumnFragment(String pageId); | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 创建直播频道的页面 | ||
| 46 | + * | ||
| 47 | + * @param isGray 是否国殇模式 | ||
| 48 | + * @param level1ChannelId 一级频道id | ||
| 49 | + * @param pageId 页面id | ||
| 50 | + * @param pageId channelId | ||
| 51 | + * @return Fragment实例 | ||
| 52 | + */ | ||
| 53 | + Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId); | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 创建默认Fragment | ||
| 58 | + * | ||
| 59 | + * @return Fragment实例 | ||
| 60 | + */ | ||
| 61 | + Fragment createDefaultFragment(); | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 创建关注Fragment | ||
| 65 | + * @param pageId 页面id | ||
| 66 | + * @return | ||
| 67 | + */ | ||
| 68 | + Fragment createFollowFragment(String pageId); | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 创建通用Fragment | ||
| 72 | + * @param pageId | ||
| 73 | + * @return | ||
| 74 | + */ | ||
| 75 | + Fragment createCommonFragment(String pageId); | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 创建 我的 Fragment | ||
| 79 | + * @param pageId | ||
| 80 | + * @return | ||
| 81 | + */ | ||
| 82 | + Fragment createMiFragment(String pageId,String pageName,int statuesBar,String backgroundUrl,String homeColor,String noticeColor); | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 创建短视频Fragment | ||
| 86 | + * @param pageId 页面id | ||
| 87 | + */ | ||
| 88 | + Fragment createShortVideoFragment(String pageId,int color); | ||
| 89 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import java.util.ArrayList; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +import com.people.entity.custom.comp.CompBean; | ||
| 11 | +import com.people.entity.custom.comp.GroupBean; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Group基类<BR> | ||
| 15 | + * | ||
| 16 | + * @author zhangbo | ||
| 17 | + * @version [V1.0.0, 2021/12/8] | ||
| 18 | + * @since V1.0.0 | ||
| 19 | + */ | ||
| 20 | +public abstract class AbsGroup extends AbsLayout { | ||
| 21 | + private AbsPage parent; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * group在页面里的下标 | ||
| 25 | + */ | ||
| 26 | + private int position; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * group在recyclerView里的下标 | ||
| 30 | + */ | ||
| 31 | + private int startPosition; | ||
| 32 | + | ||
| 33 | + // 每个楼层页码 | ||
| 34 | + private int pageNum = 1; | ||
| 35 | + | ||
| 36 | + // 是否推荐策略;2:否,1:是 | ||
| 37 | + private String groupStrategy; | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + private List<AbsSection> sections; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 楼层所在页面所有楼层中的位置 | ||
| 44 | + */ | ||
| 45 | + private int layerIndex = 0; | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 是否是页面的最后一个楼层 | ||
| 49 | + */ | ||
| 50 | + private boolean isLastLayer = false; | ||
| 51 | + | ||
| 52 | + | ||
| 53 | + // 记录AbsGroup所在GroupBean对象 | ||
| 54 | + private GroupBean groupBean; | ||
| 55 | + | ||
| 56 | + //记录的组件支持加载更多数据 (改组件对象必然在页面的最后一个楼层的最后一个组件上) | ||
| 57 | + private CompBean supportLoadMoreDataComp; | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * gzq | ||
| 62 | + * | ||
| 63 | + * @param dataBean | ||
| 64 | + * @param parent | ||
| 65 | + */ | ||
| 66 | + public AbsGroup(GroupBean dataBean, AbsPage parent) { | ||
| 67 | + this(parent); | ||
| 68 | + this.setId(dataBean.getId()); | ||
| 69 | + parseData(dataBean); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public int getLayerIndex() { | ||
| 73 | + return layerIndex; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public void setLayerIndex(int layerIndex) { | ||
| 77 | + this.layerIndex = layerIndex; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 构造器 | ||
| 82 | + * | ||
| 83 | + * @param groupId 楼层id | ||
| 84 | + * @param parent page对象 | ||
| 85 | + */ | ||
| 86 | + public AbsGroup(String groupId, AbsPage parent) { | ||
| 87 | + this(parent); | ||
| 88 | + this.setId(groupId); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * gzq | ||
| 93 | + * | ||
| 94 | + * @param parent | ||
| 95 | + */ | ||
| 96 | + public AbsGroup(AbsPage parent) { | ||
| 97 | + this.parent = parent; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + /** | ||
| 101 | + * getParent | ||
| 102 | + * | ||
| 103 | + * @param <T> | ||
| 104 | + * @return | ||
| 105 | + */ | ||
| 106 | + public <T extends AbsPage> T getParent() { | ||
| 107 | + return (T) this.parent; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public void setParent(AbsPage parent) { | ||
| 111 | + this.parent = parent; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + /** | ||
| 115 | + * getSection | ||
| 116 | + * | ||
| 117 | + * @return AbsSection | ||
| 118 | + */ | ||
| 119 | + public List<AbsSection> getSections() { | ||
| 120 | + if (sections == null) { | ||
| 121 | + sections = new ArrayList<>(); | ||
| 122 | + } | ||
| 123 | + return sections; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + public void setSections(List<AbsSection> sections) { | ||
| 127 | + this.sections = sections; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public int getPosition() { | ||
| 131 | + return position; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public void setPosition(int position) { | ||
| 135 | + this.position = position; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + public int getStartPosition() { | ||
| 139 | + return startPosition; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public void setStartPosition(int startPosition) { | ||
| 143 | + this.startPosition = startPosition; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + | ||
| 147 | + @Override | ||
| 148 | + public ILayoutPresenter getLayoutPresenter() { | ||
| 149 | + return getParent().getLayoutPresenter(); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 解析楼层,组装section | ||
| 154 | + * | ||
| 155 | + * @param groupBean 楼层数据 | ||
| 156 | + */ | ||
| 157 | + public void parseData(GroupBean groupBean) { | ||
| 158 | + getSections().clear(); | ||
| 159 | + if (groupBean.getComps() == null) { | ||
| 160 | + return; | ||
| 161 | + } | ||
| 162 | + addParseData(groupBean.getComps()); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + /** | ||
| 166 | + * 楼层添加新的组件信息以供解析成section | ||
| 167 | + * | ||
| 168 | + * @param compList | ||
| 169 | + */ | ||
| 170 | + public void addParseData(List<CompBean> compList) { | ||
| 171 | + | ||
| 172 | + if (compList == null) { | ||
| 173 | + return; | ||
| 174 | + } | ||
| 175 | + for (CompBean compBean : compList) { | ||
| 176 | + if (compBean == null) { | ||
| 177 | + continue; | ||
| 178 | + } | ||
| 179 | + if (getParent() != null && getParent().getSectionParser() != null) { | ||
| 180 | + AbsSection<?, ?> section = getParent().getSectionParser().parseSection(this, compBean); | ||
| 181 | + if (section != null) { | ||
| 182 | + section.setCompBean(compBean); | ||
| 183 | + // 添加section | ||
| 184 | + getSections().add(section); | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + /** | ||
| 193 | + * 解析Group数据 | ||
| 194 | + * | ||
| 195 | + * @param groupBean 楼层对象,携带组件和稿件数据 | ||
| 196 | + * @param loadMore true:楼层增加数据 ;false:楼层第一次数据 | ||
| 197 | + */ | ||
| 198 | + public void parseGroupData(GroupBean groupBean, boolean loadMore) { | ||
| 199 | + if (groupBean == null) { | ||
| 200 | + return; | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + if (loadMore) { | ||
| 204 | + // 记录已经存在的数据量 | ||
| 205 | + setDisplayItemCount(this.getSections().size()); | ||
| 206 | + // 解析group数据,生成section列表 | ||
| 207 | + addParseData(groupBean.getComps()); | ||
| 208 | + } else { | ||
| 209 | + setDisplayItemCount(0); | ||
| 210 | + // 解析group数据,生成section列表 | ||
| 211 | + parseData(groupBean); | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + | ||
| 215 | + for (AbsSection<?, ?> section : this.getSections()) { | ||
| 216 | + if (section == null) { | ||
| 217 | + continue; | ||
| 218 | + } | ||
| 219 | + // 解析结果 | ||
| 220 | + section.parsePartialData(); | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + public void removeSection(int index) { | ||
| 225 | + sections.remove(index); | ||
| 226 | + getLayoutPresenter().onRefreshPageSuccess(); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + public void removeSectionsByType(String type) { | ||
| 230 | + for (AbsSection section : sections) { | ||
| 231 | + if (type.equals(section.getCompType())) { | ||
| 232 | + sections.remove(section); | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | + getLayoutPresenter().onRefreshPageSuccess(); | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + public int getPageNum() { | ||
| 239 | + return pageNum; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + public void setPageNum(int pageNum) { | ||
| 243 | + this.pageNum = pageNum; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + public boolean isLastLayer() { | ||
| 247 | + return isLastLayer; | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + public void setLastLayer(boolean lastLayer) { | ||
| 251 | + isLastLayer = lastLayer; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + public String getGroupStrategy() { | ||
| 255 | + return groupStrategy; | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + public void setGroupStrategy(String groupStrategy) { | ||
| 259 | + this.groupStrategy = groupStrategy; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + public GroupBean getGroupBean() { | ||
| 263 | + return groupBean; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + public void setGroupBean(GroupBean groupBean) { | ||
| 267 | + this.groupBean = groupBean; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + public CompBean getSupportLoadMoreDataComp() { | ||
| 271 | + return supportLoadMoreDataComp; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + public void setSupportLoadMoreDataComp(CompBean supportLoadMoreDataComp) { | ||
| 275 | + this.supportLoadMoreDataComp = supportLoadMoreDataComp; | ||
| 276 | + } | ||
| 277 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutdata; | ||
| 7 | + | ||
| 8 | +import android.text.TextUtils; | ||
| 9 | + | ||
| 10 | +public abstract class AbsLayout { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 页面id | ||
| 14 | + */ | ||
| 15 | + private String id; | ||
| 16 | + | ||
| 17 | + private String blockDesc; | ||
| 18 | + | ||
| 19 | + private boolean showBlock = true; | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 记录楼层已展示的组件数量 | ||
| 23 | + */ | ||
| 24 | + private int displayItemCount = 0; | ||
| 25 | + | ||
| 26 | + public String getId() { | ||
| 27 | + return TextUtils.isEmpty(this.id) ? "" : this.id; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public void setId(String id) { | ||
| 31 | + this.id = id; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public String getBlockDesc() { | ||
| 35 | + return blockDesc; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public int getDisplayItemCount() { | ||
| 39 | + return displayItemCount; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setDisplayItemCount(int displayItemCount) { | ||
| 43 | + this.displayItemCount = displayItemCount; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public void setBlockDesc(String blockDesc) { | ||
| 47 | + this.blockDesc = blockDesc; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public boolean isShowBlock() { | ||
| 51 | + return showBlock; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public void setShowBlock(boolean showBlock) { | ||
| 55 | + this.showBlock = showBlock; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * getLayoutPresenter | ||
| 60 | + * | ||
| 61 | + * @return getLayoutPresenter | ||
| 62 | + */ | ||
| 63 | + public abstract ILayoutPresenter getLayoutPresenter(); | ||
| 64 | + | ||
| 65 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutdata; | ||
| 7 | + | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +import androidx.fragment.app.Fragment; | ||
| 12 | + | ||
| 13 | +import com.people.component.comp.parser.AbsSectionParser; | ||
| 14 | + | ||
| 15 | +public abstract class AbsPage extends AbsLayout { | ||
| 16 | + | ||
| 17 | + private AbsSectionParser sectionParser; | ||
| 18 | + | ||
| 19 | + private ILayoutPresenter layoutPresenter; | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 页面的楼层数据集合 | ||
| 23 | + */ | ||
| 24 | + private List<AbsGroup> groups; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 组件所在的楼层在groups中的索引值(记录的楼层可支持翻页) | ||
| 28 | + */ | ||
| 29 | + private int currentGroupIndex = 0; | ||
| 30 | + | ||
| 31 | + private AbsGroup specialGroup; | ||
| 32 | + | ||
| 33 | + private Fragment mFragment; | ||
| 34 | + | ||
| 35 | + public AbsSectionParser getSectionParser() { | ||
| 36 | + return sectionParser; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public void setSectionParser(AbsSectionParser sectionParser) { | ||
| 40 | + this.sectionParser = sectionParser; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public int getGroupIndex() { | ||
| 44 | + return currentGroupIndex; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setGroupIndex(int groupIndex) { | ||
| 48 | + this.currentGroupIndex = groupIndex; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + @Override | ||
| 53 | + public ILayoutPresenter getLayoutPresenter() { | ||
| 54 | + return layoutPresenter; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public void setLayoutPresenter(ILayoutPresenter layoutPresenter) { | ||
| 58 | + this.layoutPresenter = layoutPresenter; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * removeLayoutPresenter | ||
| 63 | + */ | ||
| 64 | + public void removeLayoutPresenter() { | ||
| 65 | + this.layoutPresenter = null; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * getGroups | ||
| 70 | + * | ||
| 71 | + * @return AbsGroup | ||
| 72 | + */ | ||
| 73 | + public List<AbsGroup> getGroups() { | ||
| 74 | + if (groups == null) { | ||
| 75 | + groups = new ArrayList<AbsGroup>(); | ||
| 76 | + } | ||
| 77 | + return groups; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setGroups(List<AbsGroup> groups) { | ||
| 81 | + this.groups = groups; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * removeGroup | ||
| 86 | + * | ||
| 87 | + * @param index | ||
| 88 | + */ | ||
| 89 | + public void removeGroup(int index) { | ||
| 90 | + groups.remove(index); | ||
| 91 | + getLayoutPresenter().onRefreshPageSuccess(); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + public Fragment getFragment() { | ||
| 95 | + return mFragment; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public void setFragment(Fragment fragment) { | ||
| 99 | + this.mFragment = fragment; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + public AbsGroup getSpecialGroup() { | ||
| 103 | + return specialGroup; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public void setSpecialGroup(AbsGroup specialGroup) { | ||
| 107 | + this.specialGroup = specialGroup; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 检测当前使用的楼层对象数据是在groups中最后位置(通过索引值对比) | ||
| 112 | + * | ||
| 113 | + * @return true:表示在最后的位置 | ||
| 114 | + */ | ||
| 115 | + public boolean checkGroupDataIsLastData() { | ||
| 116 | + | ||
| 117 | + int groupSize = groups.size(); | ||
| 118 | + if (groupSize > 1) { | ||
| 119 | + // 索引值从0开始计算 | ||
| 120 | + int temp = groupSize - 1; | ||
| 121 | + if (currentGroupIndex == temp) { | ||
| 122 | + return true; | ||
| 123 | + } else { | ||
| 124 | + return false; | ||
| 125 | + } | ||
| 126 | + } else { | ||
| 127 | + return true; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + /** | ||
| 134 | + * 设置新的楼层参数 | ||
| 135 | + */ | ||
| 136 | + public void setNewGroupParameter() { | ||
| 137 | + currentGroupIndex = currentGroupIndex + 1; | ||
| 138 | + } | ||
| 139 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import java.lang.reflect.ParameterizedType; | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +import androidx.annotation.NonNull; | ||
| 12 | + | ||
| 13 | +import com.orhanobut.logger.Logger; | ||
| 14 | +import com.people.entity.custom.comp.CompBean; | ||
| 15 | +import com.people.entity.custom.item.ItemBean; | ||
| 16 | +import com.people.entity.custom.section.SectionBean; | ||
| 17 | +import com.wondertek.wheat.ability.tools.ArrayUtils; | ||
| 18 | +import com.wondertek.wheat.ability.tools.CastUtils; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * section基类<BR> | ||
| 22 | + * | ||
| 23 | + * @param <T> item数据泛型限定 | ||
| 24 | + * @param <F> 泛型,待扩展限定 | ||
| 25 | + * @author zhangbo | ||
| 26 | + * @version [V1.0.0, 2021/12/8] | ||
| 27 | + * @since V1.0.0 | ||
| 28 | + */ | ||
| 29 | +public abstract class AbsSection<T extends ItemBean, F extends SectionBean> extends AbsLayout { | ||
| 30 | + /** | ||
| 31 | + * 对应comp数据 | ||
| 32 | + */ | ||
| 33 | + protected CompBean mCompBean; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 上级父节点,即楼层对象 | ||
| 37 | + */ | ||
| 38 | + protected AbsGroup parent; | ||
| 39 | + | ||
| 40 | + private int position; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 单个comp里,列表数据,如卡片列表等 | ||
| 44 | + */ | ||
| 45 | + private List<T> items = new ArrayList<>(); | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * section数据,里面包含ListT数据,待扩展 | ||
| 49 | + */ | ||
| 50 | + private F sectionData; | ||
| 51 | + | ||
| 52 | + private String compType; | ||
| 53 | + | ||
| 54 | + private String compStyle; | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 构造器 | ||
| 58 | + * | ||
| 59 | + * @param parent 承载section的group对象,即父节点 | ||
| 60 | + * @param compType comp组件类型 | ||
| 61 | + * @param compStyle comp组件样式 | ||
| 62 | + */ | ||
| 63 | + public AbsSection(AbsGroup parent, String compType, String compStyle) { | ||
| 64 | + super(); | ||
| 65 | + this.parent = parent; | ||
| 66 | + this.compType = compType; | ||
| 67 | + this.compStyle = compStyle; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 构造器 | ||
| 72 | + * | ||
| 73 | + * @param parent 承载section的group对象,即父节点 | ||
| 74 | + * @param compBean comp组件对应的comp数据 | ||
| 75 | + */ | ||
| 76 | + public AbsSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 77 | + this.parent = parent; | ||
| 78 | + this.compType = compBean.getCompType(); | ||
| 79 | + this.compStyle = compBean.getCompStyle(); | ||
| 80 | + mCompBean = compBean; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + public int getItemCount() { | ||
| 84 | + return this.items == null ? 0 : this.items.size(); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 转换数据 | ||
| 89 | + * | ||
| 90 | + * @param jsonStr json数据 | ||
| 91 | + */ | ||
| 92 | + @Deprecated | ||
| 93 | + public void parsePartialData(String jsonStr) { | ||
| 94 | + // 创建item数据 | ||
| 95 | + resetDisplayList(mCompBean); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + /** | ||
| 99 | + * 转换数据 | ||
| 100 | + */ | ||
| 101 | + public void parsePartialData() { | ||
| 102 | + parseData(); | ||
| 103 | + resetDisplayList(mCompBean); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 展示列表数据 | ||
| 108 | + * | ||
| 109 | + * @param compBean comp数据 | ||
| 110 | + */ | ||
| 111 | + public void resetDisplayList(@NonNull CompBean compBean) { | ||
| 112 | + | ||
| 113 | + int itemSize = ArrayUtils.getListSize(compBean.getOriginalItemBeans()); | ||
| 114 | + if (itemSize <= 0) { | ||
| 115 | + return; | ||
| 116 | + } | ||
| 117 | + // 源数据转换成最终展示数据 | ||
| 118 | + List<ItemBean> tmpList = compBean.getOriginalItemBeans(); | ||
| 119 | + compBean.setDisplayItemBeans(tmpList); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * 转换数据 | ||
| 124 | + * | ||
| 125 | + * @param dataList item数据列表 | ||
| 126 | + */ | ||
| 127 | + public final void parseData(List<T> dataList) { | ||
| 128 | + if (ArrayUtils.isEmpty(dataList)) { | ||
| 129 | + return; | ||
| 130 | + } | ||
| 131 | + items.clear(); | ||
| 132 | + items.addAll(dataList); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * 获取item数据 | ||
| 137 | + * | ||
| 138 | + * @param index 下标 | ||
| 139 | + * @return item数据 | ||
| 140 | + */ | ||
| 141 | + public T getItemData(int index) { | ||
| 142 | + return ArrayUtils.getListElement(getItems(), index); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + /** | ||
| 146 | + * 获取item数据 | ||
| 147 | + * | ||
| 148 | + * @param index 下标 | ||
| 149 | + * @return item数据 | ||
| 150 | + */ | ||
| 151 | + protected T getOriginalItemData(int index) { | ||
| 152 | + if (mCompBean == null || ArrayUtils.isEmpty(mCompBean.getOriginalItemBeans())) { | ||
| 153 | + return null; | ||
| 154 | + } | ||
| 155 | + ItemBean itemBean = mCompBean.getOriginalItemBeans().get(index); | ||
| 156 | + ParameterizedType pType = (ParameterizedType) this.getClass().getGenericSuperclass(); | ||
| 157 | + Class<T> clazz = (Class<T>) pType.getActualTypeArguments()[0]; | ||
| 158 | + return CastUtils.cast(itemBean, clazz); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + /** | ||
| 162 | + * 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据 | ||
| 163 | + */ | ||
| 164 | + public void setupOrNotSection() { | ||
| 165 | + Logger.t(getLogTag()).d("setupOrNotSection"); | ||
| 166 | + | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + /** | ||
| 172 | + * 因section为特殊样式,需要组装list | ||
| 173 | + * | ||
| 174 | + * 如:label、button样式、横向滑动列表样式 | ||
| 175 | + * | ||
| 176 | + * @return 创建的对象 | ||
| 177 | + */ | ||
| 178 | + protected T newItemBean() { | ||
| 179 | + ParameterizedType pType = (ParameterizedType) this.getClass().getGenericSuperclass(); | ||
| 180 | + if (pType == null) { | ||
| 181 | + return null; | ||
| 182 | + } | ||
| 183 | + Class<T> clazz = (Class<T>) pType.getActualTypeArguments()[0]; | ||
| 184 | + T t = null; | ||
| 185 | + try { | ||
| 186 | + t = clazz.newInstance(); | ||
| 187 | + } catch (IllegalAccessException | InstantiationException e) { | ||
| 188 | + Logger.t(getLogTag()).e("newItemBean, Exception: " + e.getMessage()); | ||
| 189 | + } | ||
| 190 | + return t; | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + /** | ||
| 194 | + * 转换数据,二次请求的数据 | ||
| 195 | + * | ||
| 196 | + * @param data json数据 | ||
| 197 | + */ | ||
| 198 | + @Deprecated | ||
| 199 | + protected abstract void parseData(String data); | ||
| 200 | + | ||
| 201 | + /** | ||
| 202 | + * 组装数据 | ||
| 203 | + */ | ||
| 204 | + protected abstract void parseData(); | ||
| 205 | + | ||
| 206 | + /** | ||
| 207 | + * 获取日志tag | ||
| 208 | + * | ||
| 209 | + * @return 日志tag | ||
| 210 | + */ | ||
| 211 | + public abstract String getLogTag(); | ||
| 212 | + | ||
| 213 | + /** | ||
| 214 | + * 解析数据封装对象class,super.parseData(data)用到 | ||
| 215 | + * 若,自己覆写parseData,则可以忽略 | ||
| 216 | + * | ||
| 217 | + * @return 数据class | ||
| 218 | + */ | ||
| 219 | + public abstract Class<T> getDataClazz(); | ||
| 220 | + | ||
| 221 | + public AbsGroup getParent() { | ||
| 222 | + return parent; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + public void setParent(AbsGroup parent) { | ||
| 226 | + this.parent = parent; | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + public String getCompType() { | ||
| 230 | + return compType; | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + public void setCompType(String compType) { | ||
| 234 | + this.compType = compType; | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + public String getCompStyle() { | ||
| 238 | + return compStyle; | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + public void setCompStyle(String compStyle) { | ||
| 242 | + this.compStyle = compStyle; | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + public F getSectionData() { | ||
| 246 | + return sectionData; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + public void setSectionData(F sectionData) { | ||
| 250 | + this.sectionData = sectionData; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + public CompBean getCompBean() { | ||
| 254 | + return mCompBean; | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + public void setCompBean(CompBean compBean) { | ||
| 258 | + this.mCompBean = compBean; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + @Override | ||
| 262 | + public ILayoutPresenter getLayoutPresenter() { | ||
| 263 | + return getParent().getLayoutPresenter(); | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + public List<T> getItems() { | ||
| 267 | + return items; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + public void setItems(List<T> items) { | ||
| 271 | + this.items = items; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + public int getPosition() { | ||
| 275 | + return position; | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + public void setPosition(int position) { | ||
| 279 | + this.position = position; | ||
| 280 | + } | ||
| 281 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.people.entity.custom.comp.CompBean; | ||
| 10 | +import com.people.entity.custom.comp.ContainerItemBean; | ||
| 11 | +import com.people.entity.custom.section.SectionBean; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 不直接作为item展示,需要自行添加容器展示子内容的section基类<BR> | ||
| 15 | + * 如,横向的列表样式、轮播图等 | ||
| 16 | + * | ||
| 17 | + * @author zhangbo | ||
| 18 | + * @version [V1.0.0, 2022/1/19] | ||
| 19 | + * @param <T> item数据泛型限定 | ||
| 20 | + * @since V1.0.0 | ||
| 21 | + */ | ||
| 22 | +public abstract class BaseContainerSection<T extends ContainerItemBean> extends AbsSection<T, SectionBean> { | ||
| 23 | + /** | ||
| 24 | + * 构造器 | ||
| 25 | + * | ||
| 26 | + * @param parent 承载section的group对象,即父节点 | ||
| 27 | + * @param compBean comp组件对应的comp数据 | ||
| 28 | + */ | ||
| 29 | + public BaseContainerSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 30 | + super(parent, compBean); | ||
| 31 | + | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + @Override | ||
| 35 | + protected final void parseData() { | ||
| 36 | + if (mCompBean == null) { | ||
| 37 | + return; | ||
| 38 | + } | ||
| 39 | + // 容器类型item,创建一个数据对象,并将节目数据赋值子列表 | ||
| 40 | + T itemBean = createItemBean(); | ||
| 41 | + itemBean.setSubList(mCompBean.getDataList()); | ||
| 42 | + mCompBean.getOriginalItemBeans().clear(); | ||
| 43 | + mCompBean.getOriginalItemBeans().add(itemBean); | ||
| 44 | + initItemBean(itemBean); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 转换数据,二次请求的数据 | ||
| 49 | + * | ||
| 50 | + * @param data json数据 | ||
| 51 | + */ | ||
| 52 | + @Override | ||
| 53 | + protected final void parseData(String data) { | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + private T createItemBean() { | ||
| 57 | + T itemBean = newItemBean(); | ||
| 58 | + mCompBean.getOriginalItemBeans().add(itemBean); | ||
| 59 | + if (itemBean != null) { | ||
| 60 | + // 初始化信息 | ||
| 61 | + initItemBean(itemBean); | ||
| 62 | + } | ||
| 63 | + return itemBean; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 初始化item数据<BR> | ||
| 68 | + * 处理自己的业务,如title、tab样式,需要自己获取extraData,com.people.component.comp.data.news.ContentBean#extraData | ||
| 69 | + * | ||
| 70 | + * @param itemBean item数据 | ||
| 71 | + */ | ||
| 72 | + protected abstract void initItemBean(@NonNull T itemBean); | ||
| 73 | + | ||
| 74 | + | ||
| 75 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.people.entity.custom.comp.CompBean; | ||
| 10 | +import com.people.entity.custom.item.ItemBean; | ||
| 11 | +import com.people.entity.custom.section.SectionBean; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 不直接作为item展示,需要自行添加容器展示子内容的section基类<BR> | ||
| 15 | + * 如,横向的列表样式、轮播图等 | ||
| 16 | + * | ||
| 17 | + * @author zhangbo | ||
| 18 | + * @version [V1.0.0, 2022/1/19] | ||
| 19 | + * @param <T> item数据泛型限定 | ||
| 20 | + * @param <F> 泛型,待扩展限定 | ||
| 21 | + * @since V1.0.0 | ||
| 22 | + */ | ||
| 23 | +public abstract class BaseContainerSectionOld<T extends ItemBean, F extends SectionBean> extends AbsSection<T, F> { | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 构造器 | ||
| 27 | + * | ||
| 28 | + * @param parent 承载section的group对象,即父节点 | ||
| 29 | + * @param compType comp组件类型 | ||
| 30 | + * @param compStyle comp组件样式 | ||
| 31 | + */ | ||
| 32 | + public BaseContainerSectionOld(AbsGroup parent, String compType, String compStyle) { | ||
| 33 | + super(parent, compType, compStyle); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 构造器 | ||
| 38 | + * | ||
| 39 | + * @param parent 承载section的group对象,即父节点 | ||
| 40 | + * @param compBean comp组件对应的comp数据 | ||
| 41 | + */ | ||
| 42 | + public BaseContainerSectionOld(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 43 | + super(parent, compBean); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 初始化item数据 | ||
| 48 | + * | ||
| 49 | + * @param itemBean item数据 | ||
| 50 | + */ | ||
| 51 | + protected void initItemBean(@NonNull T itemBean) { | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Override | ||
| 55 | + protected final void parseData() { | ||
| 56 | + if (mCompBean == null || mCompBean.getOriginalItemBeans().size() <= 0) { | ||
| 57 | + return; | ||
| 58 | + } | ||
| 59 | + // 容器类型item,创建一个数据对象,并将节目数据赋值子列表 | ||
| 60 | + T itemBean = createItemBean(); | ||
| 61 | + // itemBean.setSubList(mCompBean.getDataList()); | ||
| 62 | + mCompBean.getOriginalItemBeans().clear(); | ||
| 63 | + mCompBean.getOriginalItemBeans().add(itemBean); | ||
| 64 | + parseData(itemBean); | ||
| 65 | + initItemBean(itemBean); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 转换数据,二次请求的数据 | ||
| 70 | + * | ||
| 71 | + * @param data json数据 | ||
| 72 | + */ | ||
| 73 | + @Override | ||
| 74 | + protected void parseData(String data) { | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + private T createItemBean() { | ||
| 78 | + T itemBean = newItemBean(); | ||
| 79 | + mCompBean.getOriginalItemBeans().add(itemBean); | ||
| 80 | + String pageId = parent.getParent().getId(); | ||
| 81 | + if (itemBean != null) { | ||
| 82 | + // 设置pageId | ||
| 83 | + // itemBean.setPageId(pageId); | ||
| 84 | + // 初始化信息 | ||
| 85 | + initItemBean(itemBean); | ||
| 86 | + } | ||
| 87 | + return itemBean; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /** | ||
| 91 | + * 解析自己的数据 | ||
| 92 | + * | ||
| 93 | + * @param itemData item数据对象 | ||
| 94 | + */ | ||
| 95 | + protected void parseData(T itemData) { | ||
| 96 | + } | ||
| 97 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +import androidx.annotation.NonNull; | ||
| 10 | + | ||
| 11 | +import com.people.entity.custom.comp.CompBean; | ||
| 12 | +import com.people.entity.custom.item.ItemBean; | ||
| 13 | +import com.people.entity.custom.section.SectionBean; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 可以直接作为item展示的section基类<BR> | ||
| 17 | + * 如,两列多行的样式(上图下文01)、标题(LABEL-01)、按钮(BUTTON-01) | ||
| 18 | + * 理论上只会有 ContentBean数据类型,其他都是BaseContainerSection里处理,自定义数据bean | ||
| 19 | + * | ||
| 20 | + * @author zhangbo | ||
| 21 | + * @version [V1.0.0, 2022/1/19] | ||
| 22 | + * @param <T> item数据泛型限定 | ||
| 23 | + * @since V1.0.0 | ||
| 24 | + */ | ||
| 25 | +public abstract class BaseItemSection<T extends ItemBean> extends AbsSection<T, SectionBean> { | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 构造器 | ||
| 29 | + * | ||
| 30 | + * @param parent 承载section的group对象,即父节点 | ||
| 31 | + * @param compBean comp组件对应的comp数据 | ||
| 32 | + */ | ||
| 33 | + public BaseItemSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 34 | + super(parent, compBean); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @Override | ||
| 38 | + protected final void parseData(String data) { | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + protected final void parseData() { | ||
| 43 | + // 非容器类型的item,没有特殊数据;这里将解析的节目数据列表赋值给originalItemBeans | ||
| 44 | + mCompBean.getOriginalItemBeans().clear(); | ||
| 45 | + mCompBean.getOriginalItemBeans().addAll(mCompBean.getDataList()); | ||
| 46 | + initItemBean(mCompBean.getOriginalItemBeans()); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 初始化item数据<BR> | ||
| 51 | + * 扩展用 | ||
| 52 | + * | ||
| 53 | + * @param contents item数据列表 | ||
| 54 | + */ | ||
| 55 | + protected abstract void initItemBean(@NonNull List<ItemBean> contents); | ||
| 56 | + | ||
| 57 | + | ||
| 58 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import java.util.ArrayList; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +import androidx.annotation.NonNull; | ||
| 11 | + | ||
| 12 | +import com.people.entity.custom.comp.CompBean; | ||
| 13 | +import com.people.entity.custom.item.ItemBean; | ||
| 14 | +import com.people.entity.custom.section.SectionBean; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 可以直接作为item展示的section基类<BR> | ||
| 18 | + * 如,两列多行的样式(上图下文01)、标题(LABEL-01)、按钮(BUTTON-01) | ||
| 19 | + * 理论上只会有 ContentBean数据类型,其他都是BaseContainerSection里处理,自定义数据bean | ||
| 20 | + * | ||
| 21 | + * @author zhangbo | ||
| 22 | + * @version [V1.0.0, 2022/1/19] | ||
| 23 | + * @param <T> item数据泛型限定 | ||
| 24 | + * @param <F> 泛型,待扩展限定 | ||
| 25 | + * @since V1.0.0 | ||
| 26 | + */ | ||
| 27 | +public abstract class BaseItemSectionOld<T extends ItemBean, F extends SectionBean> extends AbsSection<T, F> { | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 构造器 | ||
| 31 | + * | ||
| 32 | + * @param parent 承载section的group对象,即父节点 | ||
| 33 | + * @param compType comp组件类型 | ||
| 34 | + * @param compStyle comp组件样式 | ||
| 35 | + */ | ||
| 36 | + public BaseItemSectionOld(AbsGroup parent, String compType, String compStyle) { | ||
| 37 | + super(parent, compType, compStyle); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 构造器 | ||
| 42 | + * | ||
| 43 | + * @param parent 承载section的group对象,即父节点 | ||
| 44 | + * @param compBean comp组件对应的comp数据 | ||
| 45 | + */ | ||
| 46 | + public BaseItemSectionOld(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 47 | + super(parent, compBean); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @Override | ||
| 51 | + protected void parseData(String data) { | ||
| 52 | + | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + protected void addItems(List<T> dataList) { | ||
| 56 | + // 将数据列表设置到comp里 | ||
| 57 | + if (mCompBean == null || dataList == null) { | ||
| 58 | + return; | ||
| 59 | + } | ||
| 60 | + if (mCompBean.getOriginalItemBeans() == null) { | ||
| 61 | + mCompBean.setOriginalItemBeans(new ArrayList<>()); | ||
| 62 | + } | ||
| 63 | + mCompBean.getOriginalItemBeans().clear(); | ||
| 64 | + mCompBean.getOriginalItemBeans().addAll(dataList); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 初始化item数据 | ||
| 69 | + * | ||
| 70 | + * @param itemBean item数据 | ||
| 71 | + */ | ||
| 72 | + @Deprecated | ||
| 73 | + protected void initItemBean(@NonNull T itemBean) { | ||
| 74 | + // 后续去掉该方法,这里没有被调用 | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + protected final void parseData() { | ||
| 79 | + // 非容器类型的item,没有特殊数据;这里将解析的节目数据列表赋值给originalItemBeans | ||
| 80 | + mCompBean.getOriginalItemBeans().clear(); | ||
| 81 | + mCompBean.getOriginalItemBeans().addAll(mCompBean.getDataList()); | ||
| 82 | + } | ||
| 83 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import com.people.entity.custom.comp.GroupBean; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Group类<BR> | ||
| 11 | + * 可以看做是一个栏目单元;可以是轮播图、横向列表、多列展示的卡片等 | ||
| 12 | + * | ||
| 13 | + * @author zhangbo | ||
| 14 | + * @version [V1.0.0, 2021/12/8] | ||
| 15 | + * @since V1.0.0 | ||
| 16 | + */ | ||
| 17 | +public class Group extends AbsGroup { | ||
| 18 | + | ||
| 19 | + private GroupBean groupBean; | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 构造器 | ||
| 24 | + * | ||
| 25 | + * @param dataBean Group对应的实体对象 | ||
| 26 | + * @param parent 父类对象 | ||
| 27 | + */ | ||
| 28 | + public Group(GroupBean dataBean, AbsPage parent) { | ||
| 29 | + super(dataBean, parent); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 构造器 | ||
| 34 | + * | ||
| 35 | + * @param groupId 楼层id | ||
| 36 | + * @param parent page对象 | ||
| 37 | + */ | ||
| 38 | + public Group(String groupId, AbsPage parent) { | ||
| 39 | + super(groupId, parent); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public void parseData(GroupBean var1) { | ||
| 44 | + super.parseData(var1); | ||
| 45 | + this.groupBean = var1; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public GroupBean getGroupBean() { | ||
| 49 | + return groupBean; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public void setGroupBean(GroupBean groupBean) { | ||
| 53 | + this.groupBean = groupBean; | ||
| 54 | + } | ||
| 55 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutdata; | ||
| 7 | + | ||
| 8 | +public interface ILayoutPresenter<T extends AbsPage> { | ||
| 9 | + | ||
| 10 | + /** | ||
| 11 | + * 页面刷新完成 | ||
| 12 | + */ | ||
| 13 | + void onRefreshPageSuccess(); | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 页面数据刷新失败 | ||
| 17 | + */ | ||
| 18 | + void onRefreshDataFailed(); | ||
| 19 | + | ||
| 20 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +import com.orhanobut.logger.Logger; | ||
| 10 | +import com.people.entity.custom.comp.GroupBean; | ||
| 11 | +import com.people.entity.custom.comp.PageBean; | ||
| 12 | +import com.wondertek.wheat.ability.tools.StringUtils; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * Page类<BR> | ||
| 16 | + * 可以看做是一个页面,收集多个Group。瀑布流展示页面 | ||
| 17 | + * | ||
| 18 | + * @author zhangbo | ||
| 19 | + * @version [V1.0.0, 2021/12/8] | ||
| 20 | + * @since V1.0.0 | ||
| 21 | + */ | ||
| 22 | +public class Page extends AbsPage { | ||
| 23 | + | ||
| 24 | + private static final String TAG = "Page"; | ||
| 25 | + | ||
| 26 | + private PageBean mPageBean; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 构造器 | ||
| 30 | + */ | ||
| 31 | + public Page() { | ||
| 32 | + super(); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 数据解析,组装group列表数据 | ||
| 38 | + * | ||
| 39 | + * @param pageBean PageBean数据 | ||
| 40 | + */ | ||
| 41 | + public void createGroup(PageBean pageBean) { | ||
| 42 | + if (pageBean == null) { | ||
| 43 | + Logger.t(TAG).e( "createGroup, pageBean is null"); | ||
| 44 | + return; | ||
| 45 | + } | ||
| 46 | + this.setId(pageBean.getId()); | ||
| 47 | + this.getGroups().clear(); | ||
| 48 | + //收集楼层排序和编号, | ||
| 49 | + List<GroupBean> groups = pageBean.getGroups(); | ||
| 50 | + for (int i = 0 ; i < groups.size();i++) { | ||
| 51 | + GroupBean bean = groups.get(i); | ||
| 52 | + if (StringUtils.isEmpty(bean.getId())) { | ||
| 53 | + // 丢弃无效group数据 | ||
| 54 | + continue; | ||
| 55 | + } | ||
| 56 | + Group groupBean = new Group(bean.getId(), this); | ||
| 57 | + groupBean.setPosition(i); | ||
| 58 | + groupBean.setBlockDesc(bean.getBlockDesc()); | ||
| 59 | + groupBean.setStartPosition(i); | ||
| 60 | + groupBean.setGroupStrategy(bean.getGroupStrategy()); | ||
| 61 | + this.getGroups().add(groupBean); | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public PageBean getPage() { | ||
| 66 | + return mPageBean; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public void setPage(PageBean pageBean) { | ||
| 70 | + this.mPageBean = pageBean; | ||
| 71 | + } | ||
| 72 | +} |
| 1 | +package com.wd.display.comp.layoutdata.channel; | ||
| 2 | + | ||
| 3 | +import java.util.ArrayList; | ||
| 4 | +import java.util.List; | ||
| 5 | + | ||
| 6 | +import android.text.TextUtils; | ||
| 7 | + | ||
| 8 | +import androidx.annotation.NonNull; | ||
| 9 | + | ||
| 10 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 11 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 12 | +import com.people.entity.adv.CompAdvExtraDataBean; | ||
| 13 | +import com.people.entity.custom.comp.CompBean; | ||
| 14 | +import com.people.entity.custom.content.ContentBean; | ||
| 15 | +import com.people.entity.custom.content.ContentTypeConstant; | ||
| 16 | +import com.people.entity.custom.label.CompAdv01Bean; | ||
| 17 | +import com.people.toolset.json.GsonUtils; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * @Description: 广告 | ||
| 21 | + * @Author: Li Yubing | ||
| 22 | + * @Email: liyubing@wondert.com.cn | ||
| 23 | + * @CreateDate: 2023/11/1 16:45 | ||
| 24 | + * @Version: 1.0 | ||
| 25 | + */ | ||
| 26 | +public class AdvSection extends BaseContainerSection<CompAdv01Bean> { | ||
| 27 | + | ||
| 28 | + private static final String TAG = "AggregationSection"; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 构造器 | ||
| 32 | + * | ||
| 33 | + * @param parent 承载section的group对象,即父节点 | ||
| 34 | + * @param compBean comp组件对应的comp数据 | ||
| 35 | + */ | ||
| 36 | + public AdvSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 37 | + super(parent, compBean); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + protected void initItemBean(@NonNull CompAdv01Bean itemBean) { | ||
| 42 | + | ||
| 43 | + List<ContentBean> subList = itemBean.getSubList(); | ||
| 44 | + if (subList != null && subList.size() > 0) { | ||
| 45 | + ContentBean contentBean = subList.get(0); | ||
| 46 | + String extraData = contentBean.getExtra(); | ||
| 47 | + CompAdvExtraDataBean compAdvExtraDataBean = GsonUtils.fromJson(extraData, CompAdvExtraDataBean.class); | ||
| 48 | + | ||
| 49 | + itemBean.compAdvExtraDataBean = compAdvExtraDataBean; | ||
| 50 | + itemBean.topImageUrl = compAdvExtraDataBean.itemTopImage; | ||
| 51 | + | ||
| 52 | + if (compAdvExtraDataBean.itemMore != null) { | ||
| 53 | + CompAdvExtraDataBean.ItemBean moreItemBean = compAdvExtraDataBean.itemMore; | ||
| 54 | + ContentBean moreBean = new ContentBean(); | ||
| 55 | + moreBean.setNewsTitle(moreItemBean.title); | ||
| 56 | + moreBean.setCoverUrl(moreItemBean.image); | ||
| 57 | + moreBean.setLinkUrl(moreItemBean.linkUrl); | ||
| 58 | + | ||
| 59 | + moreBean.setLinkType(moreItemBean.linkType); | ||
| 60 | + if ("0".equals(moreItemBean.linkType)) { | ||
| 61 | + moreBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_ZERO)); | ||
| 62 | + } else { | ||
| 63 | + moreBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_FOUR)); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + moreBean.setTopicInfoBean(mCompBean.getTopicInfoBean()); | ||
| 67 | + moreBean.setChannelInfoBean(mCompBean.getChannelInfoBean()); | ||
| 68 | + moreBean.setRecommend(mCompBean.getRecommend()); | ||
| 69 | + moreBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal()); | ||
| 70 | + moreBean.setCompId(mCompBean.getId()); | ||
| 71 | + | ||
| 72 | + itemBean.moreBean = moreBean; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + List<CompAdvExtraDataBean.ItemBean> advExtraItemList = compAdvExtraDataBean.item; | ||
| 77 | + List<ContentBean> adContentBeanList = new ArrayList<>(); | ||
| 78 | + if (advExtraItemList != null && advExtraItemList.size() > 0) { | ||
| 79 | + // 计算出最长标题 | ||
| 80 | + String maxTitleStr = null; | ||
| 81 | + for (CompAdvExtraDataBean.ItemBean advExtraDataBean : advExtraItemList) { | ||
| 82 | + | ||
| 83 | + ContentBean adContentBean = new ContentBean(); | ||
| 84 | + String newsTitle = advExtraDataBean.title; | ||
| 85 | + adContentBean.setNewsTitle(newsTitle); | ||
| 86 | + adContentBean.setCoverUrl(advExtraDataBean.image); | ||
| 87 | + adContentBean.setLinkUrl(advExtraDataBean.linkUrl); | ||
| 88 | + adContentBean.setLinkType(advExtraDataBean.linkType); | ||
| 89 | + if ("0".equals(advExtraDataBean.linkType)) { | ||
| 90 | + adContentBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_ZERO)); | ||
| 91 | + } else { | ||
| 92 | + adContentBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_FOUR)); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + | ||
| 96 | + adContentBean.setTopicInfoBean(mCompBean.getTopicInfoBean()); | ||
| 97 | + adContentBean.setChannelInfoBean(mCompBean.getChannelInfoBean()); | ||
| 98 | + adContentBean.setRecommend(mCompBean.getRecommend()); | ||
| 99 | + adContentBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal()); | ||
| 100 | + adContentBean.setCompId(mCompBean.getId()); | ||
| 101 | + | ||
| 102 | + if (!TextUtils.isEmpty(newsTitle)) { | ||
| 103 | + if (TextUtils.isEmpty(maxTitleStr)) { | ||
| 104 | + maxTitleStr = newsTitle; | ||
| 105 | + } else { | ||
| 106 | + if (newsTitle.length() > maxTitleStr.length()) { | ||
| 107 | + maxTitleStr = newsTitle; | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + adContentBeanList.add(adContentBean); | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + itemBean.maxTitleName = maxTitleStr; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + itemBean.adContentBeanList = adContentBeanList; | ||
| 119 | + | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + @Override | ||
| 124 | + public Class getDataClazz() { | ||
| 125 | + return CompAdv01Bean.class; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + @Override | ||
| 129 | + public String getLogTag() { | ||
| 130 | + return TAG; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +import androidx.annotation.NonNull; | ||
| 10 | + | ||
| 11 | +import com.people.component.comp.layoutdata.BaseItemSection; | ||
| 12 | +import com.people.entity.custom.BaseLineBean; | ||
| 13 | +import com.people.entity.custom.comp.CompBean; | ||
| 14 | +import com.people.entity.custom.item.ItemBean; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 底线样式(page接口返回的数据,不同于其他样式) | ||
| 18 | + * | ||
| 19 | + * @author zhangbo | ||
| 20 | + * @version [V1.0.0, 2022/4/14] | ||
| 21 | + * @since V1.0.0 | ||
| 22 | + */ | ||
| 23 | +public class BaseLineSection extends BaseItemSection<BaseLineBean> { | ||
| 24 | + private BaseLineBean mBaseLineBean; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 构造器 | ||
| 28 | + * | ||
| 29 | + * @param baseLineData 底线数据 | ||
| 30 | + */ | ||
| 31 | + public BaseLineSection(@NonNull BaseLineBean baseLineData) { | ||
| 32 | + super(null, new CompBean()); | ||
| 33 | + mBaseLineBean = baseLineData; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + protected void initItemBean(@NonNull List<ItemBean> contents) { | ||
| 38 | + // 无特殊处理 | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public String getLogTag() { | ||
| 43 | + return "BaseLineSection"; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + @Override | ||
| 47 | + public Class<BaseLineBean> getDataClazz() { | ||
| 48 | + return BaseLineBean.class; | ||
| 49 | + } | ||
| 50 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 10 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 11 | +import com.people.entity.custom.comp.CompBean; | ||
| 12 | +import com.people.entity.custom.label.Button01Bean; | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 标题section | ||
| 17 | + */ | ||
| 18 | +public class ButtonSection extends BaseContainerSection<Button01Bean> { | ||
| 19 | + | ||
| 20 | + private static final String TAG = "TitleLabelSection"; | ||
| 21 | + | ||
| 22 | + public ButtonSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 23 | + super(parent, compBean); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + protected void initItemBean(@NonNull Button01Bean labelBean) { | ||
| 28 | + if (mCompBean == null) { | ||
| 29 | + return; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + @Override | ||
| 35 | + public Class getDataClazz() { | ||
| 36 | + return ButtonSection.class; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + public String getLogTag() { | ||
| 41 | + return TAG; | ||
| 42 | + } | ||
| 43 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 10 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 11 | +import com.people.entity.custom.NavigationBeanNews; | ||
| 12 | +import com.people.entity.custom.comp.CompBean; | ||
| 13 | +import com.people.entity.custom.follow.CompFollowBean; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @Description: 用户关注数据 | ||
| 17 | + * @Author: liyub | ||
| 18 | + * @Email: liyubing@wondertek.com.cn | ||
| 19 | + * @CreateDate: 2023/10/20 | ||
| 20 | + * @UpdateRemark: 更新说明 | ||
| 21 | + * @Version: 1.0 | ||
| 22 | + */ | ||
| 23 | +public class CompFollowSection extends BaseContainerSection<CompFollowBean> { | ||
| 24 | + | ||
| 25 | + private static final String TAG = "AggregationSection"; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 构造器 | ||
| 29 | + * | ||
| 30 | + * @param parent 承载section的group对象,即父节点 | ||
| 31 | + * @param compBean comp组件对应的comp数据 | ||
| 32 | + */ | ||
| 33 | + public CompFollowSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 34 | + super(parent, compBean); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @Override | ||
| 38 | + protected void initItemBean(@NonNull CompFollowBean itemBean) { | ||
| 39 | + itemBean.setId(mCompBean.getId()); | ||
| 40 | + itemBean.setName(mCompBean.getName()); | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public Class getDataClazz() { | ||
| 47 | + return NavigationBeanNews.class; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @Override | ||
| 51 | + public String getLogTag() { | ||
| 52 | + return TAG; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | +import androidx.annotation.NonNull; | ||
| 10 | + | ||
| 11 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 12 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 13 | +import com.people.entity.custom.NavigationBeanNews; | ||
| 14 | +import com.people.entity.custom.comp.CompBean; | ||
| 15 | +import com.people.entity.custom.content.ContentBean; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 图片section | ||
| 19 | + * | ||
| 20 | + * @author 周楷桐 | ||
| 21 | + */ | ||
| 22 | +public class ImageSection extends BaseContainerSection<NavigationBeanNews> { | ||
| 23 | + | ||
| 24 | + private static final String TAG = "AggregationSection"; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 构造器 | ||
| 28 | + * | ||
| 29 | + * @param parent 承载section的group对象,即父节点 | ||
| 30 | + * @param compBean comp组件对应的comp数据 | ||
| 31 | + */ | ||
| 32 | + public ImageSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 33 | + super(parent, compBean); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + protected void initItemBean(@NonNull NavigationBeanNews itemBean) { | ||
| 38 | + itemBean.setId(mCompBean.getId()); | ||
| 39 | + itemBean.setName(mCompBean.getName()); | ||
| 40 | + itemBean.setExtraData(mCompBean.getExtraDataStr()); | ||
| 41 | + List<ContentBean> subList = itemBean.getSubList(); | ||
| 42 | + if (subList != null) { | ||
| 43 | + for (ContentBean contentBean : subList) { | ||
| 44 | + contentBean.setTopicInfoBean(mCompBean.getTopicInfoBean()); | ||
| 45 | + contentBean.setChannelInfoBean(mCompBean.getChannelInfoBean()); | ||
| 46 | + contentBean.setRecommend(mCompBean.getRecommend()); | ||
| 47 | + contentBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal()); | ||
| 48 | + contentBean.setCompId(mCompBean.getId()); | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + @Override | ||
| 54 | + public Class getDataClazz() { | ||
| 55 | + return NavigationBeanNews.class; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + @Override | ||
| 59 | + public String getLogTag() { | ||
| 60 | + return TAG; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import androidx.annotation.NonNull; | ||
| 8 | + | ||
| 9 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 10 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 11 | +import com.people.entity.custom.comp.CompBean; | ||
| 12 | +import com.people.entity.custom.label.Label01Bean; | ||
| 13 | +import com.people.entity.custom.label.Line01Bean; | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 线section | ||
| 18 | + */ | ||
| 19 | +public class LineSection extends BaseContainerSection<Line01Bean> { | ||
| 20 | + | ||
| 21 | + private static final String TAG = "LineSection"; | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + public LineSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 25 | + super(parent, compBean); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + protected void initItemBean(@NonNull Line01Bean labelBean) { | ||
| 30 | + if (mCompBean == null) { | ||
| 31 | + return; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + public Class getDataClazz() { | ||
| 38 | + return Label01Bean.class; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public String getLogTag() { | ||
| 43 | + return TAG; | ||
| 44 | + } | ||
| 45 | +} |
| 1 | +package com.wd.display.comp.layoutdata.channel; | ||
| 2 | + | ||
| 3 | +import org.jetbrains.annotations.NotNull; | ||
| 4 | + | ||
| 5 | +import androidx.annotation.NonNull; | ||
| 6 | + | ||
| 7 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 8 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 9 | +import com.people.entity.custom.comp.CompBean; | ||
| 10 | +import com.people.entity.custom.label.OneKeyPlayBean; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * @Description: 一键读报section类 | ||
| 14 | + * @Author: Li Yubing | ||
| 15 | + * @Email: liyubing@wondert.com.cn | ||
| 16 | + * @CreateDate: 2023/6/20 17:14 | ||
| 17 | + * @Version: 1.0 | ||
| 18 | + */ | ||
| 19 | +public class OneKeyPlaySection extends BaseContainerSection<OneKeyPlayBean> { | ||
| 20 | + | ||
| 21 | + private static final String TAG = "OneKeyPlaySection"; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 构造器 | ||
| 25 | + * | ||
| 26 | + * @param parent 承载section的group对象,即父节点 | ||
| 27 | + * @param compBean comp组件对应的comp数据 | ||
| 28 | + */ | ||
| 29 | + public OneKeyPlaySection(AbsGroup parent, @NonNull @NotNull CompBean compBean) { | ||
| 30 | + super(parent, compBean); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + protected void initItemBean(@NonNull @NotNull OneKeyPlayBean itemBean) { | ||
| 35 | + itemBean.setTopicInfoBean(mCompBean.getTopicInfoBean()); | ||
| 36 | + itemBean.setGroupId(mCompBean.getGroupId()); | ||
| 37 | + | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public String getLogTag() { | ||
| 42 | + return TAG; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public Class getDataClazz() { | ||
| 47 | + return OneKeyPlaySection.class; | ||
| 48 | + } | ||
| 49 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.display.comp.layoutdata.channel; | ||
| 6 | + | ||
| 7 | +import android.text.TextUtils; | ||
| 8 | + | ||
| 9 | +import androidx.annotation.NonNull; | ||
| 10 | + | ||
| 11 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 12 | +import com.people.component.comp.layoutdata.BaseContainerSection; | ||
| 13 | +import com.people.entity.custom.comp.CompBean; | ||
| 14 | +import com.people.entity.custom.content.ContentTypeConstant; | ||
| 15 | +import com.people.entity.custom.label.Label01Bean; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 标题section | ||
| 20 | + */ | ||
| 21 | +public class TitleLabelSection extends BaseContainerSection<Label01Bean> { | ||
| 22 | + | ||
| 23 | + private static final String TAG = "TitleLabelSection"; | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + public TitleLabelSection(AbsGroup parent, @NonNull CompBean compBean) { | ||
| 27 | + super(parent, compBean); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + @Override | ||
| 31 | + protected void initItemBean(@NonNull Label01Bean labelBean) { | ||
| 32 | + if (mCompBean == null) { | ||
| 33 | + return; | ||
| 34 | + } | ||
| 35 | + if(TextUtils.isEmpty(mCompBean.getObjectTitle())){ | ||
| 36 | + labelBean.setTitle(mCompBean.getName()); | ||
| 37 | + }else { | ||
| 38 | + labelBean.setTitle(mCompBean.getObjectTitle()); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + labelBean.setSubTitle(mCompBean.getObjectSummary()); | ||
| 42 | + String style = mCompBean.getCompStyle(); | ||
| 43 | + String type = mCompBean.getCompType(); | ||
| 44 | + | ||
| 45 | + String objectType = mCompBean.getObjectType(); | ||
| 46 | + if (TextUtils.isEmpty(objectType)) { | ||
| 47 | + labelBean.setShowMore(false); | ||
| 48 | + } else { | ||
| 49 | + if (String.valueOf(ContentTypeConstant.URL_TYPE_ZERO).equals(objectType)) { | ||
| 50 | + labelBean.setShowMore(false); | ||
| 51 | + } else { | ||
| 52 | + labelBean.setShowMore(true); | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @Override | ||
| 58 | + public Class getDataClazz() { | ||
| 59 | + return Label01Bean.class; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @Override | ||
| 63 | + public String getLogTag() { | ||
| 64 | + return TAG; | ||
| 65 | + } | ||
| 66 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutmanager; | ||
| 7 | + | ||
| 8 | +import java.util.HashSet; | ||
| 9 | + | ||
| 10 | +import android.util.Log; | ||
| 11 | +import android.view.LayoutInflater; | ||
| 12 | +import android.view.View; | ||
| 13 | +import android.view.ViewGroup; | ||
| 14 | + | ||
| 15 | +import androidx.annotation.NonNull; | ||
| 16 | +import androidx.recyclerview.widget.RecyclerView; | ||
| 17 | + | ||
| 18 | +import com.people.component.R; | ||
| 19 | +import com.people.entity.custom.item.ItemBean; | ||
| 20 | + | ||
| 21 | +public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 标记楼层是否初始化过 | ||
| 25 | + */ | ||
| 26 | + private HashSet<Integer> initialSet = new HashSet<>(); | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + public final int getItemViewType(int position) { | ||
| 30 | + try { | ||
| 31 | + ItemLayoutManager lm = layoutManagerAtPosition(position); | ||
| 32 | + if (lm != null) { | ||
| 33 | + return lm.getItemViewType(); | ||
| 34 | + } | ||
| 35 | + } catch (Exception e) { | ||
| 36 | + e.printStackTrace(); | ||
| 37 | + } | ||
| 38 | + return R.layout.rmrb_item_layout_placeholder; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 获取在position位置的item对应的ItemLayoutManager | ||
| 43 | + * | ||
| 44 | + * @param position adapter position | ||
| 45 | + */ | ||
| 46 | + protected abstract ItemLayoutManager layoutManagerAtPosition(int position); | ||
| 47 | + | ||
| 48 | + @NonNull | ||
| 49 | + @Override | ||
| 50 | + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
| 51 | + return new BaseViewHolder(LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false)); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Override | ||
| 55 | + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | ||
| 56 | + ItemLayoutManager layoutManager = layoutManagerAtPosition(position); | ||
| 57 | + if(layoutManager == null){ | ||
| 58 | + return; | ||
| 59 | + } | ||
| 60 | + if (!initialSet.contains(position)) { | ||
| 61 | + initialSet.add(position); | ||
| 62 | + try { | ||
| 63 | + layoutManager.onCreateViewHolder(this, holder.itemView); | ||
| 64 | + } catch (Exception e) { | ||
| 65 | + Log.e("onCreateViewHolder异常", e.getMessage()); | ||
| 66 | + e.printStackTrace(); | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + layoutManager.prepareItem(holder.itemView, position); | ||
| 71 | + layoutManager.setItemViewLongClickListener(holder.itemView, position); | ||
| 72 | + ItemBean itemBean = getItemData(layoutManager, position); | ||
| 73 | + if (itemBean != null) { | ||
| 74 | + layoutManager.bindItem(holder.itemView, position, itemBean); | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + public ItemBean getItemData(ItemLayoutManager layoutManager, int position) { | ||
| 79 | + if (layoutManager == null || layoutManager.index == null || layoutManager.getSection() == null) { | ||
| 80 | + return null; | ||
| 81 | + } | ||
| 82 | + int sectionItemIndex = layoutManager.index.getPositionInSection(position); | ||
| 83 | + return layoutManager.getSection().getItemData(sectionItemIndex); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + public static class BaseViewHolder extends RecyclerView.ViewHolder { | ||
| 87 | + | ||
| 88 | + public BaseViewHolder(@NonNull View itemView) { | ||
| 89 | + super(itemView); | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | +} |
wddisplay/src/main/java/com/wd/display/comp/layoutmanager/ILayoutManagerScrollListener.java
0 → 100644
| 1 | +package com.wd.display.comp.layoutmanager; | ||
| 2 | + | ||
| 3 | +import android.view.View; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 楼层内组件滑动监听 如内部嵌套的推荐位滑动 | ||
| 8 | + */ | ||
| 9 | +public interface ILayoutManagerScrollListener { | ||
| 10 | + | ||
| 11 | + void onScrolled(View view, int dx, int dy); | ||
| 12 | + | ||
| 13 | + void onScrollStateChanged(View view, int newState); | ||
| 14 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutmanager; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +import androidx.annotation.NonNull; | ||
| 11 | + | ||
| 12 | +import com.people.component.comp.layoutdata.AbsPage; | ||
| 13 | +import com.people.component.comp.layoutdata.AbsSection; | ||
| 14 | +import com.people.component.comp.layoutdata.Page; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Page 布局渲染器, 将comp渲染到页面上 | ||
| 18 | + * | ||
| 19 | + * @author wd | ||
| 20 | + */ | ||
| 21 | +public interface ILayoutRender { | ||
| 22 | + /** | ||
| 23 | + * 从startIndex开始有count个item被移除 | ||
| 24 | + * | ||
| 25 | + * @param startIndex 移除item范围的开始位置 | ||
| 26 | + * @param count 移除item的个数 | ||
| 27 | + */ | ||
| 28 | + void itemRangeRemoved(int startIndex, int count); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 移除置指定的item | ||
| 32 | + * @param positon | ||
| 33 | + */ | ||
| 34 | + void itemRemoved(int positon); | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 依据LayoutManager的 HashCode值删除对应的LayoutManager | ||
| 38 | + * @param hashCode | ||
| 39 | + */ | ||
| 40 | + void itemRemovedByLayoutManagerHashCode(int hashCode); | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 从startIndex开始添加count个item | ||
| 44 | + * | ||
| 45 | + * @param startIndex 添加item范围的开始位置 | ||
| 46 | + * @param count 添加item的个数 | ||
| 47 | + */ | ||
| 48 | + void itemRangeInserted(int startIndex, int count); | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 从startIndex开始有count个item数据被更新 | ||
| 52 | + * | ||
| 53 | + * @param startIndex 更新item范围的开始位置 | ||
| 54 | + * @param count 更新item的个数 | ||
| 55 | + */ | ||
| 56 | + void itemRangeChanged(int startIndex, int count); | ||
| 57 | + // | ||
| 58 | + // /** | ||
| 59 | + // * 获取在position位置的item对应的ItemLayoutManager | ||
| 60 | + // * | ||
| 61 | + // * @param position adapter position | ||
| 62 | + // */ | ||
| 63 | + // ILayoutManager layoutManagerAtPosition(int position); | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 渲染页面 | ||
| 67 | + * | ||
| 68 | + * @param page Page实例 | ||
| 69 | + */ | ||
| 70 | + void renderPage(AbsPage page,boolean isRefresh); | ||
| 71 | + | ||
| 72 | + // /** | ||
| 73 | + // * 渲染overlay浮层 | ||
| 74 | + // * | ||
| 75 | + // * @param overlay 浮层实例定义 | ||
| 76 | + // */ | ||
| 77 | + // void renderOverlay(List<MGOverlay> overlay); | ||
| 78 | + // | ||
| 79 | + // /** | ||
| 80 | + // * 获取从位置start启到end之间的所有布局管理器 | ||
| 81 | + // * | ||
| 82 | + // * @param start 启示位置 | ||
| 83 | + // * @param end 结束位置 | ||
| 84 | + // * @return 从位置start启到end之间的所有布局管理器列表 | ||
| 85 | + // */ | ||
| 86 | + // List<ILayoutManager> layoutManagerForRange(int start, int end); | ||
| 87 | + // | ||
| 88 | + // /** | ||
| 89 | + // * 获取Page中Item总条数 | ||
| 90 | + // * | ||
| 91 | + // * @return | ||
| 92 | + // */ | ||
| 93 | + // int getItemCount(); | ||
| 94 | + // | ||
| 95 | + | ||
| 96 | + /** | ||
| 97 | + * 获取所有comp 的布局管理器 | ||
| 98 | + * | ||
| 99 | + * @return list | ||
| 100 | + */ | ||
| 101 | + List<ItemLayoutManager> getAllSectionLayoutManager(); | ||
| 102 | + | ||
| 103 | + // | ||
| 104 | + // | ||
| 105 | + // void refreshGroup(AbsGroup group, boolean needNotify); | ||
| 106 | + // | ||
| 107 | + // void refreshSection(AbsSection section, boolean needNotify); | ||
| 108 | + // | ||
| 109 | + // /** | ||
| 110 | + // * section中item被删除,并更新section的索引,后续所有section的索引也会被更新 | ||
| 111 | + // * | ||
| 112 | + // * @param section 需要更新索引的section | ||
| 113 | + // * @param start 删除item的开始位置, item处在section中的相对位置 | ||
| 114 | + // * @param count item删除的个数 | ||
| 115 | + // * @param needNotify 申明是否需要通知页面刷新数据 | ||
| 116 | + // */ | ||
| 117 | + // void sectionItemRemoved(AbsSection section, int start, int count, boolean needNotify); | ||
| 118 | + // | ||
| 119 | + // /** | ||
| 120 | + // * section中添加新的item,并更新section的索引,后续所有section的索引也会被更新 | ||
| 121 | + // * | ||
| 122 | + // * @param section 需要更新索引的section | ||
| 123 | + // * @param start 删除item的开始位置, item处在section中的相对位置 | ||
| 124 | + // * @param count item删除的个数 | ||
| 125 | + // * @param needNotify 申明是否需要通知页面刷新数据 | ||
| 126 | + // */ | ||
| 127 | + // void sectionItemInserted(AbsSection section, int start, int count, boolean needNotify); | ||
| 128 | + // | ||
| 129 | + /** | ||
| 130 | + * section中添加新的item,并更新section的索引,后续所有section的索引也会被更新 | ||
| 131 | + * | ||
| 132 | + * @param section 需要更新索引的section | ||
| 133 | + */ | ||
| 134 | + void sectionItemUpdated(@NonNull AbsSection section); | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * notifyDataSetChanged | ||
| 138 | + */ | ||
| 139 | + void notifyDataSetChanged(); | ||
| 140 | + | ||
| 141 | + void releaseLayoutManagers(); | ||
| 142 | + | ||
| 143 | + void addBaseLine(Page mPage); | ||
| 144 | + | ||
| 145 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutmanager; | ||
| 7 | + | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +import androidx.annotation.NonNull; | ||
| 12 | + | ||
| 13 | +import com.orhanobut.logger.Logger; | ||
| 14 | +import com.people.component.comp.layoutdata.AbsGroup; | ||
| 15 | +import com.people.component.comp.layoutdata.AbsPage; | ||
| 16 | +import com.people.component.comp.layoutdata.AbsSection; | ||
| 17 | +import com.people.component.comp.layoutdata.channel.BaseLineSection; | ||
| 18 | +import com.people.component.comp.layoutmanager.channel.BaseLineLayoutManager; | ||
| 19 | +import com.people.entity.custom.BaseLineBean; | ||
| 20 | +import com.people.entity.custom.item.ItemBean; | ||
| 21 | +import com.wondertek.wheat.ability.tools.ArrayUtils; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * | ||
| 25 | + */ | ||
| 26 | +public class Indexer { | ||
| 27 | + | ||
| 28 | + private static final String TAG = "Indexer"; | ||
| 29 | + | ||
| 30 | + private List<ItemLayoutManager> itemLayoutManagers; | ||
| 31 | + | ||
| 32 | + public Indexer() { | ||
| 33 | + itemLayoutManagers = new ArrayList<>(); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 页面中多个楼层,每个楼层配置多个组件信息转换layoutManager,每次转换只对一个楼层中新增的组件信息转换 | ||
| 39 | + * <p> | ||
| 40 | + * page | ||
| 41 | + * groupA | ||
| 42 | + * comp1 ->section1 ->layoutmanager1 | ||
| 43 | + * comp2 ->section2 ->layoutmanager2 | ||
| 44 | + * comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager | ||
| 45 | + * .... ------------------------> List<ItemLayoutManager> | ||
| 46 | + * groupB | ||
| 47 | + * comp1 ->section1 ->layoutmanager1 | ||
| 48 | + * comp2 ->section2 ->layoutmanager2 | ||
| 49 | + * comp3 ->section3 ->layoutmanager3 | ||
| 50 | + * ... | ||
| 51 | + * ... | ||
| 52 | + * <p> | ||
| 53 | + * 依据楼层更新itemLayoutManagers | ||
| 54 | + * | ||
| 55 | + * @param page 页面信息 | ||
| 56 | + * @param isRefresh true:清理缓存数据 | ||
| 57 | + */ | ||
| 58 | + public void updateItemLayoutManagersByGroup(AbsPage page, boolean isRefresh) { | ||
| 59 | + Logger.t(TAG).d("updateItemLayoutManagers"); | ||
| 60 | + | ||
| 61 | + if (page == null || page.getGroups() == null) { | ||
| 62 | + return; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + // 刷新即清理LayoutManger | ||
| 66 | + if (isRefresh) { | ||
| 67 | + itemLayoutManagers.clear(); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + // 获取当前页面可支持需要加载更多数据的楼层对象 | ||
| 71 | + AbsGroup group = page.getGroups().get(page.getGroupIndex()); | ||
| 72 | + // comp在group里的下标 | ||
| 73 | + | ||
| 74 | + int sectionSize = group.getSections().size(); | ||
| 75 | + int groupIndex = group.getStartPosition(); | ||
| 76 | + | ||
| 77 | + // j :正在使用的楼层展示总数量 | ||
| 78 | + int j = group.getDisplayItemCount(); | ||
| 79 | + | ||
| 80 | + int sectionIndex = -1+j; | ||
| 81 | + | ||
| 82 | + List<ItemBean> list; | ||
| 83 | + for (; j < sectionSize; ++j) { | ||
| 84 | + AbsSection section = group.getSections().get(j); | ||
| 85 | + if (section == null) { | ||
| 86 | + continue; | ||
| 87 | + } | ||
| 88 | + sectionIndex++; | ||
| 89 | + section.setPosition(sectionIndex); | ||
| 90 | + | ||
| 91 | + // 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据; | ||
| 92 | + section.setupOrNotSection(); | ||
| 93 | + | ||
| 94 | + // 根据展示数据list 进行展示,限制于displayCount | ||
| 95 | + if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) { | ||
| 96 | + continue; | ||
| 97 | + } | ||
| 98 | + int itemIndex = -1; | ||
| 99 | + list = new ArrayList<>(); | ||
| 100 | + int sectionItemCount = section.getCompBean().getDisplayItemBeans().size(); | ||
| 101 | + for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) { | ||
| 102 | + if (itemBean == null) { | ||
| 103 | + continue; | ||
| 104 | + } | ||
| 105 | + ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section); | ||
| 106 | + if (layoutManager == null) { | ||
| 107 | + continue; | ||
| 108 | + } | ||
| 109 | + itemIndex++; | ||
| 110 | + layoutManager.setFragment(page.getFragment()); | ||
| 111 | + layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount)); | ||
| 112 | + layoutManager.setSection(section); | ||
| 113 | + itemLayoutManagers.add(layoutManager); | ||
| 114 | + | ||
| 115 | + list.add(itemBean); | ||
| 116 | + | ||
| 117 | + } | ||
| 118 | + // 添加section里内容列表解析 | ||
| 119 | + section.parseData(list); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size()); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + | ||
| 126 | + /** | ||
| 127 | + * 页面中一个楼层多个组件信息转换layoutManager,每次转换只对单个楼层中新增的组件信息转换 | ||
| 128 | + * page | ||
| 129 | + * groupA | ||
| 130 | + * comp1 ->section1 ->layoutmanager1 | ||
| 131 | + * comp2 ->section2 ->layoutmanager2 | ||
| 132 | + * comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager | ||
| 133 | + * .... ------------------------> List<ItemLayoutManager> | ||
| 134 | + * <p> | ||
| 135 | + * 更新itemLayoutManagers | ||
| 136 | + * | ||
| 137 | + * @param page | ||
| 138 | + * @param isRefresh true:清理缓存数据 | ||
| 139 | + */ | ||
| 140 | + public void updateItemLayoutManagers(AbsPage page, boolean isRefresh) { | ||
| 141 | + Logger.t(TAG).d("updateItemLayoutManagers"); | ||
| 142 | + | ||
| 143 | + if (page == null || page.getGroups() == null) { | ||
| 144 | + return; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + // group在recyclerView里的下标 | ||
| 148 | + int groupIndex = 0; | ||
| 149 | + | ||
| 150 | + int groupSize = page.getGroups().size(); | ||
| 151 | + // 刷新即清理LayoutManger | ||
| 152 | + if (isRefresh) { | ||
| 153 | + itemLayoutManagers.clear(); | ||
| 154 | + } | ||
| 155 | + List<ItemBean> list; | ||
| 156 | + for (int i = 0; i < groupSize; ++i) { | ||
| 157 | + AbsGroup group = page.getGroups().get(i); | ||
| 158 | + if (group.getSections() == null) { | ||
| 159 | + continue; | ||
| 160 | + } | ||
| 161 | + groupIndex = group.getStartPosition(); | ||
| 162 | + // comp在group里的下标 | ||
| 163 | + int sectionIndex = -1; | ||
| 164 | + int sectionSize = group.getSections().size(); | ||
| 165 | + // group里,所有comp里的有效数据大小总和 | ||
| 166 | + int groupItemCount = 0; | ||
| 167 | + | ||
| 168 | + int j = 0; | ||
| 169 | + if (groupSize == 1) { | ||
| 170 | + j = page.getDisplayItemCount(); | ||
| 171 | + } | ||
| 172 | + for (; j < sectionSize; ++j) { | ||
| 173 | + AbsSection section = group.getSections().get(j); | ||
| 174 | + if (section == null) { | ||
| 175 | + continue; | ||
| 176 | + } | ||
| 177 | + sectionIndex++; | ||
| 178 | + section.setPosition(sectionIndex); | ||
| 179 | + | ||
| 180 | + // 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据; | ||
| 181 | + section.setupOrNotSection(); | ||
| 182 | + | ||
| 183 | + // 根据展示数据list 进行展示,限制于displayCount | ||
| 184 | + if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) { | ||
| 185 | + continue; | ||
| 186 | + } | ||
| 187 | + int itemIndex = -1; | ||
| 188 | + list = new ArrayList<>(); | ||
| 189 | + int sectionItemCount = section.getCompBean().getDisplayItemBeans().size(); | ||
| 190 | + for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) { | ||
| 191 | + if (itemBean == null) { | ||
| 192 | + continue; | ||
| 193 | + } | ||
| 194 | + ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section); | ||
| 195 | + if (layoutManager == null) { | ||
| 196 | + continue; | ||
| 197 | + } | ||
| 198 | + itemIndex++; | ||
| 199 | + layoutManager.setFragment(page.getFragment()); | ||
| 200 | + layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount)); | ||
| 201 | + layoutManager.setSection(section); | ||
| 202 | + itemLayoutManagers.add(layoutManager); | ||
| 203 | + list.add(itemBean); | ||
| 204 | + | ||
| 205 | + } | ||
| 206 | + groupItemCount += sectionItemCount; | ||
| 207 | + // 添加section里内容列表解析 | ||
| 208 | + section.parseData(list); | ||
| 209 | + } | ||
| 210 | + } | ||
| 211 | + Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size()); | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + | ||
| 215 | + /** | ||
| 216 | + * 页面中多个楼层,每个楼层配置多个组件信息转换layoutManager,同时对多个楼层数据进行转换 | ||
| 217 | + * <p> | ||
| 218 | + * page | ||
| 219 | + * groupA | ||
| 220 | + * comp1 ->section1 ->layoutmanager1 | ||
| 221 | + * comp2 ->section2 ->layoutmanager2 | ||
| 222 | + * comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager | ||
| 223 | + * .... ------------------------> List<ItemLayoutManager> | ||
| 224 | + * groupB | ||
| 225 | + * comp1 ->section1 ->layoutmanager1 | ||
| 226 | + * comp2 ->section2 ->layoutmanager2 | ||
| 227 | + * comp3 ->section3 ->layoutmanager3 | ||
| 228 | + * ... | ||
| 229 | + * ... | ||
| 230 | + * <p> | ||
| 231 | + * 依据楼层更新itemLayoutManagers | ||
| 232 | + * | ||
| 233 | + * @param page 页面信息 | ||
| 234 | + */ | ||
| 235 | + public void updateItemLayoutManagers(AbsPage page) { | ||
| 236 | + Logger.t(TAG).d("updateItemLayoutManagers"); | ||
| 237 | + itemLayoutManagers.clear(); | ||
| 238 | + if (page == null || page.getGroups() == null) { | ||
| 239 | + return; | ||
| 240 | + } | ||
| 241 | + // group在page里的下标,getGroups()里的下标 | ||
| 242 | + int groupPosition = -1; | ||
| 243 | + // group在recyclerView里的下标 | ||
| 244 | + int groupIndex = 0; | ||
| 245 | + AbsGroup group; | ||
| 246 | + AbsSection section; | ||
| 247 | + List<ItemBean> list; | ||
| 248 | + for (int i = 0; i < page.getGroups().size(); ++i) { | ||
| 249 | + group = page.getGroups().get(i); | ||
| 250 | + if (group.getSections() == null) { | ||
| 251 | + continue; | ||
| 252 | + } | ||
| 253 | + groupPosition++; | ||
| 254 | + group.setPosition(groupPosition); | ||
| 255 | + // 判断group数据是否完整,若数据不完整则整个Group不显示 | ||
| 256 | + // boolean isDataIntegrity = group.checkoutIntegrity(); | ||
| 257 | + // boolean isLoaded = group.hasDataLoaded(); | ||
| 258 | + | ||
| 259 | + // comp在group里的下标 | ||
| 260 | + int sectionIndex = -1; | ||
| 261 | + int sectionSize = group.getSections().size(); | ||
| 262 | + group.setStartPosition(groupIndex); | ||
| 263 | + // group里,所有comp里的有效数据大小总和 | ||
| 264 | + int groupItemCount = 0; | ||
| 265 | + for (int j = 0; j < sectionSize; ++j) { | ||
| 266 | + section = group.getSections().get(j); | ||
| 267 | + if (section == null) { | ||
| 268 | + continue; | ||
| 269 | + } | ||
| 270 | + sectionIndex++; | ||
| 271 | + section.setPosition(sectionIndex); | ||
| 272 | + | ||
| 273 | + // 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据; | ||
| 274 | + section.setupOrNotSection(); | ||
| 275 | + | ||
| 276 | + // 根据展示数据list 进行展示,限制于displayCount | ||
| 277 | + if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) { | ||
| 278 | + continue; | ||
| 279 | + } | ||
| 280 | + int itemIndex = -1; | ||
| 281 | + list = new ArrayList<>(); | ||
| 282 | + int sectionItemCount = section.getCompBean().getDisplayItemBeans().size(); | ||
| 283 | + for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) { | ||
| 284 | + if (itemBean == null) { | ||
| 285 | + continue; | ||
| 286 | + } | ||
| 287 | + ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section); | ||
| 288 | + if (layoutManager == null) { | ||
| 289 | + continue; | ||
| 290 | + } | ||
| 291 | + itemIndex++; | ||
| 292 | + layoutManager.setFragment(page.getFragment()); | ||
| 293 | + // TODO new ItemIndex 用计算的方式解决,实现局部刷新 | ||
| 294 | + layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount)); | ||
| 295 | + layoutManager.setSection(section); | ||
| 296 | + itemLayoutManagers.add(layoutManager); | ||
| 297 | + list.add(itemBean); | ||
| 298 | + | ||
| 299 | + } | ||
| 300 | + groupItemCount += sectionItemCount; | ||
| 301 | + // 添加section里内容列表解析 | ||
| 302 | + section.parseData(list); | ||
| 303 | + } | ||
| 304 | + groupIndex += groupItemCount; | ||
| 305 | + } | ||
| 306 | + Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size()); | ||
| 307 | + } | ||
| 308 | + | ||
| 309 | + | ||
| 310 | + /** | ||
| 311 | + * 添加底线view | ||
| 312 | + * | ||
| 313 | + * @param baseLineBean 底线数据 | ||
| 314 | + */ | ||
| 315 | + public void addBaseLine(@NonNull BaseLineBean baseLineBean) { | ||
| 316 | + Logger.t(TAG).d("addBaseLine: " + baseLineBean.getLineHint()); | ||
| 317 | + BaseLineLayoutManager lineLayoutManager = new BaseLineLayoutManager(); | ||
| 318 | + BaseLineSection baseItemSection = new BaseLineSection(baseLineBean); | ||
| 319 | + lineLayoutManager.setSection(baseItemSection); | ||
| 320 | + itemLayoutManagers.add(lineLayoutManager); | ||
| 321 | + List<BaseLineBean> list = new ArrayList<BaseLineBean>() { | ||
| 322 | + { | ||
| 323 | + add(baseLineBean); | ||
| 324 | + } | ||
| 325 | + }; | ||
| 326 | + lineLayoutManager.setItemIndex(new ItemIndex(0, 0, 0, 1)); | ||
| 327 | + baseItemSection.parseData(list); | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public void addItemLayoutManager(AbsSection section) { | ||
| 331 | + Logger.t(TAG).d("addItemLayoutManager"); | ||
| 332 | + if (section == null || section.getCompBean() == null) { | ||
| 333 | + return; | ||
| 334 | + } | ||
| 335 | + | ||
| 336 | + List<ItemBean> itemBeans = section.getCompBean().getDisplayItemBeans(); | ||
| 337 | + if (ArrayUtils.isEmpty(itemBeans)) { | ||
| 338 | + return; | ||
| 339 | + } | ||
| 340 | + List<ItemLayoutManager> managers = new ArrayList<>(); | ||
| 341 | + int groupIndex = section.getParent().getStartPosition(); | ||
| 342 | + int sectionIndex = section.getPosition(); | ||
| 343 | + int itemSize = itemBeans.size(); | ||
| 344 | + int prePosition = groupIndex; | ||
| 345 | + List<ItemBean> list = new ArrayList<>(); | ||
| 346 | + for (ItemBean itemBean : itemBeans) { | ||
| 347 | + if (itemBean == null) { | ||
| 348 | + continue; | ||
| 349 | + } | ||
| 350 | + ItemLayoutManager layoutManager = | ||
| 351 | + section.getParent().getParent().getSectionParser().parseLayoutManager(section); | ||
| 352 | + if (layoutManager == null) { | ||
| 353 | + continue; | ||
| 354 | + } | ||
| 355 | + // layoutManager.setFragment(page.getFragment()); | ||
| 356 | + layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemSize)); | ||
| 357 | + layoutManager.setSection(section); | ||
| 358 | + managers.add(layoutManager); | ||
| 359 | + list.add(itemBean); | ||
| 360 | + } | ||
| 361 | + // 添加section里内容列表解析 | ||
| 362 | + section.parseData(list); | ||
| 363 | + itemLayoutManagers.addAll(prePosition, managers); | ||
| 364 | + Logger.t(TAG).d("addItemLayoutManager : " + itemLayoutManagers.size()); | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + /** | ||
| 368 | + * | ||
| 369 | + */ | ||
| 370 | + private int getStartPosition(@NonNull AbsSection section) { | ||
| 371 | + return section.getParent().getStartPosition(); | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + public void removeItemLayoutManager(int position) { | ||
| 375 | + itemLayoutManagers.remove(position); | ||
| 376 | + Logger.t("TAG").e("removeItemLayoutManager : " + itemLayoutManagers.size()); | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + /** | ||
| 380 | + * 插入/删除item后,更新index | ||
| 381 | + * | ||
| 382 | + * @param startIndex 开始位置 | ||
| 383 | + * @param offset 更新位移,即变化量;如插入了3条,offset=3;删除了3条,offset=-3 | ||
| 384 | + */ | ||
| 385 | + public void updateIndexer(int startIndex, int offset) { | ||
| 386 | + if (startIndex >= itemLayoutManagers.size()) { | ||
| 387 | + return; | ||
| 388 | + } | ||
| 389 | + for (int i = startIndex; i < itemLayoutManagers.size(); i++) { | ||
| 390 | + // 后面所有的item,下标刷新 | ||
| 391 | + ItemLayoutManager itemLayoutManager = itemLayoutManagers.get(i); | ||
| 392 | + ItemIndex itemIndex = itemLayoutManager.getItemIndex(); | ||
| 393 | + if (itemIndex == null) { | ||
| 394 | + continue; | ||
| 395 | + } | ||
| 396 | + | ||
| 397 | + int groupIndex = itemIndex.getGroupIndex() + offset; | ||
| 398 | + itemIndex.setGroupIndex(groupIndex); | ||
| 399 | + // 下标更新到group里 | ||
| 400 | + if (itemLayoutManager.getSection() != null && itemLayoutManager.getSection().getParent() != null) { | ||
| 401 | + itemLayoutManager.getSection().getParent().setStartPosition(groupIndex); | ||
| 402 | + } | ||
| 403 | + } | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | + public int getItemCount() { | ||
| 407 | + return itemLayoutManagers == null ? 0 : itemLayoutManagers.size(); | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + public List<ItemLayoutManager> getItemLayoutManagers() { | ||
| 411 | + return itemLayoutManagers; | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + public void setItemLayoutManagers(List<ItemLayoutManager> itemLayoutManagers) { | ||
| 415 | + this.itemLayoutManagers = itemLayoutManagers; | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + /** | ||
| 419 | + * 获取在<code>position</code>位置的item的layout manager | ||
| 420 | + */ | ||
| 421 | + ItemLayoutManager layoutMangerInPosition(int position) { | ||
| 422 | + for (ItemLayoutManager lm : itemLayoutManagers) { | ||
| 423 | + if (lm.getItemIndex() == null || lm.getItemIndex().getItemCount() == 0) { | ||
| 424 | + continue; | ||
| 425 | + } | ||
| 426 | + int lastItemPosition = lm.getItemIndex().getLastItemPosition(); | ||
| 427 | + if (position < lastItemPosition) { | ||
| 428 | + return (ItemLayoutManager) lm; | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | + | ||
| 432 | + return null; | ||
| 433 | + // return searchManager(position); | ||
| 434 | + } | ||
| 435 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutmanager; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +import com.people.entity.custom.item.ItemBean; | ||
| 10 | + | ||
| 11 | +public abstract class ItemContainerManager<T extends ItemBean> extends ItemLayoutManager<T> { | ||
| 12 | + | ||
| 13 | + @Override | ||
| 14 | + public final int getItemSpan() { | ||
| 15 | + return 1; | ||
| 16 | + } | ||
| 17 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.display.comp.layoutmanager; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * ItemIndex | ||
| 10 | + * | ||
| 11 | + * @author lvinhui | ||
| 12 | + */ | ||
| 13 | +public class ItemIndex { | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * item 所在的Group在RecyclerView中的绝对位置 | ||
| 17 | + */ | ||
| 18 | + private int groupIndex = -1; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * item 所在section在group中的相对位置 | ||
| 22 | + */ | ||
| 23 | + private int sectionIndex = -1; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * Group中的section数量 | ||
| 27 | + */ | ||
| 28 | + private int itemCount = -1; | ||
| 29 | + | ||
| 30 | + private int itemIndex; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * gzq | ||
| 34 | + * | ||
| 35 | + * @param groupIndex | ||
| 36 | + * @param sectionIndex | ||
| 37 | + * @param itemIndex | ||
| 38 | + * @param itemCount | ||
| 39 | + */ | ||
| 40 | + public ItemIndex(int groupIndex, int sectionIndex, int itemIndex, int itemCount) { | ||
| 41 | + this.groupIndex = groupIndex; | ||
| 42 | + this.sectionIndex = sectionIndex; | ||
| 43 | + this.itemCount = itemCount; | ||
| 44 | + this.itemIndex = itemIndex; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * gzq | ||
| 49 | + * | ||
| 50 | + * @param groupIndex | ||
| 51 | + * @param sectionIndex | ||
| 52 | + * @param itemCount | ||
| 53 | + */ | ||
| 54 | + public ItemIndex(int groupIndex, int sectionIndex, int itemCount) { | ||
| 55 | + this.groupIndex = groupIndex; | ||
| 56 | + this.sectionIndex = sectionIndex; | ||
| 57 | + this.itemCount = itemCount; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public int getGroupIndex() { | ||
| 61 | + return groupIndex; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public void setGroupIndex(int groupIndex) { | ||
| 65 | + this.groupIndex = groupIndex; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public int getSectionIndex() { | ||
| 69 | + return sectionIndex; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public void setSectionIndex(int sectionIndex) { | ||
| 73 | + this.sectionIndex = sectionIndex; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public int getItemCount() { | ||
| 77 | + return itemCount; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setItemCount(int itemCount) { | ||
| 81 | + this.itemCount = itemCount; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public int getLastItemPosition() { | ||
| 85 | + return groupIndex + sectionIndex + itemCount; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 根据Item在RecyclerView中的adapter position({@code position})计算出改item在section中的位置. | ||
| 90 | + * | ||
| 91 | + * @param position 在recyclerView中的绝对Adapter位置 | ||
| 92 | + * @return item在comp中的索引,若超出comp的范围则返回负数 | ||
| 93 | + */ | ||
| 94 | + public int getPositionInSection(int position) { | ||
| 95 | + // final int itemIndex = position - groupIndex - sectionIndex; | ||
| 96 | + // if (itemIndex >= itemCount) { | ||
| 97 | + // return -1; | ||
| 98 | + // } | ||
| 99 | + // | ||
| 100 | + // return itemIndex; | ||
| 101 | + return this.itemIndex; | ||
| 102 | + } | ||
| 103 | +} |
-
Please register or login to post a comment