Commit c1d7d48c5d11878be63cf636054dea00e7bf62c4

Authored by 袁思汶
0 parents

ver 1.0

Showing 58 changed files with 4843 additions and 0 deletions

Too many changes to show.

To preserve performance only 58 of 187 files are displayed.

.gitignore 0 → 100644
  1 +++ a/.gitignore
  1 +*.iml
  2 +.gradle
  3 +/local.properties
  4 +/.idea/caches
  5 +/.idea/libraries
  6 +/.idea/modules.xml
  7 +/.idea/workspace.xml
  8 +/.idea/navEditor.xml
  9 +/.idea/assetWizardSettings.xml
  10 +.DS_Store
  11 +/build
  12 +/captures
  13 +.externalNativeBuild
  14 +.cxx
... ...
.idea/codeStyles/Project.xml 0 → 100644
  1 +++ a/.idea/codeStyles/Project.xml
  1 +<component name="ProjectCodeStyleConfiguration">
  2 + <code_scheme name="Project" version="173">
  3 + <codeStyleSettings language="XML">
  4 + <indentOptions>
  5 + <option name="CONTINUATION_INDENT_SIZE" value="4" />
  6 + </indentOptions>
  7 + <arrangement>
  8 + <rules>
  9 + <section>
  10 + <rule>
  11 + <match>
  12 + <AND>
  13 + <NAME>xmlns:android</NAME>
  14 + <XML_ATTRIBUTE />
  15 + <XML_NAMESPACE>^$</XML_NAMESPACE>
  16 + </AND>
  17 + </match>
  18 + </rule>
  19 + </section>
  20 + <section>
  21 + <rule>
  22 + <match>
  23 + <AND>
  24 + <NAME>xmlns:.*</NAME>
  25 + <XML_ATTRIBUTE />
  26 + <XML_NAMESPACE>^$</XML_NAMESPACE>
  27 + </AND>
  28 + </match>
  29 + <order>BY_NAME</order>
  30 + </rule>
  31 + </section>
  32 + <section>
  33 + <rule>
  34 + <match>
  35 + <AND>
  36 + <NAME>.*:id</NAME>
  37 + <XML_ATTRIBUTE />
  38 + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
  39 + </AND>
  40 + </match>
  41 + </rule>
  42 + </section>
  43 + <section>
  44 + <rule>
  45 + <match>
  46 + <AND>
  47 + <NAME>.*:name</NAME>
  48 + <XML_ATTRIBUTE />
  49 + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
  50 + </AND>
  51 + </match>
  52 + </rule>
  53 + </section>
  54 + <section>
  55 + <rule>
  56 + <match>
  57 + <AND>
  58 + <NAME>name</NAME>
  59 + <XML_ATTRIBUTE />
  60 + <XML_NAMESPACE>^$</XML_NAMESPACE>
  61 + </AND>
  62 + </match>
  63 + </rule>
  64 + </section>
  65 + <section>
  66 + <rule>
  67 + <match>
  68 + <AND>
  69 + <NAME>style</NAME>
  70 + <XML_ATTRIBUTE />
  71 + <XML_NAMESPACE>^$</XML_NAMESPACE>
  72 + </AND>
  73 + </match>
  74 + </rule>
  75 + </section>
  76 + <section>
  77 + <rule>
  78 + <match>
  79 + <AND>
  80 + <NAME>.*</NAME>
  81 + <XML_ATTRIBUTE />
  82 + <XML_NAMESPACE>^$</XML_NAMESPACE>
  83 + </AND>
  84 + </match>
  85 + <order>BY_NAME</order>
  86 + </rule>
  87 + </section>
  88 + <section>
  89 + <rule>
  90 + <match>
  91 + <AND>
  92 + <NAME>.*</NAME>
  93 + <XML_ATTRIBUTE />
  94 + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
  95 + </AND>
  96 + </match>
  97 + <order>ANDROID_ATTRIBUTE_ORDER</order>
  98 + </rule>
  99 + </section>
  100 + <section>
  101 + <rule>
  102 + <match>
  103 + <AND>
  104 + <NAME>.*</NAME>
  105 + <XML_ATTRIBUTE />
  106 + <XML_NAMESPACE>.*</XML_NAMESPACE>
  107 + </AND>
  108 + </match>
  109 + <order>BY_NAME</order>
  110 + </rule>
  111 + </section>
  112 + </rules>
  113 + </arrangement>
  114 + </codeStyleSettings>
  115 + </code_scheme>
  116 +</component>
0 117 \ No newline at end of file
... ...
.idea/gradle.xml 0 → 100644
  1 +++ a/.idea/gradle.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="GradleMigrationSettings" migrationVersion="1" />
  4 + <component name="GradleSettings">
  5 + <option name="linkedExternalProjectsSettings">
  6 + <GradleProjectSettings>
  7 + <option name="testRunner" value="PLATFORM" />
  8 + <option name="distributionType" value="DEFAULT_WRAPPED" />
  9 + <option name="externalProjectPath" value="$PROJECT_DIR$" />
  10 + <option name="gradleJvm" value="1.8" />
  11 + <option name="modules">
  12 + <set>
  13 + <option value="$PROJECT_DIR$" />
  14 + <option value="$PROJECT_DIR$/app" />
  15 + <option value="$PROJECT_DIR$/publish" />
  16 + </set>
  17 + </option>
  18 + <option name="resolveModulePerSourceSet" value="false" />
  19 + </GradleProjectSettings>
  20 + </option>
  21 + </component>
  22 +</project>
0 23 \ No newline at end of file
... ...
.idea/jarRepositories.xml 0 → 100644
  1 +++ a/.idea/jarRepositories.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="RemoteRepositoriesConfiguration">
  4 + <remote-repository>
  5 + <option name="id" value="central" />
  6 + <option name="name" value="Maven Central repository" />
  7 + <option name="url" value="https://repo1.maven.org/maven2" />
  8 + </remote-repository>
  9 + <remote-repository>
  10 + <option name="id" value="jboss.community" />
  11 + <option name="name" value="JBoss Community repository" />
  12 + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
  13 + </remote-repository>
  14 + <remote-repository>
  15 + <option name="id" value="BintrayJCenter" />
  16 + <option name="name" value="BintrayJCenter" />
  17 + <option name="url" value="https://jcenter.bintray.com/" />
  18 + </remote-repository>
  19 + <remote-repository>
  20 + <option name="id" value="Google" />
  21 + <option name="name" value="Google" />
  22 + <option name="url" value="https://dl.google.com/dl/android/maven2/" />
  23 + </remote-repository>
  24 + <remote-repository>
  25 + <option name="id" value="maven" />
  26 + <option name="name" value="maven" />
  27 + <option name="url" value="http://android.nexus.cnlive.com/repository/cnlive-mixed/" />
  28 + </remote-repository>
  29 + <remote-repository>
  30 + <option name="id" value="maven3" />
  31 + <option name="name" value="maven3" />
  32 + <option name="url" value="https://dl.bintray.com/granzon/cnlive" />
  33 + </remote-repository>
  34 + <remote-repository>
  35 + <option name="id" value="maven2" />
  36 + <option name="name" value="maven2" />
  37 + <option name="url" value="https://jitpack.io" />
  38 + </remote-repository>
  39 + <remote-repository>
  40 + <option name="id" value="maven4" />
  41 + <option name="name" value="maven4" />
  42 + <option name="url" value="https://dl.bintray.com/granzon/cnliveLibs" />
  43 + </remote-repository>
  44 + <remote-repository>
  45 + <option name="id" value="MavenRepo" />
  46 + <option name="name" value="MavenRepo" />
  47 + <option name="url" value="https://repo.maven.apache.org/maven2/" />
  48 + </remote-repository>
  49 + <remote-repository>
  50 + <option name="id" value="maven5" />
  51 + <option name="name" value="maven5" />
  52 + <option name="url" value="http://maven.aliyun.com/nexus/content/repositories/releases" />
  53 + </remote-repository>
  54 + </component>
  55 +</project>
0 56 \ No newline at end of file
... ...
.idea/misc.xml 0 → 100644
  1 +++ a/.idea/misc.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  4 + <output url="file://$PROJECT_DIR$/build/classes" />
  5 + </component>
  6 + <component name="ProjectType">
  7 + <option name="id" value="Android" />
  8 + </component>
  9 +</project>
0 10 \ No newline at end of file
... ...
.idea/runConfigurations.xml 0 → 100644
  1 +++ a/.idea/runConfigurations.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="RunConfigurationProducerService">
  4 + <option name="ignoredProducers">
  5 + <set>
  6 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
  7 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
  8 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
  9 + </set>
  10 + </option>
  11 + </component>
  12 +</project>
0 13 \ No newline at end of file
... ...
.idea/vcs.xml 0 → 100644
  1 +++ a/.idea/vcs.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="$PROJECT_DIR$" vcs="Git" />
  5 + </component>
  6 +</project>
0 7 \ No newline at end of file
... ...
app/.gitignore 0 → 100644
  1 +++ a/app/.gitignore
  1 +/build
0 2 \ No newline at end of file
... ...
app/build.gradle 0 → 100644
  1 +++ a/app/build.gradle
  1 +apply plugin: 'com.android.application'
  2 +
  3 +
  4 +
  5 +repositories {
  6 + mavenCentral()
  7 + maven {
  8 + url "http://maven.aliyun.com/nexus/content/repositories/releases"
  9 + }
  10 + flatDir {
  11 + dirs 'libs'
  12 + }
  13 +}
  14 +
  15 +def action = rootProject.ext.action
  16 +
  17 +def ACTION_SHARE_RELEASE = action.ACTION_SHARE_RELEASE
  18 +
  19 +
  20 +static def stringValue(def value) {
  21 + return "\"${value}\""
  22 +}
  23 +
  24 +android {
  25 + compileSdkVersion = 29
  26 + buildToolsVersion = "29.0.2"
  27 +
  28 + defaultConfig {
  29 + applicationId "com.cnlive.publishingworks"
  30 + minSdkVersion 19
  31 + targetSdkVersion 29
  32 + versionCode 1
  33 + versionName "1.0"
  34 + multiDexEnabled true
  35 + //启用renderscript
  36 + renderscriptTargetApi 15
  37 + renderscriptSupportModeEnabled true
  38 +
  39 +
  40 + ndk {
  41 + abiFilters "armeabi-v7a"
  42 + }
  43 +
  44 + buildConfigField("String", "ACTION_SHARE_RELEASE", stringValue(ACTION_SHARE_RELEASE))
  45 +
  46 + manifestPlaceholders = [
  47 + ACTION_SHARE_RELEASE : ACTION_SHARE_RELEASE,
  48 + ]
  49 +
  50 + javaCompileOptions {
  51 + annotationProcessorOptions {
  52 + arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
  53 + }
  54 + }
  55 + }
  56 +
  57 + buildTypes {
  58 + release {
  59 + minifyEnabled false
  60 + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  61 + }
  62 + }
  63 +
  64 + compileOptions {
  65 + sourceCompatibility JavaVersion.VERSION_1_8
  66 + targetCompatibility JavaVersion.VERSION_1_8
  67 + }
  68 +
  69 + dataBinding {
  70 + enabled true
  71 + }
  72 +
  73 + dexOptions {
  74 + javaMaxHeapSize '4g'
  75 + }
  76 +}
  77 +
  78 +dependencies {
  79 + implementation fileTree(dir: "libs", include: ["*.jar"])
  80 + implementation "androidx.legacy:legacy-support-v4:$rootProject.androidX_legacy_support_v4"
  81 + implementation "androidx.appcompat:appcompat:$rootProject.androidXAppcompat"
  82 + implementation "androidx.recyclerview:recyclerview:$rootProject.androidXRecyclerview"
  83 + implementation "androidx.constraintlayout:constraintlayout:$rootProject.androidXConstraintlayout"
  84 + implementation 'androidx.multidex:multidex:2.0.0'
  85 + //glide
  86 + implementation "com.github.bumptech.glide:glide:$rootProject.glide"
  87 + implementation "jp.wasabeef:glide-transformations:$rootProject.glideTransformations"
  88 + implementation project(path: ':publish')
  89 + annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.compiler"
  90 +
  91 + implementation "pub.devrel:easypermissions:$rootProject.easypermissions"
  92 + implementation "com.chensl.rotatephotoview:rotatephotoview:$rootProject.rotatephotoview"
  93 +
  94 + implementation "com.alibaba:arouter-api:$rootProject.arouterApiVersion"
  95 + annotationProcessor "com.alibaba:arouter-compiler:$rootProject.arouterCompilerVersion"
  96 + implementation "com.qmuiteam:qmui:$rootProject.qmui"
  97 +
  98 +}
0 99 \ No newline at end of file
... ...
app/proguard-rules.pro 0 → 100644
  1 +++ a/app/proguard-rules.pro
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
0 22 \ No newline at end of file
... ...
app/src/androidTest/java/com/cnlive/publishingworks/ExampleInstrumentedTest.java 0 → 100644
  1 +++ a/app/src/androidTest/java/com/cnlive/publishingworks/ExampleInstrumentedTest.java
  1 +package com.cnlive.publishingworks;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import androidx.test.platform.app.InstrumentationRegistry;
  6 +import androidx.test.ext.junit.runners.AndroidJUnit4;
  7 +
  8 +import org.junit.Test;
  9 +import org.junit.runner.RunWith;
  10 +
  11 +import static org.junit.Assert.*;
  12 +
  13 +/**
  14 + * Instrumented test, which will execute on an Android device.
  15 + *
  16 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  17 + */
  18 +@RunWith(AndroidJUnit4.class)
  19 +public class ExampleInstrumentedTest {
  20 + @Test
  21 + public void useAppContext() {
  22 + // Context of the app under test.
  23 + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  24 + assertEquals("com.cnlive.publishingworks", appContext.getPackageName());
  25 + }
  26 +}
0 27 \ No newline at end of file
... ...
app/src/main/AndroidManifest.xml 0 → 100644
  1 +++ a/app/src/main/AndroidManifest.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + package="com.cnlive.publishingworks">
  4 +
  5 + <application
  6 + android:name=".Application"
  7 + android:allowBackup="true"
  8 + android:icon="@mipmap/ic_launcher"
  9 + android:label="@string/app_name"
  10 + android:roundIcon="@mipmap/ic_launcher_round"
  11 + android:supportsRtl="true"
  12 + android:theme="@style/AppTheme">
  13 + <activity android:name=".MainActivity">
  14 + <intent-filter>
  15 + <action android:name="android.intent.action.MAIN" />
  16 +
  17 + <category android:name="android.intent.category.LAUNCHER" />
  18 + </intent-filter>
  19 + </activity>
  20 + </application>
  21 +
  22 +</manifest>
0 23 \ No newline at end of file
... ...
app/src/main/java/com/cnlive/publishingworks/Application.java 0 → 100644
  1 +++ a/app/src/main/java/com/cnlive/publishingworks/Application.java
  1 +package com.cnlive.publishingworks;
  2 +
  3 +import com.alibaba.android.arouter.launcher.ARouter;
  4 +
  5 +import androidx.multidex.MultiDex;
  6 +
  7 +
  8 +public class Application extends android.app.Application {
  9 + @Override
  10 + public void onCreate() {
  11 + super.onCreate();
  12 + ARouter.openDebug();
  13 + ARouter.init(this);
  14 + MultiDex.install(this);
  15 + }
  16 +}
... ...
app/src/main/java/com/cnlive/publishingworks/MainActivity.java 0 → 100644
  1 +++ a/app/src/main/java/com/cnlive/publishingworks/MainActivity.java
  1 +package com.cnlive.publishingworks;
  2 +
  3 +import androidx.appcompat.app.AppCompatActivity;
  4 +
  5 +import android.os.Bundle;
  6 +import android.view.View;
  7 +
  8 +import com.alibaba.android.arouter.launcher.ARouter;
  9 +
  10 +public class MainActivity extends AppCompatActivity {
  11 +
  12 + @Override
  13 + protected void onCreate(Bundle savedInstanceState) {
  14 + super.onCreate(savedInstanceState);
  15 + setContentView(R.layout.activity_main);
  16 + findViewById(R.id.gogg).setOnClickListener(this::onClick);
  17 + }
  18 +
  19 + public void onClick(View view) {
  20 + ARouter.getInstance().build("/cnmain/ReleasePublishAcityity")
  21 + .navigation(view.getContext());
  22 + }
  23 +}
0 24 \ No newline at end of file
... ...
app/src/main/res/color/s_btn_blue_border.xml 0 → 100644
  1 +++ a/app/src/main/res/color/s_btn_blue_border.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
  3 + <item android:color="@color/app_color_blue_disabled" android:state_enabled="false" />
  4 + <item android:color="@color/app_color_blue_pressed" android:state_pressed="true" />
  5 + <item android:color="@color/app_color_blue" />
  6 +</selector>
0 7 \ No newline at end of file
... ...
app/src/main/res/drawable-v24/ic_launcher_foreground.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:aapt="http://schemas.android.com/aapt"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportWidth="108"
  6 + android:viewportHeight="108">
  7 + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
  8 + <aapt:attr name="android:fillColor">
  9 + <gradient
  10 + android:endX="85.84757"
  11 + android:endY="92.4963"
  12 + android:startX="42.9492"
  13 + android:startY="49.59793"
  14 + android:type="linear">
  15 + <item
  16 + android:color="#44000000"
  17 + android:offset="0.0" />
  18 + <item
  19 + android:color="#00000000"
  20 + android:offset="1.0" />
  21 + </gradient>
  22 + </aapt:attr>
  23 + </path>
  24 + <path
  25 + android:fillColor="#FFFFFF"
  26 + android:fillType="nonZero"
  27 + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
  28 + android:strokeWidth="1"
  29 + android:strokeColor="#00000000" />
  30 +</vector>
0 31 \ No newline at end of file
... ...
app/src/main/res/drawable/ic_launcher_background.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/ic_launcher_background.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportWidth="108"
  6 + android:viewportHeight="108">
  7 + <path
  8 + android:fillColor="#3DDC84"
  9 + android:pathData="M0,0h108v108h-108z" />
  10 + <path
  11 + android:fillColor="#00000000"
  12 + android:pathData="M9,0L9,108"
  13 + android:strokeWidth="0.8"
  14 + android:strokeColor="#33FFFFFF" />
  15 + <path
  16 + android:fillColor="#00000000"
  17 + android:pathData="M19,0L19,108"
  18 + android:strokeWidth="0.8"
  19 + android:strokeColor="#33FFFFFF" />
  20 + <path
  21 + android:fillColor="#00000000"
  22 + android:pathData="M29,0L29,108"
  23 + android:strokeWidth="0.8"
  24 + android:strokeColor="#33FFFFFF" />
  25 + <path
  26 + android:fillColor="#00000000"
  27 + android:pathData="M39,0L39,108"
  28 + android:strokeWidth="0.8"
  29 + android:strokeColor="#33FFFFFF" />
  30 + <path
  31 + android:fillColor="#00000000"
  32 + android:pathData="M49,0L49,108"
  33 + android:strokeWidth="0.8"
  34 + android:strokeColor="#33FFFFFF" />
  35 + <path
  36 + android:fillColor="#00000000"
  37 + android:pathData="M59,0L59,108"
  38 + android:strokeWidth="0.8"
  39 + android:strokeColor="#33FFFFFF" />
  40 + <path
  41 + android:fillColor="#00000000"
  42 + android:pathData="M69,0L69,108"
  43 + android:strokeWidth="0.8"
  44 + android:strokeColor="#33FFFFFF" />
  45 + <path
  46 + android:fillColor="#00000000"
  47 + android:pathData="M79,0L79,108"
  48 + android:strokeWidth="0.8"
  49 + android:strokeColor="#33FFFFFF" />
  50 + <path
  51 + android:fillColor="#00000000"
  52 + android:pathData="M89,0L89,108"
  53 + android:strokeWidth="0.8"
  54 + android:strokeColor="#33FFFFFF" />
  55 + <path
  56 + android:fillColor="#00000000"
  57 + android:pathData="M99,0L99,108"
  58 + android:strokeWidth="0.8"
  59 + android:strokeColor="#33FFFFFF" />
  60 + <path
  61 + android:fillColor="#00000000"
  62 + android:pathData="M0,9L108,9"
  63 + android:strokeWidth="0.8"
  64 + android:strokeColor="#33FFFFFF" />
  65 + <path
  66 + android:fillColor="#00000000"
  67 + android:pathData="M0,19L108,19"
  68 + android:strokeWidth="0.8"
  69 + android:strokeColor="#33FFFFFF" />
  70 + <path
  71 + android:fillColor="#00000000"
  72 + android:pathData="M0,29L108,29"
  73 + android:strokeWidth="0.8"
  74 + android:strokeColor="#33FFFFFF" />
  75 + <path
  76 + android:fillColor="#00000000"
  77 + android:pathData="M0,39L108,39"
  78 + android:strokeWidth="0.8"
  79 + android:strokeColor="#33FFFFFF" />
  80 + <path
  81 + android:fillColor="#00000000"
  82 + android:pathData="M0,49L108,49"
  83 + android:strokeWidth="0.8"
  84 + android:strokeColor="#33FFFFFF" />
  85 + <path
  86 + android:fillColor="#00000000"
  87 + android:pathData="M0,59L108,59"
  88 + android:strokeWidth="0.8"
  89 + android:strokeColor="#33FFFFFF" />
  90 + <path
  91 + android:fillColor="#00000000"
  92 + android:pathData="M0,69L108,69"
  93 + android:strokeWidth="0.8"
  94 + android:strokeColor="#33FFFFFF" />
  95 + <path
  96 + android:fillColor="#00000000"
  97 + android:pathData="M0,79L108,79"
  98 + android:strokeWidth="0.8"
  99 + android:strokeColor="#33FFFFFF" />
  100 + <path
  101 + android:fillColor="#00000000"
  102 + android:pathData="M0,89L108,89"
  103 + android:strokeWidth="0.8"
  104 + android:strokeColor="#33FFFFFF" />
  105 + <path
  106 + android:fillColor="#00000000"
  107 + android:pathData="M0,99L108,99"
  108 + android:strokeWidth="0.8"
  109 + android:strokeColor="#33FFFFFF" />
  110 + <path
  111 + android:fillColor="#00000000"
  112 + android:pathData="M19,29L89,29"
  113 + android:strokeWidth="0.8"
  114 + android:strokeColor="#33FFFFFF" />
  115 + <path
  116 + android:fillColor="#00000000"
  117 + android:pathData="M19,39L89,39"
  118 + android:strokeWidth="0.8"
  119 + android:strokeColor="#33FFFFFF" />
  120 + <path
  121 + android:fillColor="#00000000"
  122 + android:pathData="M19,49L89,49"
  123 + android:strokeWidth="0.8"
  124 + android:strokeColor="#33FFFFFF" />
  125 + <path
  126 + android:fillColor="#00000000"
  127 + android:pathData="M19,59L89,59"
  128 + android:strokeWidth="0.8"
  129 + android:strokeColor="#33FFFFFF" />
  130 + <path
  131 + android:fillColor="#00000000"
  132 + android:pathData="M19,69L89,69"
  133 + android:strokeWidth="0.8"
  134 + android:strokeColor="#33FFFFFF" />
  135 + <path
  136 + android:fillColor="#00000000"
  137 + android:pathData="M19,79L89,79"
  138 + android:strokeWidth="0.8"
  139 + android:strokeColor="#33FFFFFF" />
  140 + <path
  141 + android:fillColor="#00000000"
  142 + android:pathData="M29,19L29,89"
  143 + android:strokeWidth="0.8"
  144 + android:strokeColor="#33FFFFFF" />
  145 + <path
  146 + android:fillColor="#00000000"
  147 + android:pathData="M39,19L39,89"
  148 + android:strokeWidth="0.8"
  149 + android:strokeColor="#33FFFFFF" />
  150 + <path
  151 + android:fillColor="#00000000"
  152 + android:pathData="M49,19L49,89"
  153 + android:strokeWidth="0.8"
  154 + android:strokeColor="#33FFFFFF" />
  155 + <path
  156 + android:fillColor="#00000000"
  157 + android:pathData="M59,19L59,89"
  158 + android:strokeWidth="0.8"
  159 + android:strokeColor="#33FFFFFF" />
  160 + <path
  161 + android:fillColor="#00000000"
  162 + android:pathData="M69,19L69,89"
  163 + android:strokeWidth="0.8"
  164 + android:strokeColor="#33FFFFFF" />
  165 + <path
  166 + android:fillColor="#00000000"
  167 + android:pathData="M79,19L79,89"
  168 + android:strokeWidth="0.8"
  169 + android:strokeColor="#33FFFFFF" />
  170 +</vector>
... ...
app/src/main/res/layout/activity_main.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/activity_main.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools">
  5 +
  6 + <data>
  7 +
  8 + </data>
  9 +
  10 + <RelativeLayout
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"
  13 + tools:context=".MainActivity">
  14 +
  15 + <Button
  16 + android:id="@+id/gogg"
  17 + android:layout_width="wrap_content"
  18 + android:layout_height="wrap_content"
  19 + android:layout_centerInParent="true"
  20 + android:text="跳转发布"
  21 + />
  22 +
  23 + </RelativeLayout>
  24 +</layout>
0 25 \ No newline at end of file
... ...
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 0 → 100644
  1 +++ a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
0 6 \ No newline at end of file
... ...
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 0 → 100644
  1 +++ a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
0 6 \ No newline at end of file
... ...
app/src/main/res/mipmap-hdpi/ic_launcher.png 0 → 100644

3.51 KB

app/src/main/res/mipmap-hdpi/ic_launcher_round.png 0 → 100644

5.21 KB

app/src/main/res/mipmap-mdpi/ic_launcher.png 0 → 100644

2.57 KB

app/src/main/res/mipmap-mdpi/ic_launcher_round.png 0 → 100644

3.31 KB

app/src/main/res/mipmap-xhdpi/ic_launcher.png 0 → 100644

4.81 KB

app/src/main/res/mipmap-xhdpi/ic_launcher_round.png 0 → 100644

7.3 KB

app/src/main/res/mipmap-xxhdpi/ic_launcher.png 0 → 100644

7.72 KB

app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png 0 → 100644

11.6 KB

app/src/main/res/mipmap-xxxhdpi/ic_launcher.png 0 → 100644

10.4 KB

app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png 0 → 100644

16.2 KB

app/src/main/res/values/colors.xml 0 → 100644
  1 +++ a/app/src/main/res/values/colors.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 + <color name="colorPrimary">#6200EE</color>
  4 + <color name="colorPrimaryDark">#3700B3</color>
  5 + <color name="colorAccent">#03DAC5</color>
  6 +</resources>
0 7 \ No newline at end of file
... ...
app/src/main/res/values/strings.xml 0 → 100644
  1 +++ a/app/src/main/res/values/strings.xml
  1 +<resources>
  2 + <string name="app_name">PublishingWorks</string>
  3 +</resources>
0 4 \ No newline at end of file
... ...
app/src/main/res/values/styles.xml 0 → 100644
  1 +++ a/app/src/main/res/values/styles.xml
  1 +<resources>
  2 + <!-- Base application theme. -->
  3 + <style name="AppTheme" parent="QMUI.Compat.NoActionBar">
  4 + <!-- 配置Android提供的theme -->
  5 + <item name="android:listPreferredItemHeight">?attr/qmui_list_item_height_higher</item>
  6 + <item name="android:listPreferredItemHeightSmall">?attr/qmui_list_item_height</item>
  7 + <item name="colorPrimaryDark">@color/transparent</item>
  8 + <!-- 配置qmui提供的theme -->
  9 + <item name="qmui_config_color_blue">@color/white</item>
  10 + <item name="qmui_round_btn_bg_color">@color/white</item>
  11 + <item name="qmui_content_spacing_horizontal">20dp</item>
  12 + <item name="qmui_content_padding_horizontal">@dimen/qmui_content_spacing_horizontal</item>
  13 +
  14 + <item name="qmui_bottom_sheet_grid_item_mini_width">96dp</item>
  15 + </style>
  16 +
  17 +</resources>
0 18 \ No newline at end of file
... ...
app/src/test/java/com/cnlive/publishingworks/ExampleUnitTest.java 0 → 100644
  1 +++ a/app/src/test/java/com/cnlive/publishingworks/ExampleUnitTest.java
  1 +package com.cnlive.publishingworks;
  2 +
  3 +import org.junit.Test;
  4 +
  5 +import static org.junit.Assert.*;
  6 +
  7 +/**
  8 + * Example local unit test, which will execute on the development machine (host).
  9 + *
  10 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  11 + */
  12 +public class ExampleUnitTest {
  13 + @Test
  14 + public void addition_isCorrect() {
  15 + assertEquals(4, 2 + 2);
  16 + }
  17 +}
0 18 \ No newline at end of file
... ...
build.gradle 0 → 100644
  1 +++ a/build.gradle
  1 +// Top-level build file where you can add configuration options common to all sub-projects/modules.
  2 +apply from: "config.gradle"
  3 +
  4 +buildscript {
  5 + repositories {
  6 + google()
  7 + jcenter()
  8 + }
  9 + dependencies {
  10 + classpath "com.android.tools.build:gradle:3.5.0"
  11 +
  12 + // NOTE: Do not place your application dependencies here; they belong
  13 + // in the individual module build.gradle files
  14 + }
  15 +}
  16 +
  17 +allprojects {
  18 + repositories {
  19 + google()
  20 + jcenter()
  21 + maven {
  22 + url maven.mavenMixedUrl
  23 + credentials { username = nexusId;password = nexusPw }
  24 + }
  25 +
  26 + maven {
  27 + url "https://jitpack.io"
  28 + }
  29 + maven {
  30 + url 'https://dl.bintray.com/granzon/cnlive'
  31 + }
  32 + maven {
  33 + url 'https://dl.bintray.com/granzon/cnliveLibs'
  34 + }
  35 + }
  36 +}
  37 +
  38 +task clean(type: Delete) {
  39 + delete rootProject.buildDir
  40 +}
  41 +
  42 +ext {
  43 + supportV4 = '27.1.0'
  44 + appcompatV7 = '27.1.0'
  45 + recyclerviewV7 = '27.1.0'
  46 + constraintLayout = '1.1.2'
  47 + //androidX
  48 + androidXAppcompat = '1.0.0'
  49 + androidXRecyclerview = '1.0.0'
  50 + androidXConstraintlayout = '1.1.3'
  51 +
  52 + androidX_legacy_support_v4 = '1.0.0'
  53 +
  54 + glide = '4.11.0'
  55 + glideTransformations = '4.1.0'
  56 + compiler = '4.11.0'
  57 +
  58 + easypermissions = '1.0.0'
  59 + rotatephotoview = '1.0.5'
  60 +
  61 + libCnUtil = '3.1.0'
  62 + libCnVideo = '3.2.3'
  63 +
  64 + qmui = '1.1.5'
  65 +
  66 + libLargeImage = '1.0.4-androidx'
  67 + libBase = '1.9.5.9-androidx'
  68 + libVideoQiniu = '1.0.7.2'
  69 +
  70 + //阿里路由框架
  71 + arouterApiVersion = '1.5.0'
  72 + arouterCompilerVersion = '1.2.1'
  73 + libNewMediaPicker = '1.0.2.7'
  74 + qmui = '1.1.5'
  75 + libEmoj = '2.2.3.6-androidx'
  76 + location = 'latest.integration'
  77 +
  78 + appArch = '1.3.6.5-androidx'
  79 + //视频库
  80 + libVideoQiniu = '1.0.7-androidx'
  81 + //七牛
  82 + qiniuAndroidSdk = '7.4.3'
  83 + //greendao
  84 + greendao = '3.3.0'
  85 +
  86 +}
0 87 \ No newline at end of file
... ...
config.gradle 0 → 100644
  1 +++ a/config.gradle
  1 +ext {
  2 + //Nexus 访问账号
  3 + nexusId = "developer"
  4 + nexusPw = "android_2019"
  5 +
  6 + //Nexus 发布配置
  7 + maven = [
  8 + //发布版地址(暂未使用)
  9 + mavenUrl : "http://android.nexus.cnlive.com/repository/cnlive/",
  10 + //快照版地址(暂未使用)
  11 + mavenDevUrl : "http://android.nexus.cnlive.com/repository/cnlive-snapshot/",
  12 + //混合版地址
  13 + mavenMixedUrl : "http://android.nexus.cnlive.com/repository/cnlive-mixed/",
  14 + //发布账号(单独分配)
  15 + mavenUserName: "developer",
  16 + mavenPwd : "android_2019"
  17 + ]
  18 +
  19 + //Maven Base库配置
  20 + out_shared = [
  21 + //编译方式
  22 + debug : false,
  23 + //版本号
  24 + version: "1.0.0.0",
  25 + //Lib库前缀
  26 + packeg : "com.cnlive.publish",
  27 + //Lib库名称
  28 + name : "publish_works"
  29 + ]
  30 +
  31 + action = [
  32 + ACTION_SHARE_RELEASE : "netpp.intent.action.SHARE_RELEASE",
  33 + ]
  34 +}
0 35 \ No newline at end of file
... ...
gradle.properties 0 → 100644
  1 +++ a/gradle.properties
  1 +# Project-wide Gradle settings.
  2 +# IDE (e.g. Android Studio) users:
  3 +# Gradle settings configured through the IDE *will override*
  4 +# any settings specified in this file.
  5 +# For more details on how to configure your build environment visit
  6 +# http://www.gradle.org/docs/current/userguide/build_environment.html
  7 +# Specifies the JVM arguments used for the daemon process.
  8 +# The setting is particularly useful for tweaking memory settings.
  9 +org.gradle.jvmargs=-Xmx2048m
  10 +# When configured, Gradle will run in incubating parallel mode.
  11 +# This option should only be used with decoupled projects. More details, visit
  12 +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
  13 +# org.gradle.parallel=true
  14 +# AndroidX package structure to make it clearer which packages are bundled with the
  15 +# Android operating system, and which are packaged with your app"s APK
  16 +# https://developer.android.com/topic/libraries/support-library/androidx-rn
  17 +android.useAndroidX=true
  18 +android.injected.testOnly=false
  19 +# Automatically convert third-party libraries to use AndroidX
  20 +android.enableJetifier=true
0 21 \ No newline at end of file
... ...
gradle/wrapper/gradle-wrapper.jar 0 → 100644
No preview for this file type
gradle/wrapper/gradle-wrapper.properties 0 → 100644
  1 +++ a/gradle/wrapper/gradle-wrapper.properties
  1 +#Wed Nov 11 16:27:07 CST 2020
  2 +distributionBase=GRADLE_USER_HOME
  3 +distributionPath=wrapper/dists
  4 +zipStoreBase=GRADLE_USER_HOME
  5 +zipStorePath=wrapper/dists
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
... ...
gradlew 0 → 100644
  1 +++ a/gradlew
  1 +#!/usr/bin/env sh
  2 +
  3 +##############################################################################
  4 +##
  5 +## Gradle start up script for UN*X
  6 +##
  7 +##############################################################################
  8 +
  9 +# Attempt to set APP_HOME
  10 +# Resolve links: $0 may be a link
  11 +PRG="$0"
  12 +# Need this for relative symlinks.
  13 +while [ -h "$PRG" ] ; do
  14 + ls=`ls -ld "$PRG"`
  15 + link=`expr "$ls" : '.*-> \(.*\)$'`
  16 + if expr "$link" : '/.*' > /dev/null; then
  17 + PRG="$link"
  18 + else
  19 + PRG=`dirname "$PRG"`"/$link"
  20 + fi
  21 +done
  22 +SAVED="`pwd`"
  23 +cd "`dirname \"$PRG\"`/" >/dev/null
  24 +APP_HOME="`pwd -P`"
  25 +cd "$SAVED" >/dev/null
  26 +
  27 +APP_NAME="Gradle"
  28 +APP_BASE_NAME=`basename "$0"`
  29 +
  30 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  31 +DEFAULT_JVM_OPTS=""
  32 +
  33 +# Use the maximum available, or set MAX_FD != -1 to use that value.
  34 +MAX_FD="maximum"
  35 +
  36 +warn () {
  37 + echo "$*"
  38 +}
  39 +
  40 +die () {
  41 + echo
  42 + echo "$*"
  43 + echo
  44 + exit 1
  45 +}
  46 +
  47 +# OS specific support (must be 'true' or 'false').
  48 +cygwin=false
  49 +msys=false
  50 +darwin=false
  51 +nonstop=false
  52 +case "`uname`" in
  53 + CYGWIN* )
  54 + cygwin=true
  55 + ;;
  56 + Darwin* )
  57 + darwin=true
  58 + ;;
  59 + MINGW* )
  60 + msys=true
  61 + ;;
  62 + NONSTOP* )
  63 + nonstop=true
  64 + ;;
  65 +esac
  66 +
  67 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  68 +
  69 +# Determine the Java command to use to start the JVM.
  70 +if [ -n "$JAVA_HOME" ] ; then
  71 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  72 + # IBM's JDK on AIX uses strange locations for the executables
  73 + JAVACMD="$JAVA_HOME/jre/sh/java"
  74 + else
  75 + JAVACMD="$JAVA_HOME/bin/java"
  76 + fi
  77 + if [ ! -x "$JAVACMD" ] ; then
  78 + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  79 +
  80 +Please set the JAVA_HOME variable in your environment to match the
  81 +location of your Java installation."
  82 + fi
  83 +else
  84 + JAVACMD="java"
  85 + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  86 +
  87 +Please set the JAVA_HOME variable in your environment to match the
  88 +location of your Java installation."
  89 +fi
  90 +
  91 +# Increase the maximum file descriptors if we can.
  92 +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
  93 + MAX_FD_LIMIT=`ulimit -H -n`
  94 + if [ $? -eq 0 ] ; then
  95 + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  96 + MAX_FD="$MAX_FD_LIMIT"
  97 + fi
  98 + ulimit -n $MAX_FD
  99 + if [ $? -ne 0 ] ; then
  100 + warn "Could not set maximum file descriptor limit: $MAX_FD"
  101 + fi
  102 + else
  103 + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  104 + fi
  105 +fi
  106 +
  107 +# For Darwin, add options to specify how the application appears in the dock
  108 +if $darwin; then
  109 + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  110 +fi
  111 +
  112 +# For Cygwin, switch paths to Windows format before running java
  113 +if $cygwin ; then
  114 + APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  115 + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  116 + JAVACMD=`cygpath --unix "$JAVACMD"`
  117 +
  118 + # We build the pattern for arguments to be converted via cygpath
  119 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  120 + SEP=""
  121 + for dir in $ROOTDIRSRAW ; do
  122 + ROOTDIRS="$ROOTDIRS$SEP$dir"
  123 + SEP="|"
  124 + done
  125 + OURCYGPATTERN="(^($ROOTDIRS))"
  126 + # Add a user-defined pattern to the cygpath arguments
  127 + if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  128 + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  129 + fi
  130 + # Now convert the arguments - kludge to limit ourselves to /bin/sh
  131 + i=0
  132 + for arg in "$@" ; do
  133 + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  134 + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  135 +
  136 + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  137 + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  138 + else
  139 + eval `echo args$i`="\"$arg\""
  140 + fi
  141 + i=$((i+1))
  142 + done
  143 + case $i in
  144 + (0) set -- ;;
  145 + (1) set -- "$args0" ;;
  146 + (2) set -- "$args0" "$args1" ;;
  147 + (3) set -- "$args0" "$args1" "$args2" ;;
  148 + (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  149 + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  150 + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  151 + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  152 + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  153 + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  154 + esac
  155 +fi
  156 +
  157 +# Escape application args
  158 +save () {
  159 + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
  160 + echo " "
  161 +}
  162 +APP_ARGS=$(save "$@")
  163 +
  164 +# Collect all arguments for the java command, following the shell quoting and substitution rules
  165 +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
  166 +
  167 +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
  168 +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  169 + cd "$(dirname "$0")"
  170 +fi
  171 +
  172 +exec "$JAVACMD" "$@"
... ...
gradlew.bat 0 → 100644
  1 +++ a/gradlew.bat
  1 +@if "%DEBUG%" == "" @echo off
  2 +@rem ##########################################################################
  3 +@rem
  4 +@rem Gradle startup script for Windows
  5 +@rem
  6 +@rem ##########################################################################
  7 +
  8 +@rem Set local scope for the variables with windows NT shell
  9 +if "%OS%"=="Windows_NT" setlocal
  10 +
  11 +set DIRNAME=%~dp0
  12 +if "%DIRNAME%" == "" set DIRNAME=.
  13 +set APP_BASE_NAME=%~n0
  14 +set APP_HOME=%DIRNAME%
  15 +
  16 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  17 +set DEFAULT_JVM_OPTS=
  18 +
  19 +@rem Find java.exe
  20 +if defined JAVA_HOME goto findJavaFromJavaHome
  21 +
  22 +set JAVA_EXE=java.exe
  23 +%JAVA_EXE% -version >NUL 2>&1
  24 +if "%ERRORLEVEL%" == "0" goto init
  25 +
  26 +echo.
  27 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  28 +echo.
  29 +echo Please set the JAVA_HOME variable in your environment to match the
  30 +echo location of your Java installation.
  31 +
  32 +goto fail
  33 +
  34 +:findJavaFromJavaHome
  35 +set JAVA_HOME=%JAVA_HOME:"=%
  36 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  37 +
  38 +if exist "%JAVA_EXE%" goto init
  39 +
  40 +echo.
  41 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  42 +echo.
  43 +echo Please set the JAVA_HOME variable in your environment to match the
  44 +echo location of your Java installation.
  45 +
  46 +goto fail
  47 +
  48 +:init
  49 +@rem Get command-line arguments, handling Windows variants
  50 +
  51 +if not "%OS%" == "Windows_NT" goto win9xME_args
  52 +
  53 +:win9xME_args
  54 +@rem Slurp the command line arguments.
  55 +set CMD_LINE_ARGS=
  56 +set _SKIP=2
  57 +
  58 +:win9xME_args_slurp
  59 +if "x%~1" == "x" goto execute
  60 +
  61 +set CMD_LINE_ARGS=%*
  62 +
  63 +:execute
  64 +@rem Setup the command line
  65 +
  66 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
  67 +
  68 +@rem Execute Gradle
  69 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
  70 +
  71 +:end
  72 +@rem End local scope for the variables with windows NT shell
  73 +if "%ERRORLEVEL%"=="0" goto mainEnd
  74 +
  75 +:fail
  76 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  77 +rem the _cmd.exe /c_ return code!
  78 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
  79 +exit /b 1
  80 +
  81 +:mainEnd
  82 +if "%OS%"=="Windows_NT" endlocal
  83 +
  84 +:omega
... ...
publish/.gitignore 0 → 100644
  1 +++ a/publish/.gitignore
  1 +/build
0 2 \ No newline at end of file
... ...
publish/build.gradle 0 → 100644
  1 +++ a/publish/build.gradle
  1 +apply plugin: 'com.android.library'
  2 +
  3 +android {
  4 + compileSdkVersion = 29
  5 + buildToolsVersion = "29.0.2"
  6 +
  7 + defaultConfig {
  8 + minSdkVersion 19
  9 + targetSdkVersion 29
  10 + versionCode 1
  11 + versionName "1.0"
  12 + multiDexEnabled true
  13 + javaCompileOptions {
  14 + annotationProcessorOptions {
  15 + arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
  16 + }
  17 + }
  18 + }
  19 +
  20 + buildTypes {
  21 + release {
  22 + minifyEnabled false
  23 + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  24 + }
  25 + }
  26 +
  27 + compileOptions {
  28 + sourceCompatibility JavaVersion.VERSION_1_8
  29 + targetCompatibility JavaVersion.VERSION_1_8
  30 + }
  31 +
  32 + dataBinding {
  33 + enabled true
  34 + }
  35 +
  36 + dexOptions {
  37 + javaMaxHeapSize '4g'
  38 + }
  39 +}
  40 +
  41 +dependencies {
  42 + implementation fileTree(dir: "libs", include: ["*.jar"])
  43 + implementation "androidx.legacy:legacy-support-v4:$rootProject.androidX_legacy_support_v4"
  44 + implementation "androidx.appcompat:appcompat:$rootProject.androidXAppcompat"
  45 + implementation "androidx.recyclerview:recyclerview:$rootProject.androidXRecyclerview"
  46 + implementation "androidx.constraintlayout:constraintlayout:$rootProject.androidXConstraintlayout"
  47 + implementation 'androidx.multidex:multidex:2.0.0'
  48 + implementation "com.cnlive.libs:base:$rootProject.libBase"
  49 +
  50 + //glide
  51 + implementation "com.github.bumptech.glide:glide:$rootProject.glide"
  52 + implementation "jp.wasabeef:glide-transformations:$rootProject.glideTransformations"
  53 + annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.compiler"
  54 +
  55 + implementation "pub.devrel:easypermissions:$rootProject.easypermissions"
  56 + implementation "com.chensl.rotatephotoview:rotatephotoview:$rootProject.rotatephotoview"
  57 + implementation "com.qmuiteam:qmui:$rootProject.qmui"
  58 +
  59 + implementation "com.alibaba:arouter-api:$rootProject.arouterApiVersion"
  60 + annotationProcessor "com.alibaba:arouter-compiler:$rootProject.arouterCompilerVersion"
  61 + implementation "com.cnlive.libs:arch:$rootProject.appArch"
  62 + implementation "com.cnlive.media:NewMediaPicker:$rootProject.libNewMediaPicker"
  63 + implementation "com.cnlive.libs:emoj:$rootProject.libEmoj"
  64 +//高德地图-定位服务
  65 + implementation "com.amap.api:location:$rootProject.location"
  66 + implementation "com.cnlive.libs:video_qiniu:$rootProject.libVideoQiniu"
  67 +
  68 + //七牛上传
  69 + implementation "com.qiniu:qiniu-android-sdk:$rootProject.qiniuAndroidSdk"
  70 +//GreenDao
  71 + api "org.greenrobot:greendao:$rootProject.greendao"
  72 + //implementation project(':lib_network')
  73 +
  74 +}
0 75 \ No newline at end of file
... ...
publish/consumer-rules.pro 0 → 100644
  1 +++ a/publish/consumer-rules.pro
... ...
publish/proguard-rules.pro 0 → 100644
  1 +++ a/publish/proguard-rules.pro
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
0 22 \ No newline at end of file
... ...
publish/src/androidTest/java/com/cnlive/publish/ExampleInstrumentedTest.java 0 → 100644
  1 +++ a/publish/src/androidTest/java/com/cnlive/publish/ExampleInstrumentedTest.java
  1 +package com.cnlive.publish;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import androidx.test.platform.app.InstrumentationRegistry;
  6 +import androidx.test.ext.junit.runners.AndroidJUnit4;
  7 +
  8 +import org.junit.Test;
  9 +import org.junit.runner.RunWith;
  10 +
  11 +import static org.junit.Assert.*;
  12 +
  13 +/**
  14 + * Instrumented test, which will execute on an Android device.
  15 + *
  16 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  17 + */
  18 +@RunWith(AndroidJUnit4.class)
  19 +public class ExampleInstrumentedTest {
  20 + @Test
  21 + public void useAppContext() {
  22 + // Context of the app under test.
  23 + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  24 + assertEquals("com.cnlive.publish.test", appContext.getPackageName());
  25 + }
  26 +}
0 27 \ No newline at end of file
... ...
publish/src/main/AndroidManifest.xml 0 → 100644
  1 +++ a/publish/src/main/AndroidManifest.xml
  1 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  2 + package="com.cnlive.publish">
  3 +
  4 + <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  5 + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  6 + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  7 + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  8 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  9 + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
  10 + <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
  11 + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  12 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  13 + <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  14 + <uses-permission android:name="android.permission.CAMERA" />
  15 + <uses-permission android:name="android.permission.READ_CONTACTS" />
  16 + <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
  17 + <uses-permission android:name="android.permission.CALL_PHONE" />
  18 + <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
  19 + <uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
  20 + <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
  21 + <uses-permission android:name="android.permission.VIBRATE" />
  22 + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  23 + <uses-permission android:name="android.permission.RECEIVE_SMS" />
  24 +
  25 + <application
  26 + android:largeHeap="true">
  27 + <activity
  28 + android:name="com.cnlive.publish.activity.ReleasePublishAcityity"
  29 + android:configChanges="keyboardHidden|screenSize|orientation|smallestScreenSize|screenLayout"
  30 + android:launchMode="singleTop"
  31 + android:screenOrientation="portrait"
  32 + android:windowSoftInputMode="stateHidden|adjustPan">
  33 +
  34 + <!-- 系统分享 单个文件 -->
  35 + <intent-filter>
  36 + <action android:name="${ACTION_SHARE_RELEASE}" />
  37 +
  38 + <category android:name="android.intent.category.DEFAULT" />
  39 + <!-- 文字类型 -->
  40 + <data android:mimeType="text/plain" />
  41 + </intent-filter>
  42 + </activity>
  43 + </application>
  44 +</manifest>
0 45 \ No newline at end of file
... ...
publish/src/main/java/com/cnlive/publish/activity/ReleasePublishAcityity.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/activity/ReleasePublishAcityity.java
  1 +package com.cnlive.publish.activity;
  2 +
  3 +import android.content.Context;
  4 +import android.content.Intent;
  5 +import android.net.Uri;
  6 +import android.os.Bundle;
  7 +
  8 +import com.alibaba.android.arouter.facade.annotation.Route;
  9 +import com.cnlive.libs.base.ui.IBackFragment;
  10 +import com.cnlive.libs.base.ui.QMUIFragment;
  11 +import com.cnlive.libs.base.ui.QMUIFragmentActivity;
  12 +import com.cnlive.libs.base.util.ShareReleaseInfoUtil;
  13 +import com.cnlive.media.media.entity.Media;
  14 +import com.cnlive.publish.R;
  15 +import com.cnlive.publish.fragment.ReleaseInfoEditFragment;
  16 +import com.cnlive.publish.util.StatusBarUtil;
  17 +
  18 +
  19 +import java.io.File;
  20 +import java.util.ArrayList;
  21 +
  22 +import androidx.annotation.NonNull;
  23 +
  24 +@Route(path = "/cnmain/ReleasePublishAcityity")
  25 +public class ReleasePublishAcityity extends QMUIFragmentActivity {
  26 +
  27 + public static final int REQUEST_CODE_SELECT_CAMERA = 10004;
  28 + public static final int REQUEST_CODE_SELECT_READ_WRITE = 10005;
  29 + public static final int REQUEST_CODE_SELECT_READ_WRITE_2 = 10006;
  30 + /* private String imgs;
  31 + private String textwit;
  32 + private String tagName;
  33 + private String witContentId;
  34 + private String videopath;
  35 + private String duration;
  36 + private String createtime;
  37 + private String taglist;
  38 + private String jumpType;
  39 + private String json;*/
  40 +
  41 + /**
  42 + * 默认开启方式 不带任何数据
  43 + *
  44 + * @param context
  45 + */
  46 + public static void start(Context context) {
  47 + Intent intent = new Intent(context, ReleasePublishAcityity.class);
  48 + context.startActivity(intent);
  49 + }
  50 +
  51 + public static void start(Context context, int type) {
  52 + Intent intent = new Intent(context, ReleasePublishAcityity.class);
  53 + intent.putExtra("type", type);
  54 + context.startActivity(intent);
  55 + }
  56 +
  57 + /**
  58 + * 发布信息编辑模式 传入List<Media>
  59 + *
  60 + * @param context
  61 + */
  62 + public static void start(Context context, ArrayList<Media> select) {
  63 + start(context, select, 0, "", "nocircle");
  64 + }
  65 +
  66 + public static void start(Context context, ArrayList<Media> select, int type, String content, String isCircle) {
  67 + if (select == null) return;
  68 + Intent intent = new Intent(context, ReleasePublishAcityity.class);
  69 + intent.putParcelableArrayListExtra("select", select);
  70 + intent.putExtra("type", type);
  71 + intent.putExtra("content", content);
  72 + intent.putExtra("isCircle", isCircle);
  73 + context.startActivity(intent);
  74 + }
  75 +
  76 + @Override
  77 + protected int getContextViewId() {
  78 + return R.id.fragment_context;
  79 + }
  80 +
  81 + @Override
  82 + protected void onCreate(Bundle savedInstanceState) {
  83 + super.onCreate(savedInstanceState);
  84 + if (savedInstanceState != null) return;
  85 + StatusBarUtil.setStatusBarWrite(this);
  86 + //StatusBarUtil2.setColor(this, getResources().getColor(R.color.im_color_fff), 0);
  87 + QMUIFragment fragment = initShareDataFragment(getIntent());
  88 + /*if (getIntent() != null && BuildConfig.ACTION_SHARE_RELEASE.equals(getIntent().getAction())) {
  89 + imgs = getIntent().getStringExtra("imgs");
  90 + textwit = getIntent().getStringExtra("textwit");
  91 + tagName = getIntent().getStringExtra("tagName");
  92 + witContentId = getIntent().getStringExtra("witContentId");
  93 + int type = getIntent().getIntExtra("type", 0);
  94 + videopath = getIntent().getStringExtra("videopath");
  95 + duration = getIntent().getStringExtra("duration");
  96 + createtime = getIntent().getStringExtra("createtime");
  97 + taglist = getIntent().getStringExtra("taglist");
  98 + jumpType = getIntent().getStringExtra("jumpType");
  99 + json = getIntent().getStringExtra("json");
  100 + if (type == 2) {
  101 + fragment = initEditDataFragment(getIntent());
  102 + }
  103 + }*/
  104 +
  105 + if (fragment == null) fragment = initEditDataFragment(getIntent());
  106 + if (fragment == null) finish();
  107 + else startFragment(fragment);
  108 + }
  109 +
  110 + @Override
  111 + protected void onNewIntent(Intent intent) {
  112 + super.onNewIntent(intent);
  113 + int type = intent.getIntExtra("type", 0);
  114 + if (type == 3) {
  115 + ArrayList<Media> select = intent.getParcelableArrayListExtra("select");
  116 + String content = intent.getStringExtra("content");
  117 + startFragment(ReleaseInfoEditFragment.newInstance(select, 3, content));
  118 + } else {
  119 + QMUIFragment fragment = initShareDataFragment(intent);
  120 + if (fragment != null) startFragment(fragment);
  121 + }
  122 + }
  123 +
  124 + //默认编辑页面
  125 + private QMUIFragment initEditDataFragment(Intent intent) {
  126 + ArrayList<Media> select = intent.getParcelableArrayListExtra("select");
  127 + String content = intent.getStringExtra("content");
  128 + int type = intent.getIntExtra("type", 0);
  129 + String isCircle = intent.getStringExtra("isCircle");
  130 + if (type == 1) {
  131 + return ReleaseInfoEditFragment.newInstance(select, isCircle);
  132 + } else if (type == 0) {
  133 + return ReleaseInfoEditFragment.newInstance(select, isCircle);
  134 + } else if (type == 3) {
  135 + return ReleaseInfoEditFragment.newInstance(select, 3, content);
  136 + } else if (type == 4) {
  137 + String name = intent.getStringExtra("name");
  138 + String path = intent.getStringExtra("path");
  139 + String parentDir = intent.getStringExtra("parentDir");
  140 + long time = intent.getLongExtra("time", -1L);
  141 + long size = intent.getLongExtra("size", -1L);
  142 + int id = intent.getIntExtra("id", -1);
  143 + int mediaType = intent.getIntExtra("mediaType", -1);
  144 + if (select == null) select = new ArrayList<>();
  145 + select.clear();
  146 + Uri uri = Uri.fromFile(new File(path == null ? "" : path));
  147 + Media media = new Media(path, name, time, mediaType, size, id, parentDir, uri + "");
  148 + select.add(media);
  149 + return ReleaseInfoEditFragment.newInstance(select);
  150 + } else {
  151 + String imgs = getIntent().getStringExtra("imgs");
  152 + String textwit = getIntent().getStringExtra("textwit");
  153 + String tagName = getIntent().getStringExtra("tagName");
  154 + String witContentId = getIntent().getStringExtra("witContentId");
  155 + int typ = getIntent().getIntExtra("type", 0);
  156 + String videopath = getIntent().getStringExtra("videopath");
  157 + String fileUri = getIntent().getStringExtra("fileUri");
  158 + String duration = getIntent().getStringExtra("duration");
  159 + String createtime = getIntent().getStringExtra("createtime");
  160 + String taglist = getIntent().getStringExtra("taglist");
  161 + String jumpType = getIntent().getStringExtra("jumpType");
  162 + String json = getIntent().getStringExtra("json");
  163 + return ReleaseInfoEditFragment.newInstance(select, 2, textwit, imgs, tagName, witContentId, videopath, duration, createtime, taglist, jumpType, json, fileUri);
  164 + }
  165 + }
  166 +
  167 + //分享事件编辑页面
  168 + public QMUIFragment initShareDataFragment(Intent intent) {
  169 + if (intent == null || intent.getAction() == null) return null;
  170 + if (intent.getExtras() == null || intent.getType() == null) return null;
  171 + if ("netpp.intent.action.SHARE_RELEASE".equals(intent.getAction())) {
  172 + switch (intent.getType()) {
  173 + case "text/plain": //H5分享
  174 + return ReleaseInfoEditFragment.newInstance(ShareReleaseInfoUtil.ShareConfig.parse(intent));
  175 + default:
  176 + return null;
  177 + }
  178 + }
  179 + return null;
  180 + }
  181 +
  182 + @Override
  183 + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  184 + super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  185 + getCurrentFragment().onRequestPermissionsResult(requestCode, permissions, grantResults);
  186 + }
  187 +
  188 + @Override
  189 + public void onBackPressed() {
  190 + if (getCurrentFragment() != null && getCurrentFragment() instanceof IBackFragment && ((IBackFragment) getCurrentFragment()).onBackPressed())
  191 + return;
  192 + super.onBackPressed();
  193 + }
  194 +
  195 + @Override
  196 + protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  197 + super.onActivityResult(requestCode, resultCode, data);
  198 + if (getCurrentFragment() != null)
  199 + getCurrentFragment().onActivityResult(requestCode, resultCode, data);
  200 + }
  201 +}
0 202 \ No newline at end of file
... ...
publish/src/main/java/com/cnlive/publish/fragment/ReleaseInfoEditFragment.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/fragment/ReleaseInfoEditFragment.java
  1 +package com.cnlive.publish.fragment;
  2 +
  3 +import android.Manifest;
  4 +import android.app.Activity;
  5 +import android.app.Dialog;
  6 +import android.content.Context;
  7 +import android.content.Intent;
  8 +import android.graphics.Color;
  9 +import android.graphics.Rect;
  10 +import android.graphics.drawable.GradientDrawable;
  11 +import android.net.Uri;
  12 +import android.os.Build;
  13 +import android.os.Bundle;
  14 +import android.text.Editable;
  15 +import android.text.InputFilter;
  16 +import android.text.TextUtils;
  17 +import android.text.TextWatcher;
  18 +import android.util.TypedValue;
  19 +import android.view.Gravity;
  20 +import android.view.MotionEvent;
  21 +import android.view.View;
  22 +import android.view.ViewGroup;
  23 +import android.view.inputmethod.InputMethodManager;
  24 +import android.widget.Button;
  25 +import android.widget.RelativeLayout;
  26 +import android.widget.TextView;
  27 +import android.widget.Toast;
  28 +
  29 +
  30 +import com.amap.api.location.AMapLocation;
  31 +import com.amap.api.location.AMapLocationListener;
  32 +import com.cnlive.libs.base.arouter.social.SocialLifeChangeObservable;
  33 +import com.cnlive.libs.base.observable.ShareResultObservable;
  34 +import com.cnlive.libs.base.observable.ShareWjjStateObservable;
  35 +import com.cnlive.libs.base.ui.IBackFragment;
  36 +import com.cnlive.libs.base.ui.QMUIFragment;
  37 +import com.cnlive.libs.base.util.AlertUtil;
  38 +import com.cnlive.libs.base.util.DoublePressed;
  39 +import com.cnlive.libs.base.util.FileUtils;
  40 +import com.cnlive.libs.base.util.ShareReleaseInfoUtil;
  41 +import com.cnlive.libs.base.util.SharedPreferencesHelper;
  42 +
  43 +import com.cnlive.libs.base.util.StringUtils;
  44 +import com.cnlive.libs.emoj.ExpressionGridFragment;
  45 +import com.cnlive.libs.emoj.ExpressionShowFragment;
  46 +import com.cnlive.libs.emoj.core.InputEmojiLengthFilter;
  47 +import com.cnlive.media.PickerConfig;
  48 +import com.cnlive.media.media.entity.Media;
  49 +import com.cnlive.media.model.CircleChoose;
  50 +import com.cnlive.media.model.CircleData;
  51 +import com.cnlive.media.utils.AlertDialogUtils;
  52 +import com.cnlive.media.utils.AndroidQUtil;
  53 +import com.cnlive.media.utils.PermissionChecker;
  54 +
  55 +import com.cnlive.publish.R;
  56 +import com.cnlive.publish.databinding.FragmentReleaseInfoEditBinding;
  57 +import com.cnlive.publish.frame.persenter.ReleaseInfoEditPersenter;
  58 +import com.cnlive.publish.frame.view.ReleaseInfoEditView;
  59 +import com.cnlive.publish.moudle.ReleaseMediaItem;
  60 +import com.cnlive.publish.moudle.ReleaseMediaPage;
  61 +import com.cnlive.publish.util.LocationUtil;
  62 +import com.cnlive.publish.util.UserInfoUtils;
  63 +import com.cnlive.publish.widget.RecycleViewDivider;
  64 +import com.cnlive.publish.widget.ResizeFrameLayout;
  65 +import com.cnlive.strike.ui.widget.BottomSheet;
  66 +
  67 +import com.google.gson.Gson;
  68 +import com.qmuiteam.qmui.util.QMUIDisplayHelper;
  69 +import com.qmuiteam.qmui.widget.QMUITopBar;
  70 +import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;
  71 +
  72 +import org.greenrobot.eventbus.EventBus;
  73 +import org.greenrobot.eventbus.Subscribe;
  74 +import org.greenrobot.eventbus.ThreadMode;
  75 +
  76 +import java.io.File;
  77 +import java.util.ArrayList;
  78 +import java.util.List;
  79 +import java.util.concurrent.TimeUnit;
  80 +
  81 +import androidx.annotation.NonNull;
  82 +import androidx.annotation.Nullable;
  83 +import androidx.core.content.FileProvider;
  84 +import androidx.recyclerview.widget.DividerItemDecoration;
  85 +import androidx.recyclerview.widget.GridLayoutManager;
  86 +import io.reactivex.Observable;
  87 +import io.reactivex.ObservableEmitter;
  88 +import io.reactivex.ObservableOnSubscribe;
  89 +import io.reactivex.ObservableSource;
  90 +import io.reactivex.Observer;
  91 +import io.reactivex.android.schedulers.AndroidSchedulers;
  92 +import io.reactivex.disposables.Disposable;
  93 +import io.reactivex.functions.Function;
  94 +import io.reactivex.schedulers.Schedulers;
  95 +
  96 +import static android.view.View.GONE;
  97 +import static android.view.View.VISIBLE;
  98 +import static com.cnlive.libs.base.util.PixelsUtil.dip2px;
  99 +import static com.cnlive.media.PickerConfig.REQUEST_CODE_PERMISSION_CAMERA;
  100 +import static com.cnlive.media.utils.PermissionChecker.settingPermissionActivity;
  101 +import static com.cnlive.publish.activity.ReleasePublishAcityity.REQUEST_CODE_SELECT_CAMERA;
  102 +import static com.cnlive.publish.activity.ReleasePublishAcityity.REQUEST_CODE_SELECT_READ_WRITE;
  103 +import static com.cnlive.publish.activity.ReleasePublishAcityity.REQUEST_CODE_SELECT_READ_WRITE_2;
  104 +
  105 +
  106 +/**
  107 + * Created by xiansong on 2018/3/5.
  108 + */
  109 +public class ReleaseInfoEditFragment extends QMUIFragment<ReleaseInfoEditView, ReleaseInfoEditPersenter, FragmentReleaseInfoEditBinding>
  110 + implements IBackFragment, ExpressionGridFragment.ExpressionClickListener, ExpressionGridFragment.ExpressionDeleteClickListener,
  111 + View.OnClickListener, View.OnTouchListener {
  112 +
  113 + private static final int REQUEST_CODE_LOCATION = 30009;
  114 + private int outtype;
  115 + private int type1 = 8;
  116 + private String createtime = "";
  117 + private boolean comeevent = false;
  118 + private CircleData.ReleaseVideoTypeListBean messageCamera;
  119 + public Button buttonRRight;
  120 +
  121 + public static ReleaseInfoEditFragment newInstance(ShareReleaseInfoUtil.ShareConfig shareConfig) {
  122 + Bundle args = new Bundle();
  123 + if (shareConfig != null) args.putSerializable("share_config", shareConfig);
  124 + ReleaseInfoEditFragment fragment = new ReleaseInfoEditFragment();
  125 + fragment.setArguments(args);
  126 + return fragment;
  127 + }
  128 +
  129 + public static ReleaseInfoEditFragment newInstance(ArrayList<Media> medias) {
  130 + Bundle args = new Bundle();
  131 + if (medias != null) args.putParcelableArrayList("medias", medias);
  132 + ReleaseInfoEditFragment fragment = new ReleaseInfoEditFragment();
  133 + fragment.setArguments(args);
  134 + return fragment;
  135 + }
  136 +
  137 + public static ReleaseInfoEditFragment newInstance(ArrayList<Media> medias, String isCircle) {
  138 + Bundle args = new Bundle();
  139 + if (medias != null) args.putParcelableArrayList("medias", medias);
  140 + args.putString("isCircle", isCircle);
  141 + ReleaseInfoEditFragment fragment = new ReleaseInfoEditFragment();
  142 + fragment.setArguments(args);
  143 + return fragment;
  144 + }
  145 +
  146 + public static ReleaseInfoEditFragment newInstance(ArrayList<Media> medias, int outtype, String content) {
  147 + Bundle args = new Bundle();
  148 + if (medias != null) args.putParcelableArrayList("medias", medias);
  149 + args.putInt("outtype", outtype);
  150 + args.putString("content", content);
  151 + ReleaseInfoEditFragment fragment = new ReleaseInfoEditFragment();
  152 + fragment.setArguments(args);
  153 + return fragment;
  154 + }
  155 +
  156 + public static ReleaseInfoEditFragment newInstance(ArrayList<Media> medias, int type, String text, String img, String tag, String witContentId, String videopath, String duration, String createtime, String taglist, String jumpType, String json, String fileUri) {
  157 + Bundle args = new Bundle();
  158 + if (medias != null) args.putParcelableArrayList("medias", medias);
  159 + args.putInt("type", type);
  160 + args.putString("text", text);
  161 + args.putString("img", img);
  162 + args.putString("tagName", tag);
  163 + args.putString("witContentId", witContentId);
  164 + args.putString("videopath", videopath);
  165 + args.putString("fileUri", fileUri);
  166 + args.putString("duration", duration);
  167 + args.putString("createtime", createtime);
  168 + args.putString("taglist", taglist);
  169 + args.putString("jumpType", jumpType);
  170 + args.putString("json", json);
  171 + ReleaseInfoEditFragment fragment = new ReleaseInfoEditFragment();
  172 + fragment.setArguments(args);
  173 + return fragment;
  174 + }
  175 +
  176 + public Dialog deleteImageDialog;
  177 + public ReleaseMediaPage pageData;
  178 + public QMUITipDialog tipDialog, copyDialog;
  179 + public BottomSheet bottomSheet;
  180 + public BottomSheet bottomSheet1;
  181 + public BottomSheet bottomSheet2;
  182 + public BottomSheet bottomSheet3;
  183 + public BottomSheet bottomSheet4;
  184 + private Dialog dialog;
  185 + public Dialog exitDialog;
  186 + private int remainingTextSize = 10000;
  187 + private int witnessTextSize = 140;
  188 + private int defMaxTexSize = 10000;
  189 + private int witMaxTexSize = 140;
  190 + private Disposable permissionsDisposable;
  191 + // private AMapLocationListener locationCallback = null;
  192 + private View.OnClickListener toolbarClick;
  193 + private ResizeFrameLayout.KeyboardListener keyboardListener;
  194 +
  195 + @Override
  196 + protected int getToolbarId() {
  197 + return R.id.includeToolbar;
  198 + }
  199 +
  200 + @Override
  201 + public String getTitle() {
  202 + return "";
  203 + }
  204 +
  205 + @Override
  206 + protected int getLayoutId() {
  207 + return R.layout.fragment_release_info_edit;
  208 + }
  209 +
  210 + @Override
  211 + public void onCreate(@Nullable Bundle savedInstanceState) {
  212 + super.onCreate(savedInstanceState);
  213 + EventBus.getDefault().register(this);
  214 + tipDialog = new QMUITipDialog.Builder(getContext())
  215 + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING)
  216 + .setTipWord("正在上传...")
  217 + .create();
  218 + tipDialog.setCancelable(false);
  219 +
  220 + copyDialog = new QMUITipDialog.Builder(getContext())
  221 + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING)
  222 + .setTipWord("正在转码...")
  223 + .create();
  224 + copyDialog.setCancelable(false);
  225 +
  226 + bottomSheet = new BottomSheet.BottomListSheetBuilder(getActivity())
  227 + .addItem("拍摄")
  228 + .addItem("从相册中选取")
  229 + .addItem("取消")
  230 + .setOnSheetItemClickListener((dialog, itemView, position, tag) -> {
  231 + if (isFastDoubleClick()) {
  232 + return;
  233 + } else if (position == 0) {
  234 + getMvpView().showShoot(false);
  235 + } else if (position == 1) {
  236 + getMvpView().showAlbum(false);
  237 + }
  238 + dialog.dismiss();
  239 + }).build();
  240 +
  241 + bottomSheet1 = new BottomSheet.BottomListSheetBuilder(getActivity())
  242 + //.addItem("取消")
  243 + .addItem("退出")
  244 + .setOnSheetItemClickListener((dialog, itemView, position, tag) -> {
  245 + if (DoublePressed.onDoublePressed()) return;
  246 + // if (position == 0)
  247 + // getMvpView().showdis();
  248 +
  249 + if (position == 0)
  250 + getMvpView().showBack();
  251 + }).build();
  252 + bottomSheet3 = new BottomSheet.BottomListSheetBuilder(getActivity())
  253 + // .addItem("保存此次编辑")
  254 + .addItem("保存到草稿箱")
  255 + .addItem("删除视频")
  256 + .addItem("取消")
  257 + .setOnSheetItemClickListener((dialog, itemView, position, tag) -> {
  258 + if (DoublePressed.onDoublePressed()) return;
  259 + /* if (position == 0)
  260 + getMvpView().showsave();*/
  261 + if (position == 0)
  262 + getMvpView().showsavenow(type1, createtime);
  263 + if (position == 1)
  264 + getMvpView().showdel();
  265 + dialog.dismiss();
  266 + }).build();
  267 +
  268 + bottomSheet4 = new BottomSheet.BottomListSheetBuilder(getActivity())
  269 + .addItem("保存草稿")
  270 + .addItem("删除视频")
  271 + .addItem("不保存")
  272 + .addItem("取消")
  273 + .setOnSheetItemClickListener((dialog, itemView, position, tag) -> {
  274 + if (DoublePressed.onDoublePressed()) return;
  275 + if (position == 0)
  276 + getMvpView().showsavedraft(type1, createtime);
  277 + if (position == 1)
  278 + getMvpView().showdeldraft(getContext(), createtime);
  279 + if (position == 2)
  280 + getMvpView().showdedraft();
  281 + dialog.dismiss();
  282 + }).build();
  283 +
  284 + bottomSheet2 = new BottomSheet.BottomListSheetBuilder(getActivity())
  285 + //.addItem("保存此次编辑")
  286 + .addItem("退出此次编辑")
  287 + .addItem("取消")
  288 + .setOnSheetItemClickListener((dialog, itemView, position, tag) -> {
  289 + if (DoublePressed.onDoublePressed()) return;
  290 + /*if (position == 0)
  291 + getMvpView().showsave();*/
  292 + if (position == 0)
  293 + getMvpView().showdellife();
  294 + dialog.dismiss();
  295 + }).build();
  296 +
  297 +
  298 + keyboardListener = new ResizeFrameLayout.KeyboardListener() {
  299 + @Override
  300 + public void onKeyboardShown(int height) {
  301 + onCalculation(height);
  302 + }
  303 +
  304 + @Override
  305 + public void onKeyboardHidden(int height) {
  306 + onCalculation(0);
  307 + }
  308 + };
  309 + permissionsDisposable = Observable.timer(1, TimeUnit.SECONDS).subscribeOn(Schedulers.io())
  310 + .observeOn(AndroidSchedulers.mainThread()).subscribe(aLong -> initLocationPermission());
  311 +
  312 + getChildFragmentManager().beginTransaction().add(R.id.emojicons, ExpressionShowFragment.newInstance(false, UserInfoUtils.getUid(getActivity(),""))).commit();
  313 + }
  314 +
  315 + private static long lastClickTime = 0L;
  316 +
  317 + public static boolean isFastDoubleClick() {
  318 + long time = System.currentTimeMillis();
  319 + long timeD = time - lastClickTime;
  320 + if (timeD < 2000) {
  321 + lastClickTime = 0L;
  322 + return true;
  323 + }
  324 + lastClickTime = time;
  325 + return false;
  326 + }
  327 +
  328 + public void showPro(double progress) {
  329 + binding.cover.setVisibility(VISIBLE);
  330 + binding.profa.setVisibility(VISIBLE);
  331 + binding.cover.setOnClickListener(new View.OnClickListener() {
  332 + @Override
  333 + public void onClick(View v) {
  334 + }
  335 + });
  336 + if ((progress * 100) > 0) {
  337 + binding.zip.setVisibility(GONE);
  338 + binding.wenan.setVisibility(VISIBLE);
  339 + binding.progress.setVisibility(VISIBLE);
  340 + int roundProgress = binding.progress.getProgress();
  341 + binding.progress.setProgress((int) (progress * 100));
  342 + if (roundProgress >= 100) {
  343 + binding.cover.setVisibility(GONE);
  344 + binding.profa.setVisibility(GONE);
  345 + }
  346 + }
  347 + }
  348 +
  349 +
  350 + @Override
  351 + public void onSetupToolBar(QMUITopBar toolbar) {
  352 + if (getActivity() == null) return;
  353 + toolbar.setTitle(getTitle());
  354 + toolbar.setBackgroundColor(getActivity().getResources().getColor(R.color.transparent));
  355 +
  356 + Button buttonLeft = addLeftTextButton(toolbar, "取消");
  357 + buttonLeft.setTextColor(0xff282828);
  358 + buttonLeft.setOnClickListener(v -> onBackPressed());
  359 +
  360 + buttonRRight = addRightTextButton(toolbar, "发布");
  361 + buttonRRight.setTextColor(parseColor("#0BBE06"));
  362 + buttonRRight.setTextSize(13);
  363 + toolbarClick = null;
  364 + toolbarClick = v -> {
  365 + if (isFastDoubleClick()) return;
  366 + buttonRRight.setClickable(false);
  367 + //友盟统计
  368 + if (pageData == null) return;
  369 + hideSoftInput();
  370 + /* if (pageData.isVideo()) {
  371 + //友盟统计-发现圈子发布视频
  372 + UMProbeUtil.onEventObject(UMProbeUtil.friend_upload_video);
  373 + } else if (pageData.getAdapter().getList().size() > 1) {
  374 + //友盟统计-发现圈子发布图文
  375 + UMProbeUtil.onEventObject(UMProbeUtil.friend_upload_photo);
  376 + } else {
  377 + //友盟统计-发现圈子发布文本
  378 + UMProbeUtil.onEventObject(UMProbeUtil.friend_upload_text);
  379 + }*/
  380 + //友盟统计 END
  381 +
  382 + if (hasPermission()) {
  383 + if (3 == pageData.getSource() && StringUtils.isEmpty(pageData.getLocation())) {
  384 + AlertUtil.showDeftToast(getActivity(), "获取不到您的地址信息,请稍后再试");
  385 + buttonRRight.setClickable(true);
  386 + } else {
  387 + GradientDrawable gradientDrawable = new GradientDrawable();
  388 + gradientDrawable.setColor(!StringUtils.isEmpty(pageData.getReleaseButtonColor()) ? parseColor("#" + pageData.getReleaseButtonColor()) : parseColor("#F0F0F0"));
  389 + gradientDrawable.setShape(GradientDrawable.RECTANGLE);
  390 + gradientDrawable.setCornerRadius(dip2px(16));
  391 + gradientDrawable.setAlpha(255);
  392 + buttonRRight.setBackground(gradientDrawable);
  393 + getPresenter().doUploadInfo(getActivity(),
  394 + pageData.getAdapter().getList(),
  395 + TextUtils.isEmpty(pageData.getMessage()) ? "" : pageData.getMessage().trim(),
  396 + binding.closeAddress.isChecked() ? pageData.getLocation() : "",
  397 + pageData.isVideo(),
  398 + pageData.getShareConfig(),
  399 + pageData.getType(),
  400 + pageData.getGopath(),
  401 + pageData.getVideotype(),
  402 + pageData.getMultiplecategory(),
  403 + pageData.getTagtext(),
  404 + pageData.getTagId(),
  405 + type1 == 2,
  406 + pageData.getWitContentId(),
  407 + createtime,
  408 + pageData.getSource(),
  409 + binding.closeAddress.isChecked() ? pageData.getCoordinate() : ""
  410 + );
  411 + }
  412 + } else {
  413 + dia(getActivity());
  414 + }
  415 + };
  416 + buttonRRight.setOnClickListener(toolbarClick);
  417 + }
  418 +
  419 + public static void dia(Activity avtivity) {
  420 + AlertDialogUtils.showTwoButtonDialog(
  421 + avtivity,
  422 + avtivity.getString(R.string.dialog_imagepicker_permission_nerver_ask_cancel),
  423 + avtivity.getString(R.string.dialog_imagepicker_permission_nerver_ask_confirm),
  424 + avtivity.getString(R.string.dialog_imagepicker_permission_share_message),
  425 + R.color.color_dialog_btn, R.color.color_ffa300, new AlertDialogUtils.DialogTwoListener() {
  426 + @Override
  427 + public void onClickLeft(Dialog dialog) {
  428 + dialog.dismiss();
  429 + avtivity.finish();
  430 + }
  431 +
  432 + @Override
  433 + public void onClickRight(Dialog dialog) {
  434 + dialog.dismiss();
  435 + settingPermissionActivity((Activity) avtivity, 1007);
  436 + avtivity.finish();
  437 + }
  438 + });
  439 + }
  440 +
  441 + private boolean hasPermission() {
  442 + return PermissionChecker.checkPermissions(getActivity()
  443 + , new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}
  444 + , REQUEST_CODE_PERMISSION_CAMERA, R.string.dialog_imagepicker_permission_share_message);
  445 + }
  446 +
  447 + public int parseColor(String value) {
  448 + int color = 0x00000000;
  449 + if (TextUtils.isEmpty(value)) return color;
  450 +
  451 + if (value.charAt(0) != '#') {
  452 + value = "#".concat(value);
  453 + }
  454 +
  455 + try {
  456 + color = Color.parseColor(value);
  457 + } catch (Exception ignored) {
  458 + }
  459 + return color;
  460 + }
  461 +
  462 + @Override
  463 + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  464 + super.onViewCreated(view, savedInstanceState);
  465 + if (getActivity() == null) return;
  466 + if (pageData == null) init();
  467 + else reset();
  468 + input_height = (int) getActivity().getResources().getDimension(R.dimen.input_height);
  469 + input_default_height = (int) getActivity().getResources().getDimension(R.dimen.input_default_height);
  470 + input_offset = dip2px(24);
  471 + binding.calculationView.setKeyboardListener(keyboardListener);
  472 + if (view.findViewById(R.id.rightBtn) == null) return;
  473 + // ShareResultObservable.getInstance().addObserver(this);
  474 + TextView rightBtn = view.findViewById(R.id.rightBtn);
  475 + RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(dip2px(80), dip2px(30));
  476 + layoutParams.addRule(RelativeLayout.CENTER_VERTICAL);
  477 + layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
  478 + layoutParams.setMarginEnd(dip2px(13));
  479 + rightBtn.setLayoutParams(layoutParams);
  480 + rightBtn.setTextColor(!StringUtils.isEmpty(pageData.getReleaseButtonColor()) ? parseColor("#FFFFFF") : parseColor("#0BBE06"));
  481 + rightBtn.setTextSize(13);
  482 + GradientDrawable gradientDrawable = new GradientDrawable();
  483 + gradientDrawable.setColor(!StringUtils.isEmpty(pageData.getReleaseButtonColor()) ? parseColor("#" + pageData.getReleaseButtonColor()) : parseColor("#F0F0F0"));
  484 + gradientDrawable.setShape(GradientDrawable.RECTANGLE);
  485 + gradientDrawable.setCornerRadius(dip2px(16));
  486 + gradientDrawable.setAlpha(70);
  487 + rightBtn.setBackground(gradientDrawable);
  488 + binding.layout.setBackgroundColor(!StringUtils.isEmpty(pageData.getTopColor()) ? parseColor("#" + pageData.getTopColor()) : getActivity().getResources().getColor(R.color.white));
  489 + binding.message.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.text_input_color));
  490 + binding.messageCount.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.color_989898));
  491 + binding.tag.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.black));
  492 + binding.tag.setCompoundDrawablesWithIntrinsicBounds(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getDrawable(R.drawable.monkey_tag) : getActivity().getResources().getDrawable(R.drawable.mjz_bq),
  493 + null, null, null);
  494 + binding.address.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.black));
  495 + binding.address.setCompoundDrawablesWithIntrinsicBounds(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getDrawable(R.drawable.monkeyaddress) : getActivity().getResources().getDrawable(R.drawable.fb_weizhi),
  496 + null, null, null);
  497 + binding.adline1.setVisibility(1 == pageData.getDetailaddress() ? GONE : VISIBLE);
  498 + binding.adline.setAlpha(!StringUtils.isEmpty(pageData.getBottomSrc()) ? 0.7f : 1f);
  499 + binding.adline1.setAlpha(!StringUtils.isEmpty(pageData.getBottomSrc()) ? 0.7f : 1f);
  500 + binding.adline2.setAlpha(!StringUtils.isEmpty(pageData.getBottomSrc()) ? 0.7f : 1f);
  501 + binding.adline3.setAlpha(!StringUtils.isEmpty(pageData.getBottomSrc()) ? 0.7f : 1f);
  502 + binding.closeAddress.setBackgroundResource(!StringUtils.isEmpty(pageData.getBottomSrc()) ? R.drawable.bg_location_check_monkey : R.drawable.bg_location_check);
  503 + binding.recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 3));
  504 + if (!TextUtils.isEmpty(pageData.getFixedTitle())) {
  505 + binding.message.setKeyListener(null);
  506 + }
  507 + for (int i = 0; i < binding.recyclerView.getItemDecorationCount(); i++)
  508 + binding.recyclerView.removeItemDecorationAt(i);
  509 + if (!StringUtils.isEmpty(pageData.getBottomSrc())) {
  510 + DividerItemDecoration divider = new DividerItemDecoration(getActivity(), DividerItemDecoration.HORIZONTAL);
  511 + divider.setDrawable(getResources().getDrawable(R.drawable.shape_circle));
  512 + binding.recyclerView.addItemDecoration(divider);
  513 + } else {
  514 + RecycleViewDivider divider = new RecycleViewDivider(getActivity(), dip2px(8), getActivity().getResources().getColor(R.color.white));
  515 + binding.recyclerView.addItemDecoration(divider);
  516 + }
  517 + if (StringUtils.isEmpty(pageData.getBottomSrc())) {
  518 + binding.monkey.setImageRes(R.drawable.white);
  519 + } else {
  520 + binding.monkey.setImageUrl(pageData.getBottomSrc());
  521 + }
  522 + binding.setData(pageData);
  523 + binding.setOnClick(this);
  524 + binding.setOnTouch(this);
  525 + binding.message.setHintTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.color_989898));
  526 + binding.message.addTextChangedListener(new TextWatcher() {
  527 + //文本内容剩余字数校验
  528 + @Override
  529 + public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  530 +
  531 + }
  532 +
  533 + @Override
  534 + public void onTextChanged(CharSequence s, int start, int before, int count) {
  535 +
  536 + }
  537 +
  538 + @Override
  539 + public void afterTextChanged(Editable s) {
  540 + remainingTextSize = defMaxTexSize - s.length();
  541 + witnessTextSize = witMaxTexSize - s.length();
  542 + binding.message.setHint(pageData.getDefaulttext());
  543 + binding.message.setHintTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? getActivity().getResources().getColor(R.color.white) : getActivity().getResources().getColor(R.color.text_input_color));
  544 + if ("生活圈".equals(pageData.getWit())) {
  545 + binding.messageCount.setText(String.format("(%s/%s字以内)", remainingTextSize, defMaxTexSize));
  546 + } else {
  547 + binding.messageCount.setText(!"".equals(pageData.getFixedTitle()) ? "" : String.format("(%s/%s字以内)", witnessTextSize, witMaxTexSize));
  548 + }
  549 + getMvpView().hasDes(s.toString().trim());
  550 + }
  551 + });
  552 + binding.message.setHint(pageData.getDefaulttext());
  553 + if ("生活圈".equals(pageData.getWit())) {
  554 + binding.messageCount.setText(String.format("(%s/%s字以内)", remainingTextSize, defMaxTexSize));
  555 + binding.message.setFilters(new InputFilter[]{new InputEmojiLengthFilter(10000)});
  556 + pageData.setTagVisibility(View.GONE);
  557 + } else {
  558 + pageData.setTagVisibility(View.VISIBLE);
  559 + pageData.setRadioGroupVisibility(View.VISIBLE);
  560 + binding.messageCount.setText(!"".equals(pageData.getFixedTitle()) ? "" : String.format("(%s/%s字以内)", witnessTextSize, witMaxTexSize));
  561 + binding.message.setFilters(new InputFilter[]{new InputEmojiLengthFilter(140)});
  562 + List<CircleData.indextag> categoryTag = pageData.getCategoryTag();
  563 + binding.gp.removeAllViews();
  564 + if (categoryTag != null) {
  565 + for (int i = 0; i < categoryTag.size(); i++) {
  566 + if (i == 0) {
  567 + addItemToFloatLayout(categoryTag.get(i).getTagName(), categoryTag.get(i).getTagId(), true);
  568 + } else {
  569 + addItemToFloatLayout(categoryTag.get(i).getTagName(), categoryTag.get(i).getTagId(), false);
  570 + }
  571 + }
  572 + int childCount = binding.gp.getChildCount();
  573 + for (int i = 0; i < childCount; i++) {
  574 + TextView childAt = (TextView) binding.gp.getChildAt(i);
  575 + String tagName = categoryTag.get(i).getTagName();
  576 + String tagId = categoryTag.get(i).getTagId();
  577 + childAt.setOnClickListener(new View.OnClickListener() {
  578 + @Override
  579 + public void onClick(View v) {
  580 + if (type1 == 2 && !"".equals(pageData.getWitContentId())) {
  581 + } else {
  582 + if (pageData.getTagtext().equals(tagName)) {
  583 + childAt.setBackgroundResource(!StringUtils.isEmpty(pageData.getBottomSrc()) ? R.drawable.item_search3_history : R.drawable.item_search_history);
  584 + GradientDrawable mGradientDrawable = (GradientDrawable) childAt.getBackground();
  585 + mGradientDrawable.setColor(parseColor("#FFFFFF"));
  586 + // childAt.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? parseColor("#" + (pageData.getLabelcolor() == null ? "666666" : pageData.getLabelcolor())) : parseColor("#666666"));
  587 + childAt.setTextColor(parseColor("#9E9E9E"));
  588 + pageData.setTagtext("");
  589 + pageData.setTagId("");
  590 + } else {
  591 + pageData.setTagtext(tagName);
  592 + pageData.setTagId(tagId);
  593 + for (int p = 0; p < childCount; p++) {
  594 + TextView childAt2 = (TextView) binding.gp.getChildAt(p);
  595 + childAt2.setBackgroundResource(!StringUtils.isEmpty(pageData.getBottomSrc()) ? R.drawable.item_search3_history : R.drawable.item_search_history);
  596 + GradientDrawable mGradientDrawable = (GradientDrawable) childAt2.getBackground();
  597 + mGradientDrawable.setColor(parseColor("#FFFFFF"));
  598 + // childAt2.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? parseColor("#" + (pageData.getLabelcolor() == null ? "666666" : pageData.getLabelcolor())) : parseColor("#666666"));
  599 + childAt2.setTextColor(parseColor("#9E9E9E"));
  600 + }
  601 + childAt.setBackgroundResource(!StringUtils.isEmpty(pageData.getBottomSrc()) ? R.drawable.item_search3_history : R.drawable.item_search2_history);
  602 + if (!StringUtils.isEmpty(pageData.getBottomSrc())) {
  603 + GradientDrawable mGradientDrawable = (GradientDrawable) childAt.getBackground();
  604 + mGradientDrawable.setColor(parseColor("#" + (pageData.getCategoryTag().get(0).getColour() == null ? "666666" : pageData.getCategoryTag().get(0).getColour())));
  605 + }
  606 + childAt.setTextColor(!StringUtils.isEmpty(pageData.getBottomSrc()) ? parseColor("#FFFFFF") : parseColor("#9E9E9E"));
  607 + }
  608 + }
  609 + }
  610 + });
  611 + }
  612 + }
  613 + }
  614 + initDisplayScreen();
  615 + }
  616 +
  617 +
  618 + public void addItemToFloatLayout(String tagname, String tagId, boolean first) {
  619 + final TextView textView = new TextView(getContext());
  620 + int textViewPadding = QMUIDisplayHelper.dp2px(getContext(), 7);
  621 + int textViewRightPadding = QMUIDisplayHelper.dp2px(getContext(), 14);
  622 + textView.setPadding(textViewRightPadding, textViewPadding, textViewRightPadding, textViewPadding);
  623 + textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
  624 + textView.setTextColor(parseColor("#9E9E9E"));
  625 + textView.setText(tagname);
  626 + textView.setGravity(Gravity.CENTER);
  627 + textView.setMaxEms(21);
  628 + textView.setSingleLine();
  629 + textView.setEllipsize(TextUtils.TruncateAt.MIDDLE);
  630 + textView.setMinWidth(QMUIDisplayHelper.dp2px(getContext(), 50));
  631 + textView.setBackgroundResource(1 == pageData.getSource() ? R.drawable.item_search3_history : R.drawable.item_search_history);
  632 + if (1 == pageData.getSource()) {
  633 + GradientDrawable mGradientDrawable = (GradientDrawable) textView.getBackground();
  634 + mGradientDrawable.setColor(getResources().getColor(R.color.white));
  635 + }
  636 + ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  637 + if (first) {
  638 + binding.gp.addView(textView, 0, lp);
  639 + } else {
  640 + binding.gp.addView(textView, lp);
  641 + }
  642 + if (tagname.equals(pageData.getTagtext())) {
  643 + pageData.setTagtext(tagname);
  644 + pageData.setTagId(tagId);
  645 + textView.setBackgroundResource(1 == pageData.getSource() ? R.drawable.item_search3_history : R.drawable.item_search2_history);
  646 + /*if (1 == pageData.getSource()) {
  647 + GradientDrawable mGradientDrawable = (GradientDrawable) textView.getBackground();
  648 + mGradientDrawable.setColor(parseColor("#" + (pageData.getLabelcolor() == null ? "666666" : pageData.getLabelcolor())));
  649 + }*/
  650 + textView.setTextColor(1 == pageData.getSource() ? parseColor("#FFFFFF") : parseColor("#666666"));
  651 +
  652 + }
  653 + }
  654 +
  655 + private void reset() {
  656 + if (getPresenter() != null)
  657 + getPresenter().resetViewCallback(pageData.getAdapter().getList(), outtype);
  658 + }
  659 +
  660 + public static boolean checkEndTag(String str) {
  661 + return !TextUtils.isEmpty(str) && !TextUtils.isEmpty("") && str.endsWith("");
  662 + }
  663 +
  664 + private void init() {
  665 + if (getActivity() == null) return;
  666 +
  667 + if (pageData == null) pageData = new ReleaseMediaPage();
  668 + boolean hasShareData = getArguments() != null && getArguments().containsKey("share_config");
  669 + ShareReleaseInfoUtil.ShareConfig shareConfig = hasShareData ? (ShareReleaseInfoUtil.ShareConfig) getArguments().getSerializable("share_config") : null;
  670 + String type = shareConfig == null ? "witness" : shareConfig.getType() == null ? ShareReleaseInfoUtil.TYPE_HTML : shareConfig.getType();
  671 + switch (type) {
  672 + case ShareReleaseInfoUtil.TYPE_HTML:
  673 + String title = shareConfig == null ? "" : shareConfig.getTitle();
  674 + String shareTitle = title == null ? "" : checkEndTag(title) ? title.substring(0, title.indexOf("")) : title;
  675 + if (shareConfig != null) shareConfig.setTitle(shareTitle);
  676 + pageData.setShareConfig(shareConfig);
  677 + outtype = 5;
  678 + getPresenter().initPageData(getActivity(), null, "");
  679 + getMvpView().hasHTML(shareConfig);
  680 + return;
  681 + case "witness":
  682 + type1 = getArguments().getInt("type");
  683 + String isCircle = getArguments().getString("isCircle");
  684 + if (type1 == 2 && !"cancircle".equals(isCircle)) {
  685 + String text = getArguments().getString("text");
  686 + String img = getArguments().getString("img");
  687 + String tag = getArguments().getString("tagName");
  688 + String witContentId = getArguments().getString("witContentId");
  689 + String videopath = getArguments().getString("videopath");
  690 + String fileUri = getArguments().getString("fileUri");
  691 + String duration = getArguments().getString("duration");
  692 + createtime = getArguments().getString("createtime");
  693 + String taglist = getArguments().getString("taglist");
  694 + String jumpType = getArguments().getString("jumpType");
  695 + String json = getArguments().getString("json");
  696 + String sid = UserInfoUtils.getUid(getContext(),"");
  697 + String messagesp = SharedPreferencesHelper.getInstance(getContext()).getValue("SAVE_RELEASE_INFO_MESSAGE_" + sid);
  698 + String medias = SharedPreferencesHelper.getInstance(getContext()).getValue("SAVE_RELEASE_INFO_IMAGES_" + sid);
  699 + if ("draft".equals(jumpType)) {
  700 + getPresenter().WitnessLoadInfo(getActivity(), "暂无视频标题".equals(text) ? "" : text, img, tag, type1, witContentId, videopath, duration, taglist, jumpType, json, fileUri);
  701 + } else if ("auditing".equals(jumpType)) {
  702 + getPresenter().WitnessLoadInfo(getActivity(), "暂无视频标题".equals(text) ? "" : text, img, tag, type1, witContentId, "", "", "", "", json, "");
  703 + } else if (!"".equals(messagesp) || !"".equals(medias)) {
  704 + getPresenter().doLoadInfo(getActivity());
  705 + } else if ("html".equals(jumpType) && "".equals(messagesp) || "".equals(medias)) {
  706 + getPresenter().WitnessLoadInfo(getActivity(), text, img, tag, type1, witContentId, videopath, duration, taglist, jumpType, json, fileUri);
  707 + } else if ("myself".equals(jumpType) && "".equals(messagesp) || "".equals(medias)) {
  708 + getPresenter().WitnessLoadInfo(getActivity(), text, img, tag, type1, witContentId, videopath, duration, taglist, jumpType, json, fileUri);
  709 + }
  710 + } else if (type1 != 2 && "cancircle".equals(isCircle)) { //判断初次拍摄完进入发布页面
  711 + List<Media> mediaList = getArguments() == null ? null : getArguments().getParcelableArrayList("medias");
  712 + String WitnessMessage = SharedPreferencesHelper.getInstance(getActivity()).getValue("WitnessMessage");
  713 + CircleData.ReleaseVideoTypeListBean witnessmessage = new Gson().fromJson(WitnessMessage, CircleData.ReleaseVideoTypeListBean.class);
  714 + getPresenter().comeevent(getActivity(), "", witnessmessage.getText(), 0, witnessmessage.getVideoType(), witnessmessage.getChangePath(), witnessmessage.getMultiplecategory(), mediaList, "", "", "witness".equals(witnessmessage.getText()) ? 2 : 0, "witness".equals(witnessmessage.getText()) ? String.valueOf(witnessmessage.getId()) : ""
  715 + , witnessmessage.getCategoryTag(), "");
  716 + } else {
  717 + List<Media> mediaList = getArguments() == null ? null : getArguments().getParcelableArrayList("medias");
  718 + String content = getArguments() == null ? "" : getArguments().getString("content");
  719 + outtype = getArguments().getInt("outtype");
  720 + if (outtype == 3 && mediaList != null && "".equals(content)) {
  721 + pageData.getAdapter().getList().clear();
  722 + getPresenter().initPageData(getActivity(), mediaList, "");
  723 + getMvpView().hasMedias(mediaList.size());
  724 + } else if (outtype != 3 && mediaList != null) {
  725 + if (mediaList.size() > 0) {
  726 + getMvpView().showCopyView();
  727 + Observable.fromIterable(mediaList).concatMap(new Function<Media, ObservableSource<Media>>() {
  728 +
  729 + private String path;
  730 +
  731 + @Override
  732 + public ObservableSource<Media> apply(Media media) throws Exception {
  733 + if (media.mediaType == 3) {
  734 + String name = FileUtils.getFileName(media.path);
  735 + if (AndroidQUtil.isAndroidQ()) {
  736 + if (!TextUtils.isEmpty(media.fileUri)) {
  737 + path = AndroidQUtil.copyMp4(getActivity(), media.fileUri, name);
  738 + } else {
  739 + path = media.path;
  740 + }
  741 +
  742 + } else {
  743 + if (!TextUtils.isEmpty(media.path)) {
  744 + path = media.path;
  745 + } else {
  746 + if (!TextUtils.isEmpty(media.fileUri))
  747 + path = AndroidQUtil.copyMp4(getActivity(), media.fileUri, name);
  748 + }
  749 +
  750 + }
  751 +
  752 + } else if (media.mediaType == 1) {
  753 + if (AndroidQUtil.isAndroidQ() && getActivity() != null ) {
  754 + if (TextUtils.isEmpty(media.fileUri) && !TextUtils.isEmpty(media.path)) {
  755 + Uri imageContentUri = FileProvider.getUriForFile(getActivity(), getActivity().getPackageName() + ".fileprovider", new File(media.path));
  756 + // Uri imageContentUri = AndroidQUtil.getImageContentUri(PickerActivity.this, new File(media.path));
  757 + path = AndroidQUtil.copyAndroidQFile(getActivity(), imageContentUri.toString(), media.name + "");
  758 + } else {
  759 + path = AndroidQUtil.copyAndroidQFile(getActivity(), media.fileUri, media.name + "");
  760 + }
  761 + } else {
  762 + path = media.path;
  763 + }
  764 + }
  765 + media.path = path;
  766 + return Observable.just(media);
  767 + }
  768 + }).map(new Function<Media, Media>() {
  769 + @Override
  770 + public Media apply(Media media) throws Exception {
  771 + return media;
  772 + }
  773 + }).toList().flatMapObservable(new Function<List<Media>, ObservableSource<List<Media>>>() {
  774 + @Override
  775 + public ObservableSource<List<Media>> apply(List<Media> media) throws Exception {
  776 + return Observable.create(new ObservableOnSubscribe<List<Media>>() {
  777 + @Override
  778 + public void subscribe(ObservableEmitter<List<Media>> emitter) throws Exception {
  779 + emitter.onNext(media);
  780 + }
  781 + });
  782 + }
  783 + }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<List<Media>>() {
  784 + @Override
  785 + public void onSubscribe(Disposable d) {
  786 +
  787 + }
  788 +
  789 + @Override
  790 + public void onNext(List<Media> media) {
  791 + getMvpView().hideCopyView();
  792 + getPresenter().initPageData(getActivity(), media, "");
  793 + getMvpView().hasMedias(media.size());
  794 + }
  795 +
  796 + @Override
  797 + public void onError(Throwable e) {
  798 + Toast.makeText(getActivity(), "请选择媒体文件", Toast.LENGTH_SHORT).show();
  799 + }
  800 +
  801 + @Override
  802 + public void onComplete() {
  803 +
  804 + }
  805 + });
  806 + } else {
  807 + Toast.makeText(getActivity(), "请选择媒体文件", Toast.LENGTH_SHORT).show();
  808 + }
  809 + } else if (outtype == 3 && mediaList != null) {
  810 + getPresenter().initPageData(getActivity(), mediaList, content);
  811 + } else {
  812 + getPresenter().doLoadInfo(getActivity());
  813 + }
  814 + }
  815 + return;
  816 + default:
  817 + break;
  818 + }
  819 + }
  820 +
  821 + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
  822 + public void onMessageEvent(CircleChoose event) {
  823 + // 更新界面
  824 + comeevent = true;
  825 + messageCamera = event.getMessage();
  826 +
  827 + if ("生活圈".equals(event.getMessage().getText()) && pageData.getAdapter().getItemCount() == 1 && (pageData.getAdapter().getItem(0)).getType() == ReleaseMediaItem.type_select) {
  828 + pageData.getAdapter().getItem(0).setIconRes(R.drawable.fb_tjsc);
  829 + } else if (!"生活圈".equals(event.getMessage().getText()) && pageData.getAdapter().getItemCount() == 1 && (pageData.getAdapter().getItem(0)).getType() == ReleaseMediaItem.type_select) {
  830 + pageData.getAdapter().getItem(0).setIconRes(!StringUtils.isEmpty(pageData.getBottomSrc()) ? R.drawable.circle_photo : R.drawable.fb_tjsp);
  831 + }
  832 + pageData.getAdapter().getItem(0).setNullvisiable(View.VISIBLE);
  833 + pageData.getAdapter().getItem(0).setAddvisiable(View.GONE);
  834 +
  835 + }
  836 +
  837 + @Override
  838 + public void onPause() {
  839 + super.onPause();
  840 + hideSoftInput();
  841 + if (dialog != null) dialog.dismiss();
  842 + if (permissionsDisposable != null) permissionsDisposable.dispose();
  843 + }
  844 +
  845 + @Override
  846 + public void onDestroy() {
  847 + super.onDestroy();
  848 + EventBus.getDefault().unregister(this);
  849 + if (keyboardListener != null) keyboardListener = null;
  850 + if (toolbarClick != null) toolbarClick = null;
  851 + // if (locationCallback != null) locationCallback = null;
  852 + if (deleteImageDialog != null) deleteImageDialog.dismiss();
  853 + if (bottomSheet != null) bottomSheet.dismiss();
  854 + if (bottomSheet1 != null) bottomSheet1.dismiss();
  855 + if (bottomSheet2 != null) bottomSheet2.dismiss();
  856 + if (bottomSheet3 != null) bottomSheet3.dismiss();
  857 + if (bottomSheet4 != null) bottomSheet4.dismiss();
  858 + if (tipDialog != null) tipDialog.dismiss();
  859 + if (copyDialog != null) copyDialog.dismiss();
  860 + if (exitDialog != null) exitDialog.dismiss();
  861 + // ShareResultObservable.getInstance().deleteObserver(this);
  862 + }
  863 +
  864 + /**
  865 + * 隐藏软键盘
  866 + */
  867 + private void hideSoftInput() {
  868 + if (getContext() != null){
  869 + InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  870 + if (imm != null) {
  871 + imm.hideSoftInputFromWindow(binding.message.getWindowToken(), 0);
  872 + }
  873 + }
  874 + }
  875 +
  876 + private void initLocationPermission() {
  877 + if (getActivity() == null) return;
  878 + boolean hasPermission = PermissionChecker.checkPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE_LOCATION, R.string.permission_location);
  879 + if (hasPermission) {
  880 + initLocation();
  881 + }
  882 + }
  883 +
  884 + @Override
  885 + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  886 + super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  887 + buttonRRight.setClickable(true);
  888 + if (requestCode == REQUEST_CODE_SELECT_READ_WRITE || requestCode == REQUEST_CODE_SELECT_READ_WRITE_2) {
  889 + if (PermissionChecker.onRequestPermissionsResult(getActivity(), requestCode, permissions, grantResults, false, R.string.dialog_imagepicker_permission_camera_message)[0])
  890 + if (requestCode == REQUEST_CODE_SELECT_READ_WRITE) getMvpView().showAlbum(true);
  891 + else getMvpView().showSelectPage();
  892 + } else if (requestCode == REQUEST_CODE_SELECT_CAMERA) {
  893 + if (PermissionChecker.onRequestPermissionsResult(getActivity(), requestCode, permissions, grantResults, false, R.string.dialog_imagepicker_permission_camera_nerver_ask_message)[0])
  894 + getMvpView().showShoot(true);
  895 + } else if (requestCode == REQUEST_CODE_LOCATION) {
  896 + if (PermissionChecker.onRequestPermissionsResult(getActivity(), requestCode, permissions, grantResults, false, R.string.permission_location)[0]) {
  897 + initLocation();
  898 + } else {
  899 + if (3 == pageData.getSource()) {
  900 + pageData.setLocationVisibility(VISIBLE);
  901 + binding.closeAddress.setVisibility(GONE);
  902 + binding.locatagain.setVisibility(VISIBLE);
  903 + binding.locationrefresh.setVisibility(VISIBLE);
  904 + binding.address.setText("位置获取失败");
  905 + binding.address.setTextColor(getResources().getColor(R.color.address_color));
  906 + }
  907 + }
  908 + }
  909 + }
  910 +
  911 + protected void initLocation() {
  912 + LocationUtil.uploadLocation(getActivity(), new AMapLocationListener() {
  913 + @Override
  914 + public void onLocationChanged(AMapLocation location) {
  915 + if (getActivity() == null) return;
  916 + if (location != null && location.getErrorCode() == 0) {
  917 + if (3 == pageData.getSource()) {
  918 + binding.locationrefresh.setVisibility(GONE);
  919 + binding.locatagain.setVisibility(GONE);
  920 + binding.closeAddress.setVisibility(GONE);
  921 + binding.address.setTextColor(getActivity().getResources().getColor(R.color.black));
  922 + }
  923 + //省信息
  924 + String province = (location.getProvince() != null && location.getProvince().length() > 0) ? location.getProvince() : "北京市";
  925 + //城市信息
  926 + String city = (location.getCity() != null && location.getCity().length() > 0) ? location.getCity() : "北京市";
  927 + //城区信息
  928 + String district = (location.getDistrict() != null && location.getDistrict().length() > 0) ? location.getDistrict() : "";
  929 + //街道信息
  930 + String street = (location.getStreet() != null && location.getStreet().length() > 0) ? location.getStreet() : "";
  931 + //当前位置点 AOI信息
  932 + String api = (location.getAoiName() != null && location.getAoiName().length() > 0) ? location.getAoiName() : "";
  933 + //位置信息格式化
  934 + String locationStr = "%s · %s%s%s";
  935 + if (1 == pageData.getDetailaddress()) {
  936 + pageData.setLocationVisibility(VISIBLE);
  937 + pageData.setCoordinate(String.format(locationStr, city, district, street, api));
  938 + pageData.setLocation(String.format(locationStr, city, district, "", ""));
  939 + binding.address.setText(pageData.getCoordinate());
  940 + } else if ("生活圈".equals(pageData.getTitle())) {
  941 + pageData.setLocationVisibility(VISIBLE);
  942 + pageData.setCoordinate(String.format(locationStr, city, district, street, api));
  943 + pageData.setLocation(String.format(locationStr, city, district, "", ""));
  944 + binding.address.setText(pageData.getLocation());
  945 + } else {
  946 + pageData.setLocationVisibility(GONE);
  947 + }
  948 + } else {
  949 + if (3 == pageData.getSource()) {
  950 + pageData.setLocationVisibility(VISIBLE);
  951 + binding.locationrefresh.setVisibility(VISIBLE);
  952 + binding.locatagain.setVisibility(VISIBLE);
  953 + binding.address.setText("位置获取失败");
  954 + binding.address.setTextColor(getActivity().getResources().getColor(R.color.address_color));
  955 + binding.closeAddress.setVisibility(GONE);
  956 + AlertUtil.showDeftToast(getActivity(), "位置获取失败,请检查手机GPS以及位置权限是否打开");
  957 + } else {
  958 + pageData.setLocationVisibility(GONE);
  959 + }
  960 + }
  961 + }
  962 + });
  963 + }
  964 +
  965 + //Activity 返回事件处理
  966 + @Override
  967 + public void onActivityResult(int requestCode, int resultCode, Intent data) {
  968 + super.onActivityResult(requestCode, resultCode, data);
  969 + //媒体数据
  970 + buttonRRight.setClickable(true);
  971 + if ((requestCode == 200 && resultCode == PickerConfig.DEFAULT_RESULT_CODE) || resultCode == 110) {
  972 + List<Media> selects = data.getParcelableArrayListExtra(PickerConfig.EXTRA_RESULT);
  973 + if (selects != null && selects.size() > 0) {
  974 + getMvpView().showCopyView();
  975 + Observable.fromIterable(selects).concatMap(new Function<Media, ObservableSource<Media>>() {
  976 + private String path;
  977 +
  978 + @Override
  979 + public ObservableSource<Media> apply(Media media) throws Exception {
  980 + if (media.mediaType == 3) {
  981 + String name = FileUtils.getFileName(media.path);
  982 + if (AndroidQUtil.isAndroidQ()) {
  983 + if (!TextUtils.isEmpty(media.fileUri)) {
  984 + path = AndroidQUtil.copyMp4(getActivity(), media.fileUri, name);
  985 + } else {
  986 + path = media.path;
  987 + }
  988 +
  989 + } else {
  990 + if (!TextUtils.isEmpty(media.path)) {
  991 + path = media.path;
  992 + } else {
  993 + if (!TextUtils.isEmpty(media.fileUri))
  994 + path = AndroidQUtil.copyMp4(getActivity(), media.fileUri, name);
  995 + }
  996 +
  997 + }
  998 +
  999 + } else if (media.mediaType == 1) {
  1000 + if (AndroidQUtil.isAndroidQ() && getActivity()!=null) {
  1001 + if (TextUtils.isEmpty(media.fileUri) && !TextUtils.isEmpty(media.path)) {
  1002 + Uri imageContentUri = FileProvider.getUriForFile(getActivity(), getActivity().getPackageName() + ".fileprovider", new File(media.path));
  1003 + // Uri imageContentUri = AndroidQUtil.getImageContentUri(PickerActivity.this, new File(media.path));
  1004 + path = AndroidQUtil.copyAndroidQFile(getActivity(), imageContentUri.toString(), media.name + "");
  1005 + } else {
  1006 + path = AndroidQUtil.copyAndroidQFile(getActivity(), media.fileUri, media.name + "");
  1007 + }
  1008 + } else {
  1009 + path = media.path;
  1010 + }
  1011 + }
  1012 + media.path = path;
  1013 + return Observable.just(media);
  1014 + }
  1015 + }).map(new Function<Media, Media>() {
  1016 + @Override
  1017 + public Media apply(Media media) throws Exception {
  1018 + return media;
  1019 + }
  1020 + }).toList().flatMapObservable(new Function<List<Media>, ObservableSource<List<Media>>>() {
  1021 + @Override
  1022 + public ObservableSource<List<Media>> apply(List<Media> media) throws Exception {
  1023 + return Observable.create(new ObservableOnSubscribe<List<Media>>() {
  1024 + @Override
  1025 + public void subscribe(ObservableEmitter<List<Media>> emitter) throws Exception {
  1026 + emitter.onNext(media);
  1027 + }
  1028 + });
  1029 + }
  1030 + }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<List<Media>>() {
  1031 + @Override
  1032 + public void onSubscribe(Disposable d) {
  1033 +
  1034 + }
  1035 +
  1036 + @Override
  1037 + public void onNext(List<Media> media) {
  1038 + getMvpView().hideCopyView();
  1039 + getPresenter().initLocalData(getContext(), media, pageData.getWit(), pageData.getTitle(), pageData.getBottomSrc());
  1040 + }
  1041 +
  1042 + @Override
  1043 + public void onError(Throwable e) {
  1044 + Toast.makeText(getActivity(), "请选择媒体文件", Toast.LENGTH_SHORT).show();
  1045 + }
  1046 +
  1047 + @Override
  1048 + public void onComplete() {
  1049 +
  1050 + }
  1051 + });
  1052 + } else {
  1053 + getPresenter().initLocalData(getContext(), selects, pageData.getWit(), pageData.getTitle(), pageData.getBottomSrc());
  1054 + // Toast.makeText(getActivity(), "请选择媒体文件", Toast.LENGTH_SHORT).show();
  1055 + }
  1056 + }
  1057 + }
  1058 +
  1059 + public void showReleaseResult(boolean isSuccess, boolean isshare, String url) {
  1060 + if (getActivity() == null) return;
  1061 +
  1062 + binding.progress.setProgress(0);
  1063 + binding.cover.setVisibility(GONE);
  1064 + binding.profa.setVisibility(GONE);
  1065 +
  1066 + if (isSuccess) {
  1067 + if (isshare) {
  1068 + if (pageData.getVideotype().equals("witness")) {
  1069 + // todo ReleaseSuccessAcityity.start(getActivity(), pageData.getJumpType(), "上传成功", "", pageData.getSuccessJumpType());
  1070 + }
  1071 + getActivity().finish();
  1072 + SocialLifeChangeObservable.getInstance().uploadMoment();
  1073 +
  1074 + } else {
  1075 + ShareWjjStateObservable.newInstance().update(true);
  1076 + if (url != null && url.startsWith("http://wjjh5")) {
  1077 + ShareResultObservable.getInstance().update(new ShareResultObservable.ShareResultInfo(2, 1, url));
  1078 + }
  1079 + SocialLifeChangeObservable.getInstance().uploadMoment();
  1080 + getActivity().finish();
  1081 + }
  1082 + } else {
  1083 + if (url != null && url.startsWith("http://wjjh5")) {
  1084 + ShareResultObservable.getInstance().update(new ShareResultObservable.ShareResultInfo(2, 2, url));
  1085 + }
  1086 + buttonRRight.setClickable(true);
  1087 + }
  1088 + }
  1089 +
  1090 + @Override
  1091 + public boolean onBackPressed() {
  1092 + if (getActivity() == null) return false;
  1093 + if (binding.emojicons.getVisibility() == VISIBLE) {
  1094 + onClickBtn();
  1095 + } else if (pageData.getShareConfig() == null && (exitDialog == null || !exitDialog.isShowing()) && !tipDialog.isShowing() && !copyDialog.isShowing() && binding.profa.getVisibility() != VISIBLE) {
  1096 + getMvpView().showBackDialog();
  1097 + } else if (pageData.getShareConfig() != null) {
  1098 + getMvpView().showBackDialog();
  1099 + }
  1100 + return true;
  1101 + }
  1102 +
  1103 + //-------------------------------------------------------------------------------------------------
  1104 + private int displayScreenHeight;
  1105 + private int input_height, input_default_height, input_offset;
  1106 +
  1107 + @Override
  1108 + public void expressionClick(String str) {
  1109 + if (str.length() <= ("目击者".equals(pageData.getWit()) ? witnessTextSize : remainingTextSize)) {
  1110 + ExpressionShowFragment.input(binding.message, str);
  1111 + }
  1112 + }
  1113 +
  1114 + @Override
  1115 + public void onResume() {
  1116 + super.onResume();
  1117 + if (getActivity() == null) return;
  1118 + // StatusBarUtil.setStatusBarWrite(getActivity());
  1119 + // StatusBarUtil2.setColor(getActivity(), pageData != null && !StringUtils.isEmpty(pageData.getTopColor()) ? parseColor("#" + pageData.getTopColor()) : getActivity().getResources().getColor(R.color.white), 0);
  1120 + }
  1121 +
  1122 + @Override
  1123 + public void expressionDeleteClick(View v) {
  1124 + ExpressionShowFragment.delete(binding.message);
  1125 + }
  1126 +
  1127 + @Override
  1128 + public void onClick(View v) {
  1129 + int id = v.getId();
  1130 + if (id == R.id.emoticons_button) {
  1131 + onClickBtn();
  1132 + } else if (id == R.id.gobutton) {
  1133 + if (type1 == 2 && !"".equals(pageData.getWitContentId())) {
  1134 + // AlertUtil.showDeftToast(getContext(),"作品审核中暂不支持修改此项.");
  1135 + } else if ("draft".equals(pageData.getJumpType())) {
  1136 + // AlertUtil.showDeftToast(getContext(),"作品审核中暂不支持修改此项.");
  1137 + } else {
  1138 + pageData.setRadioGroupVisibility(GONE);
  1139 + // startFragment(CircleFragment.newInstance(pageData.getAdapter().getList().get(0).getType()));
  1140 + }
  1141 + } else if (id == R.id.zk) {
  1142 + if (type1 == 2 && !"".equals(pageData.getWitContentId())) {
  1143 + // AlertUtil.showDeftToast(getContext(),"作品审核中暂不支持修改此项.");
  1144 + } else {
  1145 + pageData.setSqVisibility(VISIBLE);
  1146 + pageData.setZkVisibility(GONE);
  1147 + pageData.setRadioGroupVisibility(VISIBLE);
  1148 + }
  1149 + } else if (id == R.id.sq) {
  1150 + if (type1 == 2 && !"".equals(pageData.getWitContentId())) {
  1151 + // AlertUtil.showDeftToast(getContext(),"作品审核中暂不支持修改此项.");
  1152 + } else {
  1153 + pageData.setSqVisibility(GONE);
  1154 + pageData.setZkVisibility(VISIBLE);
  1155 + pageData.setRadioGroupVisibility(GONE);
  1156 + }
  1157 + } else if (id == R.id.locatagain || id == R.id.locationrefresh) {
  1158 + initLocationPermission();
  1159 + }
  1160 + }
  1161 +
  1162 + private void initDisplayScreen() {
  1163 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  1164 + Rect r = new Rect();
  1165 + binding.layout.getWindowVisibleDisplayFrame(r);
  1166 + displayScreenHeight = r.bottom;
  1167 + }
  1168 + }
  1169 +
  1170 + protected void onClickBtn() {
  1171 + if (getActivity() == null) return;
  1172 + if (binding.emojicons.getVisibility() == VISIBLE) {
  1173 + chengeEmojiconsVisibil(false);
  1174 + InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
  1175 + if (imm != null) imm.showSoftInput(binding.message, 0);
  1176 + } else {
  1177 + chengeEmojiconsVisibil(true);
  1178 + InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
  1179 + if (imm != null) imm.hideSoftInputFromWindow(binding.message.getWindowToken(), 0);
  1180 + }
  1181 + }
  1182 +
  1183 + private void chengeEmojiconsVisibil(boolean isShow) {
  1184 + binding.emojicons.setVisibility(isShow ? VISIBLE : GONE);
  1185 + binding.emoticonsButton.setImageResource(
  1186 + isShow ? R.drawable.expression_keyboard_selector : R.drawable.expression_face_selector);
  1187 + }
  1188 +
  1189 + protected void destroyInputFragment() {
  1190 + if (getActivity() == null) return;
  1191 + if (binding.message.getWindowToken() == null) return;
  1192 + InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
  1193 + if (imm != null) imm.hideSoftInputFromWindow(binding.message.getWindowToken(), 0);
  1194 + chengeEmojiconsVisibil(false);
  1195 + }
  1196 +
  1197 + @Override
  1198 + public boolean onTouch(View v, MotionEvent event) {
  1199 + if (v.getId() == R.id.message && binding.message.canScrollVertically(-1) || binding.message.canScrollVertically(0)) {
  1200 + v.getParent().requestDisallowInterceptTouchEvent(true);
  1201 + if (event.getAction() == MotionEvent.ACTION_UP) {
  1202 + binding.message.getParent().requestDisallowInterceptTouchEvent(false);
  1203 + }
  1204 + }
  1205 + if (v.getId() == R.id.message) {
  1206 + if (event.getAction() == MotionEvent.ACTION_DOWN && binding.emojicons.getVisibility() == VISIBLE) {
  1207 + chengeEmojiconsVisibil(false);
  1208 + }
  1209 + }
  1210 + return false;
  1211 + }
  1212 +
  1213 + private void onCalculation(int heightDifference) {
  1214 + boolean isKeyBoardVisible;
  1215 + Rect r = new Rect();
  1216 + //这里得到的是除了系统自带显示区域之外的所有区域,这里就是除了最上面的一条显示电量的状态栏之外的所有区域
  1217 + binding.layout.getWindowVisibleDisplayFrame(r);
  1218 +
  1219 + isKeyBoardVisible = heightDifference > 100;
  1220 + binding.emoticonsButtonLayout.setVisibility((isKeyBoardVisible || binding.emojicons.getVisibility() == VISIBLE) ? VISIBLE : GONE);
  1221 +
  1222 + if (heightDifference > 0 && input_height != (input_default_height + heightDifference))
  1223 + input_height = input_default_height + heightDifference;
  1224 +
  1225 + if (!isKeyBoardVisible && binding.emojicons.getVisibility() == VISIBLE) {
  1226 + if (binding.topView.getLayoutParams().height != (binding.layout.getHeight() - input_height - input_offset)) {
  1227 + binding.topView.getLayoutParams().height = (binding.layout.getHeight() - input_height - input_offset);
  1228 + binding.topView.setLayoutParams(binding.topView.getLayoutParams());
  1229 + }
  1230 + } else if (binding.topView.getLayoutParams().height != (binding.layout.getHeight() - input_default_height - input_offset)) {
  1231 + binding.topView.getLayoutParams().height = (binding.layout.getHeight() - input_default_height - input_offset);
  1232 + binding.topView.setLayoutParams(binding.topView.getLayoutParams());
  1233 + }
  1234 + }
  1235 +
  1236 + /*@Override
  1237 + public void update(java.util.Observable o, Object arg) {
  1238 +
  1239 + }*/
  1240 +}
... ...
publish/src/main/java/com/cnlive/publish/frame/persenter/ReleaseInfoEditPersenter.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/frame/persenter/ReleaseInfoEditPersenter.java
  1 +package com.cnlive.publish.frame.persenter;
  2 +
  3 +import android.content.Context;
  4 +import android.content.Intent;
  5 +import android.content.SharedPreferences;
  6 +import android.graphics.Bitmap;
  7 +import android.graphics.BitmapFactory;
  8 +import android.media.MediaMetadataRetriever;
  9 +import android.net.Uri;
  10 +import android.os.Build;
  11 +import android.os.Environment;
  12 +import android.text.TextUtils;
  13 +import android.util.Log;
  14 +
  15 +import com.cnlive.libs.base.application.AppConfig;
  16 +import com.cnlive.libs.base.logic.Event;
  17 +import com.cnlive.libs.base.logic.Logic;
  18 +import com.cnlive.libs.base.util.AlertUtil;
  19 +import com.cnlive.libs.base.util.ShareReleaseInfoUtil;
  20 +import com.cnlive.libs.base.util.SharedPreferencesHelper;
  21 +import com.cnlive.libs.base.util.StringUtils;
  22 +import com.cnlive.libs.data.network.util.NetworkUtil;
  23 +import com.cnlive.media.media.entity.Media;
  24 +import com.cnlive.media.model.CircleData;
  25 +
  26 +import com.cnlive.publish.R;
  27 +import com.cnlive.publish.frame.view.ReleaseInfoEditView;
  28 +import com.cnlive.publish.moudle.ReleaseMediaItem;
  29 +import com.cnlive.publish.moudle.Witness;
  30 +import com.cnlive.publish.network.BaseInfo;
  31 +import com.cnlive.publish.upload.CoinRainAction;
  32 +import com.cnlive.publish.upload.UploadLogic;
  33 +import com.cnlive.publish.util.UserInfoUtils;
  34 +import com.google.gson.Gson;
  35 +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
  36 +
  37 +
  38 +import java.io.File;
  39 +import java.text.SimpleDateFormat;
  40 +import java.util.ArrayList;
  41 +import java.util.Arrays;
  42 +import java.util.Date;
  43 +import java.util.List;
  44 +import java.util.Locale;
  45 +
  46 +import static android.content.Context.MODE_PRIVATE;
  47 +import static com.cnlive.libs.base.logic.Config.STATE_IDLE;
  48 +import static com.cnlive.libs.base.logic.Config.STATE_LOAD;
  49 +import static com.cnlive.libs.base.util.DoublePressed.onDoublePressed;
  50 +import static com.cnlive.publish.moudle.ReleaseMediaItem.type_select;
  51 +
  52 +/**
  53 + * Created by xiansong on 2018/1/31.
  54 + */
  55 +
  56 +public class ReleaseInfoEditPersenter extends MvpBasePresenter<ReleaseInfoEditView> {
  57 +
  58 + private boolean au = false;
  59 + private String witc = "";
  60 +
  61 + public void initPageData(Context context, List<Media> medias, String content) {
  62 + initPageData(context, content, "生活圈", 2, "moment", "Daren/moment/releaseMoment.action", AppConfig.isDebug() ? 371 : 366, medias, "", "", 0, "", new ArrayList<CircleData.indextag>(), "",
  63 + "生活圈", "编辑想说的内容...", 0, "363637", 0, "", "", "");
  64 + }
  65 +
  66 + public void initPageData(Context context, String message, String wit, int type, String videotype, String path, int multiplecategory, List<Media> medias, String img, String tag, int iswitinfo, String witContentId, List<CircleData.indextag> indextags, String jumptype,
  67 + String title, String defaulttext, int detailaddress, String labelcolor, int source, String bottomsrc, String fixTitle, String successJumpType) {
  68 + List<ReleaseMediaItem> list = new ArrayList<>();
  69 + boolean isVideo = false;
  70 +
  71 + if (medias != null && medias.size() > 1 && 3 == medias.get(0).mediaType) {
  72 + medias = medias.subList(0, 1);
  73 + }
  74 +
  75 + if (medias != null) for (Media media : medias) {
  76 + //媒体类型转换
  77 + ReleaseMediaItem item = (isVideo = media.mediaType == 3) ?
  78 + ReleaseMediaItem.newLocalVideo(R.drawable.bg_image_loading, media.path, media.path, null) :
  79 + ReleaseMediaItem.newLocalImage(R.drawable.bg_image_loading, media.path, null);
  80 + item.setMedia(media);
  81 + list.add(item);
  82 + item.setListener(v -> {
  83 + if (getView() != null) getView().itemClick(v, item);
  84 + });
  85 + }
  86 + if (list.size() < 9 && !isVideo)
  87 + list.add(new ReleaseMediaItem("生活圈".equals(title) ? R.drawable.fb_tjsc : (!StringUtils.isEmpty(bottomsrc) ? R.drawable.circle_photo : R.drawable.fb_tjsp), true, list.size() == 0, view -> {
  88 + if (getView() != null) getView().showSelectPage();
  89 + }, wit));
  90 +
  91 + if (getView() != null)
  92 + getView().initPageView(title, message, wit, type, videotype, path, multiplecategory, isVideo, list, img, tag, iswitinfo, witContentId, indextags, jumptype,
  93 + defaulttext, detailaddress, labelcolor, source, fixTitle, successJumpType);
  94 +
  95 + }
  96 +
  97 + public void resetViewCallback(List<ReleaseMediaItem> list, int outtype) {
  98 + if (list == null) return;
  99 + for (ReleaseMediaItem item : list) {
  100 + item.setListener(item.getType() == type_select ?
  101 + v -> {
  102 + if (getView() != null) getView().showSelectPage();
  103 + } :
  104 + v -> {
  105 + if (getView() != null) getView().itemClick(v, item);
  106 + }
  107 + );
  108 + }
  109 + }
  110 +
  111 + public void initLocalData(Context context, List<Media> select, String wit, String title, String bootomsrc) {
  112 + List<ReleaseMediaItem> list = new ArrayList<>();
  113 + boolean isVideo = false;
  114 + if (select != null) for (Media media : select) {
  115 + ReleaseMediaItem item = (isVideo = media.mediaType == 3) ?
  116 + ReleaseMediaItem.newLocalVideo(R.drawable.bg_image_loading, media.path, media.path, null) :
  117 + ReleaseMediaItem.newLocalImage(R.drawable.bg_image_loading, media.path, null);
  118 + item.setMedia(media);
  119 + list.add(item);
  120 + item.setListener(v -> {
  121 + if (getView() != null) getView().itemClick(v, item);
  122 + });
  123 + }
  124 +
  125 + if (list.size() == 0 && !isVideo)
  126 + list.add(new ReleaseMediaItem("生活圈".equals(title) ? R.drawable.fb_tjsc : (!StringUtils.isEmpty(bootomsrc) ? R.drawable.circle_photo : R.drawable.fb_tjsp), true, list.size() == 0, view -> {
  127 + if (getView() != null) getView().showSelectPage();
  128 + }, wit));
  129 + if (list.size() < 9 && !isVideo && list.size() > 0)
  130 + list.add(new ReleaseMediaItem(R.drawable.fb_tjsc, true, list.size() == 0, view -> {
  131 + if (getView() != null) getView().showSelectPage();
  132 + }, wit));
  133 +
  134 + if (getView() != null && select.size() > 0) {
  135 + getView().initSelectList(isVideo, list);
  136 + getView().hasMedias(list.size());
  137 + }
  138 + }
  139 +
  140 + public void doUploadInfo(Context context, List<ReleaseMediaItem> list, String message, String address, boolean isVideo, ShareReleaseInfoUtil.ShareConfig shareConfig, int gotype, String gopath, String videotype, int multiplecategory, String tagname, String tagId, boolean auditing, String witContentId, String createtime, int source, String coordinate) {
  141 + //处理快速点击
  142 + if (onDoublePressed(false, 1500)) return;
  143 + if (UserInfoUtils.getNickName(context,"") == null)
  144 + return;
  145 +
  146 + String userId = UserInfoUtils.getUid(context,"");
  147 + String nickName = UserInfoUtils.getNickName(context,"");
  148 +
  149 +
  150 + if ("witness".equals(videotype)) {
  151 + if (auditing && !"".equals(witContentId)) {
  152 + UploadLogic.uploadVideoInfo(context, userId, nickName, message, address, "", uploadVideoEvent(context, ""), gopath, videotype, multiplecategory, tagname, tagId, false, auditing, witContentId, source, coordinate);
  153 + } else {
  154 + if (!isVideo) {
  155 + AlertUtil.showDeftToast(context, "该功能暂只支持视频发布,请重新添加视频.");
  156 + if (getView() != null) getView().setButClick();
  157 + } else {
  158 + if (!new File(list.get(0).getMedia().path).exists()) {
  159 + AlertUtil.showDeftToast(context, "文件已损坏 请重新选取.");
  160 + if (getView() != null) getView().setButClick();
  161 + } else {
  162 + String videoPath = list.get(0).getMedia().path;
  163 + boolean compressed = list.get(0).getMedia().compressed;
  164 + au = auditing;
  165 + witc = witContentId;
  166 + UploadLogic.uploadVideoInfo(context, userId, nickName, message, address, videoPath, uploadwitnessEvent(context, createtime == null ? "" : createtime), gopath, videotype, multiplecategory, tagname, tagId, compressed, auditing, witContentId, source, coordinate);
  167 + }
  168 + }
  169 + }
  170 + } else {
  171 + if (isVideo) { //发布视频信息
  172 + if (!new File(list.get(0).getMedia().path).exists() && !(list.get(0).getMedia().size > 0)) {
  173 + AlertUtil.showDeftToast(context, "文件已损坏 请重新选取.");
  174 + if (getView() != null) getView().setButClick();
  175 + } else {
  176 + String videoPath = list.get(0).getMedia().path;
  177 + boolean compressed = list.get(0).getMedia().compressed;
  178 + try {
  179 + MediaMetadataRetriever mmr = new MediaMetadataRetriever();
  180 + mmr.setDataSource(videoPath);
  181 + String duration = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
  182 + if (Integer.parseInt(duration) < 5000) {
  183 + AlertUtil.showFailedToast(context, "视频时长太短(小于5秒),请重新选择");
  184 + if (getView() != null) getView().setButClick();
  185 + } else {
  186 + getView().showUploadProView();
  187 + UploadLogic.uploadVideoInfo(context, userId, nickName, message, address, videoPath, uploadVideoEvent(context, ""), gopath, videotype, multiplecategory, tagname, tagId, compressed, auditing, witContentId, source, coordinate);
  188 + }
  189 + } catch (Exception e) {
  190 + AlertUtil.showDeftToast(context, "视频信息异常请重新选取");
  191 + if (getView() != null) getView().setButClick();
  192 + e.printStackTrace();
  193 + }
  194 + }
  195 + } else if (list.size() > 1) { //发布图文信息
  196 + ArrayList<String> imagePaths = new ArrayList<>();
  197 + ArrayList<Long> width = new ArrayList<>();
  198 + ArrayList<Long> height = new ArrayList<>();
  199 + BitmapFactory.Options options = new BitmapFactory.Options();
  200 + options.inJustDecodeBounds = true;
  201 + for (ReleaseMediaItem item : list)
  202 + if (item.getType() == type_select) {
  203 + } else if (item.getMedia() != null && new File(item.getMedia().path).exists()) {
  204 + Bitmap bitmap = BitmapFactory.decodeFile(item.getMedia().path, options); // 此时返回的bitmap为null
  205 + if (options.outWidth > 0 && options.outHeight > 0) {
  206 + width.add((long) options.outWidth);
  207 + height.add((long) options.outHeight);
  208 + imagePaths.add(item.getMedia().path);
  209 + } else {
  210 + AlertUtil.showDeftToast(context, "文件已损坏 请重新选取.");
  211 + if (getView() != null) getView().setButClick();
  212 + return;
  213 + }
  214 + } else {
  215 + AlertUtil.showDeftToast(context, "文件已损坏 请重新选取.");
  216 + if (getView() != null) getView().setButClick();
  217 + return;
  218 + }
  219 + UploadLogic.uploadPicInfo(context, userId, message, address, imagePaths, width, height, uploadEvent(context, ""), gopath, videotype);
  220 + // UploadLogic.uploadAddressPicInfo(context,imagePaths,uploadAddEvent(context));
  221 + } else { //发布文本信息
  222 + if (shareConfig == null && TextUtils.isEmpty(message)) {
  223 + AlertUtil.showDeftToast(context, "内容不能为空.");
  224 + if (getView() != null) getView().setButClick();
  225 + return;
  226 + }
  227 + if (shareConfig != null && shareConfig.getUrl() != null && shareConfig.getUrl().startsWith("http://wjjh5")) { //网家家内部向科链接
  228 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  229 + } else if (shareConfig != null && shareConfig.getUrl() != null && shareConfig.getUrl().contains(AppConfig.getShopPath())) { //电商链接
  230 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  231 + } else if (shareConfig != null && shareConfig.getUrl() != null && !shareConfig.getUrl().startsWith("http://wjjh5") && !"https://fir.im/d35h".equals(shareConfig.getUrl()) && !"中国网++ 让生活更美好!".equals(shareConfig.getTitle()) && !"中国网家家 让生活更美好!".equals(shareConfig.getTitle()) && !shareConfig.getUrl().startsWith("https://wjjshop")) { //外部浏览器分享链接
  232 + UploadLogic.uploadInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  233 + } else if (shareConfig != null && shareConfig.getUrl() != null && !shareConfig.getUrl().startsWith("http://wjjh5") && "https://fir.im/d35h".equals(shareConfig.getUrl()) && !shareConfig.getUrl().startsWith("https://wjjshop")) {
  234 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  235 + } else if (shareConfig != null && shareConfig.getUrl() != null && !shareConfig.getUrl().startsWith("http://wjjh5") && !"https://fir.im/d35h".equals(shareConfig.getUrl()) && "中国网++ 让生活更美好!".equals(shareConfig.getSubTitle()) && !"中国网家家 让生活更美好!".equals(shareConfig.getSubTitle()) && !shareConfig.getUrl().startsWith("https://wjjshop")) {
  236 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  237 + } else if (shareConfig != null && shareConfig.getUrl() != null && shareConfig.getUrl().contains("mp.weixin.qq.com")) {
  238 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, shareConfig, uploadEventNew(context), gopath, videotype);
  239 + } else { //纯文本
  240 + UploadLogic.uploadHomeInfo(context, userId, message, address, null, null, null, uploadEventNew(context), gopath, videotype);
  241 + }
  242 + }
  243 + }
  244 + }
  245 +
  246 + private Event<BaseInfo> uploadEventNew(Context context) {
  247 + return new Event<BaseInfo>()
  248 + .setStateCallback(state -> {
  249 + if (getView() == null) return;
  250 + if (state == STATE_LOAD) getView().showUploadView();
  251 + else if (state == STATE_IDLE) getView().hideUploadView();
  252 + })
  253 + .setFailureCallback((code, message) -> {
  254 + if (NetworkUtil.isConnectInternet(context)) {
  255 + AlertUtil.showDeftToast(context, message);
  256 + } else {
  257 + AlertUtil.showDeftToast(context, "网络连接失败");
  258 + }
  259 + if (getView() != null) getView().showResultPage(false);
  260 + })
  261 + .setProgressCallback(progress -> Log.e("Upload", "progress " + progress))
  262 + .setSuccessCallback(data -> {
  263 + SharedPreferences preferences = context.getSharedPreferences("publishmoment", MODE_PRIVATE);
  264 + boolean status = preferences.getBoolean(UserInfoUtils.getUid(context,""), false);
  265 + Boolean app_is_show_integral = SharedPreferencesHelper.getInstance(context).getBoolValue("APP_IS_SHOW_INTEGRAL");
  266 + if (!status && app_is_show_integral) {
  267 + CoinRainAction.code(context, UserInfoUtils.getUid(context,""), "publish_moment", "", "publishmoment", false);
  268 + }
  269 + File file = new File(getPath(context, "/strike/cache/") + "share.jpg");
  270 + if (file.exists()) {
  271 + file.delete();
  272 + }
  273 + AlertUtil.showDeftToast(context, "发布成功");
  274 + if (getView() != null) getView().showResultPage(true);
  275 + });
  276 + }
  277 +
  278 + private static String getPath(Context context, String cachePath) {
  279 + String path = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? context.getExternalFilesDir("") : Environment.getExternalStorageDirectory()) + cachePath;
  280 + File file = new File(path);
  281 + if (file.mkdirs()) {
  282 + return path;
  283 + }
  284 + return path;
  285 + }
  286 +
  287 +
  288 + private Event<BaseInfo> uploadEvent(Context context, String createtime) {
  289 + return new Event<BaseInfo>()
  290 + .setStateCallback(state -> {
  291 + if (getView() == null) return;
  292 + if (state == STATE_LOAD) getView().showUploadView();
  293 + else if (state == STATE_IDLE) getView().hideUploadView();
  294 + })
  295 + .setFailureCallback((code, message) -> {
  296 + if (NetworkUtil.isConnectInternet(context)) {
  297 + AlertUtil.showDeftToast(context, message);
  298 + } else {
  299 + AlertUtil.showDeftToast(context, "网络连接失败");
  300 + }
  301 + if (getView() != null) getView().showResultPage(false);
  302 + })
  303 + .setProgressCallback(progress -> Log.e("Upload", "progress " + progress))
  304 + .setSuccessCallback(data -> {
  305 + if (!"".equals(createtime)) {
  306 + //todo 数据库操作 DBWitnessDetailAPI.deleteWitnessItem(context, createtime);
  307 + }
  308 + SharedPreferences preferences = context.getSharedPreferences("publishmoment", MODE_PRIVATE);
  309 + boolean status = preferences.getBoolean(UserInfoUtils.getUid(context,""), false);
  310 + Boolean app_is_show_integral = SharedPreferencesHelper.getInstance(context).getBoolValue("APP_IS_SHOW_INTEGRAL");
  311 + if (!status && app_is_show_integral) {
  312 + CoinRainAction.code(context, UserInfoUtils.getUid(context,""), "publish_moment", "", "publishmoment", false);
  313 + }
  314 + AlertUtil.showDeftToast(context, "发布成功");
  315 + if (getView() != null) getView().showResultPage(true);
  316 + });
  317 + }
  318 +
  319 + private Event<BaseInfo> uploadVideoEvent(Context context, String createtime) {
  320 + return new Event<BaseInfo>()
  321 + .setStateCallback(state -> {
  322 + if (getView() == null) return;
  323 + //if (state == STATE_LOAD) getView().showUploadProView();
  324 + })
  325 + .setFailureCallback((code, message) -> {
  326 + if (NetworkUtil.isConnectInternet(context)) {
  327 + AlertUtil.showDeftToast(context, message);
  328 + } else {
  329 + AlertUtil.showDeftToast(context, "网络连接失败");
  330 + }
  331 + if (getView() != null) getView().showResultPage(false);
  332 + })
  333 + .setProgressCallback(progress -> {
  334 + if (getView() != null) getView().showProgressView(progress);
  335 + })
  336 + .setSuccessCallback(data -> {
  337 + if (!"".equals(createtime)) {
  338 + //todo 数据库操作 DBWitnessDetailAPI.deleteWitnessItem(context, createtime);
  339 + }
  340 + SharedPreferences preferences = context.getSharedPreferences("publishmoment", MODE_PRIVATE);
  341 + boolean status = preferences.getBoolean(UserInfoUtils.getUid(context,""), false);
  342 + Boolean app_is_show_integral = SharedPreferencesHelper.getInstance(context).getBoolValue("APP_IS_SHOW_INTEGRAL");
  343 + if (!status && app_is_show_integral) {
  344 + CoinRainAction.code(context, UserInfoUtils.getUid(context,""), "publish_moment", "", "publishmoment", false);
  345 + }
  346 + AlertUtil.showDeftToast(context, "发布成功");
  347 + if (getView() != null) getView().showResultPage(true);
  348 + });
  349 + }
  350 +
  351 + private Event<BaseInfo> uploadwitnessEvent(Context context, String createtime) {
  352 + return new Event<BaseInfo>()
  353 + .setStateCallback(state -> {
  354 + if (getView() == null) return;
  355 + if (state == STATE_LOAD) getView().showUploadProView();
  356 + })
  357 + .setFailureCallback((code, message) -> {
  358 + if (NetworkUtil.isConnectInternet(context)) {
  359 + AlertUtil.showDeftToast(context, message);
  360 + } else {
  361 + AlertUtil.showDeftToast(context, "网络连接失败");
  362 + }
  363 + if (getView() != null) getView().showResultPage(false);
  364 + })
  365 + .setProgressCallback(progress -> {
  366 + if (getView() != null) getView().showProgressView(progress);
  367 + })
  368 + .setSuccessCallback(data -> {
  369 + if (!"".equals(createtime)) {
  370 + //todo 数据库操作 DBWitnessDetailAPI.deleteWitnessItem(context, createtime);
  371 + }
  372 + SharedPreferences preferences = context.getSharedPreferences("publishwitness", MODE_PRIVATE);
  373 + boolean status = preferences.getBoolean(UserInfoUtils.getUid(context,""), false);
  374 + Boolean app_is_show_integral = SharedPreferencesHelper.getInstance(context).getBoolValue("APP_IS_SHOW_INTEGRAL");
  375 + if (!status && app_is_show_integral) {
  376 + CoinRainAction.code(context, UserInfoUtils.getUid(context,""), "publish_witness", "", "publishwitness", false);
  377 + }
  378 + //AlertUtil.showDeftToast(context, "发布成功");
  379 + if (getView() != null) getView().showResultPage(true);
  380 + });
  381 + }
  382 +
  383 + public void doSaveInfo(Context context, List<ReleaseMediaItem> adapterList, String message, String wit, int type, String videotype, String path, int multiplecategory, String texttag, List<CircleData.indextag> listtag) {
  384 + String sid = UserInfoUtils.getUid(context,"");
  385 + ArrayList<Media> list = new ArrayList<>();
  386 + for (ReleaseMediaItem item : adapterList)
  387 + if (item.getMedia() != null) list.add(item.getMedia());
  388 + String medias = new Gson().toJson(list);
  389 + String taglist = new Gson().toJson(listtag);
  390 +
  391 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_MESSAGE_" + sid, message);
  392 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_IMAGES_" + sid, medias);
  393 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_WIT_" + sid, wit);
  394 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_TYPE_" + sid, type);
  395 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_VideoType_" + sid, videotype);
  396 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_Path_" + sid, path);
  397 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_Multiplecategory_" + sid, multiplecategory);
  398 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_TEXTTAG_" + sid, texttag);
  399 + SharedPreferencesHelper.getInstance(context).setValue("SAVE_RELEASE_INFO_LISTTAG_" + sid, taglist);
  400 + }
  401 +
  402 +
  403 + public void saveDatabase(Context context, List<ReleaseMediaItem> adapterList, String title, String wit, int type, String videotype, String gopath, int multiplecategory, String tag, List<CircleData.indextag> listtag, String pageDataTitle, int source, String labelcolor, int address) {
  404 + if (adapterList == null && title == null) return;
  405 + String sd =UserInfoUtils.getUid(context,"");
  406 + String id = String.valueOf(adapterList.get(0).getMedia().id);
  407 + String path = adapterList.get(0).getMedia().path;
  408 + String fileUri = adapterList.get(0).getMedia().fileUri;
  409 + String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH).format(new Date()); //创建此次草稿时间
  410 + String time = String.valueOf(adapterList.get(0).getMedia().duration);//视频市场
  411 + if (Integer.parseInt(time) < 5000) {
  412 + AlertUtil.showFailedToast(context, "视频时长太短(小于5秒),请重新选择");
  413 + } else {
  414 + try {
  415 + String taglist = new Gson().toJson(listtag);
  416 + Logic.process(() -> {
  417 + Witness dbData = initDBDetail(sd, id, path, title, wit, type, videotype, gopath, multiplecategory, tag, timeStamp, time, "", taglist, pageDataTitle, source, labelcolor, address, fileUri);
  418 + // DBWitnessDetailAPI.removeData(context,id );
  419 + //todo 数据库操作 DBWitnessDetailAPI.insertData(context, dbData);
  420 + return 0;
  421 + }, null);
  422 + AlertUtil.showDeftToast(context, "已成功保存至草稿箱");
  423 + } catch (Exception e) {
  424 + AlertUtil.showDeftToast(context, "找不到指定路径文件");
  425 + e.printStackTrace();
  426 + }
  427 + }
  428 + }
  429 +
  430 + public void updataDatabase(Context context, List<ReleaseMediaItem> adapterList, String title, String wit, int type, String videotype, String gopath, int multiplecategory, String tag, String createtime, List<CircleData.indextag> listtag, String pageDataTitle, int source, String labelcolor, int address) {
  431 + if (adapterList == null || title == null || adapterList.get(0) == null || adapterList.get(0).getMedia() == null || adapterList.get(0).getMedia().path == null)
  432 + return;
  433 + String sd =UserInfoUtils.getUid(context,"");
  434 + String id = String.valueOf(adapterList.get(0).getMedia().id);
  435 + String path = adapterList.get(0).getMedia().path;
  436 + String fileUri = adapterList.get(0).getMedia().fileUri;
  437 + String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH).format(new Date()); //创建此次草稿时间
  438 + try {
  439 + MediaMetadataRetriever mmr = new MediaMetadataRetriever();
  440 + mmr.setDataSource(path);
  441 + String time = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
  442 + String taglist = new Gson().toJson(listtag);
  443 + Logic.process(() -> {
  444 + Witness dbData = initDBDetail(sd, id, path, title, wit, type, videotype, gopath, multiplecategory, tag, timeStamp, time, "", taglist, pageDataTitle, source, labelcolor, address, fileUri);
  445 + //todo 数据库操作 DBWitnessDetailAPI.update(context, createtime, dbData);
  446 + return 0;
  447 + }, null);
  448 + } catch (Exception e) {
  449 + AlertUtil.showDeftToast(context, "找不到指定路径文件");
  450 + e.printStackTrace();
  451 + }
  452 + }
  453 +
  454 + public Witness initDBDetail(String sid, String id, String path, String title, String wit, int type, String videotype, String gopath, int multiplecategory, String tag, String timeStamp, String dutation, String src, String taglist, String pageDataTitle, int source, String labelcolor, int address, String fileUri) {
  455 + Witness dbData = new Witness();
  456 + dbData.setId(id);
  457 + dbData.setSid(sid);
  458 + dbData.setMedias(path);
  459 + dbData.setTitle(title);
  460 + dbData.setWit(wit);
  461 + dbData.setType(type);
  462 + dbData.setVideotype(videotype);
  463 + dbData.setGopath(gopath);
  464 + dbData.setMultiplecategory(multiplecategory);
  465 + dbData.setTag(tag);
  466 + dbData.setTimeStamp(timeStamp);
  467 + dbData.setDutation(dutation);
  468 + dbData.setSrc(src);
  469 + dbData.setTaglist(taglist);
  470 + dbData.setPageDataTitle(pageDataTitle);
  471 + dbData.setSource(source);
  472 + dbData.setLabelcolor(labelcolor);
  473 + dbData.setDetailAddress(address);
  474 + dbData.setFileUri(fileUri);
  475 + return dbData;
  476 + }
  477 +
  478 +
  479 + public void doLoadInfo(Context context) {
  480 + String sid = UserInfoUtils.getUid(context,"");
  481 + String message = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_MESSAGE_" + sid);
  482 + String medias = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_IMAGES_" + sid);
  483 + String wit = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_WIT_" + sid);
  484 + String videotype = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_VideoType_" + sid);
  485 + String path = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_Path_" + sid);
  486 + int type = SharedPreferencesHelper.getInstance(context).getIntValue("SAVE_RELEASE_INFO_TYPE_" + sid);
  487 + int multiplecategory = SharedPreferencesHelper.getInstance(context).getIntValue("SAVE_RELEASE_INFO_Multiplecategory_" + sid);
  488 + String texttag = SharedPreferencesHelper.getInstance(context).getValue("SAVE_RELEASE_INFO_TEXTTAG_" + sid);
  489 + Media[] mediaArray = new Gson().fromJson(medias, Media[].class);
  490 + initPageData(context, message, "生活圈", 2, "moment", "Daren/moment/releaseMoment.action", AppConfig.isDebug() ? 371 : 366, mediaArray == null ? null : Arrays.asList(mediaArray), "", "", 0, "", new ArrayList<CircleData.indextag>(), "",
  491 + "生活圈", "编辑想说的内容...", 0, "363637", 0, "", "", "");
  492 + if (getView() != null) {
  493 + getView().hasDes(message);
  494 + getView().hasMedias(mediaArray == null ? 0 : mediaArray.length);
  495 + }
  496 + }
  497 +
  498 + public void WitnessLoadInfo(Context context, String text, String img, String tag, int iswitinfo, String witContentId, String videopath, String duration, String taglist, String jumpType, String json, String fileUri) {
  499 + if (videopath.length() > 1 && !"".equals(json) && json != null && !"undefined".equals(json)) {
  500 + CircleData.ReleaseVideoTypeListBean jsontext = new Gson().fromJson(json, CircleData.ReleaseVideoTypeListBean.class);
  501 + File file = new File(videopath);
  502 + List<Media> medias = new ArrayList<>();
  503 + Media media = new Media(file.getPath(), file.getName(), 6, 3, file.length(), 0, "", 6, fileUri);
  504 + medias.add(media);
  505 + CircleData.indextag[] tagArray = new Gson().fromJson(taglist, CircleData.indextag[].class);
  506 + if (tagArray != null) {
  507 + List<CircleData.indextag> indextags = Arrays.asList(tagArray);
  508 + initPageData(context, text, jsontext.getTitle(), 2, "witness", "Daren/witness/releaseWitness.action", AppConfig.isDebug() ? 375 : 370, medias, "", tag, iswitinfo, "", indextags, jumpType,
  509 + jsontext.getTitle(), jsontext.getDefaultText(), jsontext.getDetailAddress(), jsontext.getLabelColor(), jsontext.getSource(), jsontext.getBottomSrc(), "", jsontext.getSuccessJumpType());
  510 + } else {
  511 + List<CircleData.indextag> indextags = new ArrayList<CircleData.indextag>();
  512 + initPageData(context, text, "目击者", 2, "witness", "Daren/witness/releaseWitness.action", AppConfig.isDebug() ? 375 : 370, medias, "", tag, iswitinfo, "", indextags, jumpType,
  513 + jsontext.getTitle(), jsontext.getDefaultText(), jsontext.getDetailAddress(), jsontext.getLabelColor(), jsontext.getSource(), jsontext.getBottomSrc(), "", jsontext.getSuccessJumpType());
  514 + }
  515 +
  516 + } else if ("html".equals(jumpType) && !"".equals(json) && json != null && !"undefined".equals(json)) {
  517 + SharedPreferences.Editor editor = context.getSharedPreferences("tagVideo", Context.MODE_PRIVATE).edit();
  518 + editor.putString("videoTagList", json);
  519 + editor.apply();
  520 + CircleData.ReleaseVideoTypeListBean jsontext = new Gson().fromJson(json, CircleData.ReleaseVideoTypeListBean.class);
  521 + initPageData(context, text, jsontext.getText(), 2, jsontext.getVideoType(), jsontext.getChangePath(), jsontext.getMultiplecategory(), null, "", tag, iswitinfo, "", jsontext.getCategoryTag(), jumpType,
  522 + jsontext.getTitle(), jsontext.getDefaultText(), jsontext.getDetailAddress(), jsontext.getLabelColor(), jsontext.getSource(), jsontext.getBottomSrc(), jsontext.getFixedTitle(), jsontext.getSuccessJumpType());
  523 + } else if ("myself".equals(jumpType) && !"".equals(json) && json != null && !"undefined".equals(json)) {
  524 + SharedPreferences.Editor editor = context.getSharedPreferences("tagVideo", Context.MODE_PRIVATE).edit();
  525 + editor.putString("videoTagList", json);
  526 + editor.apply();
  527 + CircleData.ReleaseVideoTypeListBean jsontext = new Gson().fromJson(json, CircleData.ReleaseVideoTypeListBean.class);
  528 + initPageData(context, text, jsontext.getText(), 2, jsontext.getVideoType(), jsontext.getChangePath(), jsontext.getMultiplecategory(), null, "", tag, iswitinfo, "", jsontext.getCategoryTag(), jumpType,
  529 + jsontext.getTitle(), jsontext.getDefaultText(), jsontext.getDetailAddress(), jsontext.getLabelColor(), jsontext.getSource(), jsontext.getBottomSrc(), "", jsontext.getSuccessJumpType());
  530 + } else if ("WitnessInfo".equals(jumpType)) {
  531 + SharedPreferences preferences = context.getSharedPreferences("tagVideo", MODE_PRIVATE);
  532 + String videoTagList = preferences.getString("videoTagList", "");
  533 + CircleData.ReleaseVideoTypeListBean jsontext = new Gson().fromJson(videoTagList, CircleData.ReleaseVideoTypeListBean.class);
  534 + if (jsontext != null) {
  535 + initPageData(context, text, jsontext.getText(), 2, jsontext.getVideoType(), jsontext.getChangePath(), jsontext.getMultiplecategory(), null, "", tag, iswitinfo, "", jsontext.getCategoryTag(), jumpType,
  536 + jsontext.getTitle(), jsontext.getDefaultText(), jsontext.getDetailAddress(), jsontext.getLabelColor(), jsontext.getSource(), jsontext.getBottomSrc(), "", jsontext.getSuccessJumpType());
  537 + } else {
  538 +
  539 + List<CircleData.indextag> indextags = new ArrayList<>();
  540 + if (tag.length() > 1) {
  541 + CircleData.indextag indextag = new CircleData.indextag();
  542 + indextag.setTagId("110");
  543 + indextag.setTagName(tag);
  544 + indextags.add(indextag);
  545 + }
  546 + initPageData(context, text, "目击者", 2, "witness", "Daren/witness/releaseWitness.action", AppConfig.isDebug() ? 375 : 370, null, "", tag, iswitinfo, "", indextags, jumpType,
  547 + "目击者",
  548 + "我在现场,我要说...", 0, "666666", 0, "", "", "");
  549 + }
  550 + } else {
  551 + List<CircleData.indextag> indextags = new ArrayList<>();
  552 + if (tag.length() > 1) {
  553 + CircleData.indextag indextag = new CircleData.indextag();
  554 + indextag.setTagId("110");
  555 + indextag.setTagName(tag);
  556 + indextags.add(indextag);
  557 + }
  558 + initPageData(context, text, "目击者", 2, "witness", "Daren/witness/releaseWitness.action", AppConfig.isDebug() ? 375 : 370, null, img, tag, iswitinfo, witContentId, indextags, jumpType, "目击者",
  559 + "我在现场,我要说...", 0, "666666", 0, "", "", "");
  560 + }
  561 +
  562 +
  563 + if (getView() != null) {
  564 + getView().hasDes(text);
  565 + getView().hasMedias(1);
  566 + }
  567 + }
  568 +
  569 + public void comeevent(Context context, String message, String wit, int type, String videotype, String path, int multiplecategory, List<Media> medias, String img, String tag, int iswitinfo, String witContentId, List<CircleData.indextag> indextags, String jumptype) {
  570 + List<ReleaseMediaItem> list = new ArrayList<>();
  571 + String title = "目击者".equals(wit) ? "目击者" : "生活圈";
  572 + String defaultText = "目击者".equals(wit) ? "我在现场,我要说……(字数不超过140个字)" : "编辑想说的内容...";
  573 + int source = 0;
  574 + boolean isVideo = false;
  575 + if (medias != null) for (Media media : medias) {
  576 + //同步系统相册数据
  577 + Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
  578 + Uri uri = Uri.fromFile(new File(media.path));
  579 + intent.setData(uri);
  580 + context.sendBroadcast(intent);
  581 + //媒体类型转换
  582 + ReleaseMediaItem item = (isVideo = media.mediaType == 3) ?
  583 + ReleaseMediaItem.newLocalVideo(R.drawable.bg_image_loading, media.path, media.path, null) :
  584 + ReleaseMediaItem.newLocalImage(R.drawable.bg_image_loading, media.path, null);
  585 + item.setMedia(media);
  586 + list.add(item);
  587 + item.setListener(v -> {
  588 + if (getView() != null) getView().itemClick(v, item);
  589 + });
  590 + }
  591 + if (list.size() < 9 && !isVideo)
  592 + list.add(new ReleaseMediaItem("生活圈".equals(title) ? R.drawable.fb_tjsc : R.drawable.fb_tjsp, true, list.size() == 0, view -> {
  593 + if (getView() != null) getView().showSelectPage();
  594 + }, wit));
  595 +
  596 + if (getView() != null)
  597 + getView().initPageView(title, message, wit, type, videotype, path, multiplecategory, isVideo, list, img, tag, iswitinfo, witContentId, indextags, jumptype,
  598 + defaultText, 0, "363637", source, "", "");
  599 +
  600 + }
  601 +
  602 + public void doDeleteInfo(Context context) {
  603 + if (context == null) return;
  604 + String sid = UserInfoUtils.getUid(context,"");
  605 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_MESSAGE_" + sid);
  606 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_IMAGES_" + sid);
  607 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_WIT_" + sid);
  608 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_TYPE_" + sid);
  609 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_VideoType_" + sid);
  610 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_Path_" + sid);
  611 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_Multiplecategory_" + sid);
  612 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_TEXTTAG_" + sid);
  613 + SharedPreferencesHelper.getInstance(context).remove("SAVE_RELEASE_INFO_LISTTAG_" + sid);
  614 + }
  615 +
  616 +}
... ...
publish/src/main/java/com/cnlive/publish/frame/view/MyScrollView.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/frame/view/MyScrollView.java
  1 +package com.cnlive.publish.frame.view;
  2 +
  3 +import android.content.Context;
  4 +import android.graphics.Rect;
  5 +import android.util.AttributeSet;
  6 +import android.widget.ScrollView;
  7 +
  8 +/**
  9 + * Author by Yuansiwen.com, Date on 2018/9/6.
  10 + * 因发布页面“一加”手机弹出软键盘时候scrollview上移;
  11 + */
  12 +public class MyScrollView extends ScrollView {
  13 + public MyScrollView(Context context) {
  14 + super(context);
  15 + }
  16 +
  17 + public MyScrollView(Context context, AttributeSet attrs) {
  18 + super(context, attrs);
  19 + }
  20 +
  21 + public MyScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
  22 + super(context, attrs, defStyleAttr);
  23 + }
  24 +
  25 + @Override
  26 + protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) {
  27 +
  28 + return 0;
  29 + }
  30 +
  31 +
  32 +}
... ...
publish/src/main/java/com/cnlive/publish/frame/view/ReleaseInfoEditView.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/frame/view/ReleaseInfoEditView.java
  1 +package com.cnlive.publish.frame.view;
  2 +
  3 +import android.Manifest;
  4 +import android.app.Activity;
  5 +import android.app.Dialog;
  6 +import android.content.Context;
  7 +import android.os.Build;
  8 +import android.os.Environment;
  9 +import android.text.TextUtils;
  10 +import android.view.View;
  11 +import android.widget.TextView;
  12 +
  13 +import com.cnlive.libs.base.application.AppConfig;
  14 +import com.cnlive.libs.base.frame.adapter.DataBindingRecyclerAdapter;
  15 +import com.cnlive.libs.base.util.AlertUtil;
  16 +import com.cnlive.libs.base.util.DoublePressed;
  17 +import com.cnlive.libs.base.util.ShareReleaseInfoUtil;
  18 +import com.cnlive.libs.base.util.SharedPreferencesHelper;
  19 +import com.cnlive.libs.base.util.StringUtils;
  20 +import com.cnlive.media.ImagePicker;
  21 +import com.cnlive.media.PickerConfig;
  22 +import com.cnlive.media.media.entity.Media;
  23 +import com.cnlive.media.model.CircleData;
  24 +import com.cnlive.media.utils.AlertDialogUtils;
  25 +import com.cnlive.media.utils.AndroidQUtil;
  26 +import com.cnlive.media.utils.PermissionChecker;
  27 +
  28 +import com.cnlive.publish.R;
  29 +import com.cnlive.publish.fragment.ReleaseInfoEditFragment;
  30 +import com.cnlive.publish.moudle.CircleMsgData;
  31 +import com.cnlive.publish.moudle.ReleaseMediaItem;
  32 +import com.cnlive.publish.moudle.ReleaseMediaPage;
  33 +import com.cnlive.publish.util.AppUtil;
  34 +import com.cnlive.publish.widget.Constant;
  35 +import com.cnlive.strike.ui.widget.BottomSheet;
  36 +import com.google.gson.Gson;
  37 +import com.google.gson.reflect.TypeToken;
  38 +import com.hannesdorfmann.mosby3.mvp.MvpView;
  39 +
  40 +import java.util.ArrayList;
  41 +import java.util.List;
  42 +
  43 +import static com.cnlive.media.PickerConfig.CAMERA_MODE_ALL;
  44 +import static com.cnlive.media.PickerConfig.CAMERA_MODE_PIC;
  45 +import static com.cnlive.media.PickerConfig.CAMERA_MODE_VIDEO;
  46 +import static com.cnlive.publish.activity.ReleasePublishAcityity.REQUEST_CODE_SELECT_CAMERA;
  47 +import static com.cnlive.publish.activity.ReleasePublishAcityity.REQUEST_CODE_SELECT_READ_WRITE;
  48 +import static com.cnlive.publish.moudle.ReleaseMediaItem.type_local_image;
  49 +import static com.cnlive.publish.moudle.ReleaseMediaItem.type_local_video;
  50 +import static com.cnlive.publish.moudle.ReleaseMediaItem.type_net_image;
  51 +import static com.cnlive.publish.moudle.ReleaseMediaItem.type_net_video;
  52 +
  53 +
  54 +/**
  55 + * Created by xiansong on 2018/1/31.
  56 + */
  57 +
  58 +public class ReleaseInfoEditView implements MvpView {
  59 +
  60 + private ReleaseInfoEditFragment fragment;
  61 + private boolean hasHTML;
  62 + private boolean hasDes;
  63 + private boolean hasMedias;
  64 + private boolean releaseBtnClickable;
  65 + public BottomSheet bottomSheet6;
  66 + public BottomSheet bottomSheet7;
  67 +
  68 + public ReleaseInfoEditView(ReleaseInfoEditFragment fragment) {
  69 + this.fragment = fragment;
  70 + }
  71 +
  72 + private Activity getContext() {
  73 + return fragment == null ? null : fragment.getActivity();
  74 + }
  75 +
  76 + public void initSelectList(boolean isVideo, List<ReleaseMediaItem> list) {
  77 + if (getContext() == null) return;
  78 + fragment.pageData.setVideo(isVideo);
  79 + if (3 == list.get(0).getMedia().mediaType && list.size() > 1) {
  80 + List<ReleaseMediaItem> releaseMediaItems = list.subList(0, 1);
  81 + fragment.pageData.getAdapter().updateItems(releaseMediaItems);
  82 + } else {
  83 + fragment.pageData.getAdapter().updateItems(list);
  84 + }
  85 + }
  86 +
  87 + private ArrayList<Media> getMediaList() {
  88 + List<ReleaseMediaItem> list = fragment.pageData.getAdapter().getList();
  89 + ArrayList<Media> medias = new ArrayList<>();
  90 + for (ReleaseMediaItem item : list) if (item.getMedia() != null) medias.add(item.getMedia());
  91 + return medias;
  92 + }
  93 +
  94 + //根据已选媒体类型,开启相册视图
  95 + public void showSelectPage() {
  96 + if (DoublePressed.onDoublePressed()) return;
  97 + if (getContext() == null) return;
  98 + List<ReleaseMediaItem> list = fragment.pageData.getAdapter().getList();
  99 + fragment.bottomSheet.show();
  100 + }
  101 +
  102 + private static String[] showAlbumPermissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
  103 +
  104 + //相册选取
  105 + public void showAlbum(boolean checkOnly) {
  106 + if (getContext() == null) return;
  107 + List<ReleaseMediaItem> list = fragment.pageData.getAdapter().getList();
  108 +
  109 + boolean hasPermission = checkOnly ?
  110 + AppUtil.checkPermissions(fragment.getActivity(), showAlbumPermissions) :
  111 + PermissionChecker.checkPermissions(fragment.getActivity()
  112 + , showAlbumPermissions
  113 + , REQUEST_CODE_SELECT_READ_WRITE, R.string.READ_EXTERNAL_STORAGE);
  114 + if (hasPermission) {
  115 + if ("生活圈".equals(fragment.pageData.getTitle())) {
  116 + new ImagePicker.Builder()
  117 + .needCamera(false)
  118 + .maxNum(fragment.pageData.isVideo() ? 1 : 9)
  119 + .setSelectGif(true)
  120 + .maxVideoSize(200 * 1024 * 1024)
  121 + .maxImageSize(Constant.IMAGE_MAX_SIZE)
  122 + .isReturnUri(AndroidQUtil.isAndroidQ())
  123 + .isSinglePick(fragment.pageData.isVideo())
  124 + .showTime(true)
  125 + .maxTime(Constant.VIDEO_MAX_TIME)
  126 + .selectMode(list.size() > 1 ? PickerConfig.PICKER_IMAGE : PickerConfig.PICKER_ONLY_ONE_TYPE)
  127 + .cachePath((Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? getContext().getExternalFilesDir("") : Environment.getExternalStorageDirectory()) + "/strike/file/")
  128 + .defaultSelectList(getMediaList())
  129 + .isFriendCircle(true)
  130 + .builder()
  131 + //跳转到图片选择页面 activity 请求码 结果码
  132 + .start(fragment.getActivity(), 200, PickerConfig.DEFAULT_RESULT_CODE);
  133 + } else {
  134 + new ImagePicker.Builder()
  135 + .needCamera(false)
  136 + .maxNum(1)
  137 + .setSelectGif(true)
  138 + .maxVideoSize(500 * 1024 * 1024)
  139 + .maxImageSize(Constant.IMAGE_MAX_SIZE)
  140 + .isReturnUri(AndroidQUtil.isAndroidQ())
  141 + .showTime(true)
  142 + .isSinglePick(true)
  143 + .maxTime(Constant.VIDEO_MAX_TIME)
  144 + .selectMode(PickerConfig.PICKER_VIDEO)
  145 + .cachePath((Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? getContext().getExternalFilesDir("") : Environment.getExternalStorageDirectory()) + "/strike/file/")
  146 + .defaultSelectList(getMediaList())
  147 + .isFriendCircle(true)
  148 + .builder()
  149 + //跳转到图片选择页面 activity 请求码 结果码
  150 + .start(fragment.getActivity(), 200, PickerConfig.DEFAULT_RESULT_CODE);
  151 + }
  152 + }
  153 + }
  154 +
  155 + private static String[] showShootPermissions = new String[]{Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE};
  156 +
  157 + //拍摄页面
  158 + public void showShoot(boolean checkOnly) {
  159 + if (getContext() == null) return;
  160 + if (AppConfig.isIsTrtcTalking()) {
  161 + AlertUtil.showDeftToast(getContext(), getContext().getString(R.string.user_trtc_talking));
  162 + return;
  163 + }
  164 +
  165 + boolean hasPermission = checkOnly ?
  166 + AppUtil.checkPermissions(fragment.getActivity(), showShootPermissions) :
  167 + PermissionChecker.checkPermissions(fragment.getActivity()
  168 + , showShootPermissions
  169 + , REQUEST_CODE_SELECT_CAMERA, R.string.dialog_imagepicker_permission_camera_message);
  170 + if (hasPermission) {
  171 + new ImagePicker
  172 + .Builder()
  173 + .setJumpCameraMode(getMediaList().size() > 0 ? CAMERA_MODE_PIC : "生活圈".equals(fragment.pageData.getTitle()) ? CAMERA_MODE_ALL : CAMERA_MODE_VIDEO) // 1 图片 3 视频
  174 + .builder()
  175 + .startCamera(fragment.getActivity(), getMediaList(), 200, PickerConfig.DEFAULT_RESULT_CODE);
  176 + }
  177 + }
  178 +
  179 + public void showUploadView() {
  180 + fragment.tipDialog.show();
  181 + }
  182 +
  183 + public void showCopyView() {
  184 + fragment.copyDialog.show();
  185 + }
  186 +
  187 + public void setButClick() {
  188 + fragment.buttonRRight.setClickable(true);
  189 + }
  190 +
  191 + public void showUploadProView() {
  192 + fragment.showPro(0);
  193 + }
  194 +
  195 + public void hideUploadView() {
  196 + fragment.tipDialog.dismiss();
  197 + }
  198 +
  199 + public void hideCopyView() {
  200 + fragment.copyDialog.dismiss();
  201 + }
  202 +
  203 + public void showProgressView(double progress) {
  204 + fragment.showPro(progress);
  205 + }
  206 +
  207 + public void backMain() {
  208 + if (getContext() == null) return;
  209 + ((Activity) getContext()).finish();
  210 + }
  211 +
  212 + public void showResultPage(boolean isSuccess) {
  213 + if (fragment.pageData.getShareConfig() == null)
  214 + fragment.getPresenter().doDeleteInfo(getContext());
  215 + fragment.showReleaseResult(isSuccess, fragment.pageData.getShareConfig() == null,
  216 + fragment.pageData.getShareConfig() == null ? "" : fragment.pageData.getShareConfig().getUrl() == null ? "" : fragment.pageData.getShareConfig().getUrl());
  217 +
  218 + }
  219 +
  220 + public void itemClick(View view, ReleaseMediaItem item) {
  221 + if (view.getId() == R.id.workBenchView && item.getIconVisibility() != 0) {
  222 + showSelectPage();
  223 + }
  224 + if (view.getId() == R.id.workBenchView && item.getIconVisibility() == 0) {
  225 + DataBindingRecyclerAdapter adapter = fragment.pageData.getAdapter();
  226 + new ImagePicker.Builder()
  227 + .builder()
  228 + .startPreview(fragment.getActivity(), adapter.getList().indexOf(item), getMediaList(), 200, PickerConfig.DEFAULT_RESULT_CODE);
  229 + }
  230 + if (view.getId() == R.id.item_delete) {
  231 + showRemoveItemDialog(item);
  232 + }
  233 + }
  234 +
  235 + public void showRemoveItemDialog(ReleaseMediaItem item) {
  236 + if (fragment.deleteImageDialog != null) fragment.deleteImageDialog.dismiss();
  237 +
  238 + fragment.deleteImageDialog = AlertDialogUtils.showTwoButtonDialog(getContext(), "取消", "删除", deleteItemTag(item), R.color.color_dialog_btn, R.color.color_ffa300,
  239 + new AlertDialogUtils.DialogTwoListener() {
  240 + @Override
  241 + public void onClickLeft(Dialog dialog) {
  242 + dialog.dismiss();
  243 + }
  244 +
  245 + @Override
  246 + public void onClickRight(Dialog dialog) {
  247 + removeItem(item);
  248 + dialog.dismiss();
  249 + }
  250 + });
  251 + }
  252 +
  253 + public String deleteItemTag(ReleaseMediaItem item) {
  254 + String message = "确认删除此项吗";
  255 + switch (item.getType()) {
  256 + case type_net_image:
  257 + case type_local_image:
  258 + message = "确认删除图片吗?";
  259 + break;
  260 + case type_net_video:
  261 + case type_local_video:
  262 + message = "确认删除视频吗?";
  263 + break;
  264 + }
  265 + return message;
  266 + }
  267 +
  268 + public void removeItem(ReleaseMediaItem item) {
  269 + DataBindingRecyclerAdapter adapter = fragment.pageData.getAdapter();
  270 + adapter.removeItem(adapter.getList().indexOf(item));
  271 + if (adapter.getItemCount() == 0) {
  272 + adapter.addItem(new ReleaseMediaItem("生活圈".equals(fragment.pageData.getTitle()) ? R.drawable.fb_tjsc : ((!StringUtils.isEmpty(fragment.pageData.getBottomSrc()) ? R.drawable.circle_photo : R.drawable.fb_tjsp)), true, true, view -> showSelectPage(), fragment.pageData.getWit()));
  273 + fragment.pageData.setVideo(false);
  274 + } else if (adapter.getItemCount() == 1 && ((ReleaseMediaItem) adapter.getItem(0)).getType() == ReleaseMediaItem.type_select) {
  275 + ((ReleaseMediaItem) adapter.getItem(0)).setIconRes("生活圈".equals(fragment.pageData.getTitle()) ? R.drawable.fb_tjsc : ((!StringUtils.isEmpty(fragment.pageData.getBottomSrc()) ? R.drawable.circle_photo : R.drawable.fb_tjsp)));
  276 + ((ReleaseMediaItem) adapter.getItem(0)).setNullvisiable(View.VISIBLE);
  277 + ((ReleaseMediaItem) adapter.getItem(0)).setAddvisiable(View.GONE);
  278 + fragment.pageData.setVideo(false);
  279 + } else if (((ReleaseMediaItem) adapter.getItem(adapter.getItemCount() - 1)).getType() != ReleaseMediaItem.type_select) {
  280 + adapter.addItem(new ReleaseMediaItem("生活圈".equals(fragment.pageData.getTitle()) ? R.drawable.fb_tjsc : ((!StringUtils.isEmpty(fragment.pageData.getBottomSrc()) ? R.drawable.circle_photo : R.drawable.fb_tjsp)), true, adapter.getItemCount() == 0, view -> showSelectPage(), fragment.pageData.getWit()));
  281 + }
  282 +
  283 + hasMedias(adapter.getList().size() - 1);
  284 + }
  285 +
  286 + public void showBack() {
  287 + Activity activity = getContext();
  288 + if (activity == null || activity.isDestroyed()) return;
  289 + fragment.getPresenter().doDeleteInfo(activity);
  290 + fragment.bottomSheet1.dismiss();
  291 + activity.finish();
  292 + }
  293 +
  294 + public void showdis() {
  295 + fragment.bottomSheet1.dismiss();
  296 + }
  297 +
  298 + public void showsave() {
  299 + if ("目击者".equals(fragment.pageData.getWit())) {
  300 + if (fragment.pageData.isVideo()) {
  301 + /*fragment.getPresenter().saveDatabase(getContext(),fragment.pageData.getAdapter().getList(),
  302 + fragment.pageData.getMessage(),fragment.pageData.getWit(),
  303 + fragment.pageData.getType(),fragment.pageData.getVideotype(),
  304 + fragment.pageData.getGopath(),fragment.pageData.getMultiplecategory(),
  305 + fragment.pageData.getTagtext()
  306 + );*/
  307 + fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  308 + getContext().finish();
  309 + fragment.bottomSheet3.dismiss();
  310 + } else {
  311 + AlertUtil.showDeftToast(getContext(), "该功能暂只支持视频类型保存,请重新添加视频.");
  312 + }
  313 + } else {
  314 + fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  315 + getContext().finish();
  316 + fragment.bottomSheet2.dismiss();
  317 + }
  318 +
  319 + }
  320 +
  321 + /**
  322 + * 发布编辑页面选择目击者模式保存操作
  323 + */
  324 + public void showsavenow(int type, String createtime) {
  325 + if (!"生活圈".equals(fragment.pageData.getTitle())) {
  326 + if (fragment.pageData.isVideo()) {
  327 + if (type == 2 && createtime.length() > 1) {
  328 + fragment.getPresenter().updataDatabase(getContext(), fragment.pageData.getAdapter().getList(),
  329 + fragment.pageData.getMessage(), fragment.pageData.getWit(),
  330 + fragment.pageData.getType(), fragment.pageData.getVideotype(),
  331 + fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(),
  332 + fragment.pageData.getTagtext(), createtime, fragment.pageData.getCategoryTag(),
  333 + fragment.pageData.getTitle(), fragment.pageData.getSource(),
  334 + fragment.pageData.getLabelcolor(), fragment.pageData.getDetailaddress()
  335 + );
  336 + } else {
  337 + fragment.getPresenter().saveDatabase(getContext(), fragment.pageData.getAdapter().getList(),
  338 + fragment.pageData.getMessage(), fragment.pageData.getWit(),
  339 + fragment.pageData.getType(), fragment.pageData.getVideotype(),
  340 + fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(),
  341 + fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag(),
  342 + fragment.pageData.getTitle(), fragment.pageData.getSource(),
  343 + fragment.pageData.getLabelcolor(), fragment.pageData.getDetailaddress()
  344 + );
  345 + }
  346 + // fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  347 + getContext().finish();
  348 + fragment.bottomSheet3.dismiss();
  349 + } else {
  350 + AlertUtil.showDeftToast(getContext(), "该功能暂只支持视频类型保存,请重新添加视频.");
  351 + }
  352 + } else {
  353 + // fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  354 + getContext().finish();
  355 + fragment.bottomSheet3.dismiss();
  356 + }
  357 +
  358 + }
  359 +
  360 + /**
  361 + * 草稿箱进入编辑页面单纯保存至数据库
  362 + */
  363 +
  364 + public void showsavedraft(int type, String createtime) {
  365 + if (!"生活圈".equals(fragment.pageData.getTitle())) {
  366 + if (fragment.pageData.isVideo()) {
  367 + if (type == 2 && createtime.length() > 1) {
  368 + fragment.getPresenter().updataDatabase(getContext(), fragment.pageData.getAdapter().getList(),
  369 + fragment.pageData.getMessage(), fragment.pageData.getWit(),
  370 + fragment.pageData.getType(), fragment.pageData.getVideotype(),
  371 + fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(),
  372 + fragment.pageData.getTagtext(), createtime, fragment.pageData.getCategoryTag(),
  373 + fragment.pageData.getTitle(), fragment.pageData.getSource(),
  374 + fragment.pageData.getLabelcolor(), fragment.pageData.getDetailaddress()
  375 + );
  376 + } else {
  377 + fragment.getPresenter().saveDatabase(getContext(), fragment.pageData.getAdapter().getList(),
  378 + fragment.pageData.getMessage(), fragment.pageData.getWit(),
  379 + fragment.pageData.getType(), fragment.pageData.getVideotype(),
  380 + fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(),
  381 + fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag(),
  382 + fragment.pageData.getTitle(), fragment.pageData.getSource(),
  383 + fragment.pageData.getLabelcolor(), fragment.pageData.getDetailaddress());
  384 + }
  385 + // fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  386 + getContext().finish();
  387 + fragment.bottomSheet4.dismiss();
  388 + } else {
  389 + AlertUtil.showDeftToast(getContext(), "该功能暂只支持视频类型保存,请重新添加视频.");
  390 + }
  391 + } else {
  392 + // fragment.getPresenter().doSaveInfo(getContext(), fragment.pageData.getAdapter().getList(), fragment.pageData.getMessage(), fragment.pageData.getWit(), fragment.pageData.getType(), fragment.pageData.getVideotype(), fragment.pageData.getGopath(), fragment.pageData.getMultiplecategory(), fragment.pageData.getTagtext(), fragment.pageData.getCategoryTag());
  393 + getContext().finish();
  394 + fragment.bottomSheet4.dismiss();
  395 + }
  396 +
  397 + }
  398 +
  399 + /**
  400 + * 目击者删除当前数据
  401 + */
  402 + public void showdel() {
  403 + if ("目击者".equals(fragment.pageData.getWit())) {
  404 + fragment.bottomSheet3.dismiss();
  405 + } else {
  406 + fragment.bottomSheet2.dismiss();
  407 + }
  408 + bottomSheet6 = new BottomSheet.BottomListSheetBuilder(getContext())
  409 + .addItem("确定删除")
  410 + .addItem("取消")
  411 + .setOnSheetItemClickListener((dialog, itemView, positio, tag) -> {
  412 + if (positio == 0) {
  413 + fragment.getPresenter().doDeleteInfo(getContext());
  414 + bottomSheet6.dismiss();
  415 + getContext().finish();
  416 + }
  417 + dialog.dismiss();
  418 + }).build();
  419 + bottomSheet6.show();
  420 + }
  421 +
  422 + /**
  423 + * 生活圈删除
  424 + */
  425 + public void showdellife() {
  426 + fragment.getPresenter().doDeleteInfo(getContext());
  427 + getContext().finish();
  428 + if ("目击者".equals(fragment.pageData.getWit())) {
  429 + fragment.bottomSheet3.dismiss();
  430 + } else {
  431 + fragment.bottomSheet2.dismiss();
  432 + }
  433 + }
  434 +
  435 + /**
  436 + * 单纯退出草稿编辑页面
  437 + */
  438 + public void showdedraft() {
  439 + getContext().finish();
  440 + fragment.bottomSheet4.dismiss();
  441 + }
  442 +
  443 + public void showdeldraft(Context context, String createtime) {
  444 + fragment.bottomSheet4.dismiss();
  445 + bottomSheet7 = new BottomSheet.BottomListSheetBuilder(getContext())
  446 + .addItem("确定删除")
  447 + .addItem("取消")
  448 + .setOnSheetItemClickListener((dialog, itemView, positio, tag) -> {
  449 + if (positio == 0 && !StringUtils.isEmpty(createtime)) {
  450 + //todo 删除数据库数据 DBWitnessDetailAPI.deleteWitnessItem(context, createtime);
  451 + bottomSheet7.dismiss();
  452 + getContext().finish();
  453 + }
  454 + dialog.dismiss();
  455 + }).build();
  456 + bottomSheet7.show();
  457 + }
  458 +
  459 + public void showBackDialog() {
  460 + boolean messageEmpty = TextUtils.isEmpty(fragment.pageData.getMessage());
  461 + boolean fileEmpty = fragment.pageData.getAdapter().getList().get(0).getType() == ReleaseMediaItem.type_select;
  462 + if (messageEmpty && fileEmpty) {
  463 + fragment.bottomSheet1.show();
  464 + } else {
  465 + if (!"生活圈".equals(fragment.pageData.getTitle()) && "".equals(fragment.pageData.getWitContentId()) && !fileEmpty && !"draft".equals(fragment.pageData.getJumpType())) {
  466 + fragment.bottomSheet3.show();
  467 + } else if (!"生活圈".equals(fragment.pageData.getTitle()) && !"".equals(fragment.pageData.getWitContentId()) && !"draft".equals(fragment.pageData.getJumpType())) {
  468 + fragment.bottomSheet1.show();
  469 + } else if (!"生活圈".equals(fragment.pageData.getTitle()) && "draft".equals(fragment.pageData.getJumpType())) {
  470 + fragment.bottomSheet4.show();
  471 + } else {
  472 + fragment.bottomSheet2.show();
  473 + }
  474 + }
  475 + }
  476 +
  477 + public void hasHTML(ShareReleaseInfoUtil.ShareConfig shareConfig) {
  478 + if (shareConfig == null) hasHTML = false;
  479 + else hasHTML = true;
  480 + changeReleaseBtn();
  481 + }
  482 +
  483 + public void hasDes(String message) {
  484 + if (TextUtils.isEmpty(message)) hasDes = false;
  485 + else hasDes = true;
  486 + changeReleaseBtn();
  487 + }
  488 +
  489 + public void hasMedias(int size) {
  490 + if (size > 0)
  491 + hasMedias = true;
  492 + else hasMedias = false;
  493 + changeReleaseBtn();
  494 + }
  495 +
  496 + private void changeReleaseBtn() {
  497 + if (fragment == null || fragment.getView() == null) return;
  498 + if (fragment.getView().findViewById(R.id.rightBtn) == null) return;
  499 +
  500 + TextView rightBtn = fragment.getView().findViewById(R.id.rightBtn);
  501 +
  502 + if (hasDes || hasMedias || hasHTML) {
  503 + // rightBtn.setTextColor(0xffffa300);
  504 + releaseBtnClickable = true;
  505 + } else {
  506 + // if (releaseBtnClickable) rightBtn.setTextColor(0xff282828);
  507 + releaseBtnClickable = false;
  508 + }
  509 + }
  510 +
  511 + public void initPageView(String title, String message, String wit, int type, String videotype, String path, int multiplecategory, boolean isVideo, List<ReleaseMediaItem> list, String img, String tag, int iswitinfo,
  512 + String witContentId, List<CircleData.indextag> indextags, String jumpType, String defaulttext, int detailaddress, String labelcolor, int source, String fixTitle, String successJumpType) {
  513 + ReleaseMediaPage pageData = fragment.pageData;
  514 + pageData.setTitle(title);
  515 + pageData.setMessage("".equals(fixTitle) ? message : fixTitle);
  516 + pageData.setFixedTitle(fixTitle);
  517 + pageData.setSuccessJumpType(successJumpType);
  518 + pageData.setWit(wit);
  519 + pageData.setType(type);
  520 + pageData.setVideo(isVideo);
  521 + pageData.setVideotype(videotype);
  522 + pageData.setGopath(path);
  523 + pageData.setMultiplecategory(multiplecategory);
  524 + pageData.getAdapter().updateItems(list);
  525 + pageData.setTagtext(tag);
  526 + pageData.setJumpType(jumpType);
  527 + pageData.setDefaulttext(defaulttext);
  528 + pageData.setDetailaddress(detailaddress);
  529 + pageData.setLabelcolor(labelcolor);
  530 + pageData.setSource(source);
  531 + String circleMesg = SharedPreferencesHelper.getInstance(fragment.getActivity()).getValue("CIRCLE_MESG");
  532 + List<CircleMsgData.ReleaseVideoTypeListBean> circleList = new Gson().fromJson(circleMesg, new TypeToken<List<CircleMsgData.ReleaseVideoTypeListBean>>() {
  533 + }.getType());
  534 + if (!"生活圈".equals(title) && circleList != null && circleList.size() > 0) {
  535 + for (int i = 0; i < circleList.size(); i++) {
  536 + if (circleList.get(i).getSource() == source) {
  537 + pageData.setBottomSrc(circleList.get(i).getBottomSrc());
  538 + pageData.setReleaseButtonColor(circleList.get(i).getReleaseButtonColor());
  539 + pageData.setTopColor(circleList.get(i).getTopColor());
  540 + if (circleList.get(i).getCategoryTag() != null && circleList.get(i).getCategoryTag().size() > 0 && circleList.get(i).getCategoryTag().get(0).getColour() != null) {
  541 + pageData.setLabelcolor(circleList.get(i).getCategoryTag().get(0).getColour());
  542 + } else {
  543 + pageData.setLabelcolor("666666");
  544 + }
  545 + }
  546 + }
  547 + }
  548 +
  549 + if ("生活圈".equals(title) && pageData.getAdapter().getItemCount() == 1 && (pageData.getAdapter().getItem(0)).getType() == ReleaseMediaItem.type_select) {
  550 + pageData.getAdapter().getItem(0).setIconRes(R.drawable.fb_tjsc);
  551 + } else if (!"生活圈".equals(title) && pageData.getAdapter().getItemCount() == 1 && (pageData.getAdapter().getItem(0)).getType() == ReleaseMediaItem.type_select) {
  552 + pageData.getAdapter().getItem(0).setIconRes(((!StringUtils.isEmpty(fragment.pageData.getBottomSrc()) ? R.drawable.circle_photo : R.drawable.fb_tjsp)));
  553 + }
  554 + if (indextags != null && indextags.size() > 0) {
  555 + pageData.setCategoryTag(indextags);
  556 + }
  557 +
  558 +
  559 + if (iswitinfo == 2 && !"".equals(img)) {
  560 + pageData.setWitimg(img);
  561 + pageData.setWitContentId(witContentId);
  562 + pageData.setShareVisibility(View.GONE);
  563 + pageData.setRecyclerVisibility(View.GONE);
  564 + pageData.setIsWitVisibility(View.VISIBLE);
  565 + } else if (iswitinfo == 2 && "".equals(img)) {
  566 + pageData.setWitContentId("");
  567 + pageData.setShareVisibility(View.GONE);
  568 + pageData.setRecyclerVisibility(View.VISIBLE);
  569 + pageData.setIsWitVisibility(View.GONE);
  570 + } else if (iswitinfo == 0 && "".equals(img)) {
  571 + pageData.setWitContentId("");
  572 + }
  573 +
  574 +
  575 + if (pageData.getShareConfig() != null && iswitinfo != 2) {
  576 + pageData.setSharetit(pageData.getShareConfig().getTitle());
  577 + pageData.setSharepic(pageData.getShareConfig().getImage());
  578 + pageData.setShareVisibility(View.VISIBLE);
  579 + pageData.setRecyclerVisibility(View.GONE);
  580 + }
  581 + }
  582 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/AddIntegration.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/AddIntegration.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class AddIntegration implements Serializable {
  6 +
  7 +
  8 + public static class DataBean {
  9 + /**
  10 + * status : false
  11 + * score : 100
  12 + */
  13 +
  14 + private boolean status;
  15 + private String score;
  16 + private String desc;
  17 + private String descEnd;
  18 +
  19 + public String getDescEnd() {
  20 + return descEnd;
  21 + }
  22 +
  23 + public void setDescEnd(String descEnd) {
  24 + this.descEnd = descEnd;
  25 + }
  26 +
  27 + public String getDesc() {
  28 + return desc;
  29 + }
  30 +
  31 + public void setDesc(String desc) {
  32 + this.desc = desc;
  33 + }
  34 +
  35 +
  36 + public boolean isStatus() {
  37 + return status;
  38 + }
  39 +
  40 + public void setStatus(boolean status) {
  41 + this.status = status;
  42 + }
  43 +
  44 + public String getScore() {
  45 + return score;
  46 + }
  47 +
  48 + public void setScore(String score) {
  49 + this.score = score;
  50 + }
  51 + }
  52 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/CheckApplyResultInfo.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/CheckApplyResultInfo.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +import com.cnlive.publish.network.BaseInfo;
  4 +
  5 +/**
  6 + * Created by cnlive20080010 on 2018/10/10.
  7 + */
  8 +
  9 +public class CheckApplyResultInfo extends BaseInfo<CheckApplyResultInfo> {
  10 +
  11 + private boolean isNotRecorded;//是否提交了身份审核,true:是 false:否.为true时 witnessBean才有数据
  12 + private WitnessBeanBean witnessBean;
  13 +
  14 + public boolean isIsNotRecorded() {
  15 + return isNotRecorded;
  16 + }
  17 +
  18 + public void setIsNotRecorded(boolean isNotRecorded) {
  19 + this.isNotRecorded = isNotRecorded;
  20 + }
  21 +
  22 + public WitnessBeanBean getWitnessBean() {
  23 + return witnessBean;
  24 + }
  25 +
  26 + public void setWitnessBean(WitnessBeanBean witnessBean) {
  27 + this.witnessBean = witnessBean;
  28 + }
  29 +
  30 + public static class WitnessBeanBean {
  31 + /**
  32 + * nick : 哈哈哈
  33 + * realName : 徐
  34 + * face : https://wjj.ys1.cnliveimg.com/769/img/2018/0416/head_c.png
  35 + * address :
  36 + * idCardNo : 210681********6732
  37 + * mobile : 188****4578
  38 + * status : 0
  39 + * auditFailureReason :
  40 + * updateTime : 1539054682000
  41 + */
  42 +
  43 + private String nick;
  44 + private String realName;
  45 + private String face;
  46 + private String address;
  47 + private String idCardNo;
  48 + private String mobile;
  49 + private int status;//审核状态 0-审核中,1-申请失败,2申请成功
  50 + private String auditFailureReason;//审核失败原因
  51 + private long updateTime;//审核通过或失败时间
  52 +
  53 + public String getNick() {
  54 + return nick;
  55 + }
  56 +
  57 + public void setNick(String nick) {
  58 + this.nick = nick;
  59 + }
  60 +
  61 + public String getRealName() {
  62 + return realName;
  63 + }
  64 +
  65 + public void setRealName(String realName) {
  66 + this.realName = realName;
  67 + }
  68 +
  69 + public String getFace() {
  70 + return face;
  71 + }
  72 +
  73 + public void setFace(String face) {
  74 + this.face = face;
  75 + }
  76 +
  77 + public String getAddress() {
  78 + return address;
  79 + }
  80 +
  81 + public void setAddress(String address) {
  82 + this.address = address;
  83 + }
  84 +
  85 + public String getIdCardNo() {
  86 + return idCardNo;
  87 + }
  88 +
  89 + public void setIdCardNo(String idCardNo) {
  90 + this.idCardNo = idCardNo;
  91 + }
  92 +
  93 + public String getMobile() {
  94 + return mobile;
  95 + }
  96 +
  97 + public void setMobile(String mobile) {
  98 + this.mobile = mobile;
  99 + }
  100 +
  101 + public int getStatus() {
  102 + return status;
  103 + }
  104 +
  105 + public void setStatus(int status) {
  106 + this.status = status;
  107 + }
  108 +
  109 + public String getAuditFailureReason() {
  110 + return auditFailureReason;
  111 + }
  112 +
  113 + public void setAuditFailureReason(String auditFailureReason) {
  114 + this.auditFailureReason = auditFailureReason;
  115 + }
  116 +
  117 + public long getUpdateTime() {
  118 + return updateTime;
  119 + }
  120 +
  121 + public void setUpdateTime(long updateTime) {
  122 + this.updateTime = updateTime;
  123 + }
  124 +
  125 + @Override
  126 + public String toString() {
  127 + return "WitnessBeanBean{" +
  128 + "nick='" + nick + '\'' +
  129 + ", realName='" + realName + '\'' +
  130 + ", face='" + face + '\'' +
  131 + ", address='" + address + '\'' +
  132 + ", idCardNo='" + idCardNo + '\'' +
  133 + ", mobile='" + mobile + '\'' +
  134 + ", status=" + status +
  135 + ", auditFailureReason='" + auditFailureReason + '\'' +
  136 + ", updateTime=" + updateTime +
  137 + '}';
  138 + }
  139 + }
  140 +
  141 + @Override
  142 + public String toString() {
  143 + return "DarenInfo{" +
  144 + "isNotRecorded=" + isNotRecorded +
  145 + ", witnessBean=" + witnessBean +
  146 + '}';
  147 + }
  148 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/CheckData.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/CheckData.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +public class CheckData {
  4 + private int ban;
  5 + private int edit;
  6 +
  7 + public int getBan() {
  8 + return ban;
  9 + }
  10 +
  11 + public void setBan(int ban) {
  12 + this.ban = ban;
  13 + }
  14 +
  15 + public int getEdit() {
  16 + return edit;
  17 + }
  18 +
  19 + public void setEdit(int edit) {
  20 + this.edit = edit;
  21 + }
  22 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/CircleMsgData.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/CircleMsgData.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +
  4 +import android.text.TextUtils;
  5 +
  6 +import java.io.Serializable;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 视频圈子信息,与发现页面圈子信息不一致,若要相同找产品重新确认业务逻辑
  11 + */
  12 +
  13 +public class CircleMsgData implements Serializable {
  14 +
  15 +
  16 + private List<ReleaseVideoTypeListBean> releaseVideoTypeList;
  17 + private List<SnowVideoTypeListBean> snowVideoTypeList;
  18 +
  19 + public List<ReleaseVideoTypeListBean> getReleaseVideoTypeList() {
  20 + return releaseVideoTypeList;
  21 + }
  22 +
  23 + public void setReleaseVideoTypeList(List<ReleaseVideoTypeListBean> releaseVideoTypeList) {
  24 + this.releaseVideoTypeList = releaseVideoTypeList;
  25 + }
  26 +
  27 + public List<SnowVideoTypeListBean> getSnowVideoTypeList() {
  28 + return snowVideoTypeList;
  29 + }
  30 +
  31 + public void setSnowVideoTypeList(List<SnowVideoTypeListBean> snowVideoTypeList) {
  32 + this.snowVideoTypeList = snowVideoTypeList;
  33 + }
  34 +
  35 + public static class ReleaseVideoTypeListBean implements Serializable {
  36 + /**
  37 + * id : 111
  38 + * path : http://apiwjjtest.cnlive.com/Daren/witness/releaseWitness.action
  39 + * pic : https://wjj.ys1.cnliveimg.com/769/img/2018/0129/grzx_mjz.png
  40 + * text : 目击者
  41 + * videoType : witness
  42 + * multiplecategory:888
  43 + * multipleCategory
  44 + */
  45 +
  46 + private int id;
  47 + private String path;
  48 + private String pic;
  49 + private String text;
  50 + private String videoType;
  51 + private String changePath;
  52 + private int multipleCategory;
  53 + private List<indextag> categoryTag;
  54 + private String defaultText;
  55 + private String defaultTitle;
  56 + private int detailAddress;
  57 + private String labelColor;
  58 + private int source;
  59 + private String title;
  60 + private String bottomSrc;
  61 + private String protocolAddress;
  62 + private String releaseButtonColor;
  63 + private String topColor;
  64 + private String jumpAddress;
  65 + private String describes;
  66 + private String channelName;
  67 + private String signPic;
  68 + private String signText;
  69 +
  70 + public String getSignPic() {
  71 + return signPic;
  72 + }
  73 +
  74 + public void setSignPic(String signPic) {
  75 + this.signPic = signPic;
  76 + }
  77 +
  78 + public String getSignText() {
  79 + return signText;
  80 + }
  81 +
  82 + public void setSignText(String signText) {
  83 + this.signText = signText;
  84 + }
  85 +
  86 + public String getChannelName() {
  87 + return channelName;
  88 + }
  89 +
  90 + public void setChannelName(String channelName) {
  91 + this.channelName = channelName;
  92 + }
  93 +
  94 + public String getDescribes() {
  95 + return describes;
  96 + }
  97 +
  98 + public void setDescribes(String describes) {
  99 + this.describes = describes;
  100 + }
  101 +
  102 + public String getJumpAddress() {
  103 + return jumpAddress;
  104 + }
  105 +
  106 + public void setJumpAddress(String jumpAddress) {
  107 + this.jumpAddress = jumpAddress;
  108 + }
  109 +
  110 + public String getBottomSrc() {
  111 + return bottomSrc;
  112 + }
  113 +
  114 + public void setBottomSrc(String bottomSrc) {
  115 + this.bottomSrc = bottomSrc;
  116 + }
  117 +
  118 + public String getProtocolAddress() {
  119 + return protocolAddress;
  120 + }
  121 +
  122 + public void setProtocolAddress(String protocolAddress) {
  123 + this.protocolAddress = protocolAddress;
  124 + }
  125 +
  126 + public String getReleaseButtonColor() {
  127 + return releaseButtonColor;
  128 + }
  129 +
  130 + public void setReleaseButtonColor(String releaseButtonColor) {
  131 + this.releaseButtonColor = releaseButtonColor;
  132 + }
  133 +
  134 + public String getTopColor() {
  135 + return topColor;
  136 + }
  137 +
  138 + public void setTopColor(String topColor) {
  139 + this.topColor = topColor;
  140 + }
  141 +
  142 +
  143 + public String getDefaultTitle() {
  144 + return defaultTitle;
  145 + }
  146 +
  147 + public void setDefaultTitle(String defaultTitle) {
  148 + this.defaultTitle = defaultTitle;
  149 + }
  150 +
  151 + public int getMultipleCategory() {
  152 + return multipleCategory;
  153 + }
  154 +
  155 + public void setMultipleCategory(int multipleCategory) {
  156 + this.multipleCategory = multipleCategory;
  157 + }
  158 +
  159 + public String getDefaultText() {
  160 + return defaultText;
  161 + }
  162 +
  163 + public void setDefaultText(String defaultText) {
  164 + this.defaultText = defaultText;
  165 + }
  166 +
  167 + public int getDetailAddress() {
  168 + return detailAddress;
  169 + }
  170 +
  171 + public void setDetailAddress(int detailAddress) {
  172 + this.detailAddress = detailAddress;
  173 + }
  174 +
  175 + public String getLabelColor() {
  176 + return labelColor;
  177 + }
  178 +
  179 + public void setLabelColor(String labelColor) {
  180 + this.labelColor = labelColor;
  181 + }
  182 +
  183 + public int getSource() {
  184 + return source;
  185 + }
  186 +
  187 + public void setSource(int source) {
  188 + this.source = source;
  189 + }
  190 +
  191 + public String getTitle() {
  192 + return title;
  193 + }
  194 +
  195 + public void setTitle(String title) {
  196 + this.title = title;
  197 + }
  198 +
  199 + /* public ReleaseVideoTypeListBean(Parcel in) {
  200 + id = in.readInt();
  201 + path = in.readString();
  202 + pic = in.readString();
  203 + text = in.readString();
  204 + videoType = in.readString();
  205 + changePath = in.readString();
  206 + multipleCategory = in.readInt();
  207 + }*/
  208 +
  209 + /* public static final Parcelable.Creator<ReleaseVideoTypeListBean> CREATOR = new Parcelable.Creator<ReleaseVideoTypeListBean>() {
  210 + @Override
  211 + public ReleaseVideoTypeListBean createFromParcel(Parcel in) {
  212 + return new ReleaseVideoTypeListBean(in);
  213 + }
  214 +
  215 + @Override
  216 + public ReleaseVideoTypeListBean[] newArray(int size) {
  217 + return new ReleaseVideoTypeListBean[size];
  218 + }
  219 + };*/
  220 +
  221 + public List<indextag> getCategoryTag() {
  222 + return categoryTag;
  223 + }
  224 +
  225 + public void setCategoryTag(List<indextag> categoryTag) {
  226 + this.categoryTag = categoryTag;
  227 + }
  228 +
  229 +
  230 + public int getMultiplecategory() {
  231 + return multipleCategory;
  232 + }
  233 +
  234 + public void setMultiplecategory(int multipleCategory) {
  235 + this.multipleCategory = multipleCategory;
  236 + }
  237 +
  238 +
  239 + public String getChangePath() {
  240 + return changePath;
  241 + }
  242 +
  243 + public void setChangePath(String changePath) {
  244 + this.changePath = changePath;
  245 + }
  246 +
  247 +
  248 + public int getId() {
  249 + return id;
  250 + }
  251 +
  252 + public void setId(int id) {
  253 + this.id = id;
  254 + }
  255 +
  256 + public String getPath() {
  257 + return TextUtils.isEmpty(path) ? "Daren/moment/releaseMoment.action" : path;
  258 + }
  259 +
  260 + public void setPath(String path) {
  261 + this.path = path;
  262 + }
  263 +
  264 + public String getPic() {
  265 + return TextUtils.isEmpty(pic) ? "https://wjj.ys1.cnliveimg.com/769/img/2018/0129/grzx_shq.png" : pic;
  266 + }
  267 +
  268 + public void setPic(String pic) {
  269 + this.pic = pic;
  270 + }
  271 +
  272 + public String getText() {
  273 + return TextUtils.isEmpty(text) ? "生活圈" : text;
  274 + }
  275 +
  276 + public void setText(String text) {
  277 + this.text = text;
  278 + }
  279 +
  280 + public String getVideoType() {
  281 + return videoType;
  282 + }
  283 +
  284 + public void setVideoType(String videoType) {
  285 + this.videoType = videoType;
  286 + }
  287 +
  288 + /* @Override
  289 + public int describeContents() {
  290 + return 0;
  291 + }
  292 +
  293 + @Override
  294 + public void writeToParcel(Parcel dest, int flags) {
  295 + dest.writeInt(id);
  296 + dest.writeString(path);
  297 + dest.writeString(pic);
  298 + dest.writeString(text);
  299 + dest.writeString(videoType);
  300 + dest.writeString(changePath);
  301 + dest.writeInt(multipleCategory);
  302 + }*/
  303 + }
  304 +
  305 + public static class indextag {
  306 + private String tagId;
  307 + private String tagName;
  308 + private String colour;
  309 +
  310 + public String getColour() {
  311 + return colour;
  312 + }
  313 +
  314 + public void setColour(String colour) {
  315 + this.colour = colour;
  316 + }
  317 +
  318 + public String getTagId() {
  319 + return tagId;
  320 + }
  321 +
  322 + public void setTagId(String tagId) {
  323 + this.tagId = tagId;
  324 + }
  325 +
  326 + public String getTagName() {
  327 + return tagName;
  328 + }
  329 +
  330 + public void setTagName(String tagName) {
  331 + this.tagName = tagName;
  332 + }
  333 + }
  334 +
  335 + public static class SnowVideoTypeListBean {
  336 + /**
  337 + * id : 333
  338 + * pic : https://wjj.ys1.cnliveimg.com/769/img/2018/0129/882612314493918438.jpg
  339 + * text : 上冰雪
  340 + * videoType : snow
  341 + * path : http://apiwjjtest.cnlive.com/Daren/snow/releaseSnow.action
  342 + */
  343 +
  344 + private int id;
  345 + private String pic;
  346 + private String text;
  347 + private String videoType;
  348 + private String path;
  349 + private String changePath;
  350 + private int multipleCategory;
  351 +
  352 + public int getMultiplecategory() {
  353 + return multipleCategory;
  354 + }
  355 +
  356 + public void setMultiplecategory(int multipleCategory) {
  357 + this.multipleCategory = multipleCategory;
  358 + }
  359 +
  360 + public String getChangePath() {
  361 + return changePath;
  362 + }
  363 +
  364 + public void setChangePath(String changePath) {
  365 + this.changePath = changePath;
  366 + }
  367 +
  368 + public int getId() {
  369 + return id;
  370 + }
  371 +
  372 + public void setId(int id) {
  373 + this.id = id;
  374 + }
  375 +
  376 + public String getPic() {
  377 + return pic;
  378 + }
  379 +
  380 + public void setPic(String pic) {
  381 + this.pic = pic;
  382 + }
  383 +
  384 + public String getText() {
  385 + return text;
  386 + }
  387 +
  388 + public void setText(String text) {
  389 + this.text = text;
  390 + }
  391 +
  392 + public String getVideoType() {
  393 + return videoType;
  394 + }
  395 +
  396 + public void setVideoType(String videoType) {
  397 + this.videoType = videoType;
  398 + }
  399 +
  400 + public String getPath() {
  401 + return path;
  402 + }
  403 +
  404 + public void setPath(String path) {
  405 + this.path = path;
  406 + }
  407 + }
  408 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/DarenApplyModel.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/DarenApplyModel.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +
  4 +import com.cnlive.publish.network.BaseInfo;
  5 +
  6 +public class DarenApplyModel extends BaseInfo<DarenApplyModel> {
  7 + /**
  8 + * address : 中国
  9 + * auditFailureReason :
  10 + * auditor :
  11 + * createTime : 2018-10-09 11:30:30
  12 + * id : 5761e330f9844edaa08fa82eb8908ad8
  13 + * idCardNo : 210681199407146732
  14 + * idCardObv : http://wjjtest.ys2.cnliveimg.com/802/img/2018/1009/1539055830171.png
  15 + * idCardRev : http://wjjtest.ys2.cnliveimg.com/802/img/2018/1009/1539055830581.png
  16 + * mobile : 18856894578
  17 + * realName : 徐
  18 + * sid : 10510277
  19 + * status : 0
  20 + * updateTime :
  21 + */
  22 +
  23 + private String address;
  24 + private String auditFailureReason;
  25 + private String auditor;
  26 + private String createTime;
  27 + private String id;
  28 + private String idCardNo;
  29 + private String idCardObv;
  30 + private String idCardRev;
  31 + private String mobile;
  32 + private String realName;
  33 + private String sid;
  34 + private int status;
  35 + private String updateTime;
  36 +
  37 + public String getAddress() {
  38 + return address;
  39 + }
  40 +
  41 + public void setAddress(String address) {
  42 + this.address = address;
  43 + }
  44 +
  45 + public String getAuditFailureReason() {
  46 + return auditFailureReason;
  47 + }
  48 +
  49 + public void setAuditFailureReason(String auditFailureReason) {
  50 + this.auditFailureReason = auditFailureReason;
  51 + }
  52 +
  53 + public String getAuditor() {
  54 + return auditor;
  55 + }
  56 +
  57 + public void setAuditor(String auditor) {
  58 + this.auditor = auditor;
  59 + }
  60 +
  61 + public String getCreateTime() {
  62 + return createTime;
  63 + }
  64 +
  65 + public void setCreateTime(String createTime) {
  66 + this.createTime = createTime;
  67 + }
  68 +
  69 + public String getId() {
  70 + return id;
  71 + }
  72 +
  73 + public void setId(String id) {
  74 + this.id = id;
  75 + }
  76 +
  77 + public String getIdCardNo() {
  78 + return idCardNo;
  79 + }
  80 +
  81 + public void setIdCardNo(String idCardNo) {
  82 + this.idCardNo = idCardNo;
  83 + }
  84 +
  85 + public String getIdCardObv() {
  86 + return idCardObv;
  87 + }
  88 +
  89 + public void setIdCardObv(String idCardObv) {
  90 + this.idCardObv = idCardObv;
  91 + }
  92 +
  93 + public String getIdCardRev() {
  94 + return idCardRev;
  95 + }
  96 +
  97 + public void setIdCardRev(String idCardRev) {
  98 + this.idCardRev = idCardRev;
  99 + }
  100 +
  101 + public String getMobile() {
  102 + return mobile;
  103 + }
  104 +
  105 + public void setMobile(String mobile) {
  106 + this.mobile = mobile;
  107 + }
  108 +
  109 + public String getRealName() {
  110 + return realName;
  111 + }
  112 +
  113 + public void setRealName(String realName) {
  114 + this.realName = realName;
  115 + }
  116 +
  117 + public String getSid() {
  118 + return sid;
  119 + }
  120 +
  121 + public void setSid(String sid) {
  122 + this.sid = sid;
  123 + }
  124 +
  125 + public int getStatus() {
  126 + return status;
  127 + }
  128 +
  129 + public void setStatus(int status) {
  130 + this.status = status;
  131 + }
  132 +
  133 + public String getUpdateTime() {
  134 + return updateTime;
  135 + }
  136 +
  137 + public void setUpdateTime(String updateTime) {
  138 + this.updateTime = updateTime;
  139 + }
  140 +
  141 + @Override
  142 + public String toString() {
  143 + return "DarenApplyModel{" +
  144 + "address='" + address + '\'' +
  145 + ", auditFailureReason='" + auditFailureReason + '\'' +
  146 + ", auditor='" + auditor + '\'' +
  147 + ", createTime='" + createTime + '\'' +
  148 + ", id='" + id + '\'' +
  149 + ", idCardNo='" + idCardNo + '\'' +
  150 + ", idCardObv='" + idCardObv + '\'' +
  151 + ", idCardRev='" + idCardRev + '\'' +
  152 + ", mobile='" + mobile + '\'' +
  153 + ", realName='" + realName + '\'' +
  154 + ", sid='" + sid + '\'' +
  155 + ", status=" + status +
  156 + ", updateTime='" + updateTime + '\'' +
  157 + '}';
  158 + }
  159 +}
... ...
publish/src/main/java/com/cnlive/publish/moudle/FeedBackInfo.java 0 → 100644
  1 +++ a/publish/src/main/java/com/cnlive/publish/moudle/FeedBackInfo.java
  1 +package com.cnlive.publish.moudle;
  2 +
  3 +/**
  4 + * Created by Lynn on 2018/9/4.
  5 + */
  6 +
  7 +public class FeedBackInfo {
  8 + private String imageUrl;
  9 + private long imageWidth;
  10 + private long imageHeight;
  11 +
  12 + public String getImageUrl() {
  13 + return imageUrl;
  14 + }
  15 +
  16 + public void setImageUrl(String imageUrl) {
  17 + this.imageUrl = imageUrl;
  18 + }
  19 +
  20 + public long getImageWidth() {
  21 + return imageWidth;
  22 + }
  23 +
  24 + public void setImageWidth(long imageWidth) {
  25 + this.imageWidth = imageWidth;
  26 + }
  27 +
  28 + public long getImageHeight() {
  29 + return imageHeight;
  30 + }
  31 +
  32 + public void setImageHeight(long imageHeight) {
  33 + this.imageHeight = imageHeight;
  34 + }
  35 +
  36 + @Override
  37 + public String toString() {
  38 + return "FeedBackInfo{" +
  39 + "imageUrl='" + imageUrl + '\'' +
  40 + ", imageWidth=" + imageWidth +
  41 + ", imageHeight=" + imageHeight +
  42 + '}';
  43 + }
  44 +}
... ...