Andreas Sommer created CB-960:
---------------------------------

             Summary: Include resource class org.apache.cordova.R in JAR so 
that layout can be extended
                 Key: CB-960
                 URL: https://issues.apache.org/jira/browse/CB-960
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 1.9.0
            Reporter: Andreas Sommer
            Assignee: Joe Bowser


The build excludes this class from cordova-x.y.z.jar:

    <target name="jar" depends="build-javascript, -compile">
      <jar jarfile="cordova-${version}.jar" basedir="bin/classes" 
excludes="org/apache/cordova/R.class,org/apache/cordova/R$*.class"/>
    </target>

It would be nice to have access to that class in order to extend the simple 
WebView layout. For example, ActionBarSherlock can only be used with a 
hardcoded value as follows:

    protected ActionBarSherlock sherlock = ActionBarSherlock.wrap(this);

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        // Show the title bar, or else the ActionBar cannot be seen
        super.setBooleanProperty("showTitle", true);

        super.onCreate(savedInstanceState);

        
sherlock.setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);

        // This references org.apache.cordova.R.layout.main (hope this is a 
deterministic number and doesn't change)
        // !!! THIS HAS TO BE HARDCODED BECAUSE THE R CLASS IS NOT INCLUDED !!!
        sherlock.setContentView(0x7f030000);

        super.setIntegerProperty("splashscreen", R.drawable.splash);
        super.setIntegerProperty("loadUrlTimeoutValue", 60000);
        super.loadUrl("file:///android_asset/www/index.html", 120000);
    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to