diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 13:02:25 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 16:13:41 -0700 |
commit | 17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch) | |
tree | b5e5073a2a7b15cdbe826faa5c763e270a505729 /AndroidNative | |
download | xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2 xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip |
Initial import
Diffstat (limited to 'AndroidNative')
15 files changed, 242 insertions, 0 deletions
diff --git a/AndroidNative/FormsViewGroup/.classpath b/AndroidNative/FormsViewGroup/.classpath new file mode 100644 index 00000000..7bc01d9a --- /dev/null +++ b/AndroidNative/FormsViewGroup/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/AndroidNative/FormsViewGroup/.project b/AndroidNative/FormsViewGroup/.project new file mode 100644 index 00000000..752a5a15 --- /dev/null +++ b/AndroidNative/FormsViewGroup/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>FormsViewGroup</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/AndroidNative/FormsViewGroup/.settings/org.eclipse.jdt.core.prefs b/AndroidNative/FormsViewGroup/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..b080d2dd --- /dev/null +++ b/AndroidNative/FormsViewGroup/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/AndroidNative/FormsViewGroup/AndroidManifest.xml b/AndroidNative/FormsViewGroup/AndroidManifest.xml new file mode 100644 index 00000000..bc4108dc --- /dev/null +++ b/AndroidNative/FormsViewGroup/AndroidManifest.xml @@ -0,0 +1,17 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.xamarin.formsviewgroup" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk + android:minSdkVersion="15" + android:targetSdkVersion="15" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme" > + </application> + +</manifest> diff --git a/AndroidNative/FormsViewGroup/libs/android-support-v4.jar b/AndroidNative/FormsViewGroup/libs/android-support-v4.jar Binary files differnew file mode 100644 index 00000000..c31cede4 --- /dev/null +++ b/AndroidNative/FormsViewGroup/libs/android-support-v4.jar diff --git a/AndroidNative/FormsViewGroup/proguard-project.txt b/AndroidNative/FormsViewGroup/proguard-project.txt new file mode 100644 index 00000000..f2fe1559 --- /dev/null +++ b/AndroidNative/FormsViewGroup/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/AndroidNative/FormsViewGroup/project.properties b/AndroidNative/FormsViewGroup/project.properties new file mode 100644 index 00000000..7e2ca64f --- /dev/null +++ b/AndroidNative/FormsViewGroup/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-20 +android.library=true diff --git a/AndroidNative/FormsViewGroup/res/drawable-hdpi/ic_launcher.png b/AndroidNative/FormsViewGroup/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 00000000..96a442e5 --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/drawable-hdpi/ic_launcher.png diff --git a/AndroidNative/FormsViewGroup/res/drawable-mdpi/ic_launcher.png b/AndroidNative/FormsViewGroup/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 00000000..359047df --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/drawable-mdpi/ic_launcher.png diff --git a/AndroidNative/FormsViewGroup/res/drawable-xhdpi/ic_launcher.png b/AndroidNative/FormsViewGroup/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 00000000..71c6d760 --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/drawable-xhdpi/ic_launcher.png diff --git a/AndroidNative/FormsViewGroup/res/values-v11/styles.xml b/AndroidNative/FormsViewGroup/res/values-v11/styles.xml new file mode 100644 index 00000000..3c02242a --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/values-v11/styles.xml @@ -0,0 +1,11 @@ +<resources> + + <!-- + Base application theme for API 11+. This theme completely replaces + AppBaseTheme from res/values/styles.xml on API 11+ devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> + <!-- API 11 theme customizations can go here. --> + </style> + +</resources> diff --git a/AndroidNative/FormsViewGroup/res/values-v14/styles.xml b/AndroidNative/FormsViewGroup/res/values-v14/styles.xml new file mode 100644 index 00000000..a91fd037 --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/values-v14/styles.xml @@ -0,0 +1,12 @@ +<resources> + + <!-- + Base application theme for API 14+. This theme completely replaces + AppBaseTheme from BOTH res/values/styles.xml and + res/values-v11/styles.xml on API 14+ devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> + <!-- API 14 theme customizations can go here. --> + </style> + +</resources> diff --git a/AndroidNative/FormsViewGroup/res/values/strings.xml b/AndroidNative/FormsViewGroup/res/values/strings.xml new file mode 100644 index 00000000..605dd46e --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/values/strings.xml @@ -0,0 +1,5 @@ +<resources> + + <string name="app_name">FormsViewGroup</string> + +</resources> diff --git a/AndroidNative/FormsViewGroup/res/values/styles.xml b/AndroidNative/FormsViewGroup/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/AndroidNative/FormsViewGroup/res/values/styles.xml @@ -0,0 +1,20 @@ +<resources> + + <!-- + Base application theme, dependent on API level. This theme is replaced + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Light"> + <!-- + Theme customizations available in newer API levels can go in + res/values-vXX/styles.xml, while customizations related to + backward-compatibility can go here. + --> + </style> + + <!-- Application theme. --> + <style name="AppTheme" parent="AppBaseTheme"> + <!-- All customizations that are NOT specific to a particular API-level can go here. --> + </style> + +</resources> diff --git a/AndroidNative/FormsViewGroup/src/com/xamarin/forms/platform/android/FormsViewGroup.java b/AndroidNative/FormsViewGroup/src/com/xamarin/forms/platform/android/FormsViewGroup.java new file mode 100644 index 00000000..2168f323 --- /dev/null +++ b/AndroidNative/FormsViewGroup/src/com/xamarin/forms/platform/android/FormsViewGroup.java @@ -0,0 +1,96 @@ +package com.xamarin.forms.platform.android; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.view.*; + + +public class FormsViewGroup extends ViewGroup { + + public FormsViewGroup(Context context) { + super(context); + // TODO Auto-generated constructor stub + } + + public FormsViewGroup(Context context, AttributeSet attrs) { + super(context, attrs); + // TODO Auto-generated constructor stub + } + + public FormsViewGroup(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + // TODO Auto-generated constructor stub + } + + public void measureAndLayout (int widthMeasureSpec, int heightMeasureSpec, int l, int t, int r, int b) + { + measure (widthMeasureSpec, heightMeasureSpec); + layout (l, t, r, b); + } + + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + } + + boolean inputTransparent; + + protected void setInputTransparent (boolean value) + { + inputTransparent = value; + } + + protected boolean getInputTransparent () + { + return inputTransparent; + } + + @Override + public boolean onInterceptTouchEvent (MotionEvent ev) + { + if (inputTransparent) + return false; + + return super.onInterceptTouchEvent(ev); + } + + @Override + public boolean onTouchEvent (MotionEvent ev) + { + if (inputTransparent) + return false; + + return super.onTouchEvent(ev); + } + + public void sendBatchUpdate ( + float pivotX, + float pivotY, + int visibility, + boolean enabled, + float opacity, + float rotation, + float rotationX, + float rotationY, + float scale, + float translationX, + float translationY){ + setPivotX (pivotX); + setPivotY (pivotY); + + if (getVisibility () != visibility) + setVisibility (visibility); + + if (isEnabled () != enabled) + setEnabled (enabled); + + setAlpha (opacity); + setRotation (rotation); + setRotationX (rotationX); + setRotationY (rotationY); + setScaleX (scale); + setScaleY (scale); + setTranslationX (translationX); + setTranslationY (translationY); + } +} |