DDMS调试:Android应用(我发民)会导致设备(只有Nexus 5)挂,并使用ZXING和对话框时,必须重新启动 [英] DDMS Debugging: Android app (I'm devloping) causes device (ONLY Nexus 5) to hang and must restart when using ZXING and Dialog

查看:540
本文介绍了DDMS调试:Android应用(我发民)会导致设备(只有Nexus 5)挂,并使用ZXING和对话框时,必须重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序。
我使用ZXING片段开源吧code扫描。
我有一个选项,手动输入栏code。因此,当用户preSS手动输入按钮我打开与编辑文本的对话框。出现的对话框之前,我暂停相机和扫描。
这会导致设备死机,最上面一栏的倍数它自加入它的自我越来越多的时间,直到它填补了显示。要摆脱这种局面的唯一方法是重新启动设备。

此错误仅在重现的Nexus 5

我怎么能在DDMS调试呢?

我无言以对:P!任何想法

这是该设备的外观发生这种情况时,你必须重新启动设备:

下面是我的主题和样式文件,要求由@Apoorv

的themes.xml

 <?XML版本=1.0编码=UTF-8&GT?;
<资源>
    &所述;! - 应用于应用程序或活动的主题 - >
    <样式名称=MybusinessTheme
           父=@风格/ Theme.AppCompat.Light>
        <项目名称=机器人:actionBarStyle> @风格/ MybusinessActionBar< /项目>
        <项目名称=机器人:actionMenuTextColor> @色/白< /项目>
        <项目名称=机器人:homeAsUpIndicator> @绘制/ ic_home_up< /项目>
        <项目名称=机器人:actionOverflowButtonStyle> @风格/ MybusinessButtonOverFlow< /项目>
        <! - 删除动作条的影子 - >
        <项目名称=机器人:windowContentOverlay> @空< /项目>        <! - 支持库的兼容性 - >
        <项目名称=actionBarStyle> @风格/ MybusinessActionBar< /项目>
        <项目名称=actionMenuTextColor> @色/白< /项目>
        <项目名称=homeAsUpIndicator> @绘制/ ic_home_up< /项目>
        <项目名称=actionOverflowButtonStyle> @风格/ MybusinessButtonOverFlow< /项目>        <! - 对于应用的启动 - >
        <项目名称=机器人:windowBackground> @彩色/ wrntr_purple< /项目>
    < /风格>    <! - 动作条的风格 - >
    <样式名称=MybusinessActionBar
           父=@风格/ Widget.AppCompat.Light.ActionBar>
        <项目名称=机器人:背景> @彩色/ wrntr_purple< /项目>
        <项目名称=机器人:titleTextStyle> @风格/ WarrenteerActionBarTitleText< /项目>        <! - 支持库的兼容性 - >
        <项目名称=背景> @彩色/ wrntr_purple< /项目>
        <项目名称=titleTextStyle> @风格/ WarrenteerActionBarTitleText< /项目>
    < /风格>    <! - 过流按钮样式 - >
    <样式名称=MybusinessButtonOverFlow
           父=@风格/ Widget.AppCompat.Light.ActionButton.Overflow>
        <项目名称=机器人:SRC> @绘制/ ic_action_overflow< /项目>
   < /风格>    <! - 动作条标题文本 - >
    <样式名称=WarrenteerActionBarTitleText
           父=@风格/ TextAppearance.AppCompat.Widget.ActionBar.Title>
        <项目名称=机器人:文字颜色> @色/白< /项目>
    < /风格>    <样式名称=MybusinessTheme.Wallpaper
           父=MybusinessTheme>
    < /风格>
< /资源>

styles.xml

 <资源>
    <样式名称=ActivityBase>
        <项目名称=机器人:背景> @色/白< /项目>
    < /风格>    <样式名称=Next按钮>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_alignParentBottom>真< /项目>
        <项目名称=机器人:layout_alignParentLeft>真< /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ medium_text< /项目>
        <项目名称=机器人:文字颜色> @绘制/ next_button_text_color< /项目>
        <项目名称=安卓重力>中心< /项目>
        <项目名称=机器人:layout_marginLeft> 20dp< /项目>
        <项目名称=机器人:layout_marginBottom> 20dp< /项目>
        <项目名称=机器人:填充>&5DP LT; /项目>
        <项目名称=机器人:背景> @绘制/ next_button_selector< /项目>
    < /风格>    <样式名称=previousButton父=Next按钮>
        <项目名称=机器人:layout_alignParentLeft>假LT; /项目>
        <项目名称=机器人:layout_alignParentRight>真< /项目>
        <项目名称=机器人:layout_marginRight> 20dp< /项目>
    < /风格>    <样式名称=descriptiontext描述>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_below> @ ID / welcomeText< /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ medium_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
    < /风格>    <样式名称=NormalButton>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:填充> 10dp< /项目>
        <项目名称=机器人:layout_margin> 10dp< /项目>
        <项目名称=机器人:文字颜色> @色/白< /项目>
        <项目名称=机器人:背景> @绘制/ button_selector< /项目>
        <项目名称=安卓重力>中心< /项目>
    < /风格>    <样式名称=NormalBoldButton>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:填充> 10dp< /项目>
        <项目名称=机器人:layout_margin> 10dp< /项目>
        <项目名称=机器人:文字颜色> @色/白< /项目>
        <项目名称=机器人:背景> @绘制/ button_selector< /项目>
        <项目名称=机器人:文字样式>大胆< /项目>
        <项目名称=安卓重力>中心< /项目>
    < /风格>    <样式名称=LightButton>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:填充> 10dp< /项目>
        <项目名称=机器人:layout_margin> 10dp< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:背景> @绘制/ light_button_selector< /项目>
        <项目名称=安卓重力>中心< /项目>
    < /风格>    <样式名称=TitleText>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:文字样式>大胆< /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ xx_large_text< /项目>
    < /风格>    <样式名称=WizardProgressNumber>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字颜色> @色/白< /项目>
        <项目名称=机器人:paddingBottom会>&4DP LT; /项目>
        <项目名称=机器人:paddingTop>&7DP LT; /项目>
        <项目名称=机器人:paddingRight> 9dp< /项目>
        <项目名称=机器人:paddingLeft> 9dp< /项目>
        <项目名称=机器人:layout_gravity>中心< /项目>
        <项目名称=安卓重力>中心< /项目>
        <项目名称=机器人:layout_marginLeft>&6DP LT; /项目>
        <项目名称=机器人:背景> @绘制/ white_circle< /项目>
    < /风格>    <样式名称=WizardProgressViewDefault>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:填充>&5DP LT; /项目>
        <项目名称=机器人:layout_marginRight> 15dp< /项目>
        <项目名称=机器人:layout_marginTop> @扪/ add_other_device_space< /项目>
        <项目名称=机器人:layout_marginBottom> @扪/ add_other_device_space< /项目>
    < /风格>    <样式名称=NavigationDrawer>
        <项目名称=机器人:layout_width> 240dp< /项目>
        <项目名称=机器人:layout_height> match_parent< /项目>
        <项目名称=机器人:layout_gravity>启动< /项目>
        <项目名称=机器人:choiceMode> singleChoice< /项目>
        <项目名称=机器人:分> @彩色/ mybiz_light_gray< /项目>
        <项目名称=机器人:dividerHeight> 1DP< /项目>
        <项目名称=机器人:背景> @android:彩色/白色< /项目>
    < /风格>    <样式名称=HomeMenuItem>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字颜色> @彩色/ gray_turquoise_selector< /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ medium_text< /项目>
        <项目名称=机器人:layout_gravity>中心< /项目>
        <项目名称=安卓重力> center_vertical< /项目>
        <项目名称=机器人:layout_margin> 10dp< /项目>
        <项目名称=机器人:paddingTop> 3DP< /项目>
        <项目名称=机器人:drawablePadding> 10dp< /项目>
    < /风格>    <样式名称=ProductListItem>
        <项目名称=机器人:layout_alignParentRight>真< /项目>
        <项目名称=机器人:layout_marginRight> 15dp< /项目>
    < /风格>    <样式名称=ObjectSeekBar>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height> 10dp< /项目>
        <项目名称=机器人:layout_marginTop> 12dp< /项目>
        <项目名称=机器人:layout_marginLeft>&5DP LT; /项目>
        <项目名称=机器人:layout_marginRight>&5DP LT; /项目>
        <项目名称=机器人:填充> 0dp< /项目>
        <项目名称=机器人:拇指> @空< /项目>
        <项目名称=机器人:progressDrawable> @绘制/ days_left_progress< /项目>
    < /风格>    <样式名称=ObjectBoldSmallText>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ small_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:layout_marginRight> 15dp< /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
        <项目名称=机器人:文字样式>大胆< /项目>
    < /风格>
    <样式名称=ObjectSmallText>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ small_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:layout_marginRight> 15dp< /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
    < /风格>    <样式名称=ObjectMediumText父=ProductListItem>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ medium_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_purple< /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
    < /风格>    <样式名称=ObjectMediumLargeText父=ProductListItem>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ medium_large_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_purple< /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
    < /风格>    <样式名称=ObjectLargeText父=ProductListItem>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:TEXTSIZE> @扪/ large_text< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_purple< /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
    < /风格>    <样式名称=Horizo​​ntalLineGray>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height> 1DP< /项目>
        <项目名称=机器人:layout_marginTop>&5DP LT; /项目>
        <项目名称=机器人:背景> @彩色/ mybiz_gray< /项目>
    < /风格>    <样式名称=Horizo​​ntalLineLightGray>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height> 0.5dp< /项目>
        <项目名称=机器人:layout_marginTop>&5DP LT; /项目>
        <项目名称=机器人:背景> @彩色/ mybiz_light_gray< /项目>
    < /风格>    <样式名称=buttonWhiteBorder>
        <项目名称=机器人:layout_width>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_gravity>右LT; /项目>
        <项目名称=机器人:文字颜色> @绘制/ button_text_color_selector_white< /项目>
        <项目名称=机器人:paddingTop> 10dp< /项目>
        <项目名称=机器人:paddingBottom会> 10dp< /项目>
        <项目名称=机器人:paddingLeft> 20dp< /项目>
        <项目名称=机器人:paddingRight> 20dp< /项目>
        <项目名称=机器人:layout_marginRight> 15dp< /项目>
        <项目名称=机器人:背景> @绘制/ button_selector_white_transparent< /项目>
    < /风格>    <样式名称=ManualInputButton父=buttonWhiteBorder>
        <项目名称=机器人:layout_marginTop> @扪/ add_other_device_space< /项目>
        <项目名称=机器人:layout_alignParentLeft>真< /项目>
        <项目名称=机器人:layout_marginLeft> 15dp< /项目>
    < /风格>    <样式名称=ButtonTurquoiseBorder>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字颜色> @绘制/ button_text_color_selector_turquoise< /项目>
        <项目名称=机器人:背景> @绘制/ button_selector_turquoise_transparent< /项目>
    < /风格>    <样式名称=EditBoldTextLabel父=ObjectBoldSmallText>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=安卓重力>右LT; /项目>
        <项目名称=机器人:layout_marginRight> 20dp< /项目>
        <项目名称=机器人:layout_marginTop> 25dp< /项目>
    < /风格>
    <样式名称=EditTextLabel父=ObjectSmallText>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=安卓重力>右LT; /项目>
        <项目名称=机器人:layout_marginRight> 20dp< /项目>
        <项目名称=机器人:layout_marginTop> 25dp< /项目>
    < /风格>    <样式名称=EditTextManualInputLabel父=EditBoldTextLabel>
        <项目名称=机器人:文字颜色> @色/白< /项目>
    < /风格>    <样式名称=EditTextNormal>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:layout_marginRight> 20dp< /项目>
        <项目名称=机器人:layout_marginLeft> 20dp< /项目>
        <项目名称=机器人:imeOptions> actionNext< /项目>
        <项目名称=机器人:单线>真< /项目>
    < /风格>    <样式名称=EditTextManualInput父=EditTextNormal>
        <项目名称=机器人:textColorHint> @彩色/ mybiz_light_gray< /项目>
        <项目名称=机器人:文字颜色> @色/白< /项目>
        <项目名称=机器人:背景> @绘制/ edit_text_white_selector< /项目>
    < /风格>    <样式名称=LargeTextTitle父=ObjectLargeText>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字样式>大胆< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:layout_marginTop> 25dp< /项目>
    < /风格>    <样式名称=MediumTextTitle父=ObjectMediumText>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height>&WRAP_CONTENT LT; /项目>
        <项目名称=机器人:文字样式>大胆< /项目>
        <项目名称=机器人:文字颜色> @彩色/ mybiz_dark_gray< /项目>
        <项目名称=机器人:layout_marginTop> 25dp< /项目>
    < /风格>< /资源>


解决方案

OK,我们有同样的问题 - 只有Nexus 5的,但随着ZBar lib目录,而不是ZXing

这个问题是通过从SurfaceView切换到TextureView解决 - 然而,这导致了较慢的帧速率

通过测试我们发现我们的问题是由离开屏幕,带来了键盘和回去导致 - 我们的解决方案是设置机器人:在清单windowSoftInputMode到AdjustPan

希望这有助于!

I'm developing an android app. I'm using ZXING fragment open source barcode scanning. I have an option to manually input the barcode. So when the user press the manual input button I open a dialog with edit text. Before the dialog appears I pause the camera and scanning. This causes the device to hang, the top bar multiples it self adding it self more and more times until it fills the display. The only way to get out of this situation is to restart the device.

This bug only reproduce in Nexus 5

How can I debug this in DDMS?

I'm clueless :P Any ideas?!

This is how the device looks when this happens and you must restart the device:

Here are my Theme and Styles files as asked by @Apoorv

themes.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- the theme applied to the application or activity -->
    <style name="MybusinessTheme"
           parent="@style/Theme.AppCompat.Light">
        <item name="android:actionBarStyle">@style/MybusinessActionBar</item>
        <item name="android:actionMenuTextColor">@color/white</item>
        <item name="android:homeAsUpIndicator">@drawable/ic_home_up</item>
        <item name="android:actionOverflowButtonStyle">@style/MybusinessButtonOverFlow</item>
        <!-- Remove the shadow of the actionbar -->
        <item name="android:windowContentOverlay">@null</item>

        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/MybusinessActionBar</item>
        <item name="actionMenuTextColor">@color/white</item>
        <item name="homeAsUpIndicator">@drawable/ic_home_up</item>
        <item name="actionOverflowButtonStyle">@style/MybusinessButtonOverFlow</item>

        <!-- For app launching -->
        <item name="android:windowBackground">@color/wrntr_purple</item>
    </style>

    <!-- ActionBar styles -->
    <style name="MybusinessActionBar"
           parent="@style/Widget.AppCompat.Light.ActionBar">
        <item name="android:background">@color/wrntr_purple</item>
        <item name="android:titleTextStyle">@style/WarrenteerActionBarTitleText</item>

        <!-- Support library compatibility -->
        <item name="background">@color/wrntr_purple</item>
        <item name="titleTextStyle">@style/WarrenteerActionBarTitleText</item>
    </style>

    <!-- Over flow button style -->
    <style name="MybusinessButtonOverFlow"
           parent="@style/Widget.AppCompat.Light.ActionButton.Overflow">
        <item name="android:src">@drawable/ic_action_overflow</item>
   </style>

    <!-- ActionBar title text -->
    <style name="WarrenteerActionBarTitleText"
           parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
        <item name="android:textColor">@color/white</item>
    </style>

    <style name="MybusinessTheme.Wallpaper"
           parent="MybusinessTheme">
    </style>
</resources>

styles.xml

<resources>
    <style name="ActivityBase">
        <item name="android:background">@color/white</item>
    </style>

    <style name="NextButton">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_alignParentBottom">true</item>
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:textSize">@dimen/medium_text</item>
        <item name="android:textColor">@drawable/next_button_text_color</item>
        <item name="android:gravity">center</item>
        <item name="android:layout_marginLeft">20dp</item>
        <item name="android:layout_marginBottom">20dp</item>
        <item name="android:padding">5dp</item>
        <item name="android:background">@drawable/next_button_selector</item>
    </style>

    <style name="PreviousButton" parent="NextButton">
        <item name="android:layout_alignParentLeft">false</item>
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_marginRight">20dp</item>
    </style>

    <style name="DescriptionText">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_below">@id/welcomeText</item>
        <item name="android:textSize">@dimen/medium_text</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
    </style>

    <style name="NormalButton">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">10dp</item>
        <item name="android:layout_margin">10dp</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/button_selector</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="NormalBoldButton">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">10dp</item>
        <item name="android:layout_margin">10dp</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/button_selector</item>
        <item name="android:textStyle">bold</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="LightButton">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">10dp</item>
        <item name="android:layout_margin">10dp</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:background">@drawable/light_button_selector</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="TitleText">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textSize">@dimen/xx_large_text</item>
    </style>

    <style name="WizardProgressNumber">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:paddingBottom">4dp</item>
        <item name="android:paddingTop">7dp</item>
        <item name="android:paddingRight">9dp</item>
        <item name="android:paddingLeft">9dp</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:gravity">center</item>
        <item name="android:layout_marginLeft">6dp</item>
        <item name="android:background">@drawable/white_circle</item>
    </style>

    <style name="WizardProgressViewDefault">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">5dp</item>
        <item name="android:layout_marginRight">15dp</item>
        <item name="android:layout_marginTop">@dimen/add_other_device_space</item>
        <item name="android:layout_marginBottom">@dimen/add_other_device_space</item>
    </style>

    <style name="NavigationDrawer">
        <item name="android:layout_width">240dp</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:layout_gravity">start</item>
        <item name="android:choiceMode">singleChoice</item>
        <item name="android:divider">@color/mybiz_light_gray</item>
        <item name="android:dividerHeight">1dp</item>
        <item name="android:background">@android:color/white</item>
    </style>

    <style name="HomeMenuItem">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@color/gray_turquoise_selector</item>
        <item name="android:textSize">@dimen/medium_text</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:layout_margin">10dp</item>
        <item name="android:paddingTop">3dp</item>
        <item name="android:drawablePadding">10dp</item>
    </style>

    <style name="ProductListItem">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_marginRight">15dp</item>
    </style>

    <style name="ObjectSeekBar">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">10dp</item>
        <item name="android:layout_marginTop">12dp</item>
        <item name="android:layout_marginLeft">5dp</item>
        <item name="android:layout_marginRight">5dp</item>
        <item name="android:padding">0dp</item>
        <item name="android:thumb">@null</item>
        <item name="android:progressDrawable">@drawable/days_left_progress</item>
    </style>

    <style name="ObjectBoldSmallText">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/small_text</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:layout_marginRight">15dp</item>
        <item name="android:layout_gravity">right</item>
        <item name="android:textStyle">bold</item>
    </style>


    <style name="ObjectSmallText">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/small_text</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:layout_marginRight">15dp</item>
        <item name="android:layout_gravity">right</item>
    </style>

    <style name="ObjectMediumText" parent="ProductListItem">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/medium_text</item>
        <item name="android:textColor">@color/mybiz_purple</item>
        <item name="android:layout_gravity">right</item>
    </style>

    <style name="ObjectMediumLargeText" parent="ProductListItem">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/medium_large_text</item>
        <item name="android:textColor">@color/mybiz_purple</item>
        <item name="android:layout_gravity">right</item>
    </style>

    <style name="ObjectLargeText" parent="ProductListItem">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/large_text</item>
        <item name="android:textColor">@color/mybiz_purple</item>
        <item name="android:layout_gravity">right</item>
    </style>

    <style name="HorizontalLineGray">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">1dp</item>
        <item name="android:layout_marginTop">5dp</item>
        <item name="android:background">@color/mybiz_gray</item>
    </style>

    <style name="HorizontalLineLightGray">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">0.5dp</item>
        <item name="android:layout_marginTop">5dp</item>
        <item name="android:background">@color/mybiz_light_gray</item>
    </style>

    <style name="buttonWhiteBorder">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_gravity">right</item>
        <item name="android:textColor">@drawable/button_text_color_selector_white</item>
        <item name="android:paddingTop">10dp</item>
        <item name="android:paddingBottom">10dp</item>
        <item name="android:paddingLeft">20dp</item>
        <item name="android:paddingRight">20dp</item>
        <item name="android:layout_marginRight">15dp</item>
        <item name="android:background">@drawable/button_selector_white_transparent</item>
    </style>

    <style name="ManualInputButton" parent="buttonWhiteBorder">
        <item name="android:layout_marginTop">@dimen/add_other_device_space</item>
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:layout_marginLeft">15dp</item>
    </style>

    <style name="ButtonTurquoiseBorder">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@drawable/button_text_color_selector_turquoise</item>
        <item name="android:background">@drawable/button_selector_turquoise_transparent</item>
    </style>

    <style name="EditBoldTextLabel" parent="ObjectBoldSmallText">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">right</item>
        <item name="android:layout_marginRight">20dp</item>
        <item name="android:layout_marginTop">25dp</item>
    </style>


    <style name="EditTextLabel" parent="ObjectSmallText">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">right</item>
        <item name="android:layout_marginRight">20dp</item>
        <item name="android:layout_marginTop">25dp</item>
    </style>

    <style name="EditTextManualInputLabel" parent="EditBoldTextLabel">
        <item name="android:textColor">@color/white</item>
    </style>

    <style name="EditTextNormal">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginRight">20dp</item>
        <item name="android:layout_marginLeft">20dp</item>
        <item name="android:imeOptions">actionNext</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="EditTextManualInput" parent="EditTextNormal">
        <item name="android:textColorHint">@color/mybiz_light_gray</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/edit_text_white_selector</item>
    </style>

    <style name="LargeTextTitle" parent="ObjectLargeText">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:layout_marginTop">25dp</item>
    </style>

    <style name="MediumTextTitle" parent="ObjectMediumText">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@color/mybiz_dark_gray</item>
        <item name="android:layout_marginTop">25dp</item>
    </style>

</resources>

解决方案

OK we had the same problem - Nexus 5 only, but with ZBar lib instead of ZXing.

The issue was resolved by switching from a SurfaceView to a TextureView - however this resulted in slower frame rates.

Through testing we found that our issue was caused by leaving the screen, bringing up the keyboard and going back - our solution was setting android:windowSoftInputMode to AdjustPan in the manifest.

Hope this helps!

这篇关于DDMS调试:Android应用(我发民)会导致设备(只有Nexus 5)挂,并使用ZXING和对话框时,必须重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆