Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-c464-86f1-a23f-96be1521e7f2
  • Loading branch information
[email protected] committed May 13, 2011
1 parent 7359bf7 commit 522da97
Show file tree
Hide file tree
Showing 15 changed files with 640 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?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 kind="output" path="bin"/>
</classpath>
33 changes: 33 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AndroidQuery</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 AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidquery"
android:versionCode="1"
android:versionName="1.0">


<application android:icon="@drawable/icon" android:label="@string/app_name">


</application>
</manifest>
16 changes: 16 additions & 0 deletions build.jardesc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
<jardesc>
<jar path="AndroidQuery/dist/android-query.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/AndroidQuery/build.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<javaElement handleIdentifier="=AndroidQuery/src"/>
</selectedElements>
</jardesc>
12 changes: 12 additions & 0 deletions default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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 use,
# "build.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-4
android.library=true
Binary file added dist/android-query.jar
Binary file not shown.
36 changes: 36 additions & 0 deletions proguard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Binary file added res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions res/layout/main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
5 changes: 5 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World!</string>
<string name="app_name">AndroidQuery</string>
</resources>
245 changes: 245 additions & 0 deletions src/com/androidquery/AQuery.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
package com.androidquery;

import java.lang.reflect.Method;

import android.app.Activity;
import android.text.Spanned;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;


public class AQuery extends AbstractAQuery<AQuery>{

public AQuery(Activity act) {
super(act);
}

public AQuery(View view) {
super(view);
}

@Override
protected AQuery create(View view) {
return new AQuery(view);
}


/*
private View root;
private Activity act;
protected View view;
public AQuery(Activity act){
this.act = act;
this.view = root;
}
public AQuery(View root){
this.root = root;
this.view = root;
}
public View getView(){
return view;
}
private View findView(int id){
View result = null;
if(root != null){
result = root.findViewById(id);
}else if(act != null){
result = act.findViewById(id);
}
return result;
}
public AQuery find(int id){
View view = findView(id);
return new AQuery(view);
}
public id(int id){
view = findView(id);
return this;
}
public AQuery text(CharSequence text){
if(view != null){
TextView tv = (TextView) view;
tv.setText(text);
}
return this;
}
public AQuery text(Spanned text){
if(view != null){
TextView tv = (TextView) view;
tv.setText(text);
}
return this;
}
public AQuery image(int id){
if(view != null){
ImageView iv = (ImageView) view;
if(id == 0){
iv.setImageBitmap(null);
}else{
iv.setImageResource(id);
}
}
return this;
}
public AQuery transparent(boolean transparent){
if(view != null){
UIUtility.transparent(view, transparent);
}
return this;
}
public AQuery enabled(boolean enable){
if(view != null){
view.setEnabled(enable);
}
return this;
}
public AQuery gone(){
if(view != null){
view.setVisibility(View.GONE);
}
return this;
}
public AQuery hide(){
if(view != null){
view.setVisibility(View.INVISIBLE);
}
return this;
}
public AQuery show(){
if(view != null){
view.setVisibility(View.VISIBLE);
}
return this;
}
public AQuery background(int id){
if(view != null){
if(id != 0){
view.setBackgroundResource(id);
}else{
view.setBackgroundDrawable(null);
}
}
return this;
}
public AQuery dataChanged(){
if(view != null){
if(view instanceof ListView){
ListView lv = (ListView) view;
ListAdapter la = lv.getAdapter();
if(la instanceof BaseAdapter){
BaseAdapter ba = (BaseAdapter) la;
ba.notifyDataSetChanged();
}
}
}
return this;
}
private void invokeHandler(View view, Object handler, String callback){
try{
Method method = handler.getClass().getMethod(callback, View.class);
if(method != null){
method.invoke(handler, view);
}
}catch(Exception e){
//Utility.report(e);
e.printStackTrace();
}
}
public AQuery bind(Object obj, String method){
final Object o = obj;
final String callback = method;
if(view != null){
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
invokeHandler(v, o, callback);
}
});
}
return this;
}
public AQuery clear(){
if(view != null){
if(view instanceof ImageView){
ImageView iv = ((ImageView) view);
iv.setImageBitmap(null);
iv.setTag(null);
}else if(view instanceof WebView){
WebView wv = ((WebView) view);
wv.stopLoading();
wv.clearView();
wv.setTag(null);
}
}
return this;
}
*/
}
Loading

0 comments on commit 522da97

Please sign in to comment.