Skip to content
Permalink
Browse files

Add example

  • Loading branch information...
dschuermann committed Apr 12, 2015
1 parent 4ada5b0 commit eb273b05d3f56000548b495d43a9a4be14d0ffe3
Showing with 523 additions and 30 deletions.
  1. +4 −4 .gitignore
  2. +33 −0 HtmlTextView/.gitignore
  3. +38 −0 HtmlTextView/build.gradle
  4. +7 −0 HtmlTextView/src/main/AndroidManifest.xml
  5. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/HtmlTagHandler.java
  6. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/HtmlTextView.java
  7. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/JellyBeanSpanFixTextView.java
  8. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/LocalImageGetter.java
  9. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/LocalLinkMovementMethod.java
  10. 0 { → HtmlTextView}/src/main/java/org/sufficientlysecure/htmltextview/UrlImageGetter.java
  11. +11 −13 build.gradle
  12. +33 −0 example/.gitignore
  13. +18 −0 example/build.gradle
  14. +21 −0 example/src/main/AndroidManifest.xml
  15. +44 −0 example/src/main/java/org/sufficientlysecure/htmltextview/example/MainActivity.java
  16. +17 −0 example/src/main/res/layout/activity_main.xml
  17. +5 −0 example/src/main/res/menu/menu_main.xml
  18. BIN example/src/main/res/mipmap-hdpi/ic_launcher.png
  19. BIN example/src/main/res/mipmap-mdpi/ic_launcher.png
  20. BIN example/src/main/res/mipmap-xhdpi/ic_launcher.png
  21. BIN example/src/main/res/mipmap-xxhdpi/ic_launcher.png
  22. +5 −0 example/src/main/res/values-v21/styles.xml
  23. +6 −0 example/src/main/res/values-w820dp/dimens.xml
  24. +5 −0 example/src/main/res/values/dimens.xml
  25. +6 −0 example/src/main/res/values/strings.xml
  26. +8 −0 example/src/main/res/values/styles.xml
  27. BIN gradle/wrapper/gradle-wrapper.jar
  28. +6 −0 gradle/wrapper/gradle-wrapper.properties
  29. +164 −0 gradlew
  30. +90 −0 gradlew.bat
  31. +2 −0 settings.gradle
  32. +0 −13 src/main/AndroidManifest.xml
@@ -2,7 +2,6 @@
bin
gen
obj
libs/armeabi
lint.xml
local.properties
release.properties
@@ -14,9 +13,6 @@ ant.properties
.gradle
build
gradle.properties
gradlew
gradlew.bat
gradle

#Maven
target
@@ -31,3 +27,7 @@ pom.xml.*
#IntelliJ IDEA
.idea
*.iml

#Lint output
lint-report.html
lint-report_files/*
@@ -0,0 +1,33 @@
#Android specific
bin
gen
obj
lint.xml
local.properties
release.properties
ant.properties
*.class
*.apk

#Gradle
.gradle
build
gradle.properties

#Maven
target
pom.xml.*

#Eclipse
.project
.classpath
.settings
.metadata

#IntelliJ IDEA
.idea
*.iml

#Lint output
lint-report.html
lint-report_files/*
@@ -0,0 +1,38 @@
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
classpath 'com.novoda:bintray-release:0.2.9'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 21
buildToolsVersion '21.1.2'

defaultConfig {
minSdkVersion 7
targetSdkVersion 21
versionCode 1
versionName "1.0"
}

// Do not abort build if lint finds errors
lintOptions {
abortOnError false
}
}

/*publish {
userOrg = 'sufficientlysecure'
groupId = 'com.novoda'
artifactId = 'html-textview'
version = '1.0'
description = 'HtmlTextView is an extended TextView component for Android, which can load HTML and converts it into Spannable for displaying it.'
website = 'https://github.com/dschuermann/html-textview'
}*/
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sufficientlysecure.htmltextview">

<application />

</manifest>
@@ -1,16 +1,14 @@
apply plugin: 'android-library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}

// Do not abort build if lint finds errors
lintOptions {
abortOnError false
}

allprojects {
repositories {
jcenter()
}
}
@@ -0,0 +1,33 @@
#Android specific
bin
gen
obj
lint.xml
local.properties
release.properties
ant.properties
*.class
*.apk

#Gradle
.gradle
build
gradle.properties

#Maven
target
pom.xml.*

#Eclipse
.project
.classpath
.settings
.metadata

#IntelliJ IDEA
.idea
*.iml

#Lint output
lint-report.html
lint-report_files/*
@@ -0,0 +1,18 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "org.sufficientlysecure.htmltextview.example"
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
}

dependencies {
compile project(':HtmlTextView')
}
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sufficientlysecure.htmltextview.example">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
@@ -0,0 +1,44 @@
package org.sufficientlysecure.htmltextview.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import org.sufficientlysecure.htmltextview.HtmlTextView;


public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

HtmlTextView text = (HtmlTextView) findViewById(R.id.html_text);

text.setHtmlFromString("<h2>Hello wold</h2><ul><li>cats</li><li>dogs</li></ul>", false);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,17 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">

<org.sufficientlysecure.htmltextview.HtmlTextView
android:id="@+id/html_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="@android:style/TextAppearance.Small" />

</RelativeLayout>
@@ -0,0 +1,5 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" android:showAsAction="never" />
</menu>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light">
</style>
</resources>
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -0,0 +1,6 @@
<resources>
<string name="app_name">Example</string>

<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
</resources>
@@ -0,0 +1,8 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>

</resources>
Binary file not shown.
@@ -0,0 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

0 comments on commit eb273b0

Please sign in to comment.
You can’t perform that action at this time.