Permalink
Browse files

init

  • Loading branch information...
misakuo committed Jan 20, 2016
0 parents commit 62fc1167ab218d29a12df6c55b5b05f304f4c8ce
Showing with 1,591 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +1 −0 .idea/.name
  3. +22 −0 .idea/compiler.xml
  4. +3 −0 .idea/copyright/profiles_settings.xml
  5. +6 −0 .idea/encodings.xml
  6. +25 −0 .idea/gradle.xml
  7. +69 −0 .idea/misc.xml
  8. +10 −0 .idea/modules.xml
  9. +12 −0 .idea/runConfigurations.xml
  10. +1 −0 app/.gitignore
  11. +27 −0 app/build.gradle
  12. +17 −0 app/proguard-rules.pro
  13. +13 −0 app/src/androidTest/java/com/moxun/tagcloud/ApplicationTest.java
  14. +20 −0 app/src/main/AndroidManifest.xml
  15. +46 −0 app/src/main/java/com/moxun/tagcloud/MainActivity.java
  16. +11 −0 app/src/main/res/layout/activity_main.xml
  17. BIN app/src/main/res/mipmap-hdpi/ic_launcher.png
  18. BIN app/src/main/res/mipmap-mdpi/ic_launcher.png
  19. BIN app/src/main/res/mipmap-xhdpi/ic_launcher.png
  20. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  21. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  22. +6 −0 app/src/main/res/values-w820dp/dimens.xml
  23. +6 −0 app/src/main/res/values/colors.xml
  24. +5 −0 app/src/main/res/values/dimens.xml
  25. +3 −0 app/src/main/res/values/strings.xml
  26. +11 −0 app/src/main/res/values/styles.xml
  27. +15 −0 app/src/test/java/com/moxun/tagcloud/ExampleUnitTest.java
  28. +23 −0 build.gradle
  29. +18 −0 gradle.properties
  30. BIN gradle/wrapper/gradle-wrapper.jar
  31. +6 −0 gradle/wrapper/gradle-wrapper.properties
  32. +160 −0 gradlew
  33. +90 −0 gradlew.bat
  34. +1 −0 settings.gradle
  35. +1 −0 tagcloudlib/.gitignore
  36. +25 −0 tagcloudlib/build.gradle
  37. +17 −0 tagcloudlib/proguard-rules.pro
  38. +13 −0 tagcloudlib/src/androidTest/java/com/moxun/tagcloud/ApplicationTest.java
  39. +11 −0 tagcloudlib/src/main/AndroidManifest.xml
  40. +178 −0 tagcloudlib/src/main/java/com/moxun/tagcloudlib/view/Tag.java
  41. +337 −0 tagcloudlib/src/main/java/com/moxun/tagcloudlib/view/TagCloud.java
  42. +286 −0 tagcloudlib/src/main/java/com/moxun/tagcloudlib/view/TagCloudView.java
  43. +28 −0 tagcloudlib/src/main/java/com/moxun/tagcloudlib/view/TagsAdapter.java
  44. +38 −0 tagcloudlib/src/main/java/com/moxun/tagcloudlib/view/TextTagsAdapter.java
  45. BIN tagcloudlib/src/main/res/drawable/bg.png
  46. +4 −0 tagcloudlib/src/main/res/values/ids.xml
  47. +3 −0 tagcloudlib/src/main/res/values/strings.xml
  48. +15 −0 tagcloudlib/src/test/java/com/moxun/tagcloud/ExampleUnitTest.java
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
@@ -0,0 +1 @@
TagCloud
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/tagcloudlib" />
</set>
</option>
<option name="myModules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/tagcloudlib" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/3DCloudTag.iml" filepath="$PROJECT_DIR$/3DCloudTag.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/tagcloudlib/tagcloudlib.iml" filepath="$PROJECT_DIR$/tagcloudlib/tagcloudlib.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
@@ -0,0 +1 @@
/build
@@ -0,0 +1,27 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.moxun.tagcloud"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
compile project(path: ':tagcloudlib')
}
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/moxun/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# 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 *;
#}
@@ -0,0 +1,13 @@
package com.moxun.tagcloud;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moxun.tagcloud">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,46 @@
package com.moxun.tagcloud;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.LinearLayout;
import com.moxun.tagcloudlib.view.Tag;
import com.moxun.tagcloudlib.view.TagCloudView;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TagCloudView tagCloudView = new TagCloudView(this, 600, 600, createTags());
tagCloudView.requestFocus();
tagCloudView.setFocusableInTouchMode(true);
tagCloudView.setBackgroundColor(Color.LTGRAY);
LinearLayout layout = (LinearLayout) findViewById(R.id.container);
layout.addView(tagCloudView);
}
private List<Tag> createTags() {
List<Tag> tempList = new ArrayList<>();
tempList.add(new Tag("乐乘", 7, "yuecheng"));
tempList.add(new Tag("嘉灵", 5, "chentong.ct"));
tempList.add(new Tag("阿大", 6, "ada"));
tempList.add(new Tag("左穆", 3, "zuomu.zdd"));
tempList.add(new Tag("天翎", 5, "tianling.lk"));
tempList.add(new Tag("墨循", 6, "moxun.ljf"));
tempList.add(new Tag("红发", 7, "hongfa.yy"));
tempList.add(new Tag("莫凌", 5, "chunbo.lcb"));
tempList.add(new Tag("星驰", 3, "xingchi.mxc"));
tempList.add(new Tag("栖邀", 5, "qiyao.kxp"));
tempList.add(new Tag("左御", 5, "zuoyu.ht"));
tempList.add(new Tag("栖邀", 5, "qiyao.kxp"));
tempList.add(new Tag("左御", 5, "zuoyu.ht"));
return tempList;
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/container"
android:gravity="center"
android:orientation="vertical"
tools:context="com.moxun.tagcloud.MainActivity">
</LinearLayout>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</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,3 @@
<resources>
<string name="app_name">TagCloud</string>
</resources>
@@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
@@ -0,0 +1,15 @@
package com.moxun.tagcloud;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Oops, something went wrong.

0 comments on commit 62fc116

Please sign in to comment.