Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
422c3253
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
422c3253
编写于
7月 25, 2017
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 07/25 log
上级
44ea09d3
变更
30
展开全部
隐藏空白更改
内联
并排
Showing
30 changed file
with
1221 addition
and
1374 deletion
+1221
-1374
app/src/main/java/com/blankj/androidutilcode/activity/StatusBarAlphaActivity.java
...ankj/androidutilcode/activity/StatusBarAlphaActivity.java
+2
-2
app/src/main/java/com/blankj/androidutilcode/activity/StatusBarSwipeBackActivity.java
.../androidutilcode/activity/StatusBarSwipeBackActivity.java
+4
-12
app/src/main/res/layout/activity_activity.xml
app/src/main/res/layout/activity_activity.xml
+16
-21
app/src/main/res/layout/activity_app.xml
app/src/main/res/layout/activity_app.xml
+48
-53
app/src/main/res/layout/activity_bar.xml
app/src/main/res/layout/activity_bar.xml
+41
-46
app/src/main/res/layout/activity_clean.xml
app/src/main/res/layout/activity_clean.xml
+30
-35
app/src/main/res/layout/activity_device.xml
app/src/main/res/layout/activity_device.xml
+34
-39
app/src/main/res/layout/activity_drawer.xml
app/src/main/res/layout/activity_drawer.xml
+1
-1
app/src/main/res/layout/activity_flashlight.xml
app/src/main/res/layout/activity_flashlight.xml
+22
-27
app/src/main/res/layout/activity_image.xml
app/src/main/res/layout/activity_image.xml
+54
-59
app/src/main/res/layout/activity_keyboard.xml
app/src/main/res/layout/activity_keyboard.xml
+41
-46
app/src/main/res/layout/activity_log.xml
app/src/main/res/layout/activity_log.xml
+140
-145
app/src/main/res/layout/activity_network.xml
app/src/main/res/layout/activity_network.xml
+28
-33
app/src/main/res/layout/activity_permission.xml
app/src/main/res/layout/activity_permission.xml
+10
-15
app/src/main/res/layout/activity_phone.xml
app/src/main/res/layout/activity_phone.xml
+34
-39
app/src/main/res/layout/activity_pinyin.xml
app/src/main/res/layout/activity_pinyin.xml
+10
-15
app/src/main/res/layout/activity_process.xml
app/src/main/res/layout/activity_process.xml
+16
-21
app/src/main/res/layout/activity_sdcard.xml
app/src/main/res/layout/activity_sdcard.xml
+10
-15
app/src/main/res/layout/activity_snackbar.xml
app/src/main/res/layout/activity_snackbar.xml
+79
-84
app/src/main/res/layout/activity_span.xml
app/src/main/res/layout/activity_span.xml
+16
-21
app/src/main/res/layout/activity_status_bar_swipe_back.xml
app/src/main/res/layout/activity_status_bar_swipe_back.xml
+31
-62
app/src/main/res/layout/activity_toast.xml
app/src/main/res/layout/activity_toast.xml
+64
-70
app/src/main/res/layout/dialog_keyboard.xml
app/src/main/res/layout/dialog_keyboard.xml
+33
-38
app/src/main/res/layout/fragment_demo0.xml
app/src/main/res/layout/fragment_demo0.xml
+68
-77
app/src/main/res/layout/fragment_demo1.xml
app/src/main/res/layout/fragment_demo1.xml
+1
-2
app/src/main/res/layout/fragment_demo2.xml
app/src/main/res/layout/fragment_demo2.xml
+28
-37
app/src/main/res/layout/fragment_demo3.xml
app/src/main/res/layout/fragment_demo3.xml
+68
-77
update_log.md
update_log.md
+192
-191
utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java
...src/main/java/com/blankj/utilcode/util/ActivityUtils.java
+4
-4
utilcode/src/main/java/com/blankj/utilcode/util/BarUtils.java
...code/src/main/java/com/blankj/utilcode/util/BarUtils.java
+96
-87
未找到文件。
app/src/main/java/com/blankj/androidutilcode/activity/StatusBarAlphaActivity.java
浏览文件 @
422c3253
...
...
@@ -8,7 +8,7 @@ import android.widget.SeekBar;
import
android.widget.TextView
;
import
com.blankj.androidutilcode.R
;
import
com.blankj.androidutilcode.base.BaseActivity
;
import
com.blankj.androidutilcode.base.Base
Back
Activity
;
import
com.blankj.utilcode.util.BarUtils
;
/**
...
...
@@ -19,7 +19,7 @@ import com.blankj.utilcode.util.BarUtils;
* desc : Bar工具类Demo
* </pre>
*/
public
class
StatusBarAlphaActivity
extends
BaseActivity
{
public
class
StatusBarAlphaActivity
extends
Base
Back
Activity
{
private
int
mAlpha
;
...
...
app/src/main/java/com/blankj/androidutilcode/activity/StatusBarSwipeBackActivity.java
浏览文件 @
422c3253
...
...
@@ -11,9 +11,8 @@ import android.widget.TextView;
import
com.blankj.androidutilcode.R
;
import
com.blankj.androidutilcode.UtilsApp
;
import
com.blankj.androidutilcode.base.BaseActivity
;
import
com.blankj.androidutilcode.base.Base
Back
Activity
;
import
com.blankj.utilcode.util.BarUtils
;
import
com.r0adkll.slidr.Slidr
;
import
java.util.Random
;
...
...
@@ -26,7 +25,7 @@ import java.util.Random;
* desc : Bar工具类Demo
* </pre>
*/
public
class
StatusBarSwipeBackActivity
extends
BaseActivity
{
public
class
StatusBarSwipeBackActivity
extends
Base
Back
Activity
{
private
Random
mRandom
;
private
int
mColor
;
...
...
@@ -55,14 +54,7 @@ public class StatusBarSwipeBackActivity extends BaseActivity {
@Override
public
void
initView
(
Bundle
savedInstanceState
,
View
view
)
{
Slidr
.
attach
(
this
);
mToolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar
);
setSupportActionBar
(
mToolbar
);
if
(
getSupportActionBar
()
!=
null
)
{
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
}
getSupportActionBar
().
setTitle
(
getString
(
R
.
string
.
demo_bar
));
findViewById
(
R
.
id
.
btn_random_color
).
setOnClickListener
(
this
);
findViewById
(
R
.
id
.
btn_set_transparent
).
setOnClickListener
(
this
);
...
...
@@ -113,6 +105,6 @@ public class StatusBarSwipeBackActivity extends BaseActivity {
};
private
void
updateStatusBar
()
{
BarUtils
.
set
ColorForSwipeBack
(
StatusBarSwipeBackActivity
.
this
,
mColor
,
mAlpha
);
BarUtils
.
set
StatusBarColor
(
StatusBarSwipeBackActivity
.
this
,
mColor
,
mAlpha
);
}
}
app/src/main/res/layout/activity_activity.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_activity"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_activity"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_launch_image_activity"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/activity_start_imageActivity"
/>
<Button
android:id=
"@+id/btn_launch_image_activity"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/activity_start_imageActivity"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_app.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_app"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_app"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:paddingTop=
"16dp"
/>
android:gravity=
"center"
android:paddingTop=
"16dp"
/>
<Button
android:id=
"@+id/btn_install_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_install"
/>
<Button
android:id=
"@+id/btn_install_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_install"
/>
<Button
android:id=
"@+id/btn_install_app_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_install_silent"
/>
<Button
android:id=
"@+id/btn_install_app_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_install_silent"
/>
<Button
android:id=
"@+id/btn_uninstall_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_uninstall"
/>
<Button
android:id=
"@+id/btn_uninstall_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_uninstall"
/>
<Button
android:id=
"@+id/btn_uninstall_app_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_uninstall_silent"
/>
<Button
android:id=
"@+id/btn_uninstall_app_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_uninstall_silent"
/>
<Button
android:id=
"@+id/btn_launch_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_launch"
/>
<Button
android:id=
"@+id/btn_launch_app"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_launch"
/>
<Button
android:id=
"@+id/btn_get_app_details_settings"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_get_details_settings"
/>
<Button
android:id=
"@+id/btn_get_app_details_settings"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/app_get_details_settings"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_bar.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<Button
android:id=
"@+id/btn_status_bar_color"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<Button
android:id=
"@+id/btn_status_bar_color"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_color"
/>
android:text=
"@string/status_bar_set_color"
/>
<Button
android:id=
"@+id/btn_status_bar_alpha"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_alpha"
/>
<Button
android:id=
"@+id/btn_status_bar_alpha"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_alpha"
/>
<Button
android:id=
"@+id/btn_status_bar_image_view"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_image_view"
/>
<Button
android:id=
"@+id/btn_status_bar_image_view"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_image_view"
/>
<Button
android:id=
"@+id/btn_status_bar_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_fragment"
/>
<Button
android:id=
"@+id/btn_status_bar_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_fragment"
/>
<Button
android:id=
"@+id/btn_status_bar_swipe_back"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_swipe_back"
/>
<Button
android:id=
"@+id/btn_status_bar_swipe_back"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_swipe_back"
/>
<Button
android:id=
"@+id/btn_status_bar_drawer"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_drawer"
/>
<Button
android:id=
"@+id/btn_status_bar_drawer"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_drawer"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_clean.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<Button
android:id=
"@+id/btn_clean_internal_cache"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_cache"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_files"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_files"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_databases"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_databases"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_sp"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_internal_sp"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_external_cache"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_clean_external_cache"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_device.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_device"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_device"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_shutdown"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_shutdown"
/>
<Button
android:id=
"@+id/btn_shutdown"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_shutdown"
/>
<Button
android:id=
"@+id/btn_reboot"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot"
/>
<Button
android:id=
"@+id/btn_reboot"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot"
/>
<Button
android:id=
"@+id/btn_reboot_to_recovery"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot_to_recovery"
/>
<Button
android:id=
"@+id/btn_reboot_to_recovery"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot_to_recovery"
/>
<Button
android:id=
"@+id/btn_reboot_to_bootloader"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot_to_bootloader"
/>
<Button
android:id=
"@+id/btn_reboot_to_bootloader"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/device_reboot_to_bootloader"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_drawer.xml
浏览文件 @
422c3253
...
...
@@ -13,7 +13,7 @@
<FrameLayout
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
/>
android:layout_height=
"
wrap_cont
ent"
/>
<android.support.design.widget.NavigationView
android:id=
"@+id/nav_view"
...
...
app/src/main/res/layout/activity_flashlight.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_flashlight"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_flashlight"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_open_flashlight"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/flashlight_open"
/>
<Button
android:id=
"@+id/btn_open_flashlight"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/flashlight_open"
/>
<Button
android:id=
"@+id/btn_close_flashlight"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/flashlight_close"
/>
<Button
android:id=
"@+id/btn_close_flashlight"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/flashlight_close"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_image.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
android:layout_width=
"match_parent"
<ImageView
android:id=
"@+id/iv_src"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:src=
"@drawable/lena"
/>
<ImageView
android:id=
"@+id/iv_src"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
/>
<ImageView
android:id=
"@+id/iv_view2Bitmap"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_view2Bitmap
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_round
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_round
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_round_corner
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_round_corne
r"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_fast_blu
r"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_fas
t_blur"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_render_scrip
t_blur"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_render_script
_blur"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_stack
_blur"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_stack_blur
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_frame
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_frame
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_reflection
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_reflection
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_text_watermark
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_text
_watermark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_image
_watermark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_add_image_watermark
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_gray
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_gray"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</ScrollView>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_keyboard.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/fragment_container"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_keyboard"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_keyboard"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
android:gravity=
"center"
/>
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"text"
/>
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"text"
/>
<Button
android:id=
"@+id/btn_hide_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_hide_soft_input"
/>
<Button
android:id=
"@+id/btn_hide_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_hide_soft_input"
/>
<Button
android:id=
"@+id/btn_show_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_show_soft_input"
/>
<Button
android:id=
"@+id/btn_show_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_show_soft_input"
/>
<Button
android:id=
"@+id/btn_toggle_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_toggle_soft_input"
/>
<Button
android:id=
"@+id/btn_toggle_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_toggle_soft_input"
/>
<Button
android:id=
"@+id/btn_keyboard_in_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_in_dialog"
/>
<Button
android:id=
"@+id/btn_keyboard_in_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_in_dialog"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_log.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_log"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_toggle_log"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_log"
/>
<Button
android:id=
"@+id/btn_toggle_console"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_console"
/>
<Button
android:id=
"@+id/btn_toggle_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_tag"
/>
<Button
android:id=
"@+id/btn_toggle_head"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_head"
/>
<Button
android:id=
"@+id/btn_toggle_file"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_file"
/>
<Button
android:id=
"@+id/btn_toggle_dir"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_dir"
/>
<Button
android:id=
"@+id/btn_toggle_border"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_border"
/>
<Button
android:id=
"@+id/btn_toggle_conole_filter"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_console_filter"
/>
<Button
android:id=
"@+id/btn_toggle_file_filter"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_file_filter"
/>
<Button
android:id=
"@+id/btn_log_no_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_with_no_tag"
/>
<Button
android:id=
"@+id/btn_log_with_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_with_tag"
/>
<Button
android:id=
"@+id/btn_log_in_new_thread"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_in_new_thread"
/>
<Button
android:id=
"@+id/btn_log_null"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_null"
/>
<Button
android:id=
"@+id/btn_log_many_params"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_many_params"
/>
<Button
android:id=
"@+id/btn_log_long"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_long_string"
/>
<Button
android:id=
"@+id/btn_log_file"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_to_file"
/>
<Button
android:id=
"@+id/btn_log_json"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_json"
/>
<Button
android:id=
"@+id/btn_log_xml"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_xml"
/>
</LinearLayout>
</ScrollView>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_log"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_toggle_log"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_log"
/>
<Button
android:id=
"@+id/btn_toggle_console"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_console"
/>
<Button
android:id=
"@+id/btn_toggle_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_tag"
/>
<Button
android:id=
"@+id/btn_toggle_head"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_head"
/>
<Button
android:id=
"@+id/btn_toggle_file"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_file"
/>
<Button
android:id=
"@+id/btn_toggle_dir"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_dir"
/>
<Button
android:id=
"@+id/btn_toggle_border"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_border"
/>
<Button
android:id=
"@+id/btn_toggle_conole_filter"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_console_filter"
/>
<Button
android:id=
"@+id/btn_toggle_file_filter"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_toggle_file_filter"
/>
<Button
android:id=
"@+id/btn_log_no_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_with_no_tag"
/>
<Button
android:id=
"@+id/btn_log_with_tag"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_with_tag"
/>
<Button
android:id=
"@+id/btn_log_in_new_thread"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_in_new_thread"
/>
<Button
android:id=
"@+id/btn_log_null"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_null"
/>
<Button
android:id=
"@+id/btn_log_many_params"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_many_params"
/>
<Button
android:id=
"@+id/btn_log_long"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_long_string"
/>
<Button
android:id=
"@+id/btn_log_file"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_to_file"
/>
<Button
android:id=
"@+id/btn_log_json"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_json"
/>
<Button
android:id=
"@+id/btn_log_xml"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/log_xml"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_network.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_network"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_network"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_open_wireless_settings"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_open_wireless_settings"
/>
<Button
android:id=
"@+id/btn_open_wireless_settings"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_open_wireless_settings"
/>
<Button
android:id=
"@+id/btn_set_data_enabled"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_set_data_enabled"
/>
<Button
android:id=
"@+id/btn_set_data_enabled"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_set_data_enabled"
/>
<Button
android:id=
"@+id/btn_set_wifi_enabled"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_set_wifi_enabled"
/>
<Button
android:id=
"@+id/btn_set_wifi_enabled"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/network_set_wifi_enabled"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_permission.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_permission"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_permission"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_phone.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_phone"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_phone"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_dial"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_dial"
/>
<Button
android:id=
"@+id/btn_dial"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_dial"
/>
<Button
android:id=
"@+id/btn_call"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_call"
/>
<Button
android:id=
"@+id/btn_call"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_call"
/>
<Button
android:id=
"@+id/btn_send_sms"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_send_sms"
/>
<Button
android:id=
"@+id/btn_send_sms"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_send_sms"
/>
<Button
android:id=
"@+id/btn_send_sms_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_send_sms_silent"
/>
<Button
android:id=
"@+id/btn_send_sms_silent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/phone_send_sms_silent"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_pinyin.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_pinyin"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_pinyin"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_process.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_process"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_process"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_kill_all_background_processes"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/process_kill_all_background"
/>
<Button
android:id=
"@+id/btn_kill_all_background_processes"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/process_kill_all_background"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_sdcard.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_sdcard"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_sdcard"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_snackbar.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingBottom=
"@dimen/spacing_128"
android:paddingLeft=
"@dimen/spacing_16"
android:paddingRight=
"@dimen/spacing_16"
android:paddingTop=
"@dimen/spacing_16"
>
<LinearLayout
<Button
android:id=
"@+id/btn_short_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingBottom=
"@dimen/spacing_128"
android:paddingLeft=
"@dimen/spacing_16"
android:paddingRight=
"@dimen/spacing_16"
android:paddingTop=
"@dimen/spacing_16"
>
android:text=
"@string/snackbar_show_short"
/>
<Button
android:id=
"@+id/btn_short_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_short"
/>
<Button
android:id=
"@+id/btn_short_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_short_with_action"
/>
<Button
android:id=
"@+id/btn_short_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_short_with_action"
/>
<Button
android:id=
"@+id/btn_long_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_long"
/>
<Button
android:id=
"@+id/btn_long_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_long"
/>
<Button
android:id=
"@+id/btn_long_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_long_with_action"
/>
<Button
android:id=
"@+id/btn_long_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_long_with_action"
/>
<Button
android:id=
"@+id/btn_indefinite_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_indefinite"
/>
<Button
android:id=
"@+id/btn_indefinite_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_indefinite"
/>
<Button
android:id=
"@+id/btn_indefinite_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_indefinite_with_action"
/>
<Button
android:id=
"@+id/btn_indefinite_snackbar_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_indefinite_with_action"
/>
<Button
android:id=
"@+id/btn_add_view"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_add_view"
/>
<Button
android:id=
"@+id/btn_add_view"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_add_view"
/>
<Button
android:id=
"@+id/btn_add_view_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_add_view_with_action"
/>
<Button
android:id=
"@+id/btn_add_view_with_action"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_add_view_with_action"
/>
<Button
android:id=
"@+id/btn_show_success"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_success"
/>
<Button
android:id=
"@+id/btn_show_success"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_success"
/>
<Button
android:id=
"@+id/btn_show_warning"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_warning"
/>
<Button
android:id=
"@+id/btn_show_warning"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_warning"
/>
<Button
android:id=
"@+id/btn_show_error"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_error"
/>
<Button
android:id=
"@+id/btn_show_error"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_show_error"
/>
<Button
android:id=
"@+id/btn_dismiss_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_dismiss"
/>
<Button
android:id=
"@+id/btn_dismiss_snackbar"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/snackbar_dismiss"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/activity_span.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_anim_span"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:layerType=
"software"
/>
<TextView
android:id=
"@+id/tv_about_anim_span"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layerType=
"software"
/>
<TextView
android:id=
"@+id/tv_about_span"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:clickable=
"true"
/>
<TextView
android:id=
"@+id/tv_about_span"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:clickable=
"true"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_status_bar_swipe_back.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/spacing_16"
android:paddingRight=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_status_alpha"
style=
"@style/TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
/>
<android.support.design.widget.AppBarLayout
<SeekBar
android:id=
"@+id/sb_change_alpha"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:theme=
"@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:background=
"@color/colorPrimary"
app:layout_scrollFlags=
"scroll|enterAlways"
/>
</android.support.design.widget.AppBarLayout>
android:max=
"255"
android:padding=
"@dimen/spacing_8"
android:progress=
"112"
/>
<android.support.v4.widget.NestedScrollView
<Button
android:id=
"@+id/btn_random_color"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/spacing_16"
android:paddingRight=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_status_alpha"
style=
"@style/TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
/>
<SeekBar
android:id=
"@+id/sb_change_alpha"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:max=
"255"
android:padding=
"@dimen/spacing_8"
android:progress=
"112"
/>
<Button
android:id=
"@+id/btn_random_color"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_random_color"
/>
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_random_color"
/>
<Button
android:id=
"@+id/btn_set_transparent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_transparent"
/>
<Button
android:id=
"@+id/btn_set_transparent"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_bar_set_transparent"
/>
</LinearLayout>
</ScrollView>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
app/src/main/res/layout/activity_toast.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<Button
android:id=
"@+id/btn_show_short_toast_safe"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:text=
"@string/toast_show_short_safe"
/>
<Button
android:id=
"@+id/btn_show_short_toast_safe"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_short_safe"
/>
<Button
android:id=
"@+id/btn_show_short_toast"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_short"
/>
<Button
android:id=
"@+id/btn_show_long_toast_safe"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_long_safe"
/>
<Button
android:id=
"@+id/btn_show_short_toast"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_short"
/>
<Button
android:id=
"@+id/btn_show_long_toast
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_long
"
/>
<Button
android:id=
"@+id/btn_show_long_toast_safe
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_long_safe
"
/>
<Button
android:id=
"@+id/btn_show_green_fon
t"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_green_font
"
/>
<Button
android:id=
"@+id/btn_show_long_toas
t"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_long
"
/>
<Button
android:id=
"@+id/btn_show_custom_bg
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_custom_bg
"
/>
<Button
android:id=
"@+id/btn_show_green_font
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_green_font
"
/>
<Button
android:id=
"@+id/btn_show_span
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_span
"
/>
<Button
android:id=
"@+id/btn_show_custom_bg
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_custom_bg
"
/>
<Button
android:id=
"@+id/btn_show_custom_view
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_custom_view
"
/>
<Button
android:id=
"@+id/btn_show_span
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_span
"
/>
<Button
android:id=
"@+id/btn_show_middle
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_middle
"
/>
<Button
android:id=
"@+id/btn_show_custom_view
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_custom_view
"
/>
<Button
android:id=
"@+id/btn_cancel_toast
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_cancel
"
/>
<Button
android:id=
"@+id/btn_show_middle
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_show_middle
"
/>
</LinearLayout>
</ScrollView>
<Button
android:id=
"@+id/btn_cancel_toast"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/toast_cancel"
/>
</LinearLayout>
app/src/main/res/layout/dialog_keyboard.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:inputType=
"text"
/>
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"text"
/>
<Button
android:id=
"@+id/btn_hide_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_hide_soft_input"
/>
<Button
android:id=
"@+id/btn_hide_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_hide_soft_input"
/>
<Button
android:id=
"@+id/btn_show_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_show_soft_input"
/>
<Button
android:id=
"@+id/btn_show_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_show_soft_input"
/>
<Button
android:id=
"@+id/btn_toggle_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_toggle_soft_input"
/>
<Button
android:id=
"@+id/btn_toggle_soft_input"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_toggle_soft_input"
/>
<Button
android:id=
"@+id/btn_close_dialog"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_close_dialog"
/>
<Button
android:id=
"@+id/btn_close_dialog"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/keyboard_close_dialog"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
app/src/main/res/layout/fragment_demo0.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
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=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<FrameLayout
android:id=
"@+id/child_fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_show_about_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack"
/>
<Button
android:id=
"@+id/btn_add_hide"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_hide"
/>
<FrameLayout
android:id=
"@+id/child_fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_add_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_show
"
/>
<Button
android:id=
"@+id/btn_show_about_fragment
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack
"
/>
<Button
android:id=
"@+id/btn_add_child
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_child
"
/>
<Button
android:id=
"@+id/btn_add_hide
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_hide
"
/>
<Button
android:id=
"@+id/btn_pop_to_root
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_to_root
"
/>
<Button
android:id=
"@+id/btn_add_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_show
"
/>
<Button
android:id=
"@+id/btn_pop_ad
d"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_ad
d"
/>
<Button
android:id=
"@+id/btn_add_chil
d"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_chil
d"
/>
<Button
android:id=
"@+id/btn_hide_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_hide_demo0_show_demo1
"
/>
<Button
android:id=
"@+id/btn_pop_to_root
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_to_root
"
/>
<Button
android:id=
"@+id/btn_replace
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_replace
"
/>
<Button
android:id=
"@+id/btn_pop_add
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_add
"
/>
<ImageView
android:id=
"@+id/iv_shared_element"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
tools:targetApi=
"lollipop"
/>
<Button
android:id=
"@+id/btn_hide_show"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_hide_demo0_show_demo1"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_replace"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_replace"
/>
<ImageView
android:id=
"@+id/iv_shared_element"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
/>
</
ScrollView
>
</
LinearLayout
>
\ No newline at end of file
app/src/main/res/layout/fragment_demo1.xml
浏览文件 @
422c3253
...
...
@@ -38,8 +38,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
tools:targetApi=
"lollipop"
/>
android:transitionName=
"@string/fragment_transition"
/>
</LinearLayout>
...
...
app/src/main/res/layout/fragment_demo2.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
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=
"match_parent"
>
<LinearLayout
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_show_about_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack"
/>
android:gravity=
"center"
/>
<Button
android:id=
"@+id/btn_pop"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
tools:targetApi=
"lollipop"
/>
<Button
android:id=
"@+id/btn_show_about_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_pop"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
/>
</
ScrollView
>
</
LinearLayout
>
\ No newline at end of file
app/src/main/res/layout/fragment_demo3.xml
浏览文件 @
422c3253
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
<
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=
"match_parent"
>
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"@dimen/spacing_16"
>
android:gravity=
"center"
/>
<TextView
android:id=
"@+id/tv_about_fragment"
style=
"@style/TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
/>
<FrameLayout
android:id=
"@+id/child_fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_show_about_fragment"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack"
/>
<Button
android:id=
"@+id/btn_add_hide"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_hide"
/>
<FrameLayout
android:id=
"@+id/child_fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/btn_add_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_show
"
/>
<Button
android:id=
"@+id/btn_show_about_fragment
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_show_stack
"
/>
<Button
android:id=
"@+id/btn_add_child
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_child
"
/>
<Button
android:id=
"@+id/btn_add_hide
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_hide
"
/>
<Button
android:id=
"@+id/btn_pop_to_root
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_to_root
"
/>
<Button
android:id=
"@+id/btn_add_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_demo1_show
"
/>
<Button
android:id=
"@+id/btn_pop_ad
d"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_ad
d"
/>
<Button
android:id=
"@+id/btn_add_chil
d"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_add_chil
d"
/>
<Button
android:id=
"@+id/btn_hide_show
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_hide_demo0_show_demo1
"
/>
<Button
android:id=
"@+id/btn_pop_to_root
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_to_root
"
/>
<Button
android:id=
"@+id/btn_replace
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_replace
"
/>
<Button
android:id=
"@+id/btn_pop_add
"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_pop_add
"
/>
<ImageView
android:id=
"@+id/iv_shared_element"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
tools:targetApi=
"lollipop"
/>
<Button
android:id=
"@+id/btn_hide_show"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_hide_demo0_show_demo1"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_replace"
style=
"@style/WideBtnStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_replace"
/>
<ImageView
android:id=
"@+id/iv_shared_element"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:src=
"@drawable/lena"
android:transitionName=
"@string/fragment_transition"
/>
</
ScrollView
>
</
LinearLayout
>
\ No newline at end of file
update_log.md
浏览文件 @
422c3253
此差异已折叠。
点击以展开。
utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java
浏览文件 @
422c3253
...
...
@@ -151,7 +151,7 @@ public final class ActivityUtils {
public
static
void
startActivity
(
@NonNull
final
Bundle
extras
,
@NonNull
final
String
pkg
,
@NonNull
final
String
cls
)
{
startActivity
(
Utils
.
getContext
(),
extras
,
pkg
,
cls
,
extras
);
startActivity
(
Utils
.
getContext
(),
extras
,
pkg
,
cls
,
null
);
}
/**
...
...
@@ -193,10 +193,10 @@ public final class ActivityUtils {
if
(!(
context
instanceof
Activity
))
{
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
}
if
(
options
==
null
||
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
context
.
startActivity
(
intent
);
}
else
{
if
(
options
!=
null
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
context
.
startActivity
(
intent
,
options
);
}
else
{
context
.
startActivity
(
intent
);
}
}
...
...
utilcode/src/main/java/com/blankj/utilcode/util/BarUtils.java
浏览文件 @
422c3253
...
...
@@ -8,7 +8,6 @@ import android.os.Build;
import
android.support.annotation.ColorInt
;
import
android.support.annotation.IntRange
;
import
android.support.annotation.NonNull
;
import
android.support.design.widget.CoordinatorLayout
;
import
android.support.v4.widget.DrawerLayout
;
import
android.util.TypedValue
;
import
android.view.KeyCharacterMap
;
...
...
@@ -62,8 +61,9 @@ public final class BarUtils {
* @param activity activity
* @param color 状态栏颜色值
*/
public
static
void
setStatusBarColor
(
@NonNull
final
Activity
activity
,
@ColorInt
final
int
color
)
{
setStatusBarColor
(
activity
,
color
,
DEFAULT_ALPHA
);
public
static
void
setStatusBarColor
(
@NonNull
final
Activity
activity
,
@ColorInt
final
int
color
)
{
setStatusBarColor
(
activity
,
color
,
DEFAULT_ALPHA
,
false
);
}
/**
...
...
@@ -76,28 +76,49 @@ public final class BarUtils {
public
static
void
setStatusBarColor
(
@NonNull
final
Activity
activity
,
@ColorInt
final
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
setStatusBarColor
(
activity
,
color
,
alpha
,
false
);
}
/**
* 设置状态栏颜色
*
* @param activity activity
* @param color 状态栏颜色值
* @param alpha 状态栏透明度,此透明度并非颜色中的透明度
* @param isDecor {@code true}: 设置在DecorView中<br>
* {@code false}: 设置在ContentView中
*/
public
static
void
setStatusBarColor
(
@NonNull
final
Activity
activity
,
@ColorInt
final
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
,
final
boolean
isDecor
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
hideAlphaView
(
activity
);
Window
window
=
activity
.
getWindow
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
setStatusBarColor
(
getStatusBarColor
(
color
,
alpha
));
}
else
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
addColorView
(
activity
,
color
,
alpha
);
}
transparentStatusBar
(
activity
);
addColorView
(
activity
,
color
,
alpha
,
isDecor
);
fitWindowAndClipToPadding
(
activity
);
}
/**
* 设置状态栏透明度
*
* @param activity activity
* @param needOffsetViews 需要
*/
public
static
void
setStatusBarAlpha
(
@NonNull
final
Activity
activity
,
@NonNull
final
View
...
needOffsetViews
)
{
setStatusBarAlpha
(
activity
,
DEFAULT_ALPHA
,
false
,
needOffsetViews
);
}
/**
* 设置状态栏透明度
*
* @param activity activity
*/
public
static
void
setStatusBarAlpha
(
@NonNull
final
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
,
@NonNull
final
View
...
needOffsetViews
)
{
setStatusBarAlpha
(
activity
,
DEFAULT_ALPHA
,
needOffsetViews
);
setStatusBarAlpha
(
activity
,
alpha
,
false
,
needOffsetViews
);
}
/**
...
...
@@ -105,14 +126,17 @@ public final class BarUtils {
*
* @param activity activity
* @param alpha 状态栏透明度
* @param isDecor {@code true}: 设置在DecorView中<br>
* {@code false}: 设置在ContentView中
*/
public
static
void
setStatusBarAlpha
(
@NonNull
final
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
,
final
boolean
isDecor
,
@NonNull
final
View
...
needOffsetViews
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
hideColorView
(
activity
);
transparentStatusBar
(
activity
);
addAlphaView
(
activity
,
alpha
);
addAlphaView
(
activity
,
alpha
,
isDecor
);
for
(
View
view
:
needOffsetViews
)
{
addMarginTopEqualStatusBarHeight
(
view
);
}
...
...
@@ -124,7 +148,7 @@ public final class BarUtils {
* @param fakeStatusBar 伪造状态栏
* @param color 状态栏颜色值
*/
public
static
void
setFakeStatusBarColor
(
@NonNull
View
fakeStatusBar
,
@ColorInt
final
int
color
)
{
public
static
void
setFakeStatusBarColor
(
@NonNull
final
View
fakeStatusBar
,
@ColorInt
final
int
color
)
{
setFakeStatusBarColor
(
fakeStatusBar
,
color
,
DEFAULT_ALPHA
);
}
...
...
@@ -135,7 +159,7 @@ public final class BarUtils {
* @param color 状态栏颜色值
* @param alpha 状态栏透明度,此透明度并非颜色中的透明度
*/
public
static
void
setFakeStatusBarColor
(
@NonNull
View
fakeStatusBar
,
public
static
void
setFakeStatusBarColor
(
@NonNull
final
View
fakeStatusBar
,
@ColorInt
final
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
...
...
@@ -150,7 +174,7 @@ public final class BarUtils {
*
* @param fakeStatusBar 伪造状态栏
*/
public
static
void
setFakeStatusBarAlpha
(
@NonNull
View
fakeStatusBar
)
{
public
static
void
setFakeStatusBarAlpha
(
@NonNull
final
View
fakeStatusBar
)
{
setFakeStatusBarAlpha
(
fakeStatusBar
,
DEFAULT_ALPHA
);
}
...
...
@@ -160,7 +184,7 @@ public final class BarUtils {
* @param fakeStatusBar 伪造状态栏
* @param alpha 状态栏透明度
*/
public
static
void
setFakeStatusBarAlpha
(
@NonNull
View
fakeStatusBar
,
public
static
void
setFakeStatusBarAlpha
(
@NonNull
final
View
fakeStatusBar
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
transparentStatusBar
((
Activity
)
fakeStatusBar
.
getContext
());
...
...
@@ -169,56 +193,6 @@ public final class BarUtils {
fakeStatusBar
.
setBackgroundColor
(
Color
.
argb
(
alpha
,
0
,
0
,
0
));
}
public
static
void
addPaddingTopEqualStatusBarHeight
(
@NonNull
View
view
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
Object
haveSetOffset
=
view
.
getTag
(
TAG_OFFSET
);
if
(
haveSetOffset
!=
null
&&
(
Boolean
)
haveSetOffset
)
return
;
view
.
setPadding
(
view
.
getPaddingLeft
(),
view
.
getPaddingTop
()
+
getStatusBarHeight
(),
view
.
getPaddingRight
(),
view
.
getPaddingBottom
());
view
.
setTag
(
TAG_OFFSET
,
true
);
}
public
static
void
addMarginTopEqualStatusBarHeight
(
@NonNull
View
view
)
{
Object
haveSetOffset
=
view
.
getTag
(
TAG_OFFSET
);
if
(
haveSetOffset
!=
null
&&
(
Boolean
)
haveSetOffset
)
return
;
ViewGroup
.
MarginLayoutParams
layoutParams
=
(
ViewGroup
.
MarginLayoutParams
)
view
.
getLayoutParams
();
layoutParams
.
setMargins
(
layoutParams
.
leftMargin
,
layoutParams
.
topMargin
+
getStatusBarHeight
(),
layoutParams
.
rightMargin
,
layoutParams
.
bottomMargin
);
view
.
setTag
(
TAG_OFFSET
,
true
);
}
/**
* 为滑动返回界面设置状态栏颜色
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
*/
public
static
void
setColorForSwipeBack
(
@NonNull
final
Activity
activity
,
final
int
color
)
{
setColorForSwipeBack
(
activity
,
color
,
DEFAULT_ALPHA
);
}
/**
* 为滑动返回界面设置状态栏颜色
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
* @param alpha 状态栏透明度
*/
public
static
void
setColorForSwipeBack
(
@NonNull
final
Activity
activity
,
@ColorInt
final
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
));
addPaddingTopEqualStatusBarHeight
(
contentView
);
contentView
.
setBackgroundColor
(
getStatusBarColor
(
color
,
alpha
));
transparentStatusBar
(
activity
);
}
/**
* 针对根布局是 CoordinatorLayout, 使状态栏半透明
* <p>
...
...
@@ -231,7 +205,7 @@ public final class BarUtils {
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
transparentStatusBar
(
activity
);
addAlphaView
(
activity
,
alpha
);
addAlphaView
InDecorView
(
activity
,
alpha
);
}
/**
...
...
@@ -298,7 +272,7 @@ public final class BarUtils {
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
);
addAlphaView
(
activity
,
alpha
);
addAlphaView
InDecorView
(
activity
,
alpha
);
}
/**
...
...
@@ -323,7 +297,7 @@ public final class BarUtils {
@IntRange
(
from
=
0
,
to
=
255
)
final
int
alpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
setTransparentForDrawerLayout
(
activity
,
drawerLayout
);
addAlphaView
(
activity
,
alpha
);
addAlphaView
InDecorView
(
activity
,
alpha
);
}
/**
...
...
@@ -363,30 +337,63 @@ public final class BarUtils {
hideAlphaView
(
activity
);
}
public
static
void
addPaddingTopEqualStatusBarHeight
(
@NonNull
View
view
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
Object
haveSetOffset
=
view
.
getTag
(
TAG_OFFSET
);
if
(
haveSetOffset
!=
null
&&
(
Boolean
)
haveSetOffset
)
return
;
view
.
setPadding
(
view
.
getPaddingLeft
(),
view
.
getPaddingTop
()
+
getStatusBarHeight
(),
view
.
getPaddingRight
(),
view
.
getPaddingBottom
());
view
.
setTag
(
TAG_OFFSET
,
true
);
}
public
static
void
addMarginTopEqualStatusBarHeight
(
@NonNull
View
view
)
{
Object
haveSetOffset
=
view
.
getTag
(
TAG_OFFSET
);
if
(
haveSetOffset
!=
null
&&
(
Boolean
)
haveSetOffset
)
return
;
ViewGroup
.
MarginLayoutParams
layoutParams
=
(
ViewGroup
.
MarginLayoutParams
)
view
.
getLayoutParams
();
layoutParams
.
setMargins
(
layoutParams
.
leftMargin
,
layoutParams
.
topMargin
+
getStatusBarHeight
(),
layoutParams
.
rightMargin
,
layoutParams
.
bottomMargin
);
view
.
setTag
(
TAG_OFFSET
,
true
);
}
private
static
void
addColorView
(
final
Activity
activity
,
final
int
color
,
final
int
alpha
)
{
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
));
View
fakeStatusBarView
=
contentView
.
findViewWithTag
(
TAG_COLOR
);
private
static
void
addColorView
(
final
Activity
activity
,
final
int
color
,
final
int
alpha
,
boolean
isDecor
)
{
ViewGroup
parent
=
isDecor
?
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
()
:
(
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
);
View
fakeStatusBarView
=
parent
.
findViewWithTag
(
TAG_COLOR
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
getStatusBarColor
(
color
,
alpha
));
}
else
{
contentView
.
addView
(
createColorStatusBarView
(
activity
,
color
,
alpha
));
parent
.
addView
(
createColorStatusBarView
(
activity
,
color
,
alpha
));
}
}
private
static
void
addAlphaView
(
final
Activity
activity
,
final
int
alpha
)
{
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
));
View
fakeStatusBarView
=
contentView
.
findViewWithTag
(
TAG_ALPHA
);
private
static
void
addAlphaViewInDecorView
(
final
Activity
activity
,
final
int
alpha
)
{
addAlphaView
(
activity
,
alpha
,
true
);
}
private
static
void
addAlphaViewInContentView
(
final
Activity
activity
,
final
int
alpha
)
{
addAlphaView
(
activity
,
alpha
,
false
);
}
private
static
void
addAlphaView
(
final
Activity
activity
,
final
int
alpha
,
boolean
isDecor
)
{
ViewGroup
parent
=
isDecor
?
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
()
:
(
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
);
View
fakeStatusBarView
=
parent
.
findViewWithTag
(
TAG_ALPHA
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
Color
.
argb
(
alpha
,
0
,
0
,
0
));
}
else
{
contentView
.
addView
(
createAlphaStatusBarView
(
activity
,
alpha
));
parent
.
addView
(
createAlphaStatusBarView
(
activity
,
alpha
));
}
}
...
...
@@ -398,8 +405,8 @@ public final class BarUtils {
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
)
);
View
fakeStatusBarView
=
content
View
.
findViewWithTag
(
TAG_COLOR
);
ViewGroup
decorView
=
(
ViewGroup
)
window
.
getDecorView
(
);
View
fakeStatusBarView
=
decor
View
.
findViewWithTag
(
TAG_COLOR
);
if
(
fakeStatusBarView
!=
null
)
{
fakeStatusBarView
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -407,8 +414,8 @@ public final class BarUtils {
}
private
static
void
hideAlphaView
(
final
Activity
activity
)
{
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
)
);
View
fakeStatusBarView
=
content
View
.
findViewWithTag
(
TAG_ALPHA
);
ViewGroup
decorView
=
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
(
);
View
fakeStatusBarView
=
decor
View
.
findViewWithTag
(
TAG_ALPHA
);
if
(
fakeStatusBarView
!=
null
)
{
fakeStatusBarView
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -431,14 +438,16 @@ public final class BarUtils {
*/
private
static
View
createColorStatusBarView
(
final
Activity
activity
,
final
int
color
,
final
int
alpha
)
{
View
statusBarView
=
new
View
(
activity
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
getStatusBarHeight
());
statusBarView
.
setLayoutParams
(
params
);
statusBarView
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
getStatusBarHeight
()));
statusBarView
.
setBackgroundColor
(
getStatusBarColor
(
color
,
alpha
));
statusBarView
.
setTag
(
TAG_COLOR
);
return
statusBarView
;
}
/**
* 绘制一个和状态栏一样高的黑色透明度矩形
*/
private
static
View
createAlphaStatusBarView
(
final
Activity
activity
,
final
int
alpha
)
{
View
statusBarView
=
new
View
(
activity
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
...
...
@@ -453,7 +462,7 @@ public final class BarUtils {
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
return
;
Window
window
=
activity
.
getWindow
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
int
option
=
View
.
SYSTEM_UI_FLAG_LAYOUT_
FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
;
int
option
=
View
.
SYSTEM_UI_FLAG_LAYOUT_
STABLE
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
;
window
.
getDecorView
().
setSystemUiVisibility
(
option
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录