Hi,
I’ve converted the filename to ascii and have finally built the APK for my App.
After testing it on a actual Samsung device, I’ve found:
1.) The characters are not showing properly. Therefore there is a font problem. This problem does not show when I’m using the desktop.
Here is an example of the kind of fonts I should see:
ཀ ཁ ག ང ཅ ཆ ཇ ཉ ཏ ཐ ད ན
But instead of those texts, I am seeing a box with a x inside it….
2.) On the scenes where I use a Flickable component, there are 2 problems:
1.) The Scaling is wrong and it is not proportionate to the screen size and it is not the same as the desktop version’s scaling
2.) The orientation and positioning of the item/items inside the Flickable is “off” from where it is suppose to be.
The best way to understand what I’m saying is by checking my app in action.
Kindly check out any of my recent builds and click on any of the options on the first screen.
This is what you will observe:
1.) If you click on any of the options you will see that the font is off
2.) If you choose “Five Vowels”, this is a good example of the right scaling and positioning I want, but this Scene does not use Flickable.
3.) If you choose any except “Thirty Consonants” and “Five Vowels” then you will see what I mean about scaling and positioning being off, probably due to Flickable.
This is a sample template that I use across those “Scenes” using Flickable:
Am I using Flickable incorrectly???? How should I use it??? How do I fix the font problem????
Thank you…..
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import VPlay 1.0
SceneBase {
property bool onOrOff
onOnOrOffChanged: {
toggleSplBtn.color = (onOrOff == true) ? "red" : "darkblue"
}
Sound {
id: soundChosen
}
SimpleButton {
id: toggleSplBtn
anchors.top: parent.top
anchors.right: parent.right
z: 10
text: "Spell"
Component.onCompleted: {
if(onOrOff == true){
toggleSplBtn.color = "red"
}else{
toggleSplBtn.color = "darkblue"
}
}
onClicked: {
onOrOff = !onOrOff
console.debug(onOrOff)
}
}
SimpleButton {
anchors.left: parent.left
anchors.bottom: parent.bottom
text: "Back"
z: 10
onClicked: {
console.debug("BACK TO MAIN MENU")
window.state = "menu"
}
}
Flickable {
id: flickable
//contentY: 100
interactive: true
flickableDirection: flickable.VerticalFlick
anchors.fill: parent
//width: 200
//height: 200
contentWidth: parent.width
//contentHeight: 1000
Scene {
id: movableScene
EntityManager {
id: entityManager
entityContainer: movableScene
}
property url jsonFile: "json/ThirtyConsonantsWithVowels.json"
Component {
id: btnComp
EntityBase {
id: entityBaseX
property int index: 1
property string character
property double spacing: 50
property double widthValue: 40
property double heightValue: 40
property double numOfCol: 8
property double widthOfSet: numOfCol * spacing
entityId: index
entityType: "buttonEntity"
SimpleButton {
id: btn
property int col: index % numOfCol + 1
property int row: Math.floor(index / numOfCol) + 1
x: col * spacing + (parent.parent.width - widthOfSet)/2 - spacing + (spacing - widthValue)/2
y: row * spacing
width: widthValue
height: heightValue
//text: col + "/" + row
text: character
property url jsonAudioFile: "json/TibUnicodeToDecimal.json"
onClicked: {
console.debug("button " + btn.text + " clicked")
var data = fileUtils.readFile(jsonAudioFile)
var jsonObj = JSON.parse(data)
console.debug("jsonObj")
console.debug(jsonObj)
console.debug(jsonObj[btn.text])
var filename = jsonObj[btn.text]
if(onOrOff){
soundChosen.source = "snd/" + filename + "-complete" + ".wav"
soundChosen.play()
}else{
soundChosen.source = "snd/" + filename + ".wav"
soundChosen.play()
}
console.debug(soundChosen.source)
}
}
Component.onCompleted: console.debug("btn created " + index)
}
}
Component.onCompleted: {
console.debug("Flickable - Component.onCompleted")
console.debug(jsonFile)
console.debug("inside consonantsPlusVowels")
var data = fileUtils.readFile(jsonFile)
console.debug(data)
var jsonObj = JSON.parse(data)
console.debug("jsonObj")
console.debug(jsonObj)
for(var i = 0; i < jsonObj.length; i++)
{
console.debug(jsonObj[i])
entityManager.createEntityFromComponentWithProperties(btnComp, {index: i, character: jsonObj[i]})
console.debug("create button")
}
var entity = entityManager.getEntityById(1)
console.debug("numOfCol ****************")
console.debug(entity.numOfCol)
var numOfRow = jsonObj.length / entity.numOfCol
var size = numOfRow * entity.spacing + entity.spacing + entity.spacing
flickable.contentHeight = size
}
}
}
}
- This topic was modified 10 years ago by bliss.