张波

提交代码

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.

*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EclipseCodeFormatterProjectSettings">
<option name="projectSpecificProfile">
<ProjectSpecificProfile>
<option name="formatter" value="ECLIPSE" />
<option name="importOrder" value="java;javax;org;android;androidx;com;" />
<option name="pathToConfigFileJava" value="$PROJECT_DIR$/config/CodeQuality/WonderTek_CodeFormatter_Convention_v1.0.xml" />
<option name="selectedJavaProfile" value="WonderTek_CodeFormatter_Convention_v1.0" />
</ProjectSpecificProfile>
</option>
</component>
</project>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
... ...
展现框架:UI展现层、数据转换层、接口对接层
数据转换层:开放接口给业务调用,业务请求接口数据,再转换数据去展现
接口对接层:抛给上层业务处理
\ No newline at end of file
... ...
/build
\ No newline at end of file
... ...
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
android {
compileSdkVersion var.compileSdkVersion
buildToolsVersion var.buildToolsVersion
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion var.minSdkVersion
targetSdkVersion var.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk {
// noinspection ChromeOsAbiSupport
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
compileOptions {
// Java兼容性设置为Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
// implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "com.google.android.material:material:1.4.0"
// implementation 'com.wd:startup:1.0.0'
}
\ No newline at end of file
... ...
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.myapplication">
<!-- 请求网络 -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity
android:name="com.example.myapplication.MainActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
... ...
package com.example.myapplication;
import android.app.Activity;
import android.os.Bundle;
import androidx.annotation.Nullable;
/**
* @ProjectName: PeopleDailyVideo
* @Package: com.people.displayui.main
* @ClassName: WelcomeActivity
* @Description: 启动APP过渡页面
* @Author: wd
* @CreateDate: 2022/10/28 17:36
* @UpdateUser: wd
* @UpdateDate: 2022/10/28 17:36
* @UpdateRemark: 更新说明:
* @Version: 1.0
*/
public class MainActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 直接进入首页
}
}
... ...
package com.example.myapplication;
import android.app.Application;
import android.util.Log;
/**
* @author devel
* @time 2024/8/28 星期三 16:23
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Log.e("zzzz","MyApplication onCreate");
// test
}
}
... ...
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
... ...
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<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">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
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"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
... ...
<resources>
<string name="app_name">My Application</string>
</resources>
\ No newline at end of file
... ...
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
\ No newline at end of file
... ...
apply plugin: 'maven'
buildscript {
ext.kotlin_version = "1.4.32"
repositories {
mavenLocal()
mavenCentral()
// 以下四行代码为阿里gradle源,需要的人自己放開使用
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' }
//阿里云 maven
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/releases' }
google()
maven { url "https://jitpack.io" }
//华为
maven { url 'https://developer.huawei.com/repo/' }
//阿里云QuickTracking
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google/'
name 'aliyun-google'
}
// TingYun
maven { url "https://nexus2.tingyun.com/nexus/content/repositories/snapshots/" }
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.billy.android:autoregister:1.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
// 以下四行代码为阿里gradle源,需要的人自己放開使用
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' }
//阿里云 maven
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/releases' }
google()
maven { url "https://jitpack.io" }
//华为
maven { url 'https://developer.huawei.com/repo/' }
//阿里云QuickTracking
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google/'
name 'aliyun-google'
}
flatDir { dirs 'src/main/libs' }
// 快马私库
maven {
credentials {
username '6708d1cf6f4c940bd257c88d'
password 'Wm51gc4rARyr'
}
url 'https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom'
}
}
project.configurations.configureEach {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.android.support' && !details.requested.name.contains('multidex')) {
details.useVersion "28.0.0"
}
}
}
// 强制依赖
configurations.configureEach {
exclude group: 'com.alipay.android.phone.thirdparty', module: 'securityguard-build'
resolutionStrategy {
force 'androidx.activity:activity:1.2.1'
force 'androidx.annotation:annotation:1.1.0'
force 'androidx.appcompat:appcompat:1.2.0'
force 'androidx.arch.core:core-common:2.1.0'
force 'androidx.arch.core:core-runtime:2.1.0'
force 'androidx.core:core-ktx:1.6.0'
force 'androidx.core:core:1.5.0'
force 'androidx.collection:collection:1.1.0'
force 'androidx.constraintlayout:constraintlayout:2.0.4'
force 'androidx.constraintlayout:constraintlayout-solver:2.0.4'
force 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
force 'androidx.fragment:fragment:1.3.1'
force 'androidx.lifecycle:lifecycle-common:2.3.0'
force 'androidx.multidex:multidex:2.0.1'
force 'androidx.recyclerview:recyclerview:1.2.0'
force 'androidx.vectordrawable:vectordrawable:1.1.0'
force 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
force 'com.squareup.okhttp3:okhttp:4.9.1'
force 'com.squareup.okio:okio:2.7.0'
force 'org.jetbrains.kotlin:kotlin-stdlib:1.4.32'
force 'org.jetbrains.kotlin:kotilin-stdlib-jdk8:1.4.32'
force 'org.jetbrains:annotations:15.0'
force 'net.sf.proguard:proguard-base:6.1.0'
}
}
}
ext {
var = [
// SDK And Tools
applicationId : "com.wondertek.dss",
minSdkVersion : 25,
targetSdkVersion : 30,
compileSdkVersion: 30,
buildToolsVersion: "30.0.3",
// 版本号,正式版本 1.0.0 1000080 后两位,80即标识为发布版本
// 测试版本 1.0.0_TF1 1000001 后两位,01即为测试版本号,01-79
// 升级版本 1.0.0_RC1 1000081 后两位,81即为升级版本号,81-99
versionName : "1.0.0", // release正式
debugVnName : "", // debug开发模式 用于区分debug模式下上报的日志
versionCode : 100,
//此版本号是SDK版本,不能随便改
aar_version : "1.0.0",
]
}
... ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="WonderTek_CodeFormatter_Convention_v1.0"
version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off" />
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="49" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
value="1" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column"
value="false" />
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120" />
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
value="end_of_line" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
value="0" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error" />
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="20" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
value="0" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
value="end_of_line" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
value="insert" />
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16" />
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines"
value="2147483647" />
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="16" />
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
value="80" />
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column"
value="false" />
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16" />
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1" />
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
value="insert" />
</profile>
</profiles>
\ No newline at end of file
... ...
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableResourceOptimizations=false
#建议您关闭 R8 后再进行混淆
android.enableR8=false
android.enableR8.libraries=false
# 如果使用最新稳定版本 Android Studio 3.5 或以上,那么您需要在 gradle.properties 里面新增
android.buildOnlyTargetAbi=false
#网络请求接口版本 202204151851
requestVersion=107
#设置组件是否作为app还是lib,true是lib ,false 是app
#分享
isShareModule=true
#播放器
isPlayerModule=true
#是否直播模块运行 false可以单独运行
isLiveModule=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
#android.nonTransitiveRClass=true
... ...
No preview for this file type
#Fri Oct 23 14:37:25 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.8-all.zip
... ...
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
... ...
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
... ...
rootProject.name = "wddisplay"
include ':app'
include ':wddisplay'
\ No newline at end of file
... ...
/build
\ No newline at end of file
... ...
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven'
}
android {
compileSdkVersion var.compileSdkVersion
defaultConfig {
minSdkVersion var.minSdkVersion
targetSdkVersion var.targetSdkVersion
versionCode var.versionCode
versionName var.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
buildConfigField "String", "API_VERSION", "\"${requestVersion}\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 自定义AAR包名
android.libraryVariants.all { variant ->
variant.outputs.all {
if (outputFileName != null && outputFileName.endsWith(".aar")) {
def fileName = "${project.name}-${buildType.name}-v${var.aar_version}.aar"
outputFileName = fileName
}
}
}
}
dependencies {
implementation 'com.wd:wdkit:1.0.2'
implementation 'com.wd:wdbean:1.0.0'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom/") {
authentication(userName: '6708d1cf6f4c940bd257c88d', password: 'Wm51gc4rARyr')
}
pom.project {
artifactId 'display'
version '1.0.0'
groupId 'com.wd'
packaging 'aar'
}
}
}
}
\ No newline at end of file
... ...
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wd.display">
</manifest>
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp;
import static com.people.common.constant.IntentConstants.PAGE_BACKGROUND_URL;
import static com.people.common.constant.IntentConstants.PAGE_HOME_COLOR;
import static com.people.common.constant.IntentConstants.PAGE_NOTICE_COLOR;
import static com.people.common.constant.IntentConstants.PAGE_STATUS_COLOR;
import static com.people.common.constant.IntentConstants.PARAM_PAGE_ID;
import static com.people.common.constant.IntentConstants.TAB_NEWS_TITLE;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import com.people.common.constant.IntentConstants;
import com.people.entity.custom.video.VodDetailIntentBean;
import com.people.router.WdRouterRule;
import com.people.router.constants.RouterConstants;
import com.wondertek.wheat.ability.tools.JsonUtils;
/**
* comp组件的相关Service实现<BR>
*
* @author zhangbo
* @version [V1.0.0, 2020/7/23]
* @since V1.0.0
*/
public class CompServiceImpl implements ICompService {
@Override
public Fragment createMainFragment(String id) {
return null;
}
@Override
public Fragment createChannelFragment(String pageId) {
return null;
}
@Override
public Fragment createColumnFragment(String pageId) {
return null;
}
@Override
public Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId) {
Fragment myFragment = WdRouterRule.getInstance().getFragment(RouterConstants.PATH_HOME_FULL_PLAY);
if (myFragment != null) {
VodDetailIntentBean intentBean = new VodDetailIntentBean();
intentBean.setGray(isGray);
intentBean.setType(VodDetailIntentBean.Type.COMP);
intentBean.setLevel1ChannelId(level1ChannelId);
intentBean.setPageId(pageId);
intentBean.setChannelId(channelId);
Bundle bundle = new Bundle();
bundle.putString(IntentConstants.PARAMS_VIDEO_DETAIL, JsonUtils.convertObjectToJson(intentBean));
myFragment.setArguments(bundle);
return myFragment;
}
return new Fragment();
}
@Override
public Fragment createDefaultFragment() {
// 这里默认直接创建Fragment
return new Fragment();
}
@Override
public Fragment createFollowFragment(String pageId) {
return null;
}
@Override
public Fragment createCommonFragment(String pageId) {
//return CommonFragment.newInstance(pageId);
return null;
}
@Override
public Fragment createMiFragment(String pageId, String pageName, int statuesBar, String backgroundUrl, String homeColor, String noticeColor) {
Fragment myFragment =
(Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_MODULE_MY_FRAGMENT);
Bundle bundle = new Bundle();
if (myFragment != null) {
bundle.putString(PARAM_PAGE_ID, pageId);
bundle.putString(TAB_NEWS_TITLE, pageName);
bundle.putString(PAGE_BACKGROUND_URL, backgroundUrl);
bundle.putInt(PAGE_STATUS_COLOR, statuesBar);
bundle.putString(PAGE_HOME_COLOR, homeColor);
bundle.putString(PAGE_NOTICE_COLOR, noticeColor);
myFragment.setArguments(bundle);
return myFragment;
}
return createDefaultFragment();
}
@Override
public Fragment createShortVideoFragment(String pageId, int color) {
Fragment myFragment = (Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_SHORT_VIDEO);
if (myFragment != null) {
VodDetailIntentBean intentBean = new VodDetailIntentBean();
intentBean.setType(VodDetailIntentBean.Type.COMP);
intentBean.setPageId(pageId);
intentBean.color = color;
intentBean.isImmerse = true;
Bundle bundle = new Bundle();
bundle.putString(IntentConstants.PARAMS_VIDEO_DETAIL, JsonUtils.convertObjectToJson(intentBean));
myFragment.setArguments(bundle);
return myFragment;
}
return createDefaultFragment();
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp;
import androidx.fragment.app.Fragment;
import com.wondertek.wheat.ability.scheduler.IService;
/**
* comp服务的相关接口<BR>
*
* @author zhangbo
* @version [V1.0.0, 2020/7/23]
* @since V1.0.0
*/
public interface ICompService extends IService {
/**
* 创建Fragment,首页带菜单导航的页面
*
* @param id 导航栏标识
* @return Fragment实例
*/
Fragment createMainFragment(String id);
/**
* 创建Fragment,没有菜单导航的,纯内容页面(频道页面)
*
* @param pageId 页面id参数
* @return Fragment实例
*/
Fragment createChannelFragment(String pageId);
/**
* 创建Fragment,专题、栏目页面
*
* @param pageId 页面id参数
* @return Fragment实例
*/
Fragment createColumnFragment(String pageId);
/**
* 创建直播频道的页面
*
* @param isGray 是否国殇模式
* @param level1ChannelId 一级频道id
* @param pageId 页面id
* @param pageId channelId
* @return Fragment实例
*/
Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId);
/**
* 创建默认Fragment
*
* @return Fragment实例
*/
Fragment createDefaultFragment();
/**
* 创建关注Fragment
* @param pageId 页面id
* @return
*/
Fragment createFollowFragment(String pageId);
/**
* 创建通用Fragment
* @param pageId
* @return
*/
Fragment createCommonFragment(String pageId);
/**
* 创建 我的 Fragment
* @param pageId
* @return
*/
Fragment createMiFragment(String pageId,String pageName,int statuesBar,String backgroundUrl,String homeColor,String noticeColor);
/**
* 创建短视频Fragment
* @param pageId 页面id
*/
Fragment createShortVideoFragment(String pageId,int color);
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.ArrayList;
import java.util.List;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.comp.GroupBean;
/**
* Group基类<BR>
*
* @author zhangbo
* @version [V1.0.0, 2021/12/8]
* @since V1.0.0
*/
public abstract class AbsGroup extends AbsLayout {
private AbsPage parent;
/**
* group在页面里的下标
*/
private int position;
/**
* group在recyclerView里的下标
*/
private int startPosition;
// 每个楼层页码
private int pageNum = 1;
// 是否推荐策略;2:否,1:是
private String groupStrategy;
private List<AbsSection> sections;
/**
* 楼层所在页面所有楼层中的位置
*/
private int layerIndex = 0;
/**
* 是否是页面的最后一个楼层
*/
private boolean isLastLayer = false;
// 记录AbsGroup所在GroupBean对象
private GroupBean groupBean;
//记录的组件支持加载更多数据 (改组件对象必然在页面的最后一个楼层的最后一个组件上)
private CompBean supportLoadMoreDataComp;
/**
* gzq
*
* @param dataBean
* @param parent
*/
public AbsGroup(GroupBean dataBean, AbsPage parent) {
this(parent);
this.setId(dataBean.getId());
parseData(dataBean);
}
public int getLayerIndex() {
return layerIndex;
}
public void setLayerIndex(int layerIndex) {
this.layerIndex = layerIndex;
}
/**
* 构造器
*
* @param groupId 楼层id
* @param parent page对象
*/
public AbsGroup(String groupId, AbsPage parent) {
this(parent);
this.setId(groupId);
}
/**
* gzq
*
* @param parent
*/
public AbsGroup(AbsPage parent) {
this.parent = parent;
}
/**
* getParent
*
* @param <T>
* @return
*/
public <T extends AbsPage> T getParent() {
return (T) this.parent;
}
public void setParent(AbsPage parent) {
this.parent = parent;
}
/**
* getSection
*
* @return AbsSection
*/
public List<AbsSection> getSections() {
if (sections == null) {
sections = new ArrayList<>();
}
return sections;
}
public void setSections(List<AbsSection> sections) {
this.sections = sections;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public int getStartPosition() {
return startPosition;
}
public void setStartPosition(int startPosition) {
this.startPosition = startPosition;
}
@Override
public ILayoutPresenter getLayoutPresenter() {
return getParent().getLayoutPresenter();
}
/**
* 解析楼层,组装section
*
* @param groupBean 楼层数据
*/
public void parseData(GroupBean groupBean) {
getSections().clear();
if (groupBean.getComps() == null) {
return;
}
addParseData(groupBean.getComps());
}
/**
* 楼层添加新的组件信息以供解析成section
*
* @param compList
*/
public void addParseData(List<CompBean> compList) {
if (compList == null) {
return;
}
for (CompBean compBean : compList) {
if (compBean == null) {
continue;
}
if (getParent() != null && getParent().getSectionParser() != null) {
AbsSection<?, ?> section = getParent().getSectionParser().parseSection(this, compBean);
if (section != null) {
section.setCompBean(compBean);
// 添加section
getSections().add(section);
}
}
}
}
/**
* 解析Group数据
*
* @param groupBean 楼层对象,携带组件和稿件数据
* @param loadMore true:楼层增加数据 ;false:楼层第一次数据
*/
public void parseGroupData(GroupBean groupBean, boolean loadMore) {
if (groupBean == null) {
return;
}
if (loadMore) {
// 记录已经存在的数据量
setDisplayItemCount(this.getSections().size());
// 解析group数据,生成section列表
addParseData(groupBean.getComps());
} else {
setDisplayItemCount(0);
// 解析group数据,生成section列表
parseData(groupBean);
}
for (AbsSection<?, ?> section : this.getSections()) {
if (section == null) {
continue;
}
// 解析结果
section.parsePartialData();
}
}
public void removeSection(int index) {
sections.remove(index);
getLayoutPresenter().onRefreshPageSuccess();
}
public void removeSectionsByType(String type) {
for (AbsSection section : sections) {
if (type.equals(section.getCompType())) {
sections.remove(section);
}
}
getLayoutPresenter().onRefreshPageSuccess();
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public boolean isLastLayer() {
return isLastLayer;
}
public void setLastLayer(boolean lastLayer) {
isLastLayer = lastLayer;
}
public String getGroupStrategy() {
return groupStrategy;
}
public void setGroupStrategy(String groupStrategy) {
this.groupStrategy = groupStrategy;
}
public GroupBean getGroupBean() {
return groupBean;
}
public void setGroupBean(GroupBean groupBean) {
this.groupBean = groupBean;
}
public CompBean getSupportLoadMoreDataComp() {
return supportLoadMoreDataComp;
}
public void setSupportLoadMoreDataComp(CompBean supportLoadMoreDataComp) {
this.supportLoadMoreDataComp = supportLoadMoreDataComp;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import android.text.TextUtils;
public abstract class AbsLayout {
/**
* 页面id
*/
private String id;
private String blockDesc;
private boolean showBlock = true;
/**
* 记录楼层已展示的组件数量
*/
private int displayItemCount = 0;
public String getId() {
return TextUtils.isEmpty(this.id) ? "" : this.id;
}
public void setId(String id) {
this.id = id;
}
public String getBlockDesc() {
return blockDesc;
}
public int getDisplayItemCount() {
return displayItemCount;
}
public void setDisplayItemCount(int displayItemCount) {
this.displayItemCount = displayItemCount;
}
public void setBlockDesc(String blockDesc) {
this.blockDesc = blockDesc;
}
public boolean isShowBlock() {
return showBlock;
}
public void setShowBlock(boolean showBlock) {
this.showBlock = showBlock;
}
/**
* getLayoutPresenter
*
* @return getLayoutPresenter
*/
public abstract ILayoutPresenter getLayoutPresenter();
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.ArrayList;
import java.util.List;
import androidx.fragment.app.Fragment;
import com.people.component.comp.parser.AbsSectionParser;
public abstract class AbsPage extends AbsLayout {
private AbsSectionParser sectionParser;
private ILayoutPresenter layoutPresenter;
/**
* 页面的楼层数据集合
*/
private List<AbsGroup> groups;
/**
* 组件所在的楼层在groups中的索引值(记录的楼层可支持翻页)
*/
private int currentGroupIndex = 0;
private AbsGroup specialGroup;
private Fragment mFragment;
public AbsSectionParser getSectionParser() {
return sectionParser;
}
public void setSectionParser(AbsSectionParser sectionParser) {
this.sectionParser = sectionParser;
}
public int getGroupIndex() {
return currentGroupIndex;
}
public void setGroupIndex(int groupIndex) {
this.currentGroupIndex = groupIndex;
}
@Override
public ILayoutPresenter getLayoutPresenter() {
return layoutPresenter;
}
public void setLayoutPresenter(ILayoutPresenter layoutPresenter) {
this.layoutPresenter = layoutPresenter;
}
/**
* removeLayoutPresenter
*/
public void removeLayoutPresenter() {
this.layoutPresenter = null;
}
/**
* getGroups
*
* @return AbsGroup
*/
public List<AbsGroup> getGroups() {
if (groups == null) {
groups = new ArrayList<AbsGroup>();
}
return groups;
}
public void setGroups(List<AbsGroup> groups) {
this.groups = groups;
}
/**
* removeGroup
*
* @param index
*/
public void removeGroup(int index) {
groups.remove(index);
getLayoutPresenter().onRefreshPageSuccess();
}
public Fragment getFragment() {
return mFragment;
}
public void setFragment(Fragment fragment) {
this.mFragment = fragment;
}
public AbsGroup getSpecialGroup() {
return specialGroup;
}
public void setSpecialGroup(AbsGroup specialGroup) {
this.specialGroup = specialGroup;
}
/**
* 检测当前使用的楼层对象数据是在groups中最后位置(通过索引值对比)
*
* @return true:表示在最后的位置
*/
public boolean checkGroupDataIsLastData() {
int groupSize = groups.size();
if (groupSize > 1) {
// 索引值从0开始计算
int temp = groupSize - 1;
if (currentGroupIndex == temp) {
return true;
} else {
return false;
}
} else {
return true;
}
}
/**
* 设置新的楼层参数
*/
public void setNewGroupParameter() {
currentGroupIndex = currentGroupIndex + 1;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import com.orhanobut.logger.Logger;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.item.ItemBean;
import com.people.entity.custom.section.SectionBean;
import com.wondertek.wheat.ability.tools.ArrayUtils;
import com.wondertek.wheat.ability.tools.CastUtils;
/**
* section基类<BR>
*
* @param <T> item数据泛型限定
* @param <F> 泛型,待扩展限定
* @author zhangbo
* @version [V1.0.0, 2021/12/8]
* @since V1.0.0
*/
public abstract class AbsSection<T extends ItemBean, F extends SectionBean> extends AbsLayout {
/**
* 对应comp数据
*/
protected CompBean mCompBean;
/**
* 上级父节点,即楼层对象
*/
protected AbsGroup parent;
private int position;
/**
* 单个comp里,列表数据,如卡片列表等
*/
private List<T> items = new ArrayList<>();
/**
* section数据,里面包含ListT数据,待扩展
*/
private F sectionData;
private String compType;
private String compStyle;
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compType comp组件类型
* @param compStyle comp组件样式
*/
public AbsSection(AbsGroup parent, String compType, String compStyle) {
super();
this.parent = parent;
this.compType = compType;
this.compStyle = compStyle;
}
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public AbsSection(AbsGroup parent, @NonNull CompBean compBean) {
this.parent = parent;
this.compType = compBean.getCompType();
this.compStyle = compBean.getCompStyle();
mCompBean = compBean;
}
public int getItemCount() {
return this.items == null ? 0 : this.items.size();
}
/**
* 转换数据
*
* @param jsonStr json数据
*/
@Deprecated
public void parsePartialData(String jsonStr) {
// 创建item数据
resetDisplayList(mCompBean);
}
/**
* 转换数据
*/
public void parsePartialData() {
parseData();
resetDisplayList(mCompBean);
}
/**
* 展示列表数据
*
* @param compBean comp数据
*/
public void resetDisplayList(@NonNull CompBean compBean) {
int itemSize = ArrayUtils.getListSize(compBean.getOriginalItemBeans());
if (itemSize <= 0) {
return;
}
// 源数据转换成最终展示数据
List<ItemBean> tmpList = compBean.getOriginalItemBeans();
compBean.setDisplayItemBeans(tmpList);
}
/**
* 转换数据
*
* @param dataList item数据列表
*/
public final void parseData(List<T> dataList) {
if (ArrayUtils.isEmpty(dataList)) {
return;
}
items.clear();
items.addAll(dataList);
}
/**
* 获取item数据
*
* @param index 下标
* @return item数据
*/
public T getItemData(int index) {
return ArrayUtils.getListElement(getItems(), index);
}
/**
* 获取item数据
*
* @param index 下标
* @return item数据
*/
protected T getOriginalItemData(int index) {
if (mCompBean == null || ArrayUtils.isEmpty(mCompBean.getOriginalItemBeans())) {
return null;
}
ItemBean itemBean = mCompBean.getOriginalItemBeans().get(index);
ParameterizedType pType = (ParameterizedType) this.getClass().getGenericSuperclass();
Class<T> clazz = (Class<T>) pType.getActualTypeArguments()[0];
return CastUtils.cast(itemBean, clazz);
}
/**
* 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据
*/
public void setupOrNotSection() {
Logger.t(getLogTag()).d("setupOrNotSection");
}
/**
* 因section为特殊样式,需要组装list
*
* 如:label、button样式、横向滑动列表样式
*
* @return 创建的对象
*/
protected T newItemBean() {
ParameterizedType pType = (ParameterizedType) this.getClass().getGenericSuperclass();
if (pType == null) {
return null;
}
Class<T> clazz = (Class<T>) pType.getActualTypeArguments()[0];
T t = null;
try {
t = clazz.newInstance();
} catch (IllegalAccessException | InstantiationException e) {
Logger.t(getLogTag()).e("newItemBean, Exception: " + e.getMessage());
}
return t;
}
/**
* 转换数据,二次请求的数据
*
* @param data json数据
*/
@Deprecated
protected abstract void parseData(String data);
/**
* 组装数据
*/
protected abstract void parseData();
/**
* 获取日志tag
*
* @return 日志tag
*/
public abstract String getLogTag();
/**
* 解析数据封装对象class,super.parseData(data)用到
* 若,自己覆写parseData,则可以忽略
*
* @return 数据class
*/
public abstract Class<T> getDataClazz();
public AbsGroup getParent() {
return parent;
}
public void setParent(AbsGroup parent) {
this.parent = parent;
}
public String getCompType() {
return compType;
}
public void setCompType(String compType) {
this.compType = compType;
}
public String getCompStyle() {
return compStyle;
}
public void setCompStyle(String compStyle) {
this.compStyle = compStyle;
}
public F getSectionData() {
return sectionData;
}
public void setSectionData(F sectionData) {
this.sectionData = sectionData;
}
public CompBean getCompBean() {
return mCompBean;
}
public void setCompBean(CompBean compBean) {
this.mCompBean = compBean;
}
@Override
public ILayoutPresenter getLayoutPresenter() {
return getParent().getLayoutPresenter();
}
public List<T> getItems() {
return items;
}
public void setItems(List<T> items) {
this.items = items;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import androidx.annotation.NonNull;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.comp.ContainerItemBean;
import com.people.entity.custom.section.SectionBean;
/**
* 不直接作为item展示,需要自行添加容器展示子内容的section基类<BR>
* 如,横向的列表样式、轮播图等
*
* @author zhangbo
* @version [V1.0.0, 2022/1/19]
* @param <T> item数据泛型限定
* @since V1.0.0
*/
public abstract class BaseContainerSection<T extends ContainerItemBean> extends AbsSection<T, SectionBean> {
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public BaseContainerSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected final void parseData() {
if (mCompBean == null) {
return;
}
// 容器类型item,创建一个数据对象,并将节目数据赋值子列表
T itemBean = createItemBean();
itemBean.setSubList(mCompBean.getDataList());
mCompBean.getOriginalItemBeans().clear();
mCompBean.getOriginalItemBeans().add(itemBean);
initItemBean(itemBean);
}
/**
* 转换数据,二次请求的数据
*
* @param data json数据
*/
@Override
protected final void parseData(String data) {
}
private T createItemBean() {
T itemBean = newItemBean();
mCompBean.getOriginalItemBeans().add(itemBean);
if (itemBean != null) {
// 初始化信息
initItemBean(itemBean);
}
return itemBean;
}
/**
* 初始化item数据<BR>
* 处理自己的业务,如title、tab样式,需要自己获取extraData,com.people.component.comp.data.news.ContentBean#extraData
*
* @param itemBean item数据
*/
protected abstract void initItemBean(@NonNull T itemBean);
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import androidx.annotation.NonNull;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.item.ItemBean;
import com.people.entity.custom.section.SectionBean;
/**
* 不直接作为item展示,需要自行添加容器展示子内容的section基类<BR>
* 如,横向的列表样式、轮播图等
*
* @author zhangbo
* @version [V1.0.0, 2022/1/19]
* @param <T> item数据泛型限定
* @param <F> 泛型,待扩展限定
* @since V1.0.0
*/
public abstract class BaseContainerSectionOld<T extends ItemBean, F extends SectionBean> extends AbsSection<T, F> {
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compType comp组件类型
* @param compStyle comp组件样式
*/
public BaseContainerSectionOld(AbsGroup parent, String compType, String compStyle) {
super(parent, compType, compStyle);
}
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public BaseContainerSectionOld(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
/**
* 初始化item数据
*
* @param itemBean item数据
*/
protected void initItemBean(@NonNull T itemBean) {
}
@Override
protected final void parseData() {
if (mCompBean == null || mCompBean.getOriginalItemBeans().size() <= 0) {
return;
}
// 容器类型item,创建一个数据对象,并将节目数据赋值子列表
T itemBean = createItemBean();
// itemBean.setSubList(mCompBean.getDataList());
mCompBean.getOriginalItemBeans().clear();
mCompBean.getOriginalItemBeans().add(itemBean);
parseData(itemBean);
initItemBean(itemBean);
}
/**
* 转换数据,二次请求的数据
*
* @param data json数据
*/
@Override
protected void parseData(String data) {
}
private T createItemBean() {
T itemBean = newItemBean();
mCompBean.getOriginalItemBeans().add(itemBean);
String pageId = parent.getParent().getId();
if (itemBean != null) {
// 设置pageId
// itemBean.setPageId(pageId);
// 初始化信息
initItemBean(itemBean);
}
return itemBean;
}
/**
* 解析自己的数据
*
* @param itemData item数据对象
*/
protected void parseData(T itemData) {
}
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.List;
import androidx.annotation.NonNull;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.item.ItemBean;
import com.people.entity.custom.section.SectionBean;
/**
* 可以直接作为item展示的section基类<BR>
* 如,两列多行的样式(上图下文01)、标题(LABEL-01)、按钮(BUTTON-01)
* 理论上只会有 ContentBean数据类型,其他都是BaseContainerSection里处理,自定义数据bean
*
* @author zhangbo
* @version [V1.0.0, 2022/1/19]
* @param <T> item数据泛型限定
* @since V1.0.0
*/
public abstract class BaseItemSection<T extends ItemBean> extends AbsSection<T, SectionBean> {
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public BaseItemSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected final void parseData(String data) {
}
@Override
protected final void parseData() {
// 非容器类型的item,没有特殊数据;这里将解析的节目数据列表赋值给originalItemBeans
mCompBean.getOriginalItemBeans().clear();
mCompBean.getOriginalItemBeans().addAll(mCompBean.getDataList());
initItemBean(mCompBean.getOriginalItemBeans());
}
/**
* 初始化item数据<BR>
* 扩展用
*
* @param contents item数据列表
*/
protected abstract void initItemBean(@NonNull List<ItemBean> contents);
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.item.ItemBean;
import com.people.entity.custom.section.SectionBean;
/**
* 可以直接作为item展示的section基类<BR>
* 如,两列多行的样式(上图下文01)、标题(LABEL-01)、按钮(BUTTON-01)
* 理论上只会有 ContentBean数据类型,其他都是BaseContainerSection里处理,自定义数据bean
*
* @author zhangbo
* @version [V1.0.0, 2022/1/19]
* @param <T> item数据泛型限定
* @param <F> 泛型,待扩展限定
* @since V1.0.0
*/
public abstract class BaseItemSectionOld<T extends ItemBean, F extends SectionBean> extends AbsSection<T, F> {
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compType comp组件类型
* @param compStyle comp组件样式
*/
public BaseItemSectionOld(AbsGroup parent, String compType, String compStyle) {
super(parent, compType, compStyle);
}
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public BaseItemSectionOld(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void parseData(String data) {
}
protected void addItems(List<T> dataList) {
// 将数据列表设置到comp里
if (mCompBean == null || dataList == null) {
return;
}
if (mCompBean.getOriginalItemBeans() == null) {
mCompBean.setOriginalItemBeans(new ArrayList<>());
}
mCompBean.getOriginalItemBeans().clear();
mCompBean.getOriginalItemBeans().addAll(dataList);
}
/**
* 初始化item数据
*
* @param itemBean item数据
*/
@Deprecated
protected void initItemBean(@NonNull T itemBean) {
// 后续去掉该方法,这里没有被调用
}
@Override
protected final void parseData() {
// 非容器类型的item,没有特殊数据;这里将解析的节目数据列表赋值给originalItemBeans
mCompBean.getOriginalItemBeans().clear();
mCompBean.getOriginalItemBeans().addAll(mCompBean.getDataList());
}
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import com.people.entity.custom.comp.GroupBean;
/**
* Group类<BR>
* 可以看做是一个栏目单元;可以是轮播图、横向列表、多列展示的卡片等
*
* @author zhangbo
* @version [V1.0.0, 2021/12/8]
* @since V1.0.0
*/
public class Group extends AbsGroup {
private GroupBean groupBean;
/**
* 构造器
*
* @param dataBean Group对应的实体对象
* @param parent 父类对象
*/
public Group(GroupBean dataBean, AbsPage parent) {
super(dataBean, parent);
}
/**
* 构造器
*
* @param groupId 楼层id
* @param parent page对象
*/
public Group(String groupId, AbsPage parent) {
super(groupId, parent);
}
@Override
public void parseData(GroupBean var1) {
super.parseData(var1);
this.groupBean = var1;
}
public GroupBean getGroupBean() {
return groupBean;
}
public void setGroupBean(GroupBean groupBean) {
this.groupBean = groupBean;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
public interface ILayoutPresenter<T extends AbsPage> {
/**
* 页面刷新完成
*/
void onRefreshPageSuccess();
/**
* 页面数据刷新失败
*/
void onRefreshDataFailed();
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.List;
import com.orhanobut.logger.Logger;
import com.people.entity.custom.comp.GroupBean;
import com.people.entity.custom.comp.PageBean;
import com.wondertek.wheat.ability.tools.StringUtils;
/**
* Page类<BR>
* 可以看做是一个页面,收集多个Group。瀑布流展示页面
*
* @author zhangbo
* @version [V1.0.0, 2021/12/8]
* @since V1.0.0
*/
public class Page extends AbsPage {
private static final String TAG = "Page";
private PageBean mPageBean;
/**
* 构造器
*/
public Page() {
super();
}
/**
* 数据解析,组装group列表数据
*
* @param pageBean PageBean数据
*/
public void createGroup(PageBean pageBean) {
if (pageBean == null) {
Logger.t(TAG).e( "createGroup, pageBean is null");
return;
}
this.setId(pageBean.getId());
this.getGroups().clear();
//收集楼层排序和编号,
List<GroupBean> groups = pageBean.getGroups();
for (int i = 0 ; i < groups.size();i++) {
GroupBean bean = groups.get(i);
if (StringUtils.isEmpty(bean.getId())) {
// 丢弃无效group数据
continue;
}
Group groupBean = new Group(bean.getId(), this);
groupBean.setPosition(i);
groupBean.setBlockDesc(bean.getBlockDesc());
groupBean.setStartPosition(i);
groupBean.setGroupStrategy(bean.getGroupStrategy());
this.getGroups().add(groupBean);
}
}
public PageBean getPage() {
return mPageBean;
}
public void setPage(PageBean pageBean) {
this.mPageBean = pageBean;
}
}
... ...
package com.wd.display.comp.layoutdata.channel;
import java.util.ArrayList;
import java.util.List;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.adv.CompAdvExtraDataBean;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.content.ContentBean;
import com.people.entity.custom.content.ContentTypeConstant;
import com.people.entity.custom.label.CompAdv01Bean;
import com.people.toolset.json.GsonUtils;
/**
* @Description: 广告
* @Author: Li Yubing
* @Email: liyubing@wondert.com.cn
* @CreateDate: 2023/11/1 16:45
* @Version: 1.0
*/
public class AdvSection extends BaseContainerSection<CompAdv01Bean> {
private static final String TAG = "AggregationSection";
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public AdvSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull CompAdv01Bean itemBean) {
List<ContentBean> subList = itemBean.getSubList();
if (subList != null && subList.size() > 0) {
ContentBean contentBean = subList.get(0);
String extraData = contentBean.getExtra();
CompAdvExtraDataBean compAdvExtraDataBean = GsonUtils.fromJson(extraData, CompAdvExtraDataBean.class);
itemBean.compAdvExtraDataBean = compAdvExtraDataBean;
itemBean.topImageUrl = compAdvExtraDataBean.itemTopImage;
if (compAdvExtraDataBean.itemMore != null) {
CompAdvExtraDataBean.ItemBean moreItemBean = compAdvExtraDataBean.itemMore;
ContentBean moreBean = new ContentBean();
moreBean.setNewsTitle(moreItemBean.title);
moreBean.setCoverUrl(moreItemBean.image);
moreBean.setLinkUrl(moreItemBean.linkUrl);
moreBean.setLinkType(moreItemBean.linkType);
if ("0".equals(moreItemBean.linkType)) {
moreBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_ZERO));
} else {
moreBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_FOUR));
}
moreBean.setTopicInfoBean(mCompBean.getTopicInfoBean());
moreBean.setChannelInfoBean(mCompBean.getChannelInfoBean());
moreBean.setRecommend(mCompBean.getRecommend());
moreBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal());
moreBean.setCompId(mCompBean.getId());
itemBean.moreBean = moreBean;
}
List<CompAdvExtraDataBean.ItemBean> advExtraItemList = compAdvExtraDataBean.item;
List<ContentBean> adContentBeanList = new ArrayList<>();
if (advExtraItemList != null && advExtraItemList.size() > 0) {
// 计算出最长标题
String maxTitleStr = null;
for (CompAdvExtraDataBean.ItemBean advExtraDataBean : advExtraItemList) {
ContentBean adContentBean = new ContentBean();
String newsTitle = advExtraDataBean.title;
adContentBean.setNewsTitle(newsTitle);
adContentBean.setCoverUrl(advExtraDataBean.image);
adContentBean.setLinkUrl(advExtraDataBean.linkUrl);
adContentBean.setLinkType(advExtraDataBean.linkType);
if ("0".equals(advExtraDataBean.linkType)) {
adContentBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_ZERO));
} else {
adContentBean.setObjectType(String.valueOf(ContentTypeConstant.URL_TYPE_FOUR));
}
adContentBean.setTopicInfoBean(mCompBean.getTopicInfoBean());
adContentBean.setChannelInfoBean(mCompBean.getChannelInfoBean());
adContentBean.setRecommend(mCompBean.getRecommend());
adContentBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal());
adContentBean.setCompId(mCompBean.getId());
if (!TextUtils.isEmpty(newsTitle)) {
if (TextUtils.isEmpty(maxTitleStr)) {
maxTitleStr = newsTitle;
} else {
if (newsTitle.length() > maxTitleStr.length()) {
maxTitleStr = newsTitle;
}
}
}
adContentBeanList.add(adContentBean);
}
itemBean.maxTitleName = maxTitleStr;
}
itemBean.adContentBeanList = adContentBeanList;
}
}
@Override
public Class getDataClazz() {
return CompAdv01Bean.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import java.util.List;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.BaseItemSection;
import com.people.entity.custom.BaseLineBean;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.item.ItemBean;
/**
* 底线样式(page接口返回的数据,不同于其他样式)
*
* @author zhangbo
* @version [V1.0.0, 2022/4/14]
* @since V1.0.0
*/
public class BaseLineSection extends BaseItemSection<BaseLineBean> {
private BaseLineBean mBaseLineBean;
/**
* 构造器
*
* @param baseLineData 底线数据
*/
public BaseLineSection(@NonNull BaseLineBean baseLineData) {
super(null, new CompBean());
mBaseLineBean = baseLineData;
}
@Override
protected void initItemBean(@NonNull List<ItemBean> contents) {
// 无特殊处理
}
@Override
public String getLogTag() {
return "BaseLineSection";
}
@Override
public Class<BaseLineBean> getDataClazz() {
return BaseLineBean.class;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.label.Button01Bean;
/**
* 标题section
*/
public class ButtonSection extends BaseContainerSection<Button01Bean> {
private static final String TAG = "TitleLabelSection";
public ButtonSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull Button01Bean labelBean) {
if (mCompBean == null) {
return;
}
}
@Override
public Class getDataClazz() {
return ButtonSection.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.NavigationBeanNews;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.follow.CompFollowBean;
/**
* @Description: 用户关注数据
* @Author: liyub
* @Email: liyubing@wondertek.com.cn
* @CreateDate: 2023/10/20
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
public class CompFollowSection extends BaseContainerSection<CompFollowBean> {
private static final String TAG = "AggregationSection";
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public CompFollowSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull CompFollowBean itemBean) {
itemBean.setId(mCompBean.getId());
itemBean.setName(mCompBean.getName());
}
@Override
public Class getDataClazz() {
return NavigationBeanNews.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import java.util.List;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.NavigationBeanNews;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.content.ContentBean;
/**
* 图片section
*
* @author 周楷桐
*/
public class ImageSection extends BaseContainerSection<NavigationBeanNews> {
private static final String TAG = "AggregationSection";
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public ImageSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull NavigationBeanNews itemBean) {
itemBean.setId(mCompBean.getId());
itemBean.setName(mCompBean.getName());
itemBean.setExtraData(mCompBean.getExtraDataStr());
List<ContentBean> subList = itemBean.getSubList();
if (subList != null) {
for (ContentBean contentBean : subList) {
contentBean.setTopicInfoBean(mCompBean.getTopicInfoBean());
contentBean.setChannelInfoBean(mCompBean.getChannelInfoBean());
contentBean.setRecommend(mCompBean.getRecommend());
contentBean.setSourceInterfaceVal(mCompBean.getSourceInterfaceVal());
contentBean.setCompId(mCompBean.getId());
}
}
}
@Override
public Class getDataClazz() {
return NavigationBeanNews.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.label.Label01Bean;
import com.people.entity.custom.label.Line01Bean;
/**
* 线section
*/
public class LineSection extends BaseContainerSection<Line01Bean> {
private static final String TAG = "LineSection";
public LineSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull Line01Bean labelBean) {
if (mCompBean == null) {
return;
}
}
@Override
public Class getDataClazz() {
return Label01Bean.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
package com.wd.display.comp.layoutdata.channel;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.label.OneKeyPlayBean;
/**
* @Description: 一键读报section类
* @Author: Li Yubing
* @Email: liyubing@wondert.com.cn
* @CreateDate: 2023/6/20 17:14
* @Version: 1.0
*/
public class OneKeyPlaySection extends BaseContainerSection<OneKeyPlayBean> {
private static final String TAG = "OneKeyPlaySection";
/**
* 构造器
*
* @param parent 承载section的group对象,即父节点
* @param compBean comp组件对应的comp数据
*/
public OneKeyPlaySection(AbsGroup parent, @NonNull @NotNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull @NotNull OneKeyPlayBean itemBean) {
itemBean.setTopicInfoBean(mCompBean.getTopicInfoBean());
itemBean.setGroupId(mCompBean.getGroupId());
}
@Override
public String getLogTag() {
return TAG;
}
@Override
public Class getDataClazz() {
return OneKeyPlaySection.class;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata.channel;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.BaseContainerSection;
import com.people.entity.custom.comp.CompBean;
import com.people.entity.custom.content.ContentTypeConstant;
import com.people.entity.custom.label.Label01Bean;
/**
* 标题section
*/
public class TitleLabelSection extends BaseContainerSection<Label01Bean> {
private static final String TAG = "TitleLabelSection";
public TitleLabelSection(AbsGroup parent, @NonNull CompBean compBean) {
super(parent, compBean);
}
@Override
protected void initItemBean(@NonNull Label01Bean labelBean) {
if (mCompBean == null) {
return;
}
if(TextUtils.isEmpty(mCompBean.getObjectTitle())){
labelBean.setTitle(mCompBean.getName());
}else {
labelBean.setTitle(mCompBean.getObjectTitle());
}
labelBean.setSubTitle(mCompBean.getObjectSummary());
String style = mCompBean.getCompStyle();
String type = mCompBean.getCompType();
String objectType = mCompBean.getObjectType();
if (TextUtils.isEmpty(objectType)) {
labelBean.setShowMore(false);
} else {
if (String.valueOf(ContentTypeConstant.URL_TYPE_ZERO).equals(objectType)) {
labelBean.setShowMore(false);
} else {
labelBean.setShowMore(true);
}
}
}
@Override
public Class getDataClazz() {
return Label01Bean.class;
}
@Override
public String getLogTag() {
return TAG;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutmanager;
import java.util.HashSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.people.component.R;
import com.people.entity.custom.item.ItemBean;
public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
/**
* 标记楼层是否初始化过
*/
private HashSet<Integer> initialSet = new HashSet<>();
@Override
public final int getItemViewType(int position) {
try {
ItemLayoutManager lm = layoutManagerAtPosition(position);
if (lm != null) {
return lm.getItemViewType();
}
} catch (Exception e) {
e.printStackTrace();
}
return R.layout.rmrb_item_layout_placeholder;
}
/**
* 获取在position位置的item对应的ItemLayoutManager
*
* @param position adapter position
*/
protected abstract ItemLayoutManager layoutManagerAtPosition(int position);
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new BaseViewHolder(LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
ItemLayoutManager layoutManager = layoutManagerAtPosition(position);
if(layoutManager == null){
return;
}
if (!initialSet.contains(position)) {
initialSet.add(position);
try {
layoutManager.onCreateViewHolder(this, holder.itemView);
} catch (Exception e) {
Log.e("onCreateViewHolder异常", e.getMessage());
e.printStackTrace();
}
}
layoutManager.prepareItem(holder.itemView, position);
layoutManager.setItemViewLongClickListener(holder.itemView, position);
ItemBean itemBean = getItemData(layoutManager, position);
if (itemBean != null) {
layoutManager.bindItem(holder.itemView, position, itemBean);
}
}
public ItemBean getItemData(ItemLayoutManager layoutManager, int position) {
if (layoutManager == null || layoutManager.index == null || layoutManager.getSection() == null) {
return null;
}
int sectionItemIndex = layoutManager.index.getPositionInSection(position);
return layoutManager.getSection().getItemData(sectionItemIndex);
}
public static class BaseViewHolder extends RecyclerView.ViewHolder {
public BaseViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
... ...
package com.wd.display.comp.layoutmanager;
import android.view.View;
/**
* 楼层内组件滑动监听 如内部嵌套的推荐位滑动
*/
public interface ILayoutManagerScrollListener {
void onScrolled(View view, int dx, int dy);
void onScrollStateChanged(View view, int newState);
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutmanager;
import java.util.List;
import androidx.annotation.NonNull;
import com.people.component.comp.layoutdata.AbsPage;
import com.people.component.comp.layoutdata.AbsSection;
import com.people.component.comp.layoutdata.Page;
/**
* Page 布局渲染器, 将comp渲染到页面上
*
* @author wd
*/
public interface ILayoutRender {
/**
* 从startIndex开始有count个item被移除
*
* @param startIndex 移除item范围的开始位置
* @param count 移除item的个数
*/
void itemRangeRemoved(int startIndex, int count);
/**
* 移除置指定的item
* @param positon
*/
void itemRemoved(int positon);
/**
* 依据LayoutManager的 HashCode值删除对应的LayoutManager
* @param hashCode
*/
void itemRemovedByLayoutManagerHashCode(int hashCode);
/**
* 从startIndex开始添加count个item
*
* @param startIndex 添加item范围的开始位置
* @param count 添加item的个数
*/
void itemRangeInserted(int startIndex, int count);
/**
* 从startIndex开始有count个item数据被更新
*
* @param startIndex 更新item范围的开始位置
* @param count 更新item的个数
*/
void itemRangeChanged(int startIndex, int count);
//
// /**
// * 获取在position位置的item对应的ItemLayoutManager
// *
// * @param position adapter position
// */
// ILayoutManager layoutManagerAtPosition(int position);
/**
* 渲染页面
*
* @param page Page实例
*/
void renderPage(AbsPage page,boolean isRefresh);
// /**
// * 渲染overlay浮层
// *
// * @param overlay 浮层实例定义
// */
// void renderOverlay(List<MGOverlay> overlay);
//
// /**
// * 获取从位置start启到end之间的所有布局管理器
// *
// * @param start 启示位置
// * @param end 结束位置
// * @return 从位置start启到end之间的所有布局管理器列表
// */
// List<ILayoutManager> layoutManagerForRange(int start, int end);
//
// /**
// * 获取Page中Item总条数
// *
// * @return
// */
// int getItemCount();
//
/**
* 获取所有comp 的布局管理器
*
* @return list
*/
List<ItemLayoutManager> getAllSectionLayoutManager();
//
//
// void refreshGroup(AbsGroup group, boolean needNotify);
//
// void refreshSection(AbsSection section, boolean needNotify);
//
// /**
// * section中item被删除,并更新section的索引,后续所有section的索引也会被更新
// *
// * @param section 需要更新索引的section
// * @param start 删除item的开始位置, item处在section中的相对位置
// * @param count item删除的个数
// * @param needNotify 申明是否需要通知页面刷新数据
// */
// void sectionItemRemoved(AbsSection section, int start, int count, boolean needNotify);
//
// /**
// * section中添加新的item,并更新section的索引,后续所有section的索引也会被更新
// *
// * @param section 需要更新索引的section
// * @param start 删除item的开始位置, item处在section中的相对位置
// * @param count item删除的个数
// * @param needNotify 申明是否需要通知页面刷新数据
// */
// void sectionItemInserted(AbsSection section, int start, int count, boolean needNotify);
//
/**
* section中添加新的item,并更新section的索引,后续所有section的索引也会被更新
*
* @param section 需要更新索引的section
*/
void sectionItemUpdated(@NonNull AbsSection section);
/**
* notifyDataSetChanged
*/
void notifyDataSetChanged();
void releaseLayoutManagers();
void addBaseLine(Page mPage);
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutmanager;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import com.orhanobut.logger.Logger;
import com.people.component.comp.layoutdata.AbsGroup;
import com.people.component.comp.layoutdata.AbsPage;
import com.people.component.comp.layoutdata.AbsSection;
import com.people.component.comp.layoutdata.channel.BaseLineSection;
import com.people.component.comp.layoutmanager.channel.BaseLineLayoutManager;
import com.people.entity.custom.BaseLineBean;
import com.people.entity.custom.item.ItemBean;
import com.wondertek.wheat.ability.tools.ArrayUtils;
/**
*
*/
public class Indexer {
private static final String TAG = "Indexer";
private List<ItemLayoutManager> itemLayoutManagers;
public Indexer() {
itemLayoutManagers = new ArrayList<>();
}
/**
* 页面中多个楼层,每个楼层配置多个组件信息转换layoutManager,每次转换只对一个楼层中新增的组件信息转换
* <p>
* page
* groupA
* comp1 ->section1 ->layoutmanager1
* comp2 ->section2 ->layoutmanager2
* comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager
* .... ------------------------> List<ItemLayoutManager>
* groupB
* comp1 ->section1 ->layoutmanager1
* comp2 ->section2 ->layoutmanager2
* comp3 ->section3 ->layoutmanager3
* ...
* ...
* <p>
* 依据楼层更新itemLayoutManagers
*
* @param page 页面信息
* @param isRefresh true:清理缓存数据
*/
public void updateItemLayoutManagersByGroup(AbsPage page, boolean isRefresh) {
Logger.t(TAG).d("updateItemLayoutManagers");
if (page == null || page.getGroups() == null) {
return;
}
// 刷新即清理LayoutManger
if (isRefresh) {
itemLayoutManagers.clear();
}
// 获取当前页面可支持需要加载更多数据的楼层对象
AbsGroup group = page.getGroups().get(page.getGroupIndex());
// comp在group里的下标
int sectionSize = group.getSections().size();
int groupIndex = group.getStartPosition();
// j :正在使用的楼层展示总数量
int j = group.getDisplayItemCount();
int sectionIndex = -1+j;
List<ItemBean> list;
for (; j < sectionSize; ++j) {
AbsSection section = group.getSections().get(j);
if (section == null) {
continue;
}
sectionIndex++;
section.setPosition(sectionIndex);
// 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据;
section.setupOrNotSection();
// 根据展示数据list 进行展示,限制于displayCount
if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) {
continue;
}
int itemIndex = -1;
list = new ArrayList<>();
int sectionItemCount = section.getCompBean().getDisplayItemBeans().size();
for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) {
if (itemBean == null) {
continue;
}
ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section);
if (layoutManager == null) {
continue;
}
itemIndex++;
layoutManager.setFragment(page.getFragment());
layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount));
layoutManager.setSection(section);
itemLayoutManagers.add(layoutManager);
list.add(itemBean);
}
// 添加section里内容列表解析
section.parseData(list);
}
Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size());
}
/**
* 页面中一个楼层多个组件信息转换layoutManager,每次转换只对单个楼层中新增的组件信息转换
* page
* groupA
* comp1 ->section1 ->layoutmanager1
* comp2 ->section2 ->layoutmanager2
* comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager
* .... ------------------------> List<ItemLayoutManager>
* <p>
* 更新itemLayoutManagers
*
* @param page
* @param isRefresh true:清理缓存数据
*/
public void updateItemLayoutManagers(AbsPage page, boolean isRefresh) {
Logger.t(TAG).d("updateItemLayoutManagers");
if (page == null || page.getGroups() == null) {
return;
}
// group在recyclerView里的下标
int groupIndex = 0;
int groupSize = page.getGroups().size();
// 刷新即清理LayoutManger
if (isRefresh) {
itemLayoutManagers.clear();
}
List<ItemBean> list;
for (int i = 0; i < groupSize; ++i) {
AbsGroup group = page.getGroups().get(i);
if (group.getSections() == null) {
continue;
}
groupIndex = group.getStartPosition();
// comp在group里的下标
int sectionIndex = -1;
int sectionSize = group.getSections().size();
// group里,所有comp里的有效数据大小总和
int groupItemCount = 0;
int j = 0;
if (groupSize == 1) {
j = page.getDisplayItemCount();
}
for (; j < sectionSize; ++j) {
AbsSection section = group.getSections().get(j);
if (section == null) {
continue;
}
sectionIndex++;
section.setPosition(sectionIndex);
// 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据;
section.setupOrNotSection();
// 根据展示数据list 进行展示,限制于displayCount
if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) {
continue;
}
int itemIndex = -1;
list = new ArrayList<>();
int sectionItemCount = section.getCompBean().getDisplayItemBeans().size();
for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) {
if (itemBean == null) {
continue;
}
ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section);
if (layoutManager == null) {
continue;
}
itemIndex++;
layoutManager.setFragment(page.getFragment());
layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount));
layoutManager.setSection(section);
itemLayoutManagers.add(layoutManager);
list.add(itemBean);
}
groupItemCount += sectionItemCount;
// 添加section里内容列表解析
section.parseData(list);
}
}
Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size());
}
/**
* 页面中多个楼层,每个楼层配置多个组件信息转换layoutManager,同时对多个楼层数据进行转换
* <p>
* page
* groupA
* comp1 ->section1 ->layoutmanager1
* comp2 ->section2 ->layoutmanager2
* comp3 ->section3 ->layoutmanager3 收集转化成LayoutManager
* .... ------------------------> List<ItemLayoutManager>
* groupB
* comp1 ->section1 ->layoutmanager1
* comp2 ->section2 ->layoutmanager2
* comp3 ->section3 ->layoutmanager3
* ...
* ...
* <p>
* 依据楼层更新itemLayoutManagers
*
* @param page 页面信息
*/
public void updateItemLayoutManagers(AbsPage page) {
Logger.t(TAG).d("updateItemLayoutManagers");
itemLayoutManagers.clear();
if (page == null || page.getGroups() == null) {
return;
}
// group在page里的下标,getGroups()里的下标
int groupPosition = -1;
// group在recyclerView里的下标
int groupIndex = 0;
AbsGroup group;
AbsSection section;
List<ItemBean> list;
for (int i = 0; i < page.getGroups().size(); ++i) {
group = page.getGroups().get(i);
if (group.getSections() == null) {
continue;
}
groupPosition++;
group.setPosition(groupPosition);
// 判断group数据是否完整,若数据不完整则整个Group不显示
// boolean isDataIntegrity = group.checkoutIntegrity();
// boolean isLoaded = group.hasDataLoaded();
// comp在group里的下标
int sectionIndex = -1;
int sectionSize = group.getSections().size();
group.setStartPosition(groupIndex);
// group里,所有comp里的有效数据大小总和
int groupItemCount = 0;
for (int j = 0; j < sectionSize; ++j) {
section = group.getSections().get(j);
if (section == null) {
continue;
}
sectionIndex++;
section.setPosition(sectionIndex);
// 添加占位数据,如label是可以展示的,但是没有list,这里组装下占位数据;
section.setupOrNotSection();
// 根据展示数据list 进行展示,限制于displayCount
if (section.getCompBean() == null || section.getCompBean().getDisplayItemBeans() == null) {
continue;
}
int itemIndex = -1;
list = new ArrayList<>();
int sectionItemCount = section.getCompBean().getDisplayItemBeans().size();
for (ItemBean itemBean : section.getCompBean().getDisplayItemBeans()) {
if (itemBean == null) {
continue;
}
ItemLayoutManager layoutManager = page.getSectionParser().parseLayoutManager(section);
if (layoutManager == null) {
continue;
}
itemIndex++;
layoutManager.setFragment(page.getFragment());
// TODO new ItemIndex 用计算的方式解决,实现局部刷新
layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemIndex, sectionItemCount));
layoutManager.setSection(section);
itemLayoutManagers.add(layoutManager);
list.add(itemBean);
}
groupItemCount += sectionItemCount;
// 添加section里内容列表解析
section.parseData(list);
}
groupIndex += groupItemCount;
}
Logger.t(TAG).d("updateItemLayoutManagers : " + itemLayoutManagers.size());
}
/**
* 添加底线view
*
* @param baseLineBean 底线数据
*/
public void addBaseLine(@NonNull BaseLineBean baseLineBean) {
Logger.t(TAG).d("addBaseLine: " + baseLineBean.getLineHint());
BaseLineLayoutManager lineLayoutManager = new BaseLineLayoutManager();
BaseLineSection baseItemSection = new BaseLineSection(baseLineBean);
lineLayoutManager.setSection(baseItemSection);
itemLayoutManagers.add(lineLayoutManager);
List<BaseLineBean> list = new ArrayList<BaseLineBean>() {
{
add(baseLineBean);
}
};
lineLayoutManager.setItemIndex(new ItemIndex(0, 0, 0, 1));
baseItemSection.parseData(list);
}
public void addItemLayoutManager(AbsSection section) {
Logger.t(TAG).d("addItemLayoutManager");
if (section == null || section.getCompBean() == null) {
return;
}
List<ItemBean> itemBeans = section.getCompBean().getDisplayItemBeans();
if (ArrayUtils.isEmpty(itemBeans)) {
return;
}
List<ItemLayoutManager> managers = new ArrayList<>();
int groupIndex = section.getParent().getStartPosition();
int sectionIndex = section.getPosition();
int itemSize = itemBeans.size();
int prePosition = groupIndex;
List<ItemBean> list = new ArrayList<>();
for (ItemBean itemBean : itemBeans) {
if (itemBean == null) {
continue;
}
ItemLayoutManager layoutManager =
section.getParent().getParent().getSectionParser().parseLayoutManager(section);
if (layoutManager == null) {
continue;
}
// layoutManager.setFragment(page.getFragment());
layoutManager.setItemIndex(new ItemIndex(groupIndex, sectionIndex, itemSize));
layoutManager.setSection(section);
managers.add(layoutManager);
list.add(itemBean);
}
// 添加section里内容列表解析
section.parseData(list);
itemLayoutManagers.addAll(prePosition, managers);
Logger.t(TAG).d("addItemLayoutManager : " + itemLayoutManagers.size());
}
/**
*
*/
private int getStartPosition(@NonNull AbsSection section) {
return section.getParent().getStartPosition();
}
public void removeItemLayoutManager(int position) {
itemLayoutManagers.remove(position);
Logger.t("TAG").e("removeItemLayoutManager : " + itemLayoutManagers.size());
}
/**
* 插入/删除item后,更新index
*
* @param startIndex 开始位置
* @param offset 更新位移,即变化量;如插入了3条,offset=3;删除了3条,offset=-3
*/
public void updateIndexer(int startIndex, int offset) {
if (startIndex >= itemLayoutManagers.size()) {
return;
}
for (int i = startIndex; i < itemLayoutManagers.size(); i++) {
// 后面所有的item,下标刷新
ItemLayoutManager itemLayoutManager = itemLayoutManagers.get(i);
ItemIndex itemIndex = itemLayoutManager.getItemIndex();
if (itemIndex == null) {
continue;
}
int groupIndex = itemIndex.getGroupIndex() + offset;
itemIndex.setGroupIndex(groupIndex);
// 下标更新到group里
if (itemLayoutManager.getSection() != null && itemLayoutManager.getSection().getParent() != null) {
itemLayoutManager.getSection().getParent().setStartPosition(groupIndex);
}
}
}
public int getItemCount() {
return itemLayoutManagers == null ? 0 : itemLayoutManagers.size();
}
public List<ItemLayoutManager> getItemLayoutManagers() {
return itemLayoutManagers;
}
public void setItemLayoutManagers(List<ItemLayoutManager> itemLayoutManagers) {
this.itemLayoutManagers = itemLayoutManagers;
}
/**
* 获取在<code>position</code>位置的item的layout manager
*/
ItemLayoutManager layoutMangerInPosition(int position) {
for (ItemLayoutManager lm : itemLayoutManagers) {
if (lm.getItemIndex() == null || lm.getItemIndex().getItemCount() == 0) {
continue;
}
int lastItemPosition = lm.getItemIndex().getLastItemPosition();
if (position < lastItemPosition) {
return (ItemLayoutManager) lm;
}
}
return null;
// return searchManager(position);
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutmanager;
import com.people.entity.custom.item.ItemBean;
public abstract class ItemContainerManager<T extends ItemBean> extends ItemLayoutManager<T> {
@Override
public final int getItemSpan() {
return 1;
}
}
\ No newline at end of file
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutmanager;
/**
* ItemIndex
*
* @author lvinhui
*/
public class ItemIndex {
/**
* item 所在的Group在RecyclerView中的绝对位置
*/
private int groupIndex = -1;
/**
* item 所在section在group中的相对位置
*/
private int sectionIndex = -1;
/**
* Group中的section数量
*/
private int itemCount = -1;
private int itemIndex;
/**
* gzq
*
* @param groupIndex
* @param sectionIndex
* @param itemIndex
* @param itemCount
*/
public ItemIndex(int groupIndex, int sectionIndex, int itemIndex, int itemCount) {
this.groupIndex = groupIndex;
this.sectionIndex = sectionIndex;
this.itemCount = itemCount;
this.itemIndex = itemIndex;
}
/**
* gzq
*
* @param groupIndex
* @param sectionIndex
* @param itemCount
*/
public ItemIndex(int groupIndex, int sectionIndex, int itemCount) {
this.groupIndex = groupIndex;
this.sectionIndex = sectionIndex;
this.itemCount = itemCount;
}
public int getGroupIndex() {
return groupIndex;
}
public void setGroupIndex(int groupIndex) {
this.groupIndex = groupIndex;
}
public int getSectionIndex() {
return sectionIndex;
}
public void setSectionIndex(int sectionIndex) {
this.sectionIndex = sectionIndex;
}
public int getItemCount() {
return itemCount;
}
public void setItemCount(int itemCount) {
this.itemCount = itemCount;
}
public int getLastItemPosition() {
return groupIndex + sectionIndex + itemCount;
}
/**
* 根据Item在RecyclerView中的adapter position({@code position})计算出改item在section中的位置.
*
* @param position 在recyclerView中的绝对Adapter位置
* @return item在comp中的索引,若超出comp的范围则返回负数
*/
public int getPositionInSection(int position) {
// final int itemIndex = position - groupIndex - sectionIndex;
// if (itemIndex >= itemCount) {
// return -1;
// }
//
// return itemIndex;
return this.itemIndex;
}
}
... ...