Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_book
Project
Project
Details
Activity
Releases
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
android
android_book
Commits
0a0207dc
Commit
0a0207dc
authored
Sep 27, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b7214ab8
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
120 additions
and
53 deletions
+120
-53
BookSearchPresenter.kt
...uben/infinitefunjia/mvp/presenters/BookSearchPresenter.kt
+1
-0
BaseActivity.java
.../duben/infinitefunjia/ui/activitys/base/BaseActivity.java
+1
-1
LoadingDialog.java
...va/com/duben/infinitefunjia/ui/widgets/LoadingDialog.java
+8
-33
ForegroundOrBackground.java
...om/duben/infinitefunjia/utils/ForegroundOrBackground.java
+1
-1
ufo_loading.xml
book/app/src/main/res/drawable/ufo_loading.xml
+52
-0
ufo_loading_refresh.xml
book/app/src/main/res/drawable/ufo_loading_refresh.xml
+37
-0
loadingdialog.xml
book/app/src/main/res/layout/loadingdialog.xml
+12
-18
loading_u1.png
book/app/src/main/res/mipmap-xhdpi/loading_u1.png
+0
-0
loading_u10.png
book/app/src/main/res/mipmap-xhdpi/loading_u10.png
+0
-0
loading_u11.png
book/app/src/main/res/mipmap-xhdpi/loading_u11.png
+0
-0
loading_u12.png
book/app/src/main/res/mipmap-xhdpi/loading_u12.png
+0
-0
loading_u2.png
book/app/src/main/res/mipmap-xhdpi/loading_u2.png
+0
-0
loading_u3.png
book/app/src/main/res/mipmap-xhdpi/loading_u3.png
+0
-0
loading_u4.png
book/app/src/main/res/mipmap-xhdpi/loading_u4.png
+0
-0
loading_u5.png
book/app/src/main/res/mipmap-xhdpi/loading_u5.png
+0
-0
loading_u6.png
book/app/src/main/res/mipmap-xhdpi/loading_u6.png
+0
-0
loading_u7.png
book/app/src/main/res/mipmap-xhdpi/loading_u7.png
+0
-0
loading_u8.png
book/app/src/main/res/mipmap-xhdpi/loading_u8.png
+0
-0
loading_u9.png
book/app/src/main/res/mipmap-xhdpi/loading_u9.png
+0
-0
styles.xml
book/app/src/main/res/values/styles.xml
+8
-0
No files found.
book/app/src/main/java/com/duben/infinitefunjia/mvp/presenters/BookSearchPresenter.kt
View file @
0a0207dc
...
@@ -48,6 +48,7 @@ class BookSearchPresenter : BasePresenter<BookSearchView>() {
...
@@ -48,6 +48,7 @@ class BookSearchPresenter : BasePresenter<BookSearchView>() {
}
}
fun
searchBook
(
searchName
:
String
,
pageNo
:
Int
,
pageSize
:
Int
)
{
fun
searchBook
(
searchName
:
String
,
pageNo
:
Int
,
pageSize
:
Int
)
{
view
.
showLoading
(
"加载中..."
)
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"searchName"
]
=
searchName
vo
[
"searchName"
]
=
searchName
vo
[
"pageNo"
]
=
pageNo
vo
[
"pageNo"
]
=
pageNo
...
...
book/app/src/main/java/com/duben/infinitefunjia/ui/activitys/base/BaseActivity.java
View file @
0a0207dc
...
@@ -37,7 +37,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
...
@@ -37,7 +37,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
// 禁止截图
// 禁止截图
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_SECURE
);
//
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
!=
Build
.
VERSION_CODES
.
O
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
!=
Build
.
VERSION_CODES
.
O
)
{
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
...
...
book/app/src/main/java/com/duben/infinitefunjia/ui/widgets/LoadingDialog.java
View file @
0a0207dc
...
@@ -34,44 +34,19 @@ public class LoadingDialog extends BaseDialog {
...
@@ -34,44 +34,19 @@ public class LoadingDialog extends BaseDialog {
private
LayoutParams
lp
;
private
LayoutParams
lp
;
private
TextView
loadtext
;
private
TextView
loadtext
;
private
LinearLayout
loading_ll
;
private
LinearLayout
loading_ll
;
private
ImageView
loading_iv
;
public
LoadingDialog
(
Context
context
)
{
public
LoadingDialog
(
Context
context
)
{
super
(
context
,
R
.
style
.
dialog
);
super
(
context
,
R
.
style
.
dialog
);
this
.
mContext
=
context
;
this
.
mContext
=
context
;
inflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
inflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
layout
=
inflater
.
inflate
(
R
.
layout
.
loadingdialog
,
null
);
View
layout
=
inflater
.
inflate
(
R
.
layout
.
loadingdialog
,
null
);
// if (android.os.Build.VERSION.SDK_INT > 22) {//android 6.0替换clip的加载动画
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>
22
)
{
//android 6.0替换clip的加载动画
// final Drawable drawable = ContextCompat.getDrawable(mContext, R.drawable.ufo_loading_refresh);
final
Drawable
drawable
=
ContextCompat
.
getDrawable
(
mContext
,
R
.
drawable
.
ufo_loading_refresh
);
// ProgressBar loading_bar = (ProgressBar) layout.findViewById(R.id.loading_bar);
ProgressBar
loading_bar
=
(
ProgressBar
)
layout
.
findViewById
(
R
.
id
.
loading_bar
);
// loading_bar.setIndeterminateDrawable(drawable);
loading_bar
.
setIndeterminateDrawable
(
drawable
);
// }
}
// loadtext = (TextView) layout.findViewById(R.id.loading_text);
// loading_ll = (LinearLayout) layout.findViewById(R.id.loading_ll);
// setContentView(layout);
// // 设置window属性
// lp = getWindow().getAttributes();
// lp.gravity = Gravity.CENTER;
// lp.dimAmount = 0; // 去背景遮盖
// // lp.alpha = 1.0f;//透明效果
// getWindow().setAttributes(lp);
loadtext
=
(
TextView
)
layout
.
findViewById
(
R
.
id
.
loading_text
);
loadtext
=
(
TextView
)
layout
.
findViewById
(
R
.
id
.
loading_text
);
loading_iv
=
(
ImageView
)
layout
.
findViewById
(
R
.
id
.
loading_iv
);
loading_ll
=
(
LinearLayout
)
layout
.
findViewById
(
R
.
id
.
loading_ll
);
LottieDrawable
lottieDrawable
=
new
LottieDrawable
();
LottieCompositionFactory
.
fromAsset
(
context
,
"house_loading.json"
)
.
addListener
(
new
LottieListener
<
LottieComposition
>()
{
@Override
public
void
onResult
(
LottieComposition
result
)
{
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
);
lottieDrawable
.
setComposition
(
result
);
lottieDrawable
.
loop
(
true
);
lottieDrawable
.
playAnimation
();
}
});
loading_iv
.
setImageDrawable
(
lottieDrawable
);
setContentView
(
layout
);
setContentView
(
layout
);
// 设置window属性
// 设置window属性
lp
=
getWindow
().
getAttributes
();
lp
=
getWindow
().
getAttributes
();
...
@@ -88,9 +63,9 @@ public class LoadingDialog extends BaseDialog {
...
@@ -88,9 +63,9 @@ public class LoadingDialog extends BaseDialog {
*/
*/
public
void
setLoadText
(
String
content
)
{
public
void
setLoadText
(
String
content
)
{
if
(
TextUtils
.
isEmpty
(
content
))
{
if
(
TextUtils
.
isEmpty
(
content
))
{
//
loading_ll.setVisibility(View.GONE);
loading_ll
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
//
loading_ll.setVisibility(View.VISIBLE);
loading_ll
.
setVisibility
(
View
.
VISIBLE
);
loadtext
.
setText
(
content
);
loadtext
.
setText
(
content
);
}
}
}
}
...
...
book/app/src/main/java/com/duben/infinitefunjia/utils/ForegroundOrBackground.java
View file @
0a0207dc
...
@@ -88,7 +88,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -88,7 +88,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
long
diff
=
currentTimeMillis
-
activityStoppedTime
;
long
diff
=
currentTimeMillis
-
activityStoppedTime
;
long
diffInSeconds
=
diff
/
1000
;
long
diffInSeconds
=
diff
/
1000
;
System
.
out
.
println
(
"mcg -->>>>>:: diffInSeconds="
+
diffInSeconds
+
" adSuccessStatus="
+
SplashManager
.
INSTANCE
.
isSuccessStatus
());
System
.
out
.
println
(
"mcg -->>>>>:: diffInSeconds="
+
diffInSeconds
+
" adSuccessStatus="
+
SplashManager
.
INSTANCE
.
isSuccessStatus
());
if
(
diffInSeconds
>=
1
0
&&
SplashManager
.
INSTANCE
.
isSuccessStatus
())
{
if
(
diffInSeconds
>=
3
0
&&
SplashManager
.
INSTANCE
.
isSuccessStatus
())
{
activity
.
startActivity
(
new
Intent
(
activity
,
SplashForeAdActivity
.
class
));
activity
.
startActivity
(
new
Intent
(
activity
,
SplashForeAdActivity
.
class
));
}
}
}
}
...
...
book/app/src/main/res/drawable/ufo_loading.xml
0 → 100644
View file @
0a0207dc
<?xml version="1.0" encoding="UTF-8"?>
<animation-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:oneshot=
"false"
>
<!-- <item android:duration="100">-->
<!-- <clip-->
<!-- android:clipOrientation="horizontal"-->
<!-- android:drawable="@mipmap/loading_u0"-->
<!-- android:gravity="left" />-->
<!-- </item>-->
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u1"
android:gravity=
"left"
/>
</item>
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u2"
android:gravity=
"left"
/>
</item>
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u3"
android:gravity=
"left"
/>
</item>
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u4"
android:gravity=
"left"
/>
</item>
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u5"
android:gravity=
"left"
/>
</item>
<item
android:duration=
"100"
>
<clip
android:clipOrientation=
"horizontal"
android:drawable=
"@mipmap/loading_u6"
android:gravity=
"left"
/>
</item>
</animation-list>
\ No newline at end of file
book/app/src/main/res/drawable/ufo_loading_refresh.xml
0 → 100644
View file @
0a0207dc
<?xml version="1.0" encoding="UTF-8"?>
<animation-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:oneshot=
"false"
>
<item
android:drawable=
"@mipmap/loading_u1"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u2"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u3"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u4"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u5"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u7"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u8"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u9"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u10"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u11"
android:duration=
"100"
/>
<item
android:drawable=
"@mipmap/loading_u12"
android:duration=
"100"
/>
</animation-list>
\ No newline at end of file
book/app/src/main/res/layout/loadingdialog.xml
View file @
0a0207dc
...
@@ -2,40 +2,34 @@
...
@@ -2,40 +2,34 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_loading_
white
"
android:background=
"@drawable/shape_loading_
bg
"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingLeft=
"14dp"
android:paddingLeft=
"14dp"
android:padding
Top=
"10
dp"
android:padding
Right=
"14
dp"
android:padding
Right=
"14
dp"
>
android:padding
Top=
"10
dp"
>
<!-- 正在加载 -->
<!-- 正在加载 -->
<!-- <ProgressBar-->
<ProgressBar
<!-- android:id="@+id/loading_bar"-->
android:id=
"@+id/loading_bar"
<!-- style="@style/loading_small"-->
style=
"@style/loading_small"
<!-- android:layout_width="74dip"-->
android:layout_width=
"74dip"
<!-- android:layout_height="74dip" />-->
android:layout_height=
"74dip"
/>
<ImageView
android:id=
"@+id/loading_iv"
android:scaleType=
"centerCrop"
android:layout_width=
"80dip"
android:layout_height=
"80dip"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/loading_ll"
android:id=
"@+id/loading_ll"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Top=
"4
.0dip"
android:layout_margin
Bottom=
"8
.0dip"
android:layout_margin
Bottom=
"8
.0dip"
>
android:layout_margin
Top=
"4
.0dip"
>
<TextView
<TextView
android:id=
"@+id/loading_text"
android:id=
"@+id/loading_text"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"加载中..."
android:text=
"加载中..."
android:textColor=
"@color/
black
"
android:textColor=
"@color/
white
"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
</LinearLayout>
</LinearLayout>
...
...
book/app/src/main/res/mipmap-xhdpi/loading_u1.png
0 → 100644
View file @
0a0207dc
4.4 KB
book/app/src/main/res/mipmap-xhdpi/loading_u10.png
0 → 100644
View file @
0a0207dc
5.11 KB
book/app/src/main/res/mipmap-xhdpi/loading_u11.png
0 → 100644
View file @
0a0207dc
4.36 KB
book/app/src/main/res/mipmap-xhdpi/loading_u12.png
0 → 100644
View file @
0a0207dc
5.2 KB
book/app/src/main/res/mipmap-xhdpi/loading_u2.png
0 → 100644
View file @
0a0207dc
5.14 KB
book/app/src/main/res/mipmap-xhdpi/loading_u3.png
0 → 100644
View file @
0a0207dc
4.39 KB
book/app/src/main/res/mipmap-xhdpi/loading_u4.png
0 → 100644
View file @
0a0207dc
4.32 KB
book/app/src/main/res/mipmap-xhdpi/loading_u5.png
0 → 100644
View file @
0a0207dc
4.37 KB
book/app/src/main/res/mipmap-xhdpi/loading_u6.png
0 → 100644
View file @
0a0207dc
4.41 KB
book/app/src/main/res/mipmap-xhdpi/loading_u7.png
0 → 100644
View file @
0a0207dc
4.39 KB
book/app/src/main/res/mipmap-xhdpi/loading_u8.png
0 → 100644
View file @
0a0207dc
4.39 KB
book/app/src/main/res/mipmap-xhdpi/loading_u9.png
0 → 100644
View file @
0a0207dc
5.09 KB
book/app/src/main/res/values/styles.xml
View file @
0a0207dc
...
@@ -85,4 +85,12 @@
...
@@ -85,4 +85,12 @@
<item
name=
"android:progressDrawable"
>
@drawable/custom_seekbar_progress
</item>
<item
name=
"android:progressDrawable"
>
@drawable/custom_seekbar_progress
</item>
<item
name=
"android:thumb"
>
@drawable/custom_seekbar_thumb
</item>
<item
name=
"android:thumb"
>
@drawable/custom_seekbar_thumb
</item>
</style>
</style>
<style
name=
"loading_small"
parent=
"@android:style/Widget.ProgressBar.Small"
>
<item
name=
"android:indeterminateDrawable"
>
@drawable/ufo_loading
</item>
<item
name=
"android:layout_width"
>
25dip
</item>
<item
name=
"android:layout_height"
>
25dip
</item>
<item
name=
"android:layout_gravity"
>
center
</item>
</style>
</resources>
</resources>
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