Skip to content

Commit

Permalink
initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuyexiong committed Apr 12, 2014
1 parent 4803677 commit 089042c
Show file tree
Hide file tree
Showing 32 changed files with 542 additions and 0 deletions.
26 changes: 26 additions & 0 deletions animtabsview.demo/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tree.love.animtabsview.demo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
<activity
android:name="tree.love.animtabsview.demo.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>
35 changes: 35 additions & 0 deletions animtabsview.demo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':animtabsview')
}

android {
compileSdkVersion 19
buildToolsVersion "19.0.3"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
20 changes: 20 additions & 0 deletions animtabsview.demo/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -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 *;
#}
15 changes: 15 additions & 0 deletions animtabsview.demo/project.properties
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-19
android.library.reference.1=../animtabsview
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions animtabsview.demo/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="tree.love.animtabsview.demo.MainActivity"
tools:ignore="MergeRootFrame" />
15 changes: 15 additions & 0 deletions animtabsview.demo/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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:background="@drawable/test_transparent_mm"
tools:context="tree.love.animtabsview.demo.MainActivity$PlaceholderFragment" >

<tree.love.animtabsview.AnimTabsView
android:id="@+id/publiclisten_tab"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:background="#00000000" >
</tree.love.animtabsview.AnimTabsView>

</RelativeLayout>
10 changes: 10 additions & 0 deletions animtabsview.demo/res/values-w820dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<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>
7 changes: 7 additions & 0 deletions animtabsview.demo/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources>

<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>

</resources>
8 changes: 8 additions & 0 deletions animtabsview.demo/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">animtabsview.demo</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package tree.love.animtabsview.demo;

import tree.love.animtabsview.AnimTabsView;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class MainActivity extends FragmentActivity {

private static final String TAG = "MainActivity";

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

if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}

/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {

private AnimTabsView mTabsView;

public PlaceholderFragment() {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
setupViews(rootView);
return rootView;
}

private void setupViews(View rootView) {
mTabsView = (AnimTabsView) rootView.findViewById(R.id.publiclisten_tab);
mTabsView.addItem("推荐");
mTabsView.addItem("排行榜");
mTabsView.addItem("歌单");
mTabsView.addItem("DJ节目");

mTabsView.setOnAnimTabsItemViewChangeListener(new AnimTabsView.IAnimTabsItemViewChangeListener() {
@Override
public void onChange(AnimTabsView tabsView, int oldPosition, int currentPosition) {
}
});
}
}

}
11 changes: 11 additions & 0 deletions animtabsview/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tree.love.animtabsview"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

</manifest>
34 changes: 34 additions & 0 deletions animtabsview/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apply plugin: 'android-library'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 19
buildToolsVersion "19.0.3"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
20 changes: 20 additions & 0 deletions animtabsview/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -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 *;
#}
15 changes: 15 additions & 0 deletions animtabsview/project.properties
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-19
android.library=true
Binary file added animtabsview/res/drawable-hdpi/blk_menubtn_arr.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 animtabsview/res/drawable-hdpi/blk_menubtn_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions animtabsview/res/drawable/anim_tab_bg_selector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/blk_menubtn_prs_inset" android:state_selected="true"/>
<item android:drawable="@drawable/blk_menubtn_prs_inset" android:state_pressed="true"/>
<item android:drawable="@android:color/transparent"/>

</selector>
5 changes: 5 additions & 0 deletions animtabsview/res/drawable/blk_menubtn_prs_inset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/blk_menubtn_prs"
android:insetBottom="0.8000001dip"
android:insetTop="0.8000001dip" />
8 changes: 8 additions & 0 deletions animtabsview/res/drawable/tab_item_text_color_selector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:color="#ff333333"/>
<item android:state_selected="true" android:color="#ff333333"/>
<item android:color="#ff878787"/>

</selector>
22 changes: 22 additions & 0 deletions animtabsview/res/layout/anim_tab_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" >

<TextView
android:layout_width="wrap_content"
android:layout_height="25.0dip"
android:background="@drawable/anim_tab_bg_selector"
android:duplicateParentState="true"
android:gravity="center"
android:minWidth="49.0dip"
android:paddingLeft="8.0dip"
android:paddingRight="8.0dip"
android:shadowColor="#bfffffff"
android:shadowDy="2.0"
android:shadowRadius="1.0"
android:textColor="@drawable/tab_item_text_color_selector"
android:textSize="15.0sp" />

</RelativeLayout>
10 changes: 10 additions & 0 deletions animtabsview/res/values-w820dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<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>
7 changes: 7 additions & 0 deletions animtabsview/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources>

<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>

</resources>
8 changes: 8 additions & 0 deletions animtabsview/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">"animtabsview "</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>

</resources>
Loading

0 comments on commit 089042c

Please sign in to comment.