我们在Android API 4.0上运行了一个Android应用程序.其中一个活动的布局将屏幕分为两部分.在左侧,我们有一个带有一些按钮的静态部分.在右侧,我们有一个FrameLayout,它将根据按下的按钮切换到相应的片段.
问题: 右侧的一个片段包含VideoView.当用户点击按钮以显示该片段时,片段被显示并且视频立即开始播放:在渲染该片段时,整个屏幕以黑色闪烁,这非常烦人.
以下是VideoFragment类的一些代码:
public class VideoFragment extends Fragment {
public VideoView videoView;
private ExternalVideo mVideo;
private boolean mVideoExists;
private String mDestination;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mDestination = ApplicationParams.MEDIA_STORAGE_PATH + "videos/"
+ FilenameUtils.getBaseName(((DetailActivity)getActivity()).getProduct().getVideoUrl())
+ "."
+ FilenameUtils.getExtension(((DetailActivity) getActivity()).getProduct().getVideoUrl());
File file = new File(mDestination);
mVideoExists = file.exists() && file.isFile();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view;
if (mVideoExists) {
getActivity().getWindow().setFormat(PixelFormat.TRANSLUCENT);
view = inflater.inflate(R.layout.video, null);
mVideo = new ExternalVideo(mDestination);
videoView = …
Run Code Online (Sandbox Code Playgroud) android android-video-player android-layout android-fragments
我一直在为Magento(版本1.8.0.0)开发一个自定义模块,它显示了某个产品的相关产品列表.
为了实现这一点,我通过覆盖Mage_Catalog_Block_Product_List
类创建了自己的模块.
基本上这是它的工作原理:
从控制器我捕获产品entity_id
,我将产品存储在注册表中,以便我可以在我的自定义写入块中使用它,该块名为list.php
以下是填充产品集合的方法:
protected function _getProductCollection()
{
if (is_null($this->_productCollection)) {
$prod = Mage::registry('chosenproduct');
$this->_productCollection = $prod->getRelatedProductCollection()
->addAttributeToSelect('required_options')
->addAttributeToFilter(array(array('attribute'=>'accessory_manufacturer','neq'=>false)))
->addAttributeToSort('position', 'asc')
->addStoreFilter()
->setPageSize(30)
->setCurPage(1);
;
$this->_addProductAttributesAndPrices($this->_productCollection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_productCollection);
$this->setProductCollection($this->_productCollection);
}
return $this->_productCollection;
}
Run Code Online (Sandbox Code Playgroud)
我还在自定义模块的布局.xml中添加了以下内容,以确保分层导航显示:
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>
Run Code Online (Sandbox Code Playgroud)
分层导航显示,但似乎它将所有产品作为集合而不是我在上面添加的方法中使用的自定义集合.
我也知道我可以使用它来获取目录/图层 $layer = Mage::getSingleton('catalog/layer');
图层类还有一个名为prepareProductCollection和setCollection的方法,但由于某种原因我无法使其工作.
对此有何帮助?
基本上我想为自定义集合中的产品进行分层导航.
谢谢,
我正在制作一个图像上传器(将图像上传到图像托管网站),我遇到了一些问题(图像位置已经运行的应用程序)
我的program.cs:
static class Program
{
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr
wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern uint RegisterWindowMessage(string lpString);
[STAThread]
static void Main(params string[] Arguments)
{
if (Arguments.Length > 0)
{
//This means that the the upload item in the context menu is clicked
//Here the method "uploadImage(string location)"
//of the running application must be ran
}
else …
Run Code Online (Sandbox Code Playgroud) 我们公司最近决定开始使用Varnish HTTP加速器.最重要的是我们选择这个解决方案的原因是因为我们是一家专门建立网店的公司(Magento Enterprise)=> Magento有一个商业插件,与清漆一起使用.
清漆配置已经存在于我们的测试环境中,其中包含运行清漆实例的1(软件)负载均衡器,2个apache webservers和1个存储+ 1个mysql服务器.
然而,现在是时候将Varnish添加到我们的开发环境中(虚拟机具有1GB的ram运行debian,其中包含数据库,webserver,文件在同一台机器上运行)
任何人都可以为此设置发布default.vcl配置文件吗?
Apache2在端口80上运行.
提前谢谢,肯尼
对于一个项目,我运行ImageMagick将几个图像(所有相同大小960x570)转换为单个PDF.
我正在运行的命令是:
convert *.jpg pdf/export.pdf
Run Code Online (Sandbox Code Playgroud)
由于图像大小相同,我希望每个PDF页面的大小相同,但情况并非如此,您可以在下面的屏幕截图中看到:
这有点烦人,因为我不知道如何强制每个PDF页面的大小相同.
我在Android设备,ubuntu pdf阅读器和adobe阅读器上测试了PDF,它们都显示了不同的大小.
谢谢你的帮助!
编辑1: 在测试了Marc B和Basti建议的更多东西后,我设法在JPG(上传)图像上放置相同的尺寸.
使用webkit2png(将网页/ html文件转换为图像的Python脚本)生成的图像仍然存在问题.在尝试(几乎?)转换命令中的所有内容后,我无法在PDF中正确地购买这些生成的图像,如下所示:
任何帮助将非常感激!
我手机上的库存rom中的MVNO(移动虚拟网络运营商)有问题。基本上,这意味着我的数据连接仅在漫游时有效。这是一个已知问题,已经在多个rom上解决了(但不是在我的rom上)。
为了解决这个问题,我想修改framework.jar文件(/system/framework/framework.jar
)的源,更具体地讲,该文件:/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
首先,我将列出要采取的措施以显示遇到问题的地方:我已经完全对我的库存ROM进行了脱胶,包括/ system / framework /和/ system / app中的JAR文件和APK文件
这是我遇到的问题,我需要弄清楚如何编辑所需的Java文件,并最终得到一个可正常工作的framework.jar,可以将其上传到手机中。
我做错了吗?还有其他方法可以解决我的问题吗?我希望从有经验的人那里得到一些帮助...
android ×2
arguments ×1
c# ×1
collections ×1
imagemagick ×1
layered ×1
linux ×1
magento ×1
navigation ×1
pdf ×1
php ×1
product ×1
varnish ×1