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
dff0835b
Commit
dff0835b
authored
Apr 15, 2022
by
郑娜伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widget 添加加载布局控件
parent
fb2d87e4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
209 additions
and
14 deletions
+209
-14
build.gradle
app/build.gradle
+2
-2
MainActivity.java
app/src/main/java/com/sobot/moduletest/MainActivity.java
+4
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+11
-8
build.gradle
sobot_widget/build.gradle
+1
-1
sobot-widget-publish-mavencentral.gradle
sobot_widget/sobot-widget-publish-mavencentral.gradle
+1
-1
SobotLoadingLayout.java
...ain/java/com/sobot/widget/loading/SobotLoadingLayout.java
+0
-0
ClassicsFooter.java
...om/sobot/widget/refresh/layout/footer/ClassicsFooter.java
+1
-1
ClassicsHeader.java
...om/sobot/widget/refresh/layout/header/ClassicsHeader.java
+1
-1
sobot_loading_layout_button.xml
...get/src/main/res/drawable/sobot_loading_layout_button.xml
+6
-0
sobot_loading_layout_empty.xml
...widget/src/main/res/layout/sobot_loading_layout_empty.xml
+24
-0
sobot_loading_layout_error.xml
...widget/src/main/res/layout/sobot_loading_layout_error.xml
+37
-0
sobot_loading_layout_loading.xml
...dget/src/main/res/layout/sobot_loading_layout_loading.xml
+25
-0
sobot_srl_classics_footer.xml
..._widget/src/main/res/layout/sobot_srl_classics_footer.xml
+0
-0
sobot_srl_classics_header.xml
..._widget/src/main/res/layout/sobot_srl_classics_header.xml
+0
-0
strings.xml
sobot_widget/src/main/res/values-en/strings.xml
+4
-0
colors.xml
sobot_widget/src/main/res/values/colors.xml
+3
-0
strings.xml
sobot_widget/src/main/res/values/strings.xml
+7
-0
values-loading-layout.xml
sobot_widget/src/main/res/values/values-loading-layout.xml
+82
-0
No files found.
app/build.gradle
View file @
dff0835b
...
...
@@ -8,7 +8,7 @@ android {
defaultConfig
{
applicationId
"com.sobot.moduletest"
minSdkVersion
1
4
minSdkVersion
1
6
targetSdkVersion
28
versionCode
1
versionName
"1.0"
...
...
@@ -35,7 +35,7 @@ dependencies {
implementation
project
(
':sobot_common'
)
// implementation project(':sobot_widget')
implementation
'com.sobot.library:widget:0.
1
'
implementation
'com.sobot.library:widget:0.
2
'
// api 'com.sobot.library:sobotcommon:1.0'
// api 'com.sobot.library:sobotcommon_x:1.0'
...
...
app/src/main/java/com/sobot/moduletest/MainActivity.java
View file @
dff0835b
...
...
@@ -14,6 +14,7 @@ import com.sobot.common.utils.SobotImageUtils;
import
com.sobot.network.http.db.SobotDownloadManager
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.widget.loading.SobotLoadingLayout
;
import
com.sobot.widget.refresh.layout.api.RefreshLayout
;
import
com.sobot.widget.refresh.layout.footer.ClassicsFooter
;
import
com.sobot.widget.refresh.layout.header.ClassicsHeader
;
...
...
@@ -27,6 +28,7 @@ public class MainActivity extends SobotBaseActivity {
private
ImageView
img
;
private
ImageView
img2
;
private
SobotLoadingLayout
loadinglayout
;
@Override
protected
int
getContentViewResId
()
{
...
...
@@ -84,6 +86,8 @@ public class MainActivity extends SobotBaseActivity {
refreshLayout
.
setRefreshFooter
(
new
ClassicsFooter
(
this
));
refreshLayout
.
setEnableLoadMore
(
false
);
loadinglayout
=
findViewById
(
R
.
id
.
loadinglayout
);
loadinglayout
.
showContent
();
}
@Override
...
...
app/src/main/res/layout/activity_main.xml
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:orientation=
"vertical"
tools:context=
".MainActivity"
>
...
...
@@ -29,17 +29,21 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
<com.sobot.widget.loading.SobotLoadingLayout
android:id=
"@+id/loadinglayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#fff"
android:overScrollMode=
"never"
/>
app:llEmptyImage=
"@drawable/ic_launcher_background"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#fff"
android:overScrollMode=
"never"
/>
</com.sobot.widget.loading.SobotLoadingLayout>
</com.sobot.widget.refresh.layout.SobotRefreshLayout>
</LinearLayout>
\ No newline at end of file
sobot_widget/build.gradle
View file @
dff0835b
...
...
@@ -6,7 +6,7 @@ android {
compileSdkVersion
28
defaultConfig
{
minSdkVersion
1
4
minSdkVersion
1
6
}
}
...
...
sobot_widget/sobot-widget-publish-mavencentral.gradle
View file @
dff0835b
...
...
@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'widget'
//项目名
// PUBLISH_ARTIFACT_ID = 'widget_x' //项目名
PUBLISH_VERSION
=
'0.
1
'
//版本号
PUBLISH_VERSION
=
'0.
2
'
//版本号
}
...
...
sobot_widget/src/main/java/com/sobot/widget/loading/SobotLoadingLayout.java
0 → 100644
View file @
dff0835b
This diff is collapsed.
Click to expand it.
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/footer/ClassicsFooter.java
View file @
dff0835b
...
...
@@ -50,7 +50,7 @@ public class ClassicsFooter extends ClassicsAbstract<ClassicsFooter> implements
public
ClassicsFooter
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
,
0
);
View
.
inflate
(
context
,
R
.
layout
.
srl_classics_footer
,
this
);
View
.
inflate
(
context
,
R
.
layout
.
s
obot_s
rl_classics_footer
,
this
);
final
View
thisView
=
this
;
final
View
arrowView
=
mArrowView
=
thisView
.
findViewById
(
R
.
id
.
srl_classics_arrow
);
...
...
sobot_widget/src/main/java/com/sobot/widget/refresh/layout/header/ClassicsHeader.java
View file @
dff0835b
...
...
@@ -79,7 +79,7 @@ public class ClassicsHeader extends ClassicsAbstract<ClassicsHeader> implements
public
ClassicsHeader
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
,
0
);
View
.
inflate
(
context
,
R
.
layout
.
srl_classics_header
,
this
);
View
.
inflate
(
context
,
R
.
layout
.
s
obot_s
rl_classics_header
,
this
);
final
View
thisView
=
this
;
final
View
arrowView
=
mArrowView
=
thisView
.
findViewById
(
R
.
id
.
srl_classics_arrow
);
...
...
sobot_widget/src/main/res/drawable/sobot_loading_layout_button.xml
0 → 100644
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"5dp"
/>
<stroke
android:width=
"1px"
android:color=
"#CCCCCC"
/>
</shape>
\ No newline at end of file
sobot_widget/src/main/res/layout/sobot_loading_layout_empty.xml
0 → 100644
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@id/empty_image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:adjustViewBounds=
"true"
/>
<TextView
android:id=
"@id/empty_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"14dp"
/>
</LinearLayout>
\ No newline at end of file
sobot_widget/src/main/res/layout/sobot_loading_layout_error.xml
0 → 100644
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:paddingBottom=
"30dp"
>
<ImageView
android:id=
"@id/error_image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:adjustViewBounds=
"true"
/>
<TextView
android:id=
"@id/error_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_margin=
"20dp"
/>
<TextView
android:id=
"@id/retry_button"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@drawable/sobot_loading_layout_button"
android:gravity=
"center"
android:minWidth=
"120dp"
android:padding=
"10dp"
/>
</LinearLayout>
\ No newline at end of file
sobot_widget/src/main/res/layout/sobot_loading_layout_loading.xml
0 → 100644
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:paddingBottom=
"30dp"
>
<ProgressBar
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center"
android:progress=
"80"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"14dp"
android:text=
"@string/sobot_loading_string"
android:textColor=
"@color/sobot_loading_layout_text_color"
android:textSize=
"16sp"
/>
</LinearLayout>
\ No newline at end of file
sobot_widget/src/main/res/layout/srl_classics_footer.xml
→
sobot_widget/src/main/res/layout/s
obot_s
rl_classics_footer.xml
View file @
dff0835b
File moved
sobot_widget/src/main/res/layout/srl_classics_header.xml
→
sobot_widget/src/main/res/layout/s
obot_s
rl_classics_header.xml
View file @
dff0835b
File moved
sobot_widget/src/main/res/values-en/strings.xml
View file @
dff0835b
...
...
@@ -19,4 +19,8 @@
<string
name=
"sobot_srl_header_update"
>
\'Last Update\' M-d HH:mm
</string>
<string
name=
"sobot_srl_header_secondary"
>
Release To Second Floor
</string>
<string
name=
"sobot_no_data_string"
>
No data
</string>
<string
name=
"sobot_no_net_string"
>
No network connection, please check your network
</string>
<string
name=
"sobot_error_click_reload_string"
>
Loading failed, click Retry
</string>
<string
name=
"sobot_loading_string"
>
Loading...
</string>
</resources>
sobot_widget/src/main/res/values/colors.xml
View file @
dff0835b
...
...
@@ -24,4 +24,7 @@
<!--下拉刷新 尾部 加载中 旋转控件颜色-->
<color
name=
"sobot_refresh_footer_progress_color"
>
@color/sobot_refresh_progress_color
</color>
<!--加载布局控件文字颜色-->
<color
name=
"sobot_loading_layout_text_color"
>
#8B98AD
</color>
</resources>
sobot_widget/src/main/res/values/strings.xml
View file @
dff0835b
...
...
@@ -18,4 +18,11 @@
<string
name=
"sobot_srl_footer_finish"
>
加载完成
</string>
<string
name=
"sobot_srl_footer_failed"
>
加载失败
</string>
<string
name=
"sobot_srl_footer_nothing"
>
没有更多数据了
</string>
<string
name=
"sobot_no_data_string"
>
暂无数据
</string>
<string
name=
"sobot_no_net_string"
>
无网络连接,请检查您的网络...
</string>
<string
name=
"sobot_error_click_reload_string"
>
加载失败,点击重试~~
</string>
<string
name=
"sobot_loading_string"
>
加载中...
</string>
</resources>
sobot_widget/src/main/res/values/values-loading-layout.xml
0 → 100644
View file @
dff0835b
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 czy1121
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<item
name=
"empty_image"
type=
"id"
/>
<item
name=
"empty_text"
type=
"id"
/>
<item
name=
"error_image"
type=
"id"
/>
<item
name=
"error_text"
type=
"id"
/>
<item
name=
"retry_button"
type=
"id"
/>
<attr
name=
"styleLoadingLayout"
format=
"reference"
/>
<style
name=
"SobotLoadingLayout"
></style>
<style
name=
"SobotLoadingLayout.Style"
>
<item
name=
"llEmptyResId"
>
@layout/sobot_loading_layout_empty
</item>
<item
name=
"llLoadingResId"
>
@layout/sobot_loading_layout_loading
</item>
<item
name=
"llErrorResId"
>
@layout/sobot_loading_layout_error
</item>
<item
name=
"llTextColor"
>
@color/sobot_loading_layout_text_color
</item>
<item
name=
"llTextSize"
>
16sp
</item>
<item
name=
"llButtonTextColor"
>
@color/sobot_loading_layout_text_color
</item>
<item
name=
"llButtonTextSize"
>
16sp
</item>
<item
name=
"llButtonBackground"
>
@drawable/sobot_loading_layout_button
</item>
<item
name=
"llEmptyImage"
>
@null
</item>
<item
name=
"llEmptyText"
>
@string/sobot_no_data_string
</item>
<item
name=
"llErrorImage"
>
@null
</item>
<item
name=
"llErrorText"
>
@string/sobot_no_net_string
</item>
<item
name=
"llRetryText"
>
@string/sobot_error_click_reload_string
</item>
</style>
<declare-styleable
name=
"SobotLoadingLayout"
>
<!-- 空布局资源id -->
<attr
name=
"llEmptyResId"
format=
"reference"
/>
<!-- 加载中布局资源id -->
<attr
name=
"llLoadingResId"
format=
"reference"
/>
<!-- 错误布局资源id -->
<attr
name=
"llErrorResId"
format=
"reference"
/>
<!-- 空布局图片 -->
<attr
name=
"llEmptyImage"
format=
"reference"
/>
<!-- 空布局文本 -->
<attr
name=
"llEmptyText"
format=
"string"
/>
<!-- 错误布局图片 -->
<attr
name=
"llErrorImage"
format=
"reference"
/>
<!-- 错误布局文本 -->
<attr
name=
"llErrorText"
format=
"string"
/>
<!-- 错误布局重试按钮文本 -->
<attr
name=
"llRetryText"
format=
"string"
/>
<!-- 文本颜色 -->
<attr
name=
"llTextColor"
format=
"color"
/>
<!-- 文本尺寸 -->
<attr
name=
"llTextSize"
format=
"dimension"
/>
<!-- 按钮文本颜色 -->
<attr
name=
"llButtonTextColor"
format=
"color"
/>
<!-- 按钮文本尺寸 -->
<attr
name=
"llButtonTextSize"
format=
"dimension"
/>
<!-- 按钮背景 -->
<attr
name=
"llButtonBackground"
format=
"reference"
/>
</declare-styleable>
</resources>
\ No newline at end of file
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