├── sample
├── .gitignore
├── src
│ ├── main
│ │ ├── assets
│ │ │ └── ems
│ │ │ │ ├── em1.gif
│ │ │ │ ├── em10.gif
│ │ │ │ ├── em11.gif
│ │ │ │ ├── em12.gif
│ │ │ │ ├── em13.gif
│ │ │ │ ├── em14.gif
│ │ │ │ ├── em15.gif
│ │ │ │ ├── em16.gif
│ │ │ │ ├── em17.gif
│ │ │ │ ├── em18.gif
│ │ │ │ ├── em19.gif
│ │ │ │ ├── em2.gif
│ │ │ │ ├── em20.gif
│ │ │ │ ├── em21.gif
│ │ │ │ ├── em22.gif
│ │ │ │ ├── em23.gif
│ │ │ │ ├── em24.gif
│ │ │ │ ├── em25.gif
│ │ │ │ ├── em26.gif
│ │ │ │ ├── em27.gif
│ │ │ │ ├── em28.gif
│ │ │ │ ├── em29.gif
│ │ │ │ ├── em3.gif
│ │ │ │ ├── em30.gif
│ │ │ │ ├── em31.gif
│ │ │ │ ├── em32.gif
│ │ │ │ ├── em33.gif
│ │ │ │ ├── em34.gif
│ │ │ │ ├── em35.gif
│ │ │ │ ├── em36.gif
│ │ │ │ ├── em37.gif
│ │ │ │ ├── em38.gif
│ │ │ │ ├── em39.gif
│ │ │ │ ├── em4.gif
│ │ │ │ ├── em40.gif
│ │ │ │ ├── em41.gif
│ │ │ │ ├── em42.gif
│ │ │ │ ├── em43.gif
│ │ │ │ ├── em44.gif
│ │ │ │ ├── em45.gif
│ │ │ │ ├── em46.gif
│ │ │ │ ├── em47.gif
│ │ │ │ ├── em48.gif
│ │ │ │ ├── em49.gif
│ │ │ │ ├── em5.gif
│ │ │ │ ├── em50.gif
│ │ │ │ ├── em51.gif
│ │ │ │ ├── em52.gif
│ │ │ │ ├── em53.gif
│ │ │ │ ├── em54.gif
│ │ │ │ ├── em55.gif
│ │ │ │ ├── em56.gif
│ │ │ │ ├── em57.gif
│ │ │ │ ├── em58.gif
│ │ │ │ ├── em59.gif
│ │ │ │ ├── em6.gif
│ │ │ │ ├── em60.gif
│ │ │ │ ├── em61.gif
│ │ │ │ ├── em62.gif
│ │ │ │ ├── em63.gif
│ │ │ │ ├── em64.gif
│ │ │ │ ├── em65.gif
│ │ │ │ ├── em66.gif
│ │ │ │ ├── em67.gif
│ │ │ │ ├── em68.gif
│ │ │ │ ├── em69.gif
│ │ │ │ ├── em7.gif
│ │ │ │ ├── em70.gif
│ │ │ │ ├── em71.gif
│ │ │ │ ├── em72.gif
│ │ │ │ ├── em73.gif
│ │ │ │ ├── em8.gif
│ │ │ │ ├── em9.gif
│ │ │ │ ├── ema0.gif
│ │ │ │ ├── ema1.gif
│ │ │ │ ├── ema10.gif
│ │ │ │ ├── ema11.gif
│ │ │ │ ├── ema12.gif
│ │ │ │ ├── ema13.gif
│ │ │ │ ├── ema14.gif
│ │ │ │ ├── ema15.gif
│ │ │ │ ├── ema16.gif
│ │ │ │ ├── ema17.gif
│ │ │ │ ├── ema18.gif
│ │ │ │ ├── ema19.gif
│ │ │ │ ├── ema2.gif
│ │ │ │ ├── ema20.gif
│ │ │ │ ├── ema21.gif
│ │ │ │ ├── ema22.gif
│ │ │ │ ├── ema23.gif
│ │ │ │ ├── ema24.gif
│ │ │ │ ├── ema25.gif
│ │ │ │ ├── ema26.gif
│ │ │ │ ├── ema27.gif
│ │ │ │ ├── ema28.gif
│ │ │ │ ├── ema29.gif
│ │ │ │ ├── ema3.gif
│ │ │ │ ├── ema30.gif
│ │ │ │ ├── ema31.gif
│ │ │ │ ├── ema32.gif
│ │ │ │ ├── ema33.gif
│ │ │ │ ├── ema34.gif
│ │ │ │ ├── ema35.gif
│ │ │ │ ├── ema36.gif
│ │ │ │ ├── ema37.gif
│ │ │ │ ├── ema38.gif
│ │ │ │ ├── ema39.gif
│ │ │ │ ├── ema4.gif
│ │ │ │ ├── ema40.gif
│ │ │ │ ├── ema41.gif
│ │ │ │ ├── ema5.gif
│ │ │ │ ├── ema6.gif
│ │ │ │ ├── ema7.gif
│ │ │ │ ├── ema8.gif
│ │ │ │ ├── ema9.gif
│ │ │ │ ├── emb0.gif
│ │ │ │ ├── emb1.gif
│ │ │ │ ├── emb10.gif
│ │ │ │ ├── emb11.gif
│ │ │ │ ├── emb12.gif
│ │ │ │ ├── emb13.gif
│ │ │ │ ├── emb14.gif
│ │ │ │ ├── emb15.gif
│ │ │ │ ├── emb16.gif
│ │ │ │ ├── emb17.gif
│ │ │ │ ├── emb18.gif
│ │ │ │ ├── emb19.gif
│ │ │ │ ├── emb2.gif
│ │ │ │ ├── emb20.gif
│ │ │ │ ├── emb21.gif
│ │ │ │ ├── emb22.gif
│ │ │ │ ├── emb23.gif
│ │ │ │ ├── emb24.gif
│ │ │ │ ├── emb3.gif
│ │ │ │ ├── emb4.gif
│ │ │ │ ├── emb5.gif
│ │ │ │ ├── emb6.gif
│ │ │ │ ├── emb7.gif
│ │ │ │ ├── emb8.gif
│ │ │ │ ├── emb9.gif
│ │ │ │ ├── emc0.gif
│ │ │ │ ├── emc1.gif
│ │ │ │ ├── emc10.gif
│ │ │ │ ├── emc11.gif
│ │ │ │ ├── emc12.gif
│ │ │ │ ├── emc13.gif
│ │ │ │ ├── emc14.gif
│ │ │ │ ├── emc15.gif
│ │ │ │ ├── emc16.gif
│ │ │ │ ├── emc17.gif
│ │ │ │ ├── emc18.gif
│ │ │ │ ├── emc19.gif
│ │ │ │ ├── emc2.gif
│ │ │ │ ├── emc20.gif
│ │ │ │ ├── emc21.gif
│ │ │ │ ├── emc22.gif
│ │ │ │ ├── emc23.gif
│ │ │ │ ├── emc24.gif
│ │ │ │ ├── emc25.gif
│ │ │ │ ├── emc26.gif
│ │ │ │ ├── emc27.gif
│ │ │ │ ├── emc28.gif
│ │ │ │ ├── emc29.gif
│ │ │ │ ├── emc3.gif
│ │ │ │ ├── emc30.gif
│ │ │ │ ├── emc31.gif
│ │ │ │ ├── emc32.gif
│ │ │ │ ├── emc33.gif
│ │ │ │ ├── emc34.gif
│ │ │ │ ├── emc35.gif
│ │ │ │ ├── emc36.gif
│ │ │ │ ├── emc37.gif
│ │ │ │ ├── emc38.gif
│ │ │ │ ├── emc39.gif
│ │ │ │ ├── emc4.gif
│ │ │ │ ├── emc40.gif
│ │ │ │ ├── emc41.gif
│ │ │ │ ├── emc42.gif
│ │ │ │ ├── emc43.gif
│ │ │ │ ├── emc44.gif
│ │ │ │ ├── emc45.gif
│ │ │ │ ├── emc46.gif
│ │ │ │ ├── emc47.gif
│ │ │ │ ├── emc48.gif
│ │ │ │ ├── emc49.gif
│ │ │ │ ├── emc5.gif
│ │ │ │ ├── emc50.gif
│ │ │ │ ├── emc51.gif
│ │ │ │ ├── emc52.gif
│ │ │ │ ├── emc53.gif
│ │ │ │ ├── emc54.gif
│ │ │ │ ├── emc55.gif
│ │ │ │ ├── emc56.gif
│ │ │ │ ├── emc57.gif
│ │ │ │ ├── emc58.gif
│ │ │ │ ├── emc6.gif
│ │ │ │ ├── emc7.gif
│ │ │ │ ├── emc8.gif
│ │ │ │ └── emc9.gif
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.png
│ │ │ │ ├── ic_emotion.png
│ │ │ │ ├── shape_fast_reply_text.xml
│ │ │ │ ├── shape_button_reply_button.xml
│ │ │ │ └── shape_button_reply_edittext.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ └── layout
│ │ │ │ ├── emotion_gird_item.xml
│ │ │ │ ├── emotion_gird_item_classic.xml
│ │ │ │ ├── widget_tab_indicator.xml
│ │ │ │ ├── emotion_gird.xml
│ │ │ │ ├── emotion_gird_classic.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── reply_layout.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── dss886
│ │ │ └── emotionlayout
│ │ │ ├── viewpager
│ │ │ ├── EmotionAdapter.java
│ │ │ ├── GlobalOnItemClickManager.java
│ │ │ ├── TuzkiFragment.java
│ │ │ ├── XiHaHouFragment.java
│ │ │ ├── YangCongTouFragment.java
│ │ │ └── ClassicFragment.java
│ │ │ ├── MainActivity.java
│ │ │ └── SlidingTab
│ │ │ ├── SlidingTabStrip.java
│ │ │ └── SlidingTabLayout.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── dss886
│ │ │ └── emotionlayout
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── dss886
│ │ └── emotionlayout
│ │ └── ApplicationTest.java
├── proguard-rules.pro
├── build.gradle
└── sample.iml
├── library
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ └── values
│ │ │ │ └── strings.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── dss886
│ │ │ └── emotioninputdetector
│ │ │ └── library
│ │ │ └── EmotionInputDetector.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── dss886
│ │ │ └── emotionlayout
│ │ │ └── library
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── dss886
│ │ └── emotioninputdetector
│ │ └── library
│ │ └── ApplicationTest.java
├── proguard-rules.pro
├── build.gradle
└── library.iml
├── settings.gradle
├── 01.gif
├── 01.png
├── 02.png
├── .gitignore
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── EmotionLayout.iml
├── EmotionInputDetector.iml
├── gradlew.bat
├── README_cn.md
├── README.md
├── gradlew
└── LICENSE.txt
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':library'
2 |
--------------------------------------------------------------------------------
/01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/01.gif
--------------------------------------------------------------------------------
/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/01.png
--------------------------------------------------------------------------------
/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/02.png
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | library
3 |
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em1.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em10.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em11.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em12.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em13.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em14.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em15.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em16.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em17.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em18.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em19.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em2.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em20.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em21.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em22.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em23.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em24.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em25.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em26.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em27.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em28.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em29.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em3.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em30.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em31.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em32.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em33.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em34.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em35.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em36.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em37.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em38.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em39.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em4.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em40.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em41.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em42.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em43.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em44.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em45.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em46.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em47.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em48.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em49.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em5.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em50.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em51.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em52.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em53.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em54.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em55.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em56.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em57.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em58.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em59.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em6.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em60.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em61.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em62.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em63.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em64.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em65.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em66.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em67.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em68.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em69.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em7.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em70.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em71.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em72.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em72.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em73.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em73.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em8.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/em9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/em9.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema0.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema1.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema10.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema11.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema12.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema13.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema14.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema15.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema16.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema17.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema18.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema19.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema2.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema20.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema21.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema22.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema23.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema24.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema25.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema26.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema27.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema28.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema29.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema3.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema30.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema31.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema32.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema33.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema34.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema35.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema36.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema37.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema38.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema39.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema4.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema40.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema41.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema5.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema6.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema7.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema8.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/ema9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/ema9.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb0.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb1.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb10.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb11.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb12.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb13.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb14.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb15.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb16.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb17.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb18.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb19.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb2.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb20.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb21.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb22.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb23.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb24.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb3.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb4.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb5.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb6.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb7.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb8.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emb9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emb9.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc0.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc1.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc10.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc11.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc12.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc13.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc14.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc15.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc16.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc17.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc18.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc19.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc2.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc20.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc21.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc22.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc23.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc24.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc25.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc26.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc27.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc28.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc29.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc3.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc30.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc31.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc32.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc33.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc34.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc35.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc36.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc37.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc38.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc39.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc4.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc40.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc41.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc42.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc43.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc44.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc45.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc46.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc47.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc48.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc49.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc5.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc50.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc51.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc52.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc53.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc54.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc55.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc56.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc57.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc58.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc6.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc7.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc8.gif
--------------------------------------------------------------------------------
/sample/src/main/assets/ems/emc9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/assets/ems/emc9.gif
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/drawable/ic_plus.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_emotion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/drawable/ic_emotion.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dss886/Android-EmotionInputDetector/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | EmotionLayout
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Sep 26 21:54:24 CST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 40dp
7 |
8 |
--------------------------------------------------------------------------------
/sample/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/test/java/com/dss886/emotionlayout/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/library/src/test/java/com/dss886/emotionlayout/library/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.library;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/shape_fast_reply_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/sample/src/androidTest/java/com/dss886/emotionlayout/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/library/src/androidTest/java/com/dss886/emotioninputdetector/library/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.library;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/src/main/res/layout/emotion_gird_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/emotion_gird_item_classic.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #f5f5f5
8 | #dfFFFFFF
9 | #b8b8b8
10 | #FFFFFF
11 | #df000000
12 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/shape_button_reply_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/shape_button_reply_edittext.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
15 |
16 |
17 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/dss886/Applications/android-sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/dss886/Applications/android-sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | group='com.github.dss886'
4 |
5 | android {
6 | compileSdkVersion 23
7 | buildToolsVersion "23.0.0"
8 |
9 | defaultConfig {
10 | minSdkVersion 14
11 | targetSdkVersion 23
12 | versionCode 6
13 | versionName "0.2.0"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | compile fileTree(dir: 'libs', include: ['*.jar'])
25 | testCompile 'junit:junit:4.12'
26 | compile 'com.android.support:appcompat-v7:23.0.1'
27 | }
28 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/widget_tab_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.0"
6 |
7 | defaultConfig {
8 | applicationId "com.dss886.emotionlayout"
9 | minSdkVersion 14
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile project(':library')
25 | testCompile 'junit:junit:4.12'
26 | compile 'com.android.support:appcompat-v7:23.0.1'
27 | compile 'com.android.support:design:23.0.1'
28 | compile 'com.squareup.picasso:picasso:2.5.2'
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/sample/src/main/res/layout/emotion_gird.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
22 |
23 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/emotion_gird_classic.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
22 |
23 |
--------------------------------------------------------------------------------
/EmotionLayout.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/EmotionInputDetector.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/EmotionAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentStatePagerAdapter;
6 | import android.util.SparseArray;
7 | import android.view.ViewGroup;
8 |
9 | /**
10 | * Created by dss886 on 15/9/22.
11 | */
12 | public class EmotionAdapter extends FragmentStatePagerAdapter {
13 | private SparseArray mPages;
14 |
15 | private String[] mTitles;
16 |
17 | public EmotionAdapter(FragmentManager fm, String[] mTitles) {
18 | super(fm);
19 | mPages = new SparseArray();
20 | this.mTitles = mTitles;
21 | }
22 |
23 | @Override
24 | public Fragment getItem(int position) {
25 | Fragment f = null;
26 | switch (position) {
27 | case 0:
28 | f = new ClassicFragment();
29 | break;
30 | case 1:
31 | f = new XiHaHouFragment();
32 | break;
33 | case 2:
34 | f = new TuzkiFragment();
35 | break;
36 | case 3:
37 | f = new YangCongTouFragment();
38 | break;
39 | }
40 | mPages.put(position, f);
41 | return f;
42 | }
43 |
44 | @Override
45 | public int getCount() {
46 | return mTitles.length;
47 | }
48 |
49 | @Override
50 | public void destroyItem(ViewGroup container, int position, Object object) {
51 | if (0 <= mPages.indexOfKey(position)) {
52 | mPages.remove(position);
53 | }
54 | super.destroyItem(container, position, object);
55 | }
56 |
57 | @Override
58 | public CharSequence getPageTitle(int position) {
59 | return mTitles[position];
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/GlobalOnItemClickManager.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.view.View;
4 | import android.widget.AdapterView;
5 | import android.widget.EditText;
6 |
7 | /**
8 | * Created by dss886 on 15/9/22.
9 | */
10 | public class GlobalOnItemClickManager {
11 |
12 | private static GlobalOnItemClickManager instance;
13 | private EditText mEditText;
14 |
15 | public static GlobalOnItemClickManager getInstance() {
16 | if (instance == null) {
17 | instance = new GlobalOnItemClickManager();
18 | }
19 | return instance;
20 | }
21 |
22 | public void attachToEditText(EditText editText) {
23 | mEditText = editText;
24 | }
25 |
26 | public AdapterView.OnItemClickListener getOnItemClickListener(final int emojiType) {
27 | return new AdapterView.OnItemClickListener() {
28 | @Override
29 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
30 | StringBuilder sb = new StringBuilder();
31 | switch (emojiType) {
32 | case 0:
33 | sb.append("[em").append(String.valueOf(position + 1)).append("]");
34 | break;
35 | case 1:
36 | sb.append("[ema").append(String.valueOf(position)).append("]");
37 | break;
38 | case 2:
39 | sb.append("[emb").append(String.valueOf(position)).append("]");
40 | break;
41 | case 3:
42 | sb.append("[emc").append(String.valueOf(position)).append("]");
43 | break;
44 | }
45 | mEditText.append(sb.toString());
46 | }
47 | };
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.content.ContextCompat;
5 | import android.support.v4.view.ViewPager;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.widget.EditText;
9 | import com.dss886.emotioninputdetector.library.EmotionInputDetector;
10 | import com.dss886.emotionlayout.SlidingTab.SlidingTabLayout;
11 | import com.dss886.emotionlayout.viewpager.EmotionAdapter;
12 | import com.dss886.emotionlayout.viewpager.GlobalOnItemClickManager;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | private EmotionInputDetector mDetector;
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_main);
22 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
23 | setSupportActionBar(toolbar);
24 |
25 | mDetector = EmotionInputDetector.with(this)
26 | .setEmotionView(findViewById(R.id.emotion_layout))
27 | .bindToContent(findViewById(R.id.list))
28 | .bindToEditText((EditText) findViewById(R.id.edit_text))
29 | .bindToEmotionButton(findViewById(R.id.emotion_button))
30 | .build();
31 | setUpEmotionViewPager();
32 | }
33 |
34 | @Override
35 | public void onBackPressed() {
36 | if (!mDetector.interceptBackPress()) {
37 | super.onBackPressed();
38 | }
39 | }
40 |
41 | private void setUpEmotionViewPager() {
42 | final String[] titles = new String[]{"经典", "悠嘻猴", "兔斯基", "洋葱头"};
43 | EmotionAdapter mViewPagerAdapter = new EmotionAdapter(getSupportFragmentManager(), titles);
44 | final ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
45 | mViewPager.setAdapter(mViewPagerAdapter);
46 | mViewPager.setCurrentItem(1);
47 |
48 | SlidingTabLayout slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
49 | slidingTabLayout.setCustomTabView(R.layout.widget_tab_indicator, R.id.text);
50 | slidingTabLayout.setSelectedIndicatorColors(ContextCompat.getColor(this, R.color.colorPrimary));
51 | slidingTabLayout.setDistributeEvenly(true);
52 | slidingTabLayout.setViewPager(mViewPager);
53 |
54 | GlobalOnItemClickManager globalOnItemClickListener = GlobalOnItemClickManager.getInstance();
55 | globalOnItemClickListener.attachToEditText((EditText)findViewById(R.id.edit_text));
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/TuzkiFragment.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.BaseAdapter;
10 | import android.widget.GridView;
11 | import android.widget.ImageView;
12 | import com.dss886.emotionlayout.R;
13 | import com.squareup.picasso.Picasso;
14 |
15 | /**
16 | * Created by dss886 on 15/9/22.
17 | */
18 | public class TuzkiFragment extends Fragment {
19 |
20 | private Context mContext;
21 |
22 | @Override
23 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
24 | View view = inflater.inflate(R.layout.emotion_gird, container, false);
25 | BaseAdapter adapter = new TuzkiEmojiAdapter(mContext);
26 | GridView grid = (GridView) view.findViewById(R.id.grid);
27 | grid.setAdapter(adapter);
28 | grid.setOnItemClickListener(GlobalOnItemClickManager.getInstance().getOnItemClickListener(2));
29 | return view;
30 | }
31 |
32 | @Override
33 | public void onAttach(Context context) {
34 | super.onAttach(context);
35 | mContext = context;
36 | }
37 |
38 | private class TuzkiEmojiAdapter extends BaseAdapter {
39 |
40 | private Context mContext;
41 |
42 | public TuzkiEmojiAdapter(Context mContext) {
43 | this.mContext = mContext;
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return 25;
49 | }
50 |
51 | @Override
52 | public Object getItem(int position) {
53 | return null;
54 | }
55 |
56 | @Override
57 | public long getItemId(int position) {
58 | return position;
59 | }
60 |
61 | @Override
62 | public View getView(int position, View convertView, ViewGroup parent) {
63 | ViewHolder holder;
64 | if (convertView == null) {
65 | convertView = LayoutInflater.from(mContext).inflate(R.layout.emotion_gird_item, parent, false);
66 | holder = new ViewHolder();
67 | holder.image = (ImageView) convertView.findViewById(R.id.image);
68 | convertView.setTag(holder);
69 | } else {
70 | holder = (ViewHolder) convertView.getTag();
71 | }
72 | String path = "file:///android_asset/ems/emb" + position + ".gif";
73 | Picasso.with(mContext).load(path).into(holder.image);
74 | return convertView;
75 | }
76 |
77 | private class ViewHolder {
78 | public ImageView image;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/XiHaHouFragment.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.BaseAdapter;
10 | import android.widget.GridView;
11 | import android.widget.ImageView;
12 | import com.dss886.emotionlayout.R;
13 | import com.squareup.picasso.Picasso;
14 |
15 | /**
16 | * Created by dss886 on 15/9/22.
17 | */
18 | public class XiHaHouFragment extends Fragment {
19 |
20 | private Context mContext;
21 |
22 | @Override
23 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
24 | View view = inflater.inflate(R.layout.emotion_gird, container, false);
25 | BaseAdapter adapter = new XiHaHouEmojiAdapter(mContext);
26 | GridView grid = (GridView) view.findViewById(R.id.grid);
27 | grid.setAdapter(adapter);
28 | grid.setOnItemClickListener(GlobalOnItemClickManager.getInstance().getOnItemClickListener(1));
29 | return view;
30 | }
31 |
32 | @Override
33 | public void onAttach(Context context) {
34 | super.onAttach(context);
35 | mContext = context;
36 | }
37 |
38 | private class XiHaHouEmojiAdapter extends BaseAdapter {
39 |
40 | private Context mContext;
41 |
42 | public XiHaHouEmojiAdapter(Context mContext) {
43 | this.mContext = mContext;
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return 42;
49 | }
50 |
51 | @Override
52 | public Object getItem(int position) {
53 | return null;
54 | }
55 |
56 | @Override
57 | public long getItemId(int position) {
58 | return position;
59 | }
60 |
61 | @Override
62 | public View getView(int position, View convertView, ViewGroup parent) {
63 | ViewHolder holder;
64 | if (convertView == null) {
65 | convertView = LayoutInflater.from(mContext).inflate(R.layout.emotion_gird_item, parent, false);
66 | holder = new ViewHolder();
67 | holder.image = (ImageView) convertView.findViewById(R.id.image);
68 | convertView.setTag(holder);
69 | } else {
70 | holder = (ViewHolder) convertView.getTag();
71 | }
72 | String path = "file:///android_asset/ems/ema" + position + ".gif";
73 | Picasso.with(mContext).load(path).into(holder.image);
74 | return convertView;
75 | }
76 |
77 | private class ViewHolder {
78 | public ImageView image;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/YangCongTouFragment.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.BaseAdapter;
10 | import android.widget.GridView;
11 | import android.widget.ImageView;
12 | import com.dss886.emotionlayout.R;
13 | import com.squareup.picasso.Picasso;
14 |
15 | /**
16 | * Created by dss886 on 15/9/22.
17 | */
18 | public class YangCongTouFragment extends Fragment {
19 |
20 | private Context mContext;
21 |
22 | @Override
23 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
24 | View view = inflater.inflate(R.layout.emotion_gird, container, false);
25 | BaseAdapter adapter = new YangCongTouEmojiAdapter(mContext);
26 | GridView grid = (GridView) view.findViewById(R.id.grid);
27 | grid.setAdapter(adapter);
28 | grid.setOnItemClickListener(GlobalOnItemClickManager.getInstance().getOnItemClickListener(3));
29 | return view;
30 | }
31 |
32 | @Override
33 | public void onAttach(Context context) {
34 | super.onAttach(context);
35 | mContext = context;
36 | }
37 |
38 | private class YangCongTouEmojiAdapter extends BaseAdapter {
39 |
40 | private Context mContext;
41 |
42 | public YangCongTouEmojiAdapter(Context mContext) {
43 | this.mContext = mContext;
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return 59;
49 | }
50 |
51 | @Override
52 | public Object getItem(int position) {
53 | return null;
54 | }
55 |
56 | @Override
57 | public long getItemId(int position) {
58 | return position;
59 | }
60 |
61 | @Override
62 | public View getView(int position, View convertView, ViewGroup parent) {
63 | ViewHolder holder;
64 | if (convertView == null) {
65 | convertView = LayoutInflater.from(mContext).inflate(R.layout.emotion_gird_item, parent, false);
66 | holder = new ViewHolder();
67 | holder.image = (ImageView) convertView.findViewById(R.id.image);
68 | convertView.setTag(holder);
69 | } else {
70 | holder = (ViewHolder) convertView.getTag();
71 | }
72 | String path = "file:///android_asset/ems/emc" + position + ".gif";
73 | Picasso.with(mContext).load(path).into(holder.image);
74 | return convertView;
75 | }
76 |
77 | private class ViewHolder {
78 | public ImageView image;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/viewpager/ClassicFragment.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotionlayout.viewpager;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.BaseAdapter;
10 | import android.widget.GridView;
11 | import android.widget.ImageView;
12 | import com.dss886.emotionlayout.R;
13 | import com.squareup.picasso.Picasso;
14 |
15 | /**
16 | * Created by dss886 on 15/9/22.
17 | */
18 | public class ClassicFragment extends Fragment {
19 |
20 | private Context mContext;
21 |
22 | @Override
23 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
24 | View view = inflater.inflate(R.layout.emotion_gird_classic, container, false);
25 | BaseAdapter adapter = new ClassicEmojiAdapter(mContext);
26 | GridView grid = (GridView) view.findViewById(R.id.grid);
27 | grid.setAdapter(adapter);
28 | grid.setOnItemClickListener(GlobalOnItemClickManager.getInstance().getOnItemClickListener(0));
29 | return view;
30 | }
31 |
32 | @Override
33 | public void onAttach(Context context) {
34 | super.onAttach(context);
35 | mContext = context;
36 | }
37 |
38 | private class ClassicEmojiAdapter extends BaseAdapter {
39 |
40 | private Context mContext;
41 |
42 | public ClassicEmojiAdapter(Context mContext) {
43 | this.mContext = mContext;
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return 73;
49 | }
50 |
51 | @Override
52 | public Object getItem(int position) {
53 | return null;
54 | }
55 |
56 | @Override
57 | public long getItemId(int position) {
58 | return position;
59 | }
60 |
61 | @Override
62 | public View getView(int position, View convertView, ViewGroup parent) {
63 | ViewHolder holder;
64 | if (convertView == null) {
65 | convertView = LayoutInflater.from(mContext).inflate(R.layout.emotion_gird_item_classic, parent, false);
66 | holder = new ViewHolder();
67 | holder.image = (ImageView) convertView.findViewById(R.id.image);
68 | convertView.setTag(holder);
69 | } else {
70 | holder = (ViewHolder) convertView.getTag();
71 | }
72 | String path = "file:///android_asset/ems/em" + (position + 1) + ".gif";
73 | Picasso.with(mContext).load(path).into(holder.image);
74 | return convertView;
75 | }
76 |
77 | private class ViewHolder {
78 | public ImageView image;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/README_cn.md:
--------------------------------------------------------------------------------
1 | # EmotionInputDetector
2 |
3 | 
4 |
5 | [For English Version, Click Me >>>](/README.md)
6 |
7 | 一个用来开发表情输入键盘的依赖库,类似于微信,QQ和Telegram
8 |
9 | 
10 |
11 | ## Download
12 |
13 | 在project的build.gradle中加入以下语句
14 |
15 | ~~~
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | maven { url "https://jitpack.io" }
20 | }
21 | }
22 | ~~~
23 |
24 | 在module的build.gradle中加入以下语句
25 |
26 | ~~~
27 | dependencies {
28 | compile 'com.github.dss886:Android-EmotionInputDetector:v0.2.0'
29 | }
30 | ~~~
31 |
32 | ## Usage
33 |
34 | 1.保证整个布局文件根布局为LinearLayout,其中有高度可变化的组件(比如一个ListView或一个RelativeLayout),将其layout_height设为0,将layout_weight设为1
35 |
36 | 2.然后在布局文件的最下方中加入表情输入框的layout
37 |
38 | ~~~xml
39 |
43 |
44 |
50 |
51 |
55 |
56 |
57 | ~~~
58 |
59 | 3.然后新建一个reply_layout,其中的布局可完全自定义,如Sample项目使用了一个ViewPager
60 |
61 | 4.使用EmotionInputDetector
62 |
63 | ~~~java
64 | EmotionInputDetector.with(this)
65 | .setEmotionView(emotionView)
66 | .bindToContent(contentView)
67 | .bindToEditText(editText)
68 | .bindToEmotionButton(emotionButton)
69 | .build();
70 | ~~~
71 |
72 | 这里一共需要设置四个View:
73 |
74 | - emotionView: 显示表情框的Layout
75 | - contentView: 根布局中高度可变化的组件 (如Usage#1中的listview)
76 | - editText: 需要绑定的EditText
77 | - emotionButton: 点击显示/隐藏表情框的按钮
78 |
79 | 这些View的关系:
80 |
81 | 
82 |
83 | 
84 |
85 | ## Options
86 |
87 | 在Activity的onBackPressed函数中使用`EmotionInputDetector.interceptBackPress()`函数判断是否拦截返回键动作,可以得到更好的表现形式。
88 |
89 | ~~~java
90 | @Override
91 | public void onBackPressed() {
92 | if (!mDetector.interceptBackPress()) {
93 | super.onBackPressed();
94 | }
95 | }
96 | ~~~
97 |
98 | ## License
99 |
100 | ~~~
101 | Copyright 2015 dss886
102 |
103 | Licensed under the Apache License, Version 2.0 (the "License");
104 | you may not use this file except in compliance with the License.
105 | You may obtain a copy of the License at
106 |
107 | http://www.apache.org/licenses/LICENSE-2.0
108 |
109 | Unless required by applicable law or agreed to in writing, software
110 | distributed under the License is distributed on an "AS IS" BASIS,
111 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112 | See the License for the specific language governing permissions and
113 | limitations under the License.
114 | ~~~
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EmotionInputDetector
2 |
3 | 
4 |
5 | [简体中文版说明 >>>](/README_cn.md)
6 |
7 | A Library to develop emotion-input layout like WeChat, Telegram, etc.
8 |
9 | 
10 |
11 | ## Download
12 |
13 | Add it in your build.gradle at the end of repositories:
14 |
15 | ~~~
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | maven { url "https://jitpack.io" }
20 | }
21 | }
22 | ~~~
23 |
24 | Add the dependency in the form:
25 |
26 | ~~~
27 | dependencies {
28 | compile 'com.github.dss886:Android-EmotionInputDetector:v0.2.0'
29 | }
30 | ~~~
31 |
32 | ## Usage
33 |
34 | 1.Make sure the root layout of your activity is a LinearLayout, and there are a view/layout of variable height in it (like a ListView or a RelativeLayout). Set the height-variable view/layout's layout_height as 0 and the layout_weight as 1
35 |
36 | 2.Add your custom emotion-input layout at the bottom of your activity layout:
37 |
38 | ~~~xml
39 |
43 |
44 |
50 |
51 |
55 |
56 |
57 | ~~~
58 |
59 | 3.then custom your reply_layout.xml to show editText and emotion layout (e.g using a ViewPager as the Sample module)
60 |
61 | 4.Use EmotionInputDetector
62 |
63 | ~~~java
64 | EmotionInputDetector.with(this)
65 | .setEmotionView(emotionView)
66 | .bindToContent(contentView)
67 | .bindToEditText(editText)
68 | .bindToEmotionButton(emotionButton)
69 | .build();
70 | ~~~
71 |
72 | There are 4 views:
73 |
74 | - emotionView: the layout to show clickable emotions.
75 | - contentView: the height-variable view/layout in the root layout.
76 | - editText: the EditText need to bind.
77 | - emotionButton: the button to switch emotion layout's visibility.
78 |
79 | the relationship of these views:
80 |
81 | 
82 |
83 | 
84 |
85 | ## Options
86 |
87 | For better performance, using `EmotionInputDetector.interceptBackPress()` method in the override method `onBackPressed()` of your activity, to determine whether the back pressed action should be intercepted.
88 |
89 | ~~~java
90 | @Override
91 | public void onBackPressed() {
92 | if (!mDetector.interceptBackPress()) {
93 | super.onBackPressed();
94 | }
95 | }
96 | ~~~
97 |
98 | ## License
99 |
100 | ~~~
101 | Copyright 2015 dss886
102 |
103 | Licensed under the Apache License, Version 2.0 (the "License");
104 | you may not use this file except in compliance with the License.
105 | You may obtain a copy of the License at
106 |
107 | http://www.apache.org/licenses/LICENSE-2.0
108 |
109 | Unless required by applicable law or agreed to in writing, software
110 | distributed under the License is distributed on an "AS IS" BASIS,
111 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112 | See the License for the specific language governing permissions and
113 | limitations under the License.
114 | ~~~
--------------------------------------------------------------------------------
/sample/src/main/res/layout/reply_layout.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
23 |
24 |
30 |
31 |
40 |
41 |
50 |
51 |
57 |
58 |
59 |
66 |
67 |
68 |
72 |
73 |
82 |
83 |
89 |
90 |
95 |
96 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/SlidingTab/SlidingTabStrip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Google Inc. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.dss886.emotionlayout.SlidingTab;
18 |
19 | import android.R;
20 | import android.content.Context;
21 | import android.graphics.Canvas;
22 | import android.graphics.Color;
23 | import android.graphics.Paint;
24 | import android.util.AttributeSet;
25 | import android.util.TypedValue;
26 | import android.view.View;
27 | import android.widget.LinearLayout;
28 |
29 | class SlidingTabStrip extends LinearLayout {
30 |
31 | private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0;
32 | private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26;
33 | private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 3;
34 | private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5;
35 |
36 | private final int mBottomBorderThickness;
37 | private final Paint mBottomBorderPaint;
38 |
39 | private final int mSelectedIndicatorThickness;
40 | private final Paint mSelectedIndicatorPaint;
41 |
42 | private final int mDefaultBottomBorderColor;
43 | private final SimpleTabColorizer mDefaultTabColorizer;
44 | private int mSelectedPosition;
45 | private float mSelectionOffset;
46 | private SlidingTabLayout.TabColorizer mCustomTabColorizer;
47 |
48 | SlidingTabStrip(Context context) {
49 | this(context, null);
50 | }
51 |
52 | SlidingTabStrip(Context context, AttributeSet attrs) {
53 | super(context, attrs);
54 | setWillNotDraw(false);
55 |
56 | final float density = getResources().getDisplayMetrics().density;
57 |
58 | TypedValue outValue = new TypedValue();
59 | context.getTheme().resolveAttribute(R.attr.colorForeground, outValue, true);
60 | final int themeForegroundColor = outValue.data;
61 |
62 | mDefaultBottomBorderColor = setColorAlpha(themeForegroundColor,
63 | DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);
64 |
65 | mDefaultTabColorizer = new SimpleTabColorizer();
66 | mDefaultTabColorizer.setIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR);
67 |
68 | mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
69 | mBottomBorderPaint = new Paint();
70 | mBottomBorderPaint.setColor(mDefaultBottomBorderColor);
71 |
72 | mSelectedIndicatorThickness = (int) (SELECTED_INDICATOR_THICKNESS_DIPS * density);
73 | mSelectedIndicatorPaint = new Paint();
74 | }
75 |
76 | /**
77 | * Set the alpha value of the {@code color} to be the given {@code alpha} value.
78 | */
79 | private static int setColorAlpha(int color, byte alpha) {
80 | return Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color));
81 | }
82 |
83 | /**
84 | * Blend {@code color1} and {@code color2} using the given ratio.
85 | *
86 | * @param ratio of which to blend. 1.0 will return {@code color1}, 0.5 will give an even blend,
87 | * 0.0 will return {@code color2}.
88 | */
89 | private static int blendColors(int color1, int color2, float ratio) {
90 | final float inverseRation = 1f - ratio;
91 | float r = (Color.red(color1) * ratio) + (Color.red(color2) * inverseRation);
92 | float g = (Color.green(color1) * ratio) + (Color.green(color2) * inverseRation);
93 | float b = (Color.blue(color1) * ratio) + (Color.blue(color2) * inverseRation);
94 | return Color.rgb((int) r, (int) g, (int) b);
95 | }
96 |
97 | void setCustomTabColorizer(SlidingTabLayout.TabColorizer customTabColorizer) {
98 | mCustomTabColorizer = customTabColorizer;
99 | invalidate();
100 | }
101 |
102 | void setSelectedIndicatorColors(int... colors) {
103 | // Make sure that the custom colorizer is removed
104 | mCustomTabColorizer = null;
105 | mDefaultTabColorizer.setIndicatorColors(colors);
106 | invalidate();
107 | }
108 |
109 | void onViewPagerPageChanged(int position, float positionOffset) {
110 | mSelectedPosition = position;
111 | mSelectionOffset = positionOffset;
112 | invalidate();
113 | }
114 |
115 | @Override
116 | protected void onDraw(Canvas canvas) {
117 | final int height = getHeight();
118 | final int childCount = getChildCount();
119 | final SlidingTabLayout.TabColorizer tabColorizer = mCustomTabColorizer != null
120 | ? mCustomTabColorizer
121 | : mDefaultTabColorizer;
122 |
123 | // Thick colored underline below the current selection
124 | if (childCount > 0) {
125 | View selectedTitle = getChildAt(mSelectedPosition);
126 | int left = selectedTitle.getLeft();
127 | int right = selectedTitle.getRight();
128 | int color = tabColorizer.getIndicatorColor(mSelectedPosition);
129 |
130 | if (mSelectionOffset > 0f && mSelectedPosition < (getChildCount() - 1)) {
131 | int nextColor = tabColorizer.getIndicatorColor(mSelectedPosition + 1);
132 | if (color != nextColor) {
133 | color = blendColors(nextColor, color, mSelectionOffset);
134 | }
135 |
136 | // Draw the selection partway between the tabs
137 | View nextTitle = getChildAt(mSelectedPosition + 1);
138 | left = (int) (mSelectionOffset * nextTitle.getLeft() +
139 | (1.0f - mSelectionOffset) * left);
140 | right = (int) (mSelectionOffset * nextTitle.getRight() +
141 | (1.0f - mSelectionOffset) * right);
142 | }
143 |
144 | mSelectedIndicatorPaint.setColor(color);
145 |
146 | canvas.drawRect(left, height - mSelectedIndicatorThickness, right,
147 | height, mSelectedIndicatorPaint);
148 | }
149 |
150 | // Thin underline along the entire bottom edge
151 | canvas.drawRect(0, height - mBottomBorderThickness, getWidth(), height, mBottomBorderPaint);
152 | }
153 |
154 | private static class SimpleTabColorizer implements SlidingTabLayout.TabColorizer {
155 | private int[] mIndicatorColors;
156 |
157 | @Override
158 | public final int getIndicatorColor(int position) {
159 | return mIndicatorColors[position % mIndicatorColors.length];
160 | }
161 |
162 | void setIndicatorColors(int... colors) {
163 | mIndicatorColors = colors;
164 | }
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/sample/sample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/library/library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/library/src/main/java/com/dss886/emotioninputdetector/library/EmotionInputDetector.java:
--------------------------------------------------------------------------------
1 | package com.dss886.emotioninputdetector.library;
2 |
3 | import android.annotation.TargetApi;
4 | import android.app.Activity;
5 | import android.content.Context;
6 | import android.content.SharedPreferences;
7 | import android.graphics.Rect;
8 | import android.os.Build;
9 | import android.util.DisplayMetrics;
10 | import android.util.Log;
11 | import android.view.MotionEvent;
12 | import android.view.View;
13 | import android.view.WindowManager;
14 | import android.view.inputmethod.InputMethodManager;
15 | import android.widget.EditText;
16 | import android.widget.LinearLayout;
17 |
18 | /**
19 | * Created by dss886 on 15/9/26.
20 | */
21 | public class EmotionInputDetector {
22 |
23 | private static final String SHARE_PREFERENCE_NAME = "com.dss886.emotioninputdetector";
24 | private static final String SHARE_PREFERENCE_TAG = "soft_input_height";
25 |
26 | private Activity mActivity;
27 | private InputMethodManager mInputManager;
28 | private SharedPreferences sp;
29 | private View mEmotionLayout;
30 | private EditText mEditText;
31 | private View mContentView;
32 |
33 | private EmotionInputDetector() {}
34 |
35 | public static EmotionInputDetector with(Activity activity) {
36 | EmotionInputDetector emotionInputDetector = new EmotionInputDetector();
37 | emotionInputDetector.mActivity = activity;
38 | emotionInputDetector.mInputManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
39 | emotionInputDetector.sp = activity.getSharedPreferences(SHARE_PREFERENCE_NAME, Context.MODE_PRIVATE);
40 | return emotionInputDetector;
41 | }
42 |
43 | public EmotionInputDetector bindToContent(View contentView) {
44 | mContentView = contentView;
45 | return this;
46 | }
47 |
48 | public EmotionInputDetector bindToEditText(EditText editText) {
49 | mEditText = editText;
50 | mEditText.requestFocus();
51 | mEditText.setOnTouchListener(new View.OnTouchListener() {
52 | @Override
53 | public boolean onTouch(View v, MotionEvent event) {
54 | if (event.getAction() == MotionEvent.ACTION_UP && mEmotionLayout.isShown()) {
55 | lockContentHeight();
56 | hideEmotionLayout(true);
57 |
58 | mEditText.postDelayed(new Runnable() {
59 | @Override
60 | public void run() {
61 | unlockContentHeightDelayed();
62 | }
63 | }, 200L);
64 | }
65 | return false;
66 | }
67 | });
68 | return this;
69 | }
70 |
71 | public EmotionInputDetector bindToEmotionButton(View emotionButton) {
72 | emotionButton.setOnClickListener(new View.OnClickListener() {
73 | @Override
74 | public void onClick(View v) {
75 | if (mEmotionLayout.isShown()) {
76 | lockContentHeight();
77 | hideEmotionLayout(true);
78 | unlockContentHeightDelayed();
79 | } else {
80 | if (isSoftInputShown()) {
81 | lockContentHeight();
82 | showEmotionLayout();
83 | unlockContentHeightDelayed();
84 | } else {
85 | showEmotionLayout();
86 | }
87 | }
88 | }
89 | });
90 | return this;
91 | }
92 |
93 | public EmotionInputDetector setEmotionView(View emotionView) {
94 | mEmotionLayout = emotionView;
95 | return this;
96 | }
97 |
98 | public EmotionInputDetector build(){
99 | mActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN |
100 | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
101 | hideSoftInput();
102 | return this;
103 | }
104 |
105 | public boolean interceptBackPress() {
106 | // TODO: 15/11/2 change this method's name
107 | if (mEmotionLayout.isShown()) {
108 | hideEmotionLayout(false);
109 | return true;
110 | }
111 | return false;
112 | }
113 |
114 | private void showEmotionLayout() {
115 | int softInputHeight = getSupportSoftInputHeight();
116 | if (softInputHeight == 0) {
117 | softInputHeight = sp.getInt(SHARE_PREFERENCE_TAG, 400);
118 | }
119 | hideSoftInput();
120 | mEmotionLayout.getLayoutParams().height = softInputHeight;
121 | mEmotionLayout.setVisibility(View.VISIBLE);
122 | }
123 |
124 | private void hideEmotionLayout(boolean showSoftInput) {
125 | if (mEmotionLayout.isShown()) {
126 | mEmotionLayout.setVisibility(View.GONE);
127 | if (showSoftInput) {
128 | showSoftInput();
129 | }
130 | }
131 | }
132 |
133 | private void lockContentHeight() {
134 | LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mContentView.getLayoutParams();
135 | params.height = mContentView.getHeight();
136 | params.weight = 0.0F;
137 | }
138 |
139 | private void unlockContentHeightDelayed() {
140 | mEditText.postDelayed(new Runnable() {
141 | @Override
142 | public void run() {
143 | ((LinearLayout.LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
144 | }
145 | }, 200L);
146 | }
147 |
148 | private void showSoftInput() {
149 | mEditText.requestFocus();
150 | mEditText.post(new Runnable() {
151 | @Override
152 | public void run() {
153 | mInputManager.showSoftInput(mEditText, 0);
154 | }
155 | });
156 | }
157 |
158 | private void hideSoftInput() {
159 | mInputManager.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);
160 | }
161 |
162 | private boolean isSoftInputShown() {
163 | return getSupportSoftInputHeight() != 0;
164 | }
165 |
166 | private int getSupportSoftInputHeight() {
167 | Rect r = new Rect();
168 | mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
169 | int screenHeight = mActivity.getWindow().getDecorView().getRootView().getHeight();
170 | int softInputHeight = screenHeight - r.bottom;
171 | if (Build.VERSION.SDK_INT >= 20) {
172 | // When SDK Level >= 20 (Android L), the softInputHeight will contain the height of softButtonsBar (if has)
173 | softInputHeight = softInputHeight - getSoftButtonsBarHeight();
174 | }
175 | if (softInputHeight < 0) {
176 | Log.w("EmotionInputDetector", "Warning: value of softInputHeight is below zero!");
177 | }
178 | if (softInputHeight > 0) {
179 | sp.edit().putInt(SHARE_PREFERENCE_TAG, softInputHeight).apply();
180 | }
181 | return softInputHeight;
182 | }
183 |
184 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
185 | private int getSoftButtonsBarHeight() {
186 | DisplayMetrics metrics = new DisplayMetrics();
187 | mActivity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
188 | int usableHeight = metrics.heightPixels;
189 | mActivity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
190 | int realHeight = metrics.heightPixels;
191 | if (realHeight > usableHeight) {
192 | return realHeight - usableHeight;
193 | } else {
194 | return 0;
195 | }
196 | }
197 |
198 | }
199 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dss886/emotionlayout/SlidingTab/SlidingTabLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Google Inc. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.dss886.emotionlayout.SlidingTab;
18 |
19 | import android.content.Context;
20 | import android.graphics.Typeface;
21 | import android.support.v4.view.PagerAdapter;
22 | import android.support.v4.view.ViewPager;
23 | import android.util.AttributeSet;
24 | import android.util.SparseArray;
25 | import android.util.TypedValue;
26 | import android.view.Gravity;
27 | import android.view.LayoutInflater;
28 | import android.view.View;
29 | import android.view.ViewGroup;
30 | import android.widget.HorizontalScrollView;
31 | import android.widget.LinearLayout;
32 | import android.widget.TextView;
33 |
34 | /**
35 | * To be used with ViewPager to provide a tab indicator component which give constant feedback as to
36 | * the user's scroll progress.
37 | *
38 | * To use the component, simply add it to your view hierarchy. Then in your
39 | * {@link android.app.Activity} or {@link android.support.v4.app.Fragment} call
40 | * {@link #setViewPager(android.support.v4.view.ViewPager)} providing it the ViewPager this layout is being used for.
41 | *
42 | * The colors can be customized in two ways. The first and simplest is to provide an array of colors
43 | * via {@link #setSelectedIndicatorColors(int...)}. The
44 | * alternative is via the {@link SlidingTabLayout.TabColorizer} interface which provides you complete control over
45 | * which color is used for any individual position.
46 | *
47 | * The views used as tabs can be customized by calling {@link #setCustomTabView(int, int)},
48 | * providing the layout ID of your custom layout.
49 | */
50 | public class SlidingTabLayout extends HorizontalScrollView {
51 | private static final int TITLE_OFFSET_DIPS = 24;
52 | private static final int TAB_VIEW_PADDING_DIPS = 16;
53 | private static final int TAB_VIEW_TEXT_SIZE_SP = 12;
54 | private final SlidingTabStrip mTabStrip;
55 | private int mTitleOffset;
56 |
57 | private int mTabViewLayoutId;
58 | private int mTabViewTextViewId;
59 | private boolean mDistributeEvenly;
60 |
61 | private ViewPager mViewPager;
62 | private SparseArray mContentDescriptions = new SparseArray();
63 | private ViewPager.OnPageChangeListener mViewPagerPageChangeListener;
64 |
65 | public SlidingTabLayout(Context context) {
66 | this(context, null);
67 | }
68 |
69 | public SlidingTabLayout(Context context, AttributeSet attrs) {
70 | this(context, attrs, 0);
71 | }
72 |
73 | public SlidingTabLayout(Context context, AttributeSet attrs, int defStyle) {
74 | super(context, attrs, defStyle);
75 |
76 | // Disable the Scroll Bar
77 | setHorizontalScrollBarEnabled(false);
78 | // Make sure that the Tab Strips fills this View
79 | setFillViewport(true);
80 |
81 | mTitleOffset = (int) (TITLE_OFFSET_DIPS * getResources().getDisplayMetrics().density);
82 |
83 | mTabStrip = new SlidingTabStrip(context);
84 | addView(mTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
85 | }
86 |
87 | /**
88 | * Set the custom {@link SlidingTabLayout.TabColorizer} to be used.
89 | *
90 | * If you only require simple custmisation then you can use
91 | * {@link #setSelectedIndicatorColors(int...)} to achieve
92 | * similar effects.
93 | */
94 | public void setCustomTabColorizer(TabColorizer tabColorizer) {
95 | mTabStrip.setCustomTabColorizer(tabColorizer);
96 | }
97 |
98 | public void setDistributeEvenly(boolean distributeEvenly) {
99 | mDistributeEvenly = distributeEvenly;
100 | }
101 |
102 | /**
103 | * Sets the colors to be used for indicating the selected tab. These colors are treated as a
104 | * circular array. Providing one color will mean that all tabs are indicated with the same color.
105 | */
106 | public void setSelectedIndicatorColors(int... colors) {
107 | mTabStrip.setSelectedIndicatorColors(colors);
108 | }
109 |
110 | /**
111 | * Set the {@link android.support.v4.view.ViewPager.OnPageChangeListener}. When using {@link SlidingTabLayout} you are
112 | * required to set any {@link android.support.v4.view.ViewPager.OnPageChangeListener} through this method. This is so
113 | * that the layout can update it's scroll position correctly.
114 | *
115 | * @see android.support.v4.view.ViewPager#setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener)
116 | */
117 | public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
118 | mViewPagerPageChangeListener = listener;
119 | }
120 |
121 | /**
122 | * Set the custom layout to be inflated for the tab views.
123 | *
124 | * @param layoutResId Layout id to be inflated
125 | * @param textViewId id of the {@link TextView} in the inflated view
126 | */
127 | public void setCustomTabView(int layoutResId, int textViewId) {
128 | mTabViewLayoutId = layoutResId;
129 | mTabViewTextViewId = textViewId;
130 | }
131 |
132 | /**
133 | * Sets the associated view pager. Note that the assumption here is that the pager content
134 | * (number of tabs and tab titles) does not change after this call has been made.
135 | */
136 | public void setViewPager(ViewPager viewPager) {
137 | mTabStrip.removeAllViews();
138 |
139 | mViewPager = viewPager;
140 | if (viewPager != null) {
141 | viewPager.setOnPageChangeListener(new InternalViewPagerListener());
142 | populateTabStrip();
143 | }
144 | }
145 |
146 | /**
147 | * Create a default view to be used for tabs. This is called if a custom tab view is not set via
148 | * {@link #setCustomTabView(int, int)}.
149 | */
150 | protected TextView createDefaultTabView(Context context) {
151 | TextView textView = new TextView(context);
152 | textView.setGravity(Gravity.CENTER);
153 | textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
154 | textView.setTypeface(Typeface.DEFAULT_BOLD);
155 | textView.setLayoutParams(new LinearLayout.LayoutParams(
156 | ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
157 |
158 | TypedValue outValue = new TypedValue();
159 | getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,
160 | outValue, true);
161 | textView.setBackgroundResource(outValue.resourceId);
162 | textView.setAllCaps(true);
163 |
164 | int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
165 | textView.setPadding(padding, padding, padding, padding);
166 |
167 | return textView;
168 | }
169 |
170 | private void populateTabStrip() {
171 | final PagerAdapter adapter = mViewPager.getAdapter();
172 | final OnClickListener tabClickListener = new TabClickListener();
173 |
174 | for (int i = 0; i < adapter.getCount(); i++) {
175 | View tabView = null;
176 | TextView tabTitleView = null;
177 |
178 | if (mTabViewLayoutId != 0) {
179 | // If there is a custom tab view layout id set, try and inflate it
180 | tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip,
181 | false);
182 | tabTitleView = (TextView) tabView.findViewById(mTabViewTextViewId);
183 | }
184 |
185 | if (tabView == null) {
186 | tabView = createDefaultTabView(getContext());
187 | }
188 |
189 | if (tabTitleView == null && TextView.class.isInstance(tabView)) {
190 | tabTitleView = (TextView) tabView;
191 | }
192 |
193 | if (mDistributeEvenly) {
194 | LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabView.getLayoutParams();
195 | lp.width = 0;
196 | lp.weight = 1;
197 | }
198 |
199 | tabTitleView.setText(adapter.getPageTitle(i));
200 | tabView.setOnClickListener(tabClickListener);
201 | String desc = mContentDescriptions.get(i, null);
202 | if (desc != null) {
203 | tabView.setContentDescription(desc);
204 | }
205 |
206 | mTabStrip.addView(tabView);
207 | if (i == mViewPager.getCurrentItem()) {
208 | tabView.setSelected(true);
209 | }
210 | }
211 | }
212 |
213 | public void setContentDescription(int i, String desc) {
214 | mContentDescriptions.put(i, desc);
215 | }
216 |
217 | @Override
218 | protected void onAttachedToWindow() {
219 | super.onAttachedToWindow();
220 |
221 | if (mViewPager != null) {
222 | scrollToTab(mViewPager.getCurrentItem(), 0);
223 | }
224 | }
225 |
226 | private void scrollToTab(int tabIndex, int positionOffset) {
227 | final int tabStripChildCount = mTabStrip.getChildCount();
228 | if (tabStripChildCount == 0 || tabIndex < 0 || tabIndex >= tabStripChildCount) {
229 | return;
230 | }
231 |
232 | View selectedChild = mTabStrip.getChildAt(tabIndex);
233 | if (selectedChild != null) {
234 | int targetScrollX = selectedChild.getLeft() + positionOffset;
235 |
236 | if (tabIndex > 0 || positionOffset > 0) {
237 | // If we're not at the first child and are mid-scroll, make sure we obey the offset
238 | targetScrollX -= mTitleOffset;
239 | }
240 |
241 | scrollTo(targetScrollX, 0);
242 | }
243 | }
244 |
245 | /**
246 | * Allows complete control over the colors drawn in the tab layout. Set with
247 | * {@link #setCustomTabColorizer(SlidingTabLayout.TabColorizer)}.
248 | */
249 | public interface TabColorizer {
250 |
251 | /**
252 | * @return return the color of the indicator used when {@code position} is selected.
253 | */
254 | int getIndicatorColor(int position);
255 |
256 | }
257 |
258 | private class InternalViewPagerListener implements ViewPager.OnPageChangeListener {
259 | private int mScrollState;
260 |
261 | @Override
262 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
263 | int tabStripChildCount = mTabStrip.getChildCount();
264 | if ((tabStripChildCount == 0) || (position < 0) || (position >= tabStripChildCount)) {
265 | return;
266 | }
267 |
268 | mTabStrip.onViewPagerPageChanged(position, positionOffset);
269 |
270 | View selectedTitle = mTabStrip.getChildAt(position);
271 | int extraOffset = (selectedTitle != null)
272 | ? (int) (positionOffset * selectedTitle.getWidth())
273 | : 0;
274 | scrollToTab(position, extraOffset);
275 |
276 | if (mViewPagerPageChangeListener != null) {
277 | mViewPagerPageChangeListener.onPageScrolled(position, positionOffset,
278 | positionOffsetPixels);
279 | }
280 | }
281 |
282 | @Override
283 | public void onPageScrollStateChanged(int state) {
284 | mScrollState = state;
285 |
286 | if (mViewPagerPageChangeListener != null) {
287 | mViewPagerPageChangeListener.onPageScrollStateChanged(state);
288 | }
289 | }
290 |
291 | @Override
292 | public void onPageSelected(int position) {
293 | if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
294 | mTabStrip.onViewPagerPageChanged(position, 0f);
295 | scrollToTab(position, 0);
296 | }
297 | for (int i = 0; i < mTabStrip.getChildCount(); i++) {
298 | mTabStrip.getChildAt(i).setSelected(position == i);
299 | }
300 | if (mViewPagerPageChangeListener != null) {
301 | mViewPagerPageChangeListener.onPageSelected(position);
302 | }
303 | }
304 |
305 | }
306 |
307 | private class TabClickListener implements OnClickListener {
308 | @Override
309 | public void onClick(View v) {
310 | for (int i = 0; i < mTabStrip.getChildCount(); i++) {
311 | if (v == mTabStrip.getChildAt(i)) {
312 | mViewPager.setCurrentItem(i);
313 | return;
314 | }
315 | }
316 | }
317 | }
318 |
319 | }
320 |
--------------------------------------------------------------------------------