Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23601] Update android module for deprecations, manifest for Ti 6+ #4

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
language: objective-c
osx_image: xcode7.3
env:
global:
- "MODULE_NAME=ti.moddevguide"
global:
- "MODULE_NAME=ti.moddevguide"
- TRAVIS_NODE_VERSION="4"
before_install:
- MODULE_ROOT=$PWD
- brew update
- brew install nvm
- source $(brew --prefix nvm)/nvm.sh
- nvm install 4
- npm config delete prefix
- nvm use --delete-prefix v4.4.7 4
install:
- cd $MODULE_ROOT
- curl -o install.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/install.sh
- source install.sh
script:
- curl -o script.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/script.sh
- curl -o install.sh https://raw.githubusercontent.com/sgtcoolguy/ci/v8/travis/install.sh
- source install.sh -s "--branch master"
script:
- curl -o script.sh https://raw.githubusercontent.com/sgtcoolguy/ci/v8/travis/script.sh
- source script.sh
after_success: # and this only on success
- curl -o deploy.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/deploy.sh
Expand Down
Empty file added android/lib/.gitkeep
Empty file.
9 changes: 5 additions & 4 deletions android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.1.1
apiversion: 2
version: 3.0.0
apiversion: 3
architectures: armeabi-v7a x86
description: Titanium Module Development Guide
author: Jeff English & Jon Alter
license: Appcelerator Commercial License
copyright: Copyright (c) 2010-2012 by Appcelerator, Inc.
copyright: Copyright (c) 2010-2016 by Appcelerator, Inc.


# these should not be edited
name: moddevguide
moduleid: ti.moddevguide
guid: 0c7b7522-0e82-4ff2-b456-3ec6ac7948ae
platform: android
minsdk: 3.2.2
minsdk: 6.0.0
37 changes: 18 additions & 19 deletions android/src/ti/moddevguide/DemoViewProxy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
Expand All @@ -14,7 +14,6 @@
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.titanium.view.TiUIView;
import org.appcelerator.titanium.proxy.TiViewProxy;
Expand All @@ -26,33 +25,33 @@
// The proxy is declared with the @Kroll.proxy annotation

@Kroll.proxy(creatableInModule = ModdevguideModule.class)
public class DemoViewProxy extends TiViewProxy
public class DemoViewProxy extends TiViewProxy
{
// Standard Debugging variables
private static final String LCAT = "ModdevguideModule";

public DemoViewProxy() {
super();

Log.d(LCAT, "[VIEWPROXY LIFECYCLE EVENT] init");
}

@Override
public TiUIView createView(Activity activity)
public TiUIView createView(Activity activity)
{
// This method is called when the view needs to be created. This is
// a required method for a TiViewProxy subclass.

DemoView view = new DemoView(this);
view.getLayoutParams().autoFillsHeight = true;
view.getLayoutParams().autoFillsWidth = true;

return view;
}

// Handle creation options
@Override
public void handleCreationDict(KrollDict options)
public void handleCreationDict(KrollDict options)
{
// This method is called from handleCreationArgs if there is at least
// argument specified for the proxy creation call and the first argument
Expand All @@ -65,34 +64,34 @@ public void handleCreationDict(KrollDict options)
super.handleCreationDict(options);
}

public void handleCreationArgs(KrollModule createdInModule, Object[] args)
public void handleCreationArgs(KrollModule createdInModule, Object[] args)
{
// This method is one of the initializers for the proxy class. The arguments
// for the create call are passed as an array of objects. If your proxy
// for the create call are passed as an array of objects. If your proxy
// simply needs to handle a single KrollDict argument, use handleCreationDict.
// The superclass method calls the handleCreationDict if the first argument
// to the create method is a dictionary object.

Log.d(LCAT, "VIEWPROXY LIFECYCLE EVENT] handleCreationArgs ");

for (int i = 0; i < args.length; i++) {
Log.d(LCAT, "VIEWPROXY LIFECYCLE EVENT] args[" + i + "] " + args[i]);
}

super.handleCreationArgs(createdInModule, args);
}

// Proxy properties are forwarded to the view in the propertyChanged
// notification. If the property update needs to occur on the UI thread
// then create the setProperty method in the proxy and forward to the view.

private static final int MSG_SET_COLOR = 70000;

@Kroll.setProperty(retain=false)
public void setColor(final String color)
public void setColor(final String color)
{
Log.d(LCAT,"[VIEWPROXY LIFECYCLE EVENT] Property Set: setColor");

// Get the view object from the proxy and set the color
if (view != null) {
if (!TiApplication.isUIThread()) {
Expand All @@ -115,10 +114,10 @@ public boolean handleMessage(Message msg) {
demoView.setColor(color);
}
}
// Call setProperty if you want the property set on the proxy and

// Call setPropertyAndFire if you want the property set on the proxy and
// to signal the propertyChanged notification
setProperty("color", color, true);
setPropertyAndFire("color", color);
}

}