Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
40da7eff
Commit
40da7eff
authored
Dec 21, 2022
by
郑娜伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 发布1.2.2 版本
parent
3a45670f
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
158 additions
and
89 deletions
+158
-89
ExampleInstrumentedTest.java
...st/java/com/sobot/moduletest/ExampleInstrumentedTest.java
+2
-2
MainActivity.java
app/src/main/java/com/sobot/moduletest/MainActivity.java
+80
-9
MyApp.java
app/src/main/java/com/sobot/moduletest/MyApp.java
+3
-5
ExampleUnitTest.java
app/src/test/java/com/sobot/moduletest/ExampleUnitTest.java
+2
-2
build.gradle
sobot_common/build.gradle
+9
-9
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotBaseActivity.java
...main/java/com/sobot/common/ui/base/SobotBaseActivity.java
+1
-1
GsonBuilder.java
sobot_gson/src/main/java/com/sobot/gson/GsonBuilder.java
+12
-12
$Gson$Types.java
...on/src/main/java/com/sobot/gson/internal/$Gson$Types.java
+3
-3
JsonWriter.java
..._gson/src/main/java/com/sobot/gson/stream/JsonWriter.java
+8
-8
SobotRefreshLayout.java
...a/com/sobot/widget/refresh/layout/SobotRefreshLayout.java
+12
-12
RefreshComponent.java
...com/sobot/widget/refresh/layout/api/RefreshComponent.java
+4
-4
RefreshFooter.java
...va/com/sobot/widget/refresh/layout/api/RefreshFooter.java
+2
-2
ClassicsAbstract.java
.../sobot/widget/refresh/layout/footer/ClassicsAbstract.java
+2
-2
ClassicsHeader.java
...om/sobot/widget/refresh/layout/header/ClassicsHeader.java
+2
-2
OnStateChangedListener.java
...idget/refresh/layout/listener/OnStateChangedListener.java
+4
-4
SimpleComponent.java
...m/sobot/widget/refresh/layout/simple/SimpleComponent.java
+2
-2
SmartUtil.java
.../java/com/sobot/widget/refresh/layout/util/SmartUtil.java
+3
-3
RefreshContentWrapper.java
.../widget/refresh/layout/wrapper/RefreshContentWrapper.java
+6
-6
No files found.
app/src/androidTest/java/com/sobot/moduletest/ExampleInstrumentedTest.java
View file @
40da7eff
package
com
.
sobot
.
moduletest
;
import
static
org
.
junit
.
Assert
.*;
import
android.content.Context
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
...
...
@@ -8,8 +10,6 @@ import androidx.test.platform.app.InstrumentationRegistry;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
...
...
app/src/main/java/com/sobot/moduletest/MainActivity.java
View file @
40da7eff
package
com
.
sobot
.
moduletest
;
import
static
com
.
sobot
.
common
.
ui
.
SobotBaseConstant
.
REQUEST_CODE_PICTURE
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.widget.ImageView
;
...
...
@@ -14,11 +15,9 @@ import com.sobot.common.utils.SobotCommonApi;
import
com.sobot.common.utils.SobotImageUtils
;
import
com.sobot.network.apiUtils.SobotHttpUtils
;
import
com.sobot.network.http.HttpBaseUtils
;
import
com.sobot.network.http.db.SobotDownloadManager
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotSDCardUtils
;
import
com.sobot.utils.SobotSharedPreferencesUtil
;
import
com.sobot.widget.image.photoview.SobotPhotoView
;
import
com.sobot.widget.loading.SobotLoadingLayout
;
import
com.sobot.widget.refresh.layout.api.RefreshLayout
;
...
...
@@ -29,13 +28,11 @@ import java.io.File;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
sobot
.
common
.
ui
.
SobotBaseConstant
.
REQUEST_CODE_PICTURE
;
public
class
MainActivity
extends
SobotBaseActivity
{
private
ImageView
img
;
private
SobotPhotoView
img2
;
private
SobotLoadingLayout
loadinglayout
;
private
SobotLoadingLayout
loadinglayout
;
@Override
...
...
@@ -55,7 +52,7 @@ public class MainActivity extends SobotBaseActivity {
img2
=
findViewById
(
R
.
id
.
img2
);
// img2.setScaleType(ImageView.ScaleType.FIT_XY);
SobotBitmapUtil
.
display
(
this
,
"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg"
,
img2
);
SobotBitmapUtil
.
display
(
this
,
"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg"
,
img2
);
// File save=new File(SobotSDCardUtils.getSDCardRootPath(MainActivity.this)+"/9410b53be86b4d589c61c60f6aee2461.jpeg");
// HttpBaseUtils.getInstance().download("https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg", save, new HttpBaseUtils.FileCallBack() {
// @Override
...
...
@@ -120,13 +117,87 @@ public class MainActivity extends SobotBaseActivity {
// selectVedioFromLocal();
// openCamera();
RefreshLayout
refreshLayout
=
(
RefreshLayout
)
findViewById
(
R
.
id
.
refreshLayout
);
RefreshLayout
refreshLayout
=
(
RefreshLayout
)
findViewById
(
R
.
id
.
refreshLayout
);
refreshLayout
.
setRefreshHeader
(
new
ClassicsHeader
(
this
));
refreshLayout
.
setRefreshFooter
(
new
ClassicsFooter
(
this
));
refreshLayout
.
setEnableLoadMore
(
false
);
loadinglayout
=
findViewById
(
R
.
id
.
loadinglayout
);
loadinglayout
=
findViewById
(
R
.
id
.
loadinglayout
);
loadinglayout
.
showContent
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"uid"
,
"34a466420d78fa1172bc0acd85166745"
);
map
.
put
(
"robotFlag"
,
"1"
);
map
.
put
(
"faqId"
,
"0"
);
map
.
put
(
"version"
,
"2.9.7"
);
map
.
put
(
"from"
,
"2"
);
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"version"
,
"2.9.7"
);
headers
.
put
(
"from"
,
"2"
);
SobotHttpUtils
.
doPost
(
MainActivity
.
this
,
"https://api.sobot.com/chat-sdk/sdk/user/v2/robotGuide.action"
,
map
,
headers
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
public
void
onResponse
(
String
result
)
{
}
@Override
public
void
onError
(
Exception
e
,
String
msg
,
int
responseCode
)
{
}
@Override
public
void
inProgress
(
int
progress
)
{
}
});
String
languageFileName
=
"sobot_android_strings_en.json"
;
String
languagePath
=
SobotSDCardUtils
.
getPrivatePath
(
MainActivity
.
this
)
+
File
.
separator
+
"sobot_language"
+
File
.
separator
+
languageFileName
;
File
file
=
new
File
(
languagePath
);
// HttpBaseUtils.getInstance().download("https://img.sobot.com/mobile/multilingual/android/3_1_5/sobot_android_strings_en.json", file, new HttpBaseUtils.FileCallBack() {
// @Override
// public void onResponse(File result) {
// if (result.exists()) {
// SobotLogUtils.i("下载文件成功");
// }else{
// SobotLogUtils.i("下载的文件不存在");
// }
// }
//
// @Override
// public void onError(Exception e, String msg, int responseCode) {
//
// }
//
// @Override
// public void inProgress(int progress) {
//
// }
// });
// if (file.exists()) {
// SobotLogUtils.i("文件存在 开始上传");
// Map<String, Object> map1 = new HashMap<>();
// map1.put("uid", "34a466420d78fa1172bc0acd85166745");
// map1.put("cid", "2b3dd49e54654313a2985c1a160f1671");
// map1.put("from", "2");
// map1.put("version", "2.9.7");
// Map<String, String> headers1 = new HashMap<>();
// SobotHttpUtils.uploadFile(MainActivity.this, "https://api.sobot.com/chat-sdk/sdk/user/v2/uploadFileAndroid.action", map1, headers1, file.getAbsolutePath(), new HttpBaseUtils.StringCallBack() {
// @Override
// public void onResponse(String result) {
//
// }
//
// @Override
// public void onError(Exception e, String msg, int responseCode) {
//
// }
//
// @Override
// public void inProgress(int progress) {
//
// }
// });
// }
}
@Override
...
...
app/src/main/java/com/sobot/moduletest/MyApp.java
View file @
40da7eff
package
com
.
sobot
.
moduletest
;
import
android.app.Application
;
import
android.support.multidex.MultiDex
;
import
android.support.multidex.MultiDexApplication
;
//import com.facebook.drawee.backends.pipeline.Fresco;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.utils.SobotCommonApi
;
...
...
@@ -13,13 +11,13 @@ import com.sobot.common.utils.SobotCommonApi;
* @Date: 2021/7/19 上午11:06
* @Version: 1.0
*/
public
class
MyApp
extends
Application
{
public
class
MyApp
extends
MultiDex
Application
{
@Override
public
void
onCreate
()
{
super
.
onCreate
();
// Fresco.initialize(this);
// 主要是添加下面这句代码
MultiDex
.
install
(
this
);
//
MultiDex.install(this);
SobotCommonApi
.
init
(
this
,
"https://sobot.com"
);
SobotCommonApi
.
setShowLogDebug
(
true
);
...
...
app/src/test/java/com/sobot/moduletest/ExampleUnitTest.java
View file @
40da7eff
package
com
.
sobot
.
moduletest
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
import
org.junit.Test
;
/**
* Example local unit test, which will execute on the development machine (host).
*
...
...
sobot_common/build.gradle
View file @
40da7eff
...
...
@@ -14,19 +14,19 @@ dependencies {
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compileOnly
'com.squareup.okhttp3:okhttp:3.12.0'
compileOnly
'com.android.support:appcompat-v7:28.0.0'
//
api project(':sobot_utils')
//
api project(':sobot_pictureframe')
//
api project(':sobot_network')
//
api project(':sobot_gson')
api
project
(
':sobot_utils'
)
api
project
(
':sobot_pictureframe'
)
api
project
(
':sobot_network'
)
api
project
(
':sobot_gson'
)
api
'com.sobot.library:utils:1.1.1'
api
'com.sobot.library:picture:1.1.4'
api
'com.sobot.library:net:1.1.1
'
api
'com.sobot.library:gson:1.1.1'
//
api 'com.sobot.library:utils:1.1.1'
//
api 'com.sobot.library:picture:1.1.4'
// api 'com.sobot.library:net:1.1.2
'
//
api 'com.sobot.library:gson:1.1.1'
// api 'com.sobot.library:utils:1.1.1'
// api 'com.sobot.library:picture_x:1.1.4'
// api 'com.sobot.library:net:1.1.
1
'
// api 'com.sobot.library:net:1.1.
2
'
// api 'com.sobot.library:gson:1.1.1'
}
...
...
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
40da7eff
...
...
@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon'
//项目名
// PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名
PUBLISH_VERSION
=
'1.2.
1
'
//版本号
PUBLISH_VERSION
=
'1.2.
2
'
//版本号
}
...
...
sobot_common/src/main/java/com/sobot/common/ui/base/SobotBaseActivity.java
View file @
40da7eff
...
...
@@ -358,7 +358,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
protected
void
initBundleData
(
Bundle
savedInstanceState
)
{
}
protected
abstract
void
initView
();
protected
abstract
void
initView
()
throws
InterruptedException
;
protected
abstract
void
initData
();
...
...
sobot_gson/src/main/java/com/sobot/gson/GsonBuilder.java
View file @
40da7eff
...
...
@@ -16,6 +16,18 @@
package
com
.
sobot
.
gson
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_COMPLEX_MAP_KEYS
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_DATE_PATTERN
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_ESCAPE_HTML
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_JSON_NON_EXECUTABLE
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_LENIENT
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_NUMBER_TO_NUMBER_STRATEGY
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_OBJECT_TO_NUMBER_STRATEGY
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_PRETTY_PRINT
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_SERIALIZE_NULLS
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_SPECIALIZE_FLOAT_VALUES
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_USE_JDK_UNSAFE
;
import
com.sobot.gson.internal.
$Gson$Preconditions
;
import
com.sobot.gson.internal.Excluder
;
import
com.sobot.gson.internal.bind.DefaultDateTypeAdapter
;
...
...
@@ -35,18 +47,6 @@ import java.util.LinkedList;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_COMPLEX_MAP_KEYS
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_DATE_PATTERN
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_ESCAPE_HTML
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_JSON_NON_EXECUTABLE
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_LENIENT
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_NUMBER_TO_NUMBER_STRATEGY
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_OBJECT_TO_NUMBER_STRATEGY
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_PRETTY_PRINT
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_SERIALIZE_NULLS
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_SPECIALIZE_FLOAT_VALUES
;
import
static
com
.
sobot
.
gson
.
Gson
.
DEFAULT_USE_JDK_UNSAFE
;
/**
* <p>Use this builder to construct a {@link Gson} instance when you need to set configuration
* options other than the default. For {@link Gson} with default configuration, it is simpler to
...
...
sobot_gson/src/main/java/com/sobot/gson/internal/$Gson$Types.java
View file @
40da7eff
...
...
@@ -16,6 +16,9 @@
package
com
.
sobot
.
gson
.
internal
;
import
static
com
.
sobot
.
gson
.
internal
.
$Gson$Preconditions
.
checkArgument
;
import
static
com
.
sobot
.
gson
.
internal
.
$Gson$Preconditions
.
checkNotNull
;
import
java.io.Serializable
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.GenericArrayType
;
...
...
@@ -32,9 +35,6 @@ import java.util.Map;
import
java.util.NoSuchElementException
;
import
java.util.Properties
;
import
static
com
.
sobot
.
gson
.
internal
.
$Gson$Preconditions
.
checkArgument
;
import
static
com
.
sobot
.
gson
.
internal
.
$Gson$Preconditions
.
checkNotNull
;
/**
* Static methods for working with types.
*
...
...
sobot_gson/src/main/java/com/sobot/gson/stream/JsonWriter.java
View file @
40da7eff
...
...
@@ -16,6 +16,14 @@
package
com
.
sobot
.
gson
.
stream
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
DANGLING_NAME
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_ARRAY
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_DOCUMENT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_OBJECT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_ARRAY
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_DOCUMENT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_OBJECT
;
import
java.io.Closeable
;
import
java.io.Flushable
;
import
java.io.IOException
;
...
...
@@ -27,14 +35,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.regex.Pattern
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
DANGLING_NAME
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_ARRAY
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_DOCUMENT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
EMPTY_OBJECT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_ARRAY
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_DOCUMENT
;
import
static
com
.
sobot
.
gson
.
stream
.
JsonScope
.
NONEMPTY_OBJECT
;
/**
* Writes a JSON (<a href="http://www.ietf.org/rfc/rfc7159.txt">RFC 7159</a>)
* encoded value to a stream, one token at a time. The stream includes both
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/SobotRefreshLayout.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
;
import
static
android
.
view
.
MotionEvent
.
obtain
;
import
static
android
.
view
.
View
.
MeasureSpec
.
AT_MOST
;
import
static
android
.
view
.
View
.
MeasureSpec
.
EXACTLY
;
import
static
android
.
view
.
View
.
MeasureSpec
.
getSize
;
import
static
android
.
view
.
View
.
MeasureSpec
.
makeMeasureSpec
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
dp2px
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
fling
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isContentView
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
android.animation.Animator
;
import
android.animation.AnimatorListenerAdapter
;
import
android.animation.ValueAnimator
;
...
...
@@ -61,18 +73,6 @@ import com.sobot.widget.refresh.layout.wrapper.RefreshContentWrapper;
import
com.sobot.widget.refresh.layout.wrapper.RefreshFooterWrapper
;
import
com.sobot.widget.refresh.layout.wrapper.RefreshHeaderWrapper
;
import
static
android
.
view
.
MotionEvent
.
obtain
;
import
static
android
.
view
.
View
.
MeasureSpec
.
AT_MOST
;
import
static
android
.
view
.
View
.
MeasureSpec
.
EXACTLY
;
import
static
android
.
view
.
View
.
MeasureSpec
.
getSize
;
import
static
android
.
view
.
View
.
MeasureSpec
.
makeMeasureSpec
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
dp2px
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
fling
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isContentView
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
/**
* 智能刷新布局
* Intelligent RefreshLayout
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/api/RefreshComponent.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
api
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY_GROUP
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
SUBCLASSES
;
import
android.support.annotation.ColorInt
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.RestrictTo
;
...
...
@@ -8,10 +12,6 @@ import android.view.View;
import
com.sobot.widget.refresh.layout.constant.SpinnerStyle
;
import
com.sobot.widget.refresh.layout.listener.OnStateChangedListener
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY_GROUP
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
SUBCLASSES
;
/**
* 刷新内部组件
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/api/RefreshFooter.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
api
;
import
android.support.annotation.RestrictTo
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY_GROUP
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
SUBCLASSES
;
import
android.support.annotation.RestrictTo
;
/**
* 刷新底部
* Created by scwang on 2017/5/26.
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/footer/ClassicsAbstract.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
footer
;
import
static
android
.
view
.
View
.
MeasureSpec
.
EXACTLY
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.Animatable
;
...
...
@@ -25,8 +27,6 @@ import com.sobot.widget.refresh.layout.drawable.PaintDrawable;
import
com.sobot.widget.refresh.layout.simple.SimpleComponent
;
import
com.sobot.widget.refresh.layout.util.SmartUtil
;
import
static
android
.
view
.
View
.
MeasureSpec
.
EXACTLY
;
@SuppressWarnings
({
"unused"
,
"UnusedReturnValue"
})
public
abstract
class
ClassicsAbstract
<
T
extends
ClassicsAbstract
>
extends
SimpleComponent
implements
RefreshComponent
{
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/header/ClassicsHeader.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
header
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
...
...
@@ -33,8 +35,6 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Locale
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
/**
* 经典下拉头部
* Created by scwang on 2017/5/28.
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/listener/OnStateChangedListener.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
listener
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY_GROUP
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
SUBCLASSES
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.RestrictTo
;
import
com.sobot.widget.refresh.layout.api.RefreshLayout
;
import
com.sobot.widget.refresh.layout.constant.RefreshState
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
LIBRARY_GROUP
;
import
static
android
.
support
.
annotation
.
RestrictTo
.
Scope
.
SUBCLASSES
;
/**
* 刷新状态改变监听器
* Created by scwang on 2017/5/26.
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/simple/SimpleComponent.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
simple
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.support.annotation.ColorInt
;
...
...
@@ -20,8 +22,6 @@ import com.sobot.widget.refresh.layout.constant.RefreshState;
import
com.sobot.widget.refresh.layout.constant.SpinnerStyle
;
import
com.sobot.widget.refresh.layout.listener.OnStateChangedListener
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
/**
* Component 初步实现
* 实现 Header 和 Footer 时,继承 ComponentAbstract 的话可以少写很多接口方法
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/util/SmartUtil.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
util
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
import
android.content.res.Resources
;
import
android.graphics.PointF
;
import
android.os.Build
;
...
...
@@ -21,9 +24,6 @@ import android.widget.ScrollView;
import
com.sobot.widget.R
;
import
com.sobot.widget.refresh.layout.api.RefreshComponent
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
;
/**
* SmartUtil
* Created by scwang on 2018/3/5.
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/wrapper/RefreshContentWrapper.java
View file @
40da7eff
package
com
.
sobot
.
widget
.
refresh
.
layout
.
wrapper
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isContentView
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isTransformedTouchPointInView
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
measureViewHeight
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
scrollListBy
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator.AnimatorUpdateListener
;
import
android.graphics.PointF
;
...
...
@@ -26,12 +32,6 @@ import java.util.LinkedList;
import
java.util.List
;
import
java.util.Queue
;
import
static
android
.
view
.
ViewGroup
.
LayoutParams
.
MATCH_PARENT
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isContentView
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
isTransformedTouchPointInView
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
measureViewHeight
;
import
static
com
.
sobot
.
widget
.
refresh
.
layout
.
util
.
SmartUtil
.
scrollListBy
;
/**
* 刷新内容包装
* Created by scwang on 2017/5/26.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment