Android的银河S4采用价值观大? [英] Android Galaxy S4 uses values-large?

查看:117
本文介绍了Android的银河S4采用价值观大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

我测试使用Eclipse / ADT包我的应用程序。在一个AVD创建效仿银河S4(定义为设备的常规的大小)操作系统是选择从价值观大文件夹中的XML文件。

Android的操作系统无视我都在试图从片区分S4中定义的所有其他值的文件夹。

由于下列文件夹,它选择了价值观为大文件夹的S4:

 值,大
价值观sw720dp
值
值正常,华电国际
值正常,MDPI
值正常,xhdpi
值正常,xxhdpi
值正常
 

现在的问题是,我有主/从(ListFragment /详细信息片段)两个片段显示,只有在大屏幕上(片剂)显示正常。它不能正常在S4中,因为该设备的尺寸显示,。在设备上小于6宽,图标都能得到显示,而不是在文本右侧的文字之上。唯一的区别是与S4在横向方向。

在S4是唯一的正常大小的设备,可以显示在横向两个窗格布局。 Nexus的4和其他人不能。在景观S4额外的密度是什么使得它的工作。

我也不想在S4使用dimens.xml文件,是在价值观的大目录。

问题:

这是正常/预期的行为?是否操作系统的S4归类为大型的设备?操作系统无视我曾尝试使用瞄准S4所有其他文件夹的名称。因此,prefers的pre 3.2名在较新的。

在换句话说,当我尝试使用较新的文件夹名称,例如价值观sw720dp ,操作系统仍然选择在大文件夹。

我有两个AVDS。一个我创建相匹配的S4的规格。另一种是索尼Xperia Z1,具有相同的规格,当你安装索尼SDK可用。这两个AVDS都设置是尺寸=正常。我检查了每一个来使某些有他们的设置没有错误。

感谢。

修改

我有一个新的LG G2,这是在大小和密度类似于S4。它不使用该值,大的目录。我认为这是用值正常,xxhdpi ,但需要运行更多的测试(在dimens.xml改变尺寸值),看看哪个目录下的选择。

解决方案
  

对于大屏幕的主/双面板布局(任意方向)

这似乎罚款。言下之意是,你将使用此 -xlarge 以及 -large

  

和具有高DPI中的屏幕在横向

首先,我不知道什么是中屏的,因为这个词是不是在Android开发中使用。

二,我不知道为什么你认为这将是适当的。屏密度不应影响的是否显示一个或两个窗格的决定。我很想知道,应用程序,由专家撰写的,你看采取这一做法。

  

起初我还以为是第二个文件夹(sw720dp)引起的问题

请注意,你有没有说明是什么问题。

  

索尼的Xperia Z1 AVD

我不知道SONY分布仿真图像为他们的设备。

  

做的事情是一样的S4 AVD

我不知道的是,三星分发模拟器图像为他们的设备。

  

是否有价值观夹我可以使用,使银河S4不会选择主/详细信息可言,但仍允许平板电脑使用它?

忽略你的中等屏幕,高DPI横向,使用 -large -xlarge 为平板电脑。三星Galaxy S4将不会使用 -large -xlarge 的资源,因为它是一个 -Normal 设备。这是同时使用GT-I9500这个特定型号的SGH-I337版本证实。

  

有没有一种方法,我可以把它只有在横向使用主/详细S4?

您可以使用 - 正常陆来确定 -Normal 设备 - 土地方向。需要注意的是屏幕尺寸( -Normal )是一个有点模糊匹配,在安卓认为,有效的设备在尺寸级别的或更大的。因此, - 正常陆将使用 -large陆 -xlarge-土地设备,以及,在没有更好的比赛。

(请注意,密度预选赛甚至是模糊的 - -mdpi 将用于的任意的器件密度,在没有更好的匹配,因为密度预选赛被设计成只在绘制目录中,其中机器人可以申请重采样算法使用。使用密度预选赛上以外的任何其他可绘制和的也许维资源是code气味。)

就个人而言,我不会用一个双窗格策略 - 正常陆设备,如 -Normal 云一路下跌到3路对角线。

  

这是所有在使用模拟器在Eclipse / ADT包。

我的猜测是,这是你的问题进入。

除非你从一个设备制造商下载的东西(例如,亚马逊与他们的模拟器图像Kindle Fire的系列),绝不会说,你有一个索尼Xperia Z1 AVD或S4 AVD 。您对我们撒谎,更有甚者,你对自己说谎。在最好的情况,你有,你认为你已经配置以满足这些设备的规格仿真器的图像。但是:

  • 假定你有配置正确
  • 在这假设设备制造商还没有在固件级别改变了他们的设备的行为
  • 在假定没有仿真器的bug

您肯定是欢迎的说,你正在测试的 -Normal -hdpi 模拟器的东西,或类似,因为这些事情,你通过AVD管理的设备定义选项卡直接控制。

Problem:

I am testing my app using the Eclipse/ADT bundle. On an AVD created to emulate the Galaxy S4 (a device defined as being "normal" in size) the OS is selecting the XML files from the values-large folder.

The Android operating system is ignoring all other values folders I have defined in an attempt to differentiate the S4 from tablets.

Given the following folders, it selects the values-large folder for the S4:

values-large
values-sw720dp
values
values-normal-hdpi
values-normal-mdpi
values-normal-xhdpi
values-normal-xxhdpi
values-normal

The problem is that I have Master/Detail (ListFragment/Detail-Fragment) two-fragment display that only displays correctly on large screens (tablets). It does not display correctly on the S4, because of the device's size. On a device smaller than 6" wide, the icons end up getting displayed on top of the text, instead of to the right of the text. The only difference is with the S4 in landscape orientation.

The S4 is the ONLY normal sized device that can show the two-pane layout in landscape orientation. The Nexus 4 and others cannot. In landscape the extra density of the S4 is what makes it work.

I also don't want the S4 to use the dimens.xml file that is in the values-large directory.

Questions:

Is this normal/expected behavior? Does the OS classify the S4 as a "large" device? The OS has ignored every other folder name I have tried to use to target the S4. So, it prefers the pre 3.2 names over the newer ones.

In other words, when I attempt to use the newer folder names, like values-sw720dp, the OS still chooses the large folder.

I have two AVDs. One I created to match the specs of the S4. The other is the Sony Xperia Z1, that has the same specs and is available when you install the Sony SDK. Both AVDs are setup with size=normal. I have checked each to makes certain there is no mistake in their setup.

Thanks.

EDIT

I have a new LG G2, which is similar to the S4 in size and density. It does NOT use the values-large directory. I think it is using values-normal-xxhdpi, but need to run more tests (changing dimension values in the dimens.xml) to see what directory it is choosing.

解决方案

Master/Detail two-pane layout for large screens (any orientation)

That seems fine. The implication is that you will use this for -xlarge as well as -large.

and medium screens with high dpi in landscape orientation

First, I do not know what "medium screens" are, as that term is not used in Android development.

Second, I have no idea why you think this would be appropriate. Screen density should not impact the decision of whether to show one or two panes. I would be interested to know applications, written by experts, you see taking this approach.

At first I thought it was the second folder (sw720dp) causing the problem

Note that you have not stated what the problem is.

The Sony Xperia Z1 AVD

I am not aware that SONY distributes emulator images for their devices.

does the same thing as the S4 AVD

I am not aware that Samsung distributes emulator images for their devices.

Is there a values folder I can use to make the Galaxy S4 not choose Master/Detail at all, but still allow tablets to use it?

Ignoring your "medium screens with high dpi in landscape orientation", use -large or -xlarge for tablets. The Samsung Galaxy S4 will not use -large or -xlarge resources, as it is a -normal device. This was confirmed using both the GT-I9500 and the SGH-I337 versions of this particular model.

Is there a way I can make it use Master/Detail for the S4 only when in landscape?

You can use -normal-land to identify -normal devices in the -land orientation. Note that screen size (-normal) is a bit of a fuzzy match, in that Android considers that valid for devices in that size class or larger. Hence, -normal-land would be used by -large-land and -xlarge-land devices as well, in the absence of better matches.

(Note that density qualifiers are even fuzzier -- -mdpi will be used for any device density, in the absence of a better match, as density qualifiers are designed to be used only on drawable directories, where Android can apply resampling algorithms. Using density qualifiers on anything other than drawables and maybe dimension resources is a code smell.)

Personally, I would not use a dual-pane strategy for -normal-land devices, as -normal goes all the way down to 3" diagonal.

This is all in the Eclipse/ADT bundle using the emulator.

My guess is that this is where your problems are coming in.

Unless you downloaded something from a device manufacturer (e.g., Amazon with their emulator images for the Kindle Fire series), NEVER say that you have a "Sony Xperia Z1 AVD" or a "S4 AVD". You are lying to us and, worse, you are lying to yourself. At best, you have an emulator image that you think that you have configured to match the specifications of those devices. However:

  • That assumes you got the configuration correct
  • That assumes that the device manufacturer has not changed the behavior of their device at the firmware level
  • That assumes there are no emulator bugs

You are certainly welcome to say that you are testing things on -normal -hdpi emulators, or the like, as those are things that you directly control via the Device Definitions tab of the AVD Manager.

这篇关于Android的银河S4采用价值观大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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