提交 422c3253 编写于 作者: B Blankj

see 07/25 log

上级 44ea09d3
......@@ -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.BaseBackActivity;
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 BaseBackActivity {
private int mAlpha;
......
......@@ -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.BaseBackActivity;
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 BaseBackActivity {
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.setColorForSwipeBack(StatusBarSwipeBackActivity.this, mColor, mAlpha);
BarUtils.setStatusBarColor(StatusBarSwipeBackActivity.this, mColor, mAlpha);
}
}
<?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>
<?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>
<?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>
<?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
<?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>
......@@ -13,7 +13,7 @@
<FrameLayout
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="wrap_content" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
......
<?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>
<?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_corner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/iv_fast_blur"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/iv_fast_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_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
<?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>
<?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
<?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
<?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>
<?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>
<?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
<?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
<?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>
<?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>
<?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
<?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>
<?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_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_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_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>
<?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>
<?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_add"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_pop_add" />
<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_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
......@@ -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>
......
<?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
<?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_add"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_pop_add" />
<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_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
此差异已折叠。
......@@ -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);
}
}
......
......@@ -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);
addAlphaViewInDecorView(activity, alpha);
}
/**
......@@ -298,7 +272,7 @@ public final class BarUtils {
}
// 设置属性
setDrawerLayoutProperty(drawerLayout, contentLayout);
addAlphaView(activity, alpha);
addAlphaViewInDecorView(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);
addAlphaViewInDecorView(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 = contentView.findViewWithTag(TAG_COLOR);
ViewGroup decorView = (ViewGroup) window.getDecorView();
View fakeStatusBarView = decorView.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 = contentView.findViewWithTag(TAG_ALPHA);
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
View fakeStatusBarView = decorView.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.
先完成此消息的编辑!
想要评论请 注册