Translate

Scroll to a given item in a dataview - Sencha Touch

In my Sencha Touch app I had a component dataview. I had included an index bar and I needed to scroll to the relevant items when I click on index bar. This is what I did.

Here recordIndex is the index of the component in dataview that we need to scroll to.

Adding a custom theme for the android preview screen in a Sencha Touch - Cordova app

In android on app launch, a preview screen is shown. This is before the splash screen. In a Sencha - Cordova app even if we have added the splash screen plugin, before the splash screen this preview window will appear. In my last post I have written how to change the theme of this preview screen in a pure Sencha Touch app. Here I'm writing how to add a custom theme for Sencha Touch+cordova app.

First create an xml file inside,

project-folder/cordova/platforms/android/res/values

The name of the XML file could be anything. Let's call it themes.xml. Then define your theme inside it.

Eg:
I'm going to override the NoTitleBar theme.. To do that this is what we should put inside themes.xml

Now, in the android manifest XML file which is inside,

project-folder/cordova/platforms/android

change the theme as follows.
android:theme="@style/MyTheme"



Black screen before splash screen in Sencha Touch android app?

I built a native Sencha Touch app using Sencha cmd.

I was having a problem. When I open the app before my splash screen loads a black screen was appearing. I found that the reason for this black screen is that on app launch, Android displays a simple preview window (based on your activity theme) as an immediate response to the user action. Then the preview window crossfades with the actual UI, once that has fully loaded [1].  


I could not find a "nice" way to get rid of this black preview window. This is the only solution I found.

1. Go to AndroidManifest.xml inside the path_to_sencha_cmd/Sencha/Cmd/4.0.4.84/stbuild/st-res/android/
(I was using the version 4.0.4.84. The path depends on that.)

2. Inside application tag change the theme as android:theme="@android:style/Theme.Light"

If you do not want the title bar use this instead of the above one.
android:theme="@android:style/Theme.Light.NoTitleBar"

I don't think this is a good way to solve the problem. But I could not find a better way rather than changing Sencha cmd code.


References

[1] https://plus.google.com/+AndroidDevelopers/posts/VVpjo7KDx4H