Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
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_flowbox
Commits
884561f5
Commit
884561f5
authored
Jul 21, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改加载框
parent
ac2f1ffe
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
10 deletions
+30
-10
BaseActivity.java
...ava/com/mints/flowbox/ui/activitys/base/BaseActivity.java
+1
-0
BaseFragment.java
...java/com/mints/flowbox/ui/fragment/base/BaseFragment.java
+1
-0
LoadingDialog.java
...va/com/mints/flowbox/ui/widgets/dialog/LoadingDialog.java
+13
-5
GlideUtils.java
app/src/main/java/com/mints/library/utils/GlideUtils.java
+5
-0
ic_loading.gif
app/src/main/res/drawable-xhdpi/ic_loading.gif
+0
-0
loadingdialog.xml
app/src/main/res/layout/loadingdialog.xml
+10
-5
No files found.
app/src/main/java/com/mints/flowbox/ui/activitys/base/BaseActivity.java
View file @
884561f5
...
...
@@ -174,6 +174,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
try
{
if
(
this
.
getWindow
()
!=
null
&&
!
this
.
isFinishing
())
{
if
(
progressDialog
!=
null
&&
progressDialog
.
isShowing
())
{
progressDialog
.
clear
();
progressDialog
.
dismiss
();
progressDialog
=
null
;
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/base/BaseFragment.java
View file @
884561f5
...
...
@@ -98,6 +98,7 @@ public abstract class BaseFragment extends BaseAppFragment {
try
{
if
(
getActivity
().
getWindow
()
!=
null
&&
!
getActivity
().
isFinishing
())
{
if
(
progressDialog
!=
null
&&
progressDialog
.
isShowing
())
{
progressDialog
.
clear
();
progressDialog
.
dismiss
();
progressDialog
=
null
;
}
...
...
app/src/main/java/com/mints/flowbox/ui/widgets/dialog/LoadingDialog.java
View file @
884561f5
...
...
@@ -11,11 +11,13 @@ import android.view.Gravity;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.WindowManager.LayoutParams
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
com.mints.flowbox.R
;
import
com.mints.library.utils.GlideUtils
;
/**
* 描述:加载中dialog
...
...
@@ -30,17 +32,20 @@ public class LoadingDialog extends Dialog {
private
LayoutParams
lp
;
private
TextView
loadtext
;
private
LinearLayout
loading_ll
;
private
ImageView
loading_iv
;
public
LoadingDialog
(
Context
context
)
{
super
(
context
,
R
.
style
.
dialog
);
this
.
mContext
=
context
;
inflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
layout
=
inflater
.
inflate
(
R
.
layout
.
loadingdialog
,
null
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>
22
)
{
//android 6.0替换clip的加载动画
final
Drawable
drawable
=
ContextCompat
.
getDrawable
(
mContext
,
R
.
drawable
.
ufo_loading_refresh
);
ProgressBar
loading_bar
=
(
ProgressBar
)
layout
.
findViewById
(
R
.
id
.
loading_bar
);
loading_bar
.
setIndeterminateDrawable
(
drawable
);
}
// if (android.os.Build.VERSION.SDK_INT > 22) {//android 6.0替换clip的加载动画
// final Drawable drawable = ContextCompat.getDrawable(mContext, R.drawable.ufo_loading_refresh);
// ProgressBar loading_bar = (ProgressBar) layout.findViewById(R.id.loading_bar);
// loading_bar.setIndeterminateDrawable(drawable);
// }
loading_iv
=
(
ImageView
)
layout
.
findViewById
(
R
.
id
.
loading_iv
);
GlideUtils
.
loadImageViewGif
(
context
,
R
.
drawable
.
ic_loading
,
loading_iv
);
loadtext
=
(
TextView
)
layout
.
findViewById
(
R
.
id
.
loading_text
);
loading_ll
=
(
LinearLayout
)
layout
.
findViewById
(
R
.
id
.
loading_ll
);
setContentView
(
layout
);
...
...
@@ -66,4 +71,7 @@ public class LoadingDialog extends Dialog {
}
}
public
void
clear
(){
GlideUtils
.
clear
(
mContext
,
loading_iv
);
}
}
\ No newline at end of file
app/src/main/java/com/mints/library/utils/GlideUtils.java
View file @
884561f5
...
...
@@ -152,4 +152,9 @@ public class GlideUtils {
void
gifPlayComplete
();
}
public
static
void
clear
(
Context
context
,
ImageView
iv
){
if
(
iv
!=
null
){
Glide
.
with
(
context
).
clear
(
iv
);
}
}
}
app/src/main/res/drawable-xhdpi/ic_loading.gif
0 → 100644
View file @
884561f5
445 KB
app/src/main/res/layout/loadingdialog.xml
View file @
884561f5
...
...
@@ -11,11 +11,16 @@
<!-- 正在加载 -->
<ProgressBar
android:id=
"@+id/loading_bar"
style=
"@style/loading_small"
<!-- <ProgressBar-->
<!-- android:id="@+id/loading_bar"-->
<!-- style="@style/loading_small"-->
<!-- android:layout_width="74dip"-->
<!-- android:layout_height="74dip" />-->
<ImageView
android:id=
"@+id/loading_iv"
android:layout_width=
"74dip"
android:layout_height=
"74dip"
/>
android:layout_height=
"74dip"
/>
<LinearLayout
android:id=
"@+id/loading_ll"
...
...
@@ -30,7 +35,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"加载中..."
android:textColor=
"@color/
white
"
android:textColor=
"@color/
color_3D5AFE
"
android:textSize=
"14sp"
/>
</LinearLayout>
...
...
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