-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-17361] Android: Initial CardView support
- Loading branch information
Ashraf
committed
Oct 1, 2015
1 parent
28e08a7
commit 9966ef5
Showing
19 changed files
with
571 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<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="src" path="src"/> | ||
<classpathentry kind="src" path="gen"/> | ||
<classpathentry exported="true" kind="lib" path="lib/cardview-v7-23.0.1.jar"/> | ||
<classpathentry kind="output" path="bin/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>android-support-v7-cardview</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> |
12 changes: 12 additions & 0 deletions
12
android/modules/cardview/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.6 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2014 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="android.support.v7.cardview" > | ||
|
||
<uses-sdk android:minSdkVersion="7" /> | ||
|
||
<application /> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
int attr cardBackgroundColor 0x7f010000 | ||
int attr cardCornerRadius 0x7f010001 | ||
int attr cardElevation 0x7f010002 | ||
int attr cardMaxElevation 0x7f010003 | ||
int attr cardPreventCornerOverlap 0x7f010005 | ||
int attr cardUseCompatPadding 0x7f010004 | ||
int attr contentPadding 0x7f010006 | ||
int attr contentPaddingBottom 0x7f01000a | ||
int attr contentPaddingLeft 0x7f010007 | ||
int attr contentPaddingRight 0x7f010008 | ||
int attr contentPaddingTop 0x7f010009 | ||
int color cardview_dark_background 0x7f020000 | ||
int color cardview_light_background 0x7f020001 | ||
int color cardview_shadow_end_color 0x7f020002 | ||
int color cardview_shadow_start_color 0x7f020003 | ||
int dimen cardview_compat_inset_shadow 0x7f030000 | ||
int dimen cardview_default_elevation 0x7f030001 | ||
int dimen cardview_default_radius 0x7f030002 | ||
int style CardView 0x7f040000 | ||
int style CardView_Dark 0x7f040001 | ||
int style CardView_Light 0x7f040002 | ||
int[] styleable CardView { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a } | ||
int styleable CardView_cardBackgroundColor 0 | ||
int styleable CardView_cardCornerRadius 1 | ||
int styleable CardView_cardElevation 2 | ||
int styleable CardView_cardMaxElevation 3 | ||
int styleable CardView_cardPreventCornerOverlap 5 | ||
int styleable CardView_cardUseCompatPadding 4 | ||
int styleable CardView_contentPadding 6 | ||
int styleable CardView_contentPaddingBottom 10 | ||
int styleable CardView_contentPaddingLeft 7 | ||
int styleable CardView_contentPaddingRight 8 | ||
int styleable CardView_contentPaddingTop 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2014 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="android.support.v7.cardview" > | ||
|
||
<uses-sdk android:minSdkVersion="7" /> | ||
|
||
<application /> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<project name="cardview" default="build"> | ||
<import file="../../build/build-module.xml"/> | ||
</project> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-23 | ||
android.library=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-sdk-release/frameworks/support/v7/cardview/res/values/colors.xml --> | ||
<eat-comment/> | ||
<color name="cardview_dark_background">#FF202020</color> | ||
<color name="cardview_light_background">#FFFAFAFA</color> | ||
<color name="cardview_shadow_end_color">#03000000</color> | ||
<color name="cardview_shadow_start_color">#37000000</color> | ||
<declare-styleable name="CardView"><attr format="color" name="cardBackgroundColor"/><attr format="dimension" name="cardCornerRadius"/><attr format="dimension" name="cardElevation"/><attr format="dimension" name="cardMaxElevation"/><attr format="boolean" name="cardUseCompatPadding"/><attr format="boolean" name="cardPreventCornerOverlap"/><attr format="dimension" name="contentPadding"/><attr format="dimension" name="contentPaddingLeft"/><attr format="dimension" name="contentPaddingRight"/><attr format="dimension" name="contentPaddingTop"/><attr format="dimension" name="contentPaddingBottom"/></declare-styleable> | ||
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-sdk-release/frameworks/support/v7/cardview/res/values/dimens.xml --> | ||
<eat-comment/> | ||
<dimen name="cardview_compat_inset_shadow">1dp</dimen> | ||
<dimen name="cardview_default_elevation">2dp</dimen> | ||
<dimen name="cardview_default_radius">2dp</dimen> | ||
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-sdk-release/frameworks/support/v7/cardview/res/values/styles.xml --> | ||
<eat-comment/> | ||
<style name="CardView"> | ||
<item name="cardBackgroundColor">@color/cardview_light_background</item> | ||
<item name="cardCornerRadius">@dimen/cardview_default_radius</item> | ||
<item name="cardElevation">@dimen/cardview_default_elevation</item> | ||
<item name="cardMaxElevation">@dimen/cardview_default_elevation</item> | ||
<item name="cardUseCompatPadding">false</item> | ||
<item name="cardPreventCornerOverlap">true</item> | ||
</style> | ||
<style name="CardView.Dark"> | ||
<item name="cardBackgroundColor">@color/cardview_dark_background</item> | ||
</style> | ||
<style name="CardView.Light"> | ||
<item name="cardBackgroundColor">@color/cardview_light_background</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file exists to keep src/java around |
58 changes: 58 additions & 0 deletions
58
android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2015 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. | ||
*/ | ||
package ti.modules.titanium.ui.android; | ||
|
||
import org.appcelerator.kroll.KrollProxy; | ||
import org.appcelerator.kroll.annotations.Kroll; | ||
import org.appcelerator.titanium.TiC; | ||
import org.appcelerator.titanium.TiContext; | ||
import org.appcelerator.titanium.proxy.TiViewProxy; | ||
import org.appcelerator.titanium.view.TiUIView; | ||
|
||
import ti.modules.titanium.ui.widget.TiUICardView; | ||
import android.app.Activity; | ||
|
||
@Kroll.proxy(creatableInModule = AndroidModule.class, propertyAccessors = { | ||
TiC.PROPERTY_CARD_BACKGROUND_COLOR, | ||
TiC.PROPERTY_CARD_CORNER_RADIUS, | ||
TiC.PROPERTY_CARD_ELEVATION, | ||
TiC.PROPERTY_CARD_MAX_ELEVATION, | ||
TiC.PROPERTY_CARD_PREVENT_CORNER_OVERLAP, | ||
TiC.PROPERTY_CARD_USE_COMPAT_PADDING, | ||
TiC.PROPERTY_CONTENT_PADDING, | ||
TiC.PROPERTY_CONTENT_PADDING_BOTTOM, | ||
TiC.PROPERTY_CONTENT_PADDING_LEFT, | ||
TiC.PROPERTY_CONTENT_PADDING_RIGHT, | ||
TiC.PROPERTY_CONTENT_PADDING_TOP | ||
}) | ||
public class CardViewProxy extends TiViewProxy | ||
{ | ||
private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1; | ||
protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; | ||
|
||
public CardViewProxy() | ||
{ | ||
super(); | ||
} | ||
|
||
public CardViewProxy(TiContext tiContext) | ||
{ | ||
this(); | ||
} | ||
|
||
@Override | ||
public TiUIView createView(Activity activity) | ||
{ | ||
return new TiUICardView(this); | ||
} | ||
|
||
@Override | ||
public String getApiName() | ||
{ | ||
return "Ti.UI.Android.CardView"; | ||
} | ||
} |
Oops, something went wrong.