use of org.w3c.dom.smil.SMILRegionElement in project android-aosp-mms by slvn.
the class SmilHelper method setRegion.
private static boolean setRegion(SMILRegionMediaElement srme, ArrayList<SMILRegionElement> smilRegions, SMILLayoutElement smilLayout, String regionId, boolean regionPresentInLayout) {
SMILRegionElement smilRegion = findRegionElementById(smilRegions, regionId);
if (!regionPresentInLayout && smilRegion != null) {
srme.setRegion(smilRegion);
smilLayout.appendChild(smilRegion);
return true;
}
return false;
}
use of org.w3c.dom.smil.SMILRegionElement in project android-aosp-mms by slvn.
the class SmilRegionMediaElementImpl method getRegion.
public SMILRegionElement getRegion() {
if (mRegion == null) {
SMILDocument doc = (SMILDocument) this.getOwnerDocument();
NodeList regions = doc.getLayout().getElementsByTagName("region");
SMILRegionElement region = null;
for (int i = 0; i < regions.getLength(); i++) {
region = (SMILRegionElement) regions.item(i);
if (region.getId().equals(this.getAttribute("region"))) {
mRegion = region;
}
}
}
return mRegion;
}
use of org.w3c.dom.smil.SMILRegionElement in project qksms by moezbhatti.
the class SmilRegionMediaElementImpl method getRegion.
public SMILRegionElement getRegion() {
if (mRegion == null) {
SMILDocument doc = (SMILDocument) this.getOwnerDocument();
NodeList regions = doc.getLayout().getElementsByTagName("region");
SMILRegionElement region = null;
for (int i = 0; i < regions.getLength(); i++) {
region = (SMILRegionElement) regions.item(i);
if (region.getId().equals(this.getAttribute("region"))) {
mRegion = region;
}
}
}
return mRegion;
}
use of org.w3c.dom.smil.SMILRegionElement in project Signal-Android by WhisperSystems.
the class SmilUtil method getRegion.
private static SMILRegionElement getRegion(SMILDocument document, PduPart part) {
if (PartParser.isAudio(part))
return null;
SMILRegionElement region = (SMILRegionElement) document.createElement("region");
if (PartParser.isText(part)) {
region.setId("Text");
region.setTop(SmilUtil.ROOT_HEIGHT);
region.setHeight(50);
} else {
region.setId("Image");
region.setTop(0);
region.setHeight(SmilUtil.ROOT_HEIGHT);
}
region.setLeft(0);
region.setWidth(SmilUtil.ROOT_WIDTH);
region.setFit("meet");
return region;
}
use of org.w3c.dom.smil.SMILRegionElement in project qksms by moezbhatti.
the class MediaModelFactory method getRegionMediaModel.
private static MediaModel getRegionMediaModel(Context context, String tag, String src, SMILRegionMediaElement srme, LayoutModel layouts, PduPart part) throws IOException, MmsException {
SMILRegionElement sre = srme.getRegion();
if (sre != null) {
RegionModel region = layouts.findRegionById(sre.getId());
if (region != null) {
return getGenericMediaModel(context, tag, src, srme, part, region);
}
} else {
String rId;
if (tag.equals(SmilHelper.ELEMENT_TAG_TEXT)) {
rId = LayoutModel.TEXT_REGION_ID;
} else {
rId = LayoutModel.IMAGE_REGION_ID;
}
RegionModel region = layouts.findRegionById(rId);
if (region != null) {
return getGenericMediaModel(context, tag, src, srme, part, region);
}
}
throw new IllegalArgumentException("Region not found or bad region ID.");
}
Aggregations