├── .gitignore ├── .idea ├── dictionaries │ └── shrikanthravi.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── Explanation Screenshot 1.png ├── Explanation Screenshot 2.png ├── Explanation Screenshot.png ├── LICENSE ├── README.md ├── Sender_Layout.png ├── _config.yml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── shrikanthravi │ │ └── chatviewlibrary │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── fonts │ │ │ ├── product_san_regular.ttf │ │ │ ├── product_sans_bold.ttf │ │ │ ├── product_sans_bold_italic.ttf │ │ │ └── product_sans_italic.ttf │ │ ├── top_bg.jpeg │ │ └── top_bg1.jpg │ ├── java │ │ └── com │ │ │ └── shrikanthravi │ │ │ └── chatviewlibrary │ │ │ ├── App.java │ │ │ ├── ChatViewTestActivity.java │ │ │ ├── DBHandler.java │ │ │ ├── EndlessRecyclerOnScrollListener.java │ │ │ ├── FontChanger.java │ │ │ ├── ImageFFActivity.java │ │ │ ├── Message.java │ │ │ └── ProfileActivity.java │ └── res │ │ ├── anim │ │ └── floating_anim.xml │ │ ├── drawable-hdpi │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ └── send_icon.png │ │ ├── drawable-mdpi │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ └── send_icon.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ └── send_icon.png │ │ ├── drawable-xxhdpi │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ └── send_icon.png │ │ ├── drawable │ │ ├── boy.png │ │ ├── boy1.png │ │ ├── et_bg.xml │ │ ├── girl.png │ │ ├── girl1.png │ │ ├── gradient.xml │ │ ├── gradient1.xml │ │ ├── groot.jpg │ │ ├── hodor.jpeg │ │ ├── ic_launcher_background.xml │ │ ├── left_iv_bg.xml │ │ ├── left_tv_bg.xml │ │ ├── leonardo.jpg │ │ ├── man.png │ │ ├── man1.png │ │ ├── man2.png │ │ ├── man3.png │ │ ├── man4.png │ │ ├── margot.jpg │ │ ├── quick_tv_bg.xml │ │ ├── right_iv_bg.xml │ │ ├── right_tv_bg.xml │ │ └── rounded_corners.xml │ │ ├── layout │ │ ├── activity_chat_view_test.xml │ │ ├── activity_image_ff.xml │ │ ├── activity_profile.xml │ │ └── chat_row_item.xml │ │ ├── menu │ │ └── profile_pic_popup.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── transition │ │ ├── image_transition.xml │ │ ├── profile_pic_transition.xml │ │ └── text_transition.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── provider_paths.xml │ └── test │ └── java │ └── com │ └── shrikanthravi │ └── chatviewlibrary │ └── ExampleUnitTest.java ├── build.gradle ├── chatview library video.gif ├── chatview ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── shrikanthravi │ │ └── chatview │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── fonts │ │ │ ├── product_san_regular.ttf │ │ │ ├── product_sans_bold.ttf │ │ │ ├── product_sans_bold_italic.ttf │ │ │ └── product_sans_italic.ttf │ ├── java │ │ └── com │ │ │ └── shrikanthravi │ │ │ └── chatview │ │ │ ├── activities │ │ │ ├── ImageFFActivity.java │ │ │ └── VideoFFActivity.java │ │ │ ├── data │ │ │ ├── Message.java │ │ │ ├── MessageAdapter.java │ │ │ ├── MessageFilter.java │ │ │ └── VideoPlayer.java │ │ │ ├── utils │ │ │ └── FontChanger.java │ │ │ └── widget │ │ │ └── ChatView.java │ └── res │ │ ├── drawable-hdpi │ │ ├── audio_icon.png │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ ├── send_icon.png │ │ └── video_icon.png │ │ ├── drawable-mdpi │ │ ├── audio_icon.png │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ ├── send_icon.png │ │ └── video_icon.png │ │ ├── drawable-xhdpi │ │ ├── audio_icon.png │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ ├── send_icon.png │ │ └── video_icon.png │ │ ├── drawable-xxhdpi │ │ ├── audio_icon.png │ │ ├── camera_icon.png │ │ ├── clock_icon.png │ │ ├── gallery_icon.png │ │ ├── location_icon.png │ │ ├── media_icon.png │ │ ├── mic_icon.png │ │ ├── profile_icon.png │ │ ├── report_icon.png │ │ ├── search_icon.png │ │ ├── send_icon.png │ │ └── video_icon.png │ │ ├── drawable │ │ ├── boy.png │ │ ├── boy1.png │ │ ├── et_bg.xml │ │ ├── girl.png │ │ ├── girl1.png │ │ ├── gradient.xml │ │ ├── gradient1.xml │ │ ├── groot.jpg │ │ ├── hodor.jpeg │ │ ├── ic_launcher_background.xml │ │ ├── left_iv_bg.xml │ │ ├── left_tv_bg.xml │ │ ├── leonardo.jpg │ │ ├── man.png │ │ ├── man1.png │ │ ├── man2.png │ │ ├── man3.png │ │ ├── man4.png │ │ ├── margot.jpg │ │ ├── progress_drawable_seekbar.xml │ │ ├── quick_tv_bg.xml │ │ ├── right_iv_bg.xml │ │ ├── right_tv_bg.xml │ │ ├── rounded_corners.xml │ │ └── video_controller_bg_gradient.xml │ │ ├── layout │ │ ├── activity_image_ff.xml │ │ ├── activity_video_ff.xml │ │ ├── left_audio_layout.xml │ │ ├── left_image_layout.xml │ │ ├── left_images_layout.xml │ │ ├── left_text_layout.xml │ │ ├── left_typing_layout.xml │ │ ├── left_video_layout.xml │ │ ├── right_audio_layout.xml │ │ ├── right_image_layout.xml │ │ ├── right_images_layout.xml │ │ ├── right_text_layout.xml │ │ ├── right_video_layout.xml │ │ └── widget_chatview.xml │ │ ├── transition │ │ ├── image_transition.xml │ │ ├── profile_pic_transition.xml │ │ └── text_transition.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── shrikanthravi │ └── chatview │ └── ExampleUnitTest.java ├── chatview_library_icon.png ├── chatview_library_icon_1.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/dictionaries/shrikanthravi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Android 36 | 37 | 38 | 39 | 40 | Android 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 52 | 53 | 54 | 55 | 56 | 57 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Explanation Screenshot 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/Explanation Screenshot 1.png -------------------------------------------------------------------------------- /Explanation Screenshot 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/Explanation Screenshot 2.png -------------------------------------------------------------------------------- /Explanation Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/Explanation Screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Shrikanth Ravi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Sender_Layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/Sender_Layout.png -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman 2 | plugins: 3 | - jekyll-seo-tag 4 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.shrikanthravi.chatviewlibrary" 7 | minSdkVersion 21 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(include: ['*.jar'], dir: 'libs') 23 | implementation 'com.android.support:appcompat-v7:27.0.2' 24 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 25 | testImplementation 'junit:junit:4.12' 26 | 27 | compile 'com.android.support:cardview-v7:27.0.2' 28 | compile 'com.android.support:recyclerview-v7:27.0.2' 29 | compile 'com.github.zagum:Android-ExpandIcon:1.2.1' 30 | compile 'com.balysv:material-ripple:1.0.2' 31 | compile 'com.github.SilenceDut:ExpandableLayout:1.2.0' 32 | compile 'jp.wasabeef:recyclerview-animators:2.3.0' 33 | compile 'com.zhihu.android:matisse:0.4.3' 34 | compile 'com.squareup.picasso:picasso:2.5.2' 35 | implementation 'com.github.chrisbanes:PhotoView:2.1.3' 36 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 37 | compile 'de.hdodenhof:circleimageview:2.2.0' 38 | compile 'com.github.lopei:collageview:0.1.3' 39 | compile 'com.wang.avi:library:2.1.3' 40 | compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14' 41 | 42 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 43 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 44 | implementation project(':chatview') 45 | } 46 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/shrikanthravi/chatviewlibrary/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.shrikanthravi.chatviewlibrary", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/product_san_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/fonts/product_san_regular.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/product_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/fonts/product_sans_bold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/product_sans_bold_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/fonts/product_sans_bold_italic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/product_sans_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/fonts/product_sans_italic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/top_bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/top_bg.jpeg -------------------------------------------------------------------------------- /app/src/main/assets/top_bg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/assets/top_bg1.jpg -------------------------------------------------------------------------------- /app/src/main/java/com/shrikanthravi/chatviewlibrary/App.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | import android.app.Application; 4 | 5 | import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache; 6 | import com.nostra13.universalimageloader.core.DisplayImageOptions; 7 | import com.nostra13.universalimageloader.core.ImageLoader; 8 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 9 | import com.nostra13.universalimageloader.core.assist.ImageScaleType; 10 | import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; 11 | 12 | /** 13 | * Created by shrikanthravi on 16/02/18. 14 | */ 15 | 16 | public class App extends Application { 17 | 18 | @Override 19 | public void onCreate() { 20 | super.onCreate(); 21 | 22 | // UNIVERSAL IMAGE LOADER SETUP 23 | DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() 24 | .resetViewBeforeLoading(true) 25 | .cacheOnDisk(true) 26 | .cacheInMemory(true) 27 | .imageScaleType(ImageScaleType.EXACTLY) 28 | .displayer(new FadeInBitmapDisplayer(300)) 29 | .build(); 30 | 31 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) 32 | .defaultDisplayImageOptions(defaultOptions) 33 | .memoryCache(new WeakMemoryCache()) 34 | .diskCacheSize(100 * 1024 * 1024) 35 | .build(); 36 | 37 | ImageLoader.getInstance().init(config); 38 | // END - UNIVERSAL IMAGE LOADER SETUP 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/shrikanthravi/chatviewlibrary/DBHandler.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | /** 4 | * Created by shrikanthravi on 16/02/18. 5 | */ 6 | 7 | import android.content.ContentValues; 8 | import android.content.Context; 9 | import android.database.Cursor; 10 | import android.database.DatabaseUtils; 11 | import android.database.sqlite.SQLiteDatabase; 12 | import android.database.sqlite.SQLiteOpenHelper; 13 | import android.net.Uri; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | import java.util.StringTokenizer; 18 | 19 | public class DBHandler extends SQLiteOpenHelper { 20 | 21 | public static final String DATABASE_NAME = "ChatUI"; 22 | public static final String TABLE_NAME1 = "ChatDB"; 23 | 24 | 25 | public DBHandler(Context context) { 26 | super(context, DATABASE_NAME, null, 1); 27 | } 28 | 29 | @Override 30 | public void onCreate(SQLiteDatabase db) { 31 | 32 | db.execSQL("create table " + TABLE_NAME1 + " (MID INTEGER PRIMARY KEY AUTOINCREMENT, TYPE TEXT, DATE_TIME TEXT, MESSAGE TEXT,IMAGES TEXT)"); 33 | 34 | } 35 | 36 | @Override 37 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 38 | db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME1); 39 | onCreate(db); 40 | 41 | 42 | } 43 | 44 | 45 | 46 | public int numberOfRows() { 47 | SQLiteDatabase db = this.getReadableDatabase(); 48 | int numRows = (int) DatabaseUtils.queryNumEntries(db, TABLE_NAME1); 49 | return numRows; 50 | } 51 | 52 | 53 | public ArrayList getAllMessages(int start,int include){ 54 | ArrayList chat = new ArrayList<>(); 55 | SQLiteDatabase db = this.getReadableDatabase(); 56 | Cursor res = db.rawQuery("select * from " + TABLE_NAME1+" order by MID desc LIMIT "+start+", "+include, null); 57 | res.moveToFirst(); 58 | while (res.isAfterLast() == false) { 59 | String[] images = res.getString(res.getColumnIndex("IMAGES")).split("#"); 60 | List imagesList = new ArrayList<>(); 61 | for(int i=0;i getAllMessages(){ 72 | ArrayList chat = new ArrayList<>(); 73 | SQLiteDatabase db = this.getReadableDatabase(); 74 | Cursor res = db.rawQuery("select * from " + TABLE_NAME1, null); 75 | res.moveToFirst(); 76 | while (res.isAfterLast() == false) { 77 | String[] images = res.getString(res.getColumnIndex("IMAGES")).split("#"); 78 | List imagesList = new ArrayList<>(); 79 | for(int i=0;i mPreviousTotal) { 33 | mLoading = false; 34 | mPreviousTotal = totalItemCount; 35 | } 36 | } 37 | int visibleThreshold = 5; 38 | if (!mLoading && (totalItemCount - visibleItemCount) 39 | <= (firstVisibleItem + visibleThreshold)) { 40 | // End has been reached 41 | 42 | onLoadMore(); 43 | 44 | mLoading = true; 45 | } 46 | } 47 | 48 | public abstract void onLoadMore(); 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/shrikanthravi/chatviewlibrary/FontChanger.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | import android.graphics.Typeface; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.TextView; 7 | 8 | /** 9 | * Created by shrikanthravi on 16/02/18. 10 | */ 11 | 12 | public class FontChanger { 13 | private Typeface typeface; 14 | 15 | public FontChanger(Typeface typeface){ 16 | this.typeface = typeface; 17 | } 18 | 19 | public void replaceFonts(ViewGroup viewTree){ 20 | View child; 21 | for(int i=0;i imageList; 16 | List quickList; 17 | 18 | public Message(String type, String body, String time) { 19 | this.type = type; 20 | this.body = body; 21 | this.time = time; 22 | } 23 | 24 | public Message(String type, String body, String time, String status) { 25 | this.type = type; 26 | this.body = body; 27 | this.time = time; 28 | this.status = status; 29 | } 30 | 31 | public Message(String type, String body, String time, List imageList) { 32 | this.type = type; 33 | this.body = body; 34 | this.time = time; 35 | this.imageList = imageList; 36 | } 37 | 38 | public Message( String type, String body, List quickList) { 39 | this.type = type; 40 | this.body = body; 41 | this.quickList = quickList; 42 | } 43 | 44 | public Message(long id, String type, String body, String time, List imageList) { 45 | this.id = id; 46 | this.type = type; 47 | this.body = body; 48 | this.time = time; 49 | this.imageList = imageList; 50 | } 51 | 52 | public Message(long id, String type, String body, String time, String status, List imageList, List quickList) { 53 | this.id = id; 54 | this.type = type; 55 | this.body = body; 56 | this.time = time; 57 | this.status = status; 58 | this.imageList = imageList; 59 | this.quickList = quickList; 60 | } 61 | 62 | public long getId() { 63 | return id; 64 | } 65 | 66 | public void setId(long id) { 67 | this.id = id; 68 | } 69 | 70 | public String getType() { 71 | return type; 72 | } 73 | 74 | public void setType(String type) { 75 | this.type = type; 76 | } 77 | 78 | public String getBody() { 79 | return body; 80 | } 81 | 82 | public void setBody(String body) { 83 | this.body = body; 84 | } 85 | 86 | public String getTime() { 87 | return time; 88 | } 89 | 90 | public void setTime(String time) { 91 | this.time = time; 92 | } 93 | 94 | public String getStatus() { 95 | return status; 96 | } 97 | 98 | public void setStatus(String status) { 99 | this.status = status; 100 | } 101 | 102 | public List getImageList() { 103 | return imageList; 104 | } 105 | 106 | public void setImageList(List imageList) { 107 | this.imageList = imageList; 108 | } 109 | 110 | public List getQuickList() { 111 | return quickList; 112 | } 113 | 114 | public void setQuickList(List quickList) { 115 | this.quickList = quickList; 116 | } 117 | } 118 | 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/shrikanthravi/chatviewlibrary/ProfileActivity.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | 4 | import android.graphics.Typeface; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.transition.TransitionInflater; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | 11 | import com.squareup.picasso.Picasso; 12 | 13 | public class ProfileActivity extends AppCompatActivity { 14 | 15 | Typeface regular,bold; 16 | FontChanger regularFontChanger,boldFontChanger; 17 | ImageView topBgIV; 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_profile); 22 | 23 | 24 | //Changing the font throughout the activity 25 | regular = Typeface.createFromAsset(getAssets(), "fonts/product_san_regular.ttf"); 26 | bold = Typeface.createFromAsset(getAssets(),"fonts/product_sans_bold.ttf"); 27 | regularFontChanger = new FontChanger(regular); 28 | boldFontChanger = new FontChanger(bold); 29 | regularFontChanger.replaceFonts((ViewGroup)this.findViewById(android.R.id.content)); 30 | 31 | topBgIV = findViewById(R.id.topBgIV); 32 | 33 | Picasso.with(getApplicationContext()).load("file:///android_asset/top_bg1.jpg").into(topBgIV); 34 | } 35 | @Override 36 | public void onBackPressed() { 37 | //To support reverse transitions when user clicks the device back button 38 | supportFinishAfterTransition(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/anim/floating_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/camera_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/camera_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clock_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/clock_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/gallery_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/gallery_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/location_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/location_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/media_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/media_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/mic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/mic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/profile_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/profile_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/report_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/report_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/search_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/send_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-hdpi/send_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/camera_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/camera_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clock_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/clock_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/gallery_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/gallery_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/location_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/location_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/media_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/media_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/mic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/mic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/profile_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/profile_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/report_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/report_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/search_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/send_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-mdpi/send_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/camera_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/camera_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clock_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/clock_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/gallery_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/gallery_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/location_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/location_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/media_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/media_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/mic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/profile_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/profile_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/report_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/report_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/search_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/send_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xhdpi/send_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/camera_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/camera_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clock_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/clock_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/gallery_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/gallery_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/location_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/location_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/media_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/media_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/mic_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/profile_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/profile_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/report_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/report_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/search_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/send_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable-xxhdpi/send_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/boy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/boy.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/boy1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/boy1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/et_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/girl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/girl.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/girl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/girl1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/groot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/groot.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/hodor.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/hodor.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/left_iv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/left_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/leonardo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/leonardo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/man.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/man1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/man1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/man2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/man2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/man3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/man3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/man4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/man4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/margot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/drawable/margot.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/quick_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/right_iv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/right_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_chat_view_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 20 | 21 | 22 | 23 | 30 | 31 | 38 | 43 | 51 | 58 | 66 | 72 | 73 | 81 | 89 | 90 | 99 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 117 | 118 | 129 | 134 | 135 | 136 | 137 | 151 | 163 | 164 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_image_ff.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 23 | 24 | 39 | 40 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/chat_row_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 18 | 21 | 22 | 26 | 33 | 37 | 38 | 51 | 52 | 53 | 60 | 68 | 74 | 75 | 76 | 77 | 89 | 90 | 91 | 100 | 104 | 110 | 114 | 126 | 133 | 141 | 147 | 148 | 149 | 150 | 157 | 158 | 159 | 160 | 172 | 173 | 179 | 180 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /app/src/main/res/menu/profile_pic_popup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 12 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/transition/image_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/transition/profile_pic_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/transition/text_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #212121 5 | #e34d1e 6 | #FF28B5A8 7 | #DADADA 8 | 9 | 10 | #11000000 11 | #22000000 12 | #33000000 13 | #44000000 14 | #55000000 15 | #66000000 16 | #77000000 17 | #88000000 18 | #99000000 19 | #aa000000 20 | #bb000000 21 | #cc000000 22 | #dd000000 23 | #ee000000 24 | #ff000000 25 | 26 | #0D000000 27 | #1A000000 28 | #26000000 29 | #33000000 30 | #40000000 31 | #4D000000 32 | #59000000 33 | #66000000 34 | #73000000 35 | #80000000 36 | #8C000000 37 | #99000000 38 | #A6000000 39 | #B3000000 40 | #BF000000 41 | #cc000000 42 | #D9000000 43 | #E6000000 44 | #F2000000 45 | 46 | 47 | #11ffffff 48 | #22ffffff 49 | #33ffffff 50 | #44ffffff 51 | #55ffffff 52 | #66ffffff 53 | #77ffffff 54 | #88ffffff 55 | #99ffffff 56 | #aaffffff 57 | #bbffffff 58 | #ccffffff 59 | #ddffffff 60 | #eeffffff 61 | #ffffffff 62 | 63 | #0Dffffff 64 | #1Affffff 65 | #26ffffff 66 | #33ffffff 67 | #40ffffff 68 | #4Dffffff 69 | #59ffffff 70 | #66ffffff 71 | #73ffffff 72 | #80ffffff 73 | #8Cffffff 74 | #99ffffff 75 | #A6ffffff 76 | #B3ffffff 77 | #BFffffff 78 | #CCffffff 79 | #D9ffffff 80 | #E6ffffff 81 | #F2ffffff 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Chat UI 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/test/java/com/shrikanthravi/chatviewlibrary/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatviewlibrary; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.0.1' 11 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | maven { url 'https://jitpack.io' } 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /chatview library video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview library video.gif -------------------------------------------------------------------------------- /chatview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /chatview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shrikanth7698' 4 | 5 | android { 6 | compileSdkVersion 27 7 | 8 | 9 | 10 | defaultConfig { 11 | minSdkVersion 21 12 | targetSdkVersion 27 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 17 | 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | 32 | 33 | implementation 'com.android.support:appcompat-v7:27.0.2' 34 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 35 | compile 'com.android.support:cardview-v7:27.0.2' 36 | compile 'com.android.support:recyclerview-v7:27.0.2' 37 | compile 'com.github.zagum:Android-ExpandIcon:1.2.1' 38 | compile 'com.balysv:material-ripple:1.0.2' 39 | compile 'com.github.SilenceDut:ExpandableLayout:1.2.0' 40 | compile 'jp.wasabeef:recyclerview-animators:2.3.0' 41 | compile 'com.zhihu.android:matisse:0.4.3' 42 | compile 'com.squareup.picasso:picasso:2.5.2' 43 | implementation 'com.github.chrisbanes:PhotoView:2.1.3' 44 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 45 | compile 'de.hdodenhof:circleimageview:2.2.0' 46 | compile 'com.github.lopei:collageview:0.1.3' 47 | compile 'com.wang.avi:library:2.1.3' 48 | compile 'com.github.marcinmoskala:ArcSeekBar:0.31' 49 | compile 'com.github.ohoussein.playpauseview:playpauseview:1.0.2' 50 | 51 | testImplementation 'junit:junit:4.12' 52 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 53 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 54 | } 55 | -------------------------------------------------------------------------------- /chatview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /chatview/src/androidTest/java/com/shrikanthravi/chatview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.shrikanthravi.chatview.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /chatview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chatview/src/main/assets/fonts/product_san_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/assets/fonts/product_san_regular.ttf -------------------------------------------------------------------------------- /chatview/src/main/assets/fonts/product_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/assets/fonts/product_sans_bold.ttf -------------------------------------------------------------------------------- /chatview/src/main/assets/fonts/product_sans_bold_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/assets/fonts/product_sans_bold_italic.ttf -------------------------------------------------------------------------------- /chatview/src/main/assets/fonts/product_sans_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/assets/fonts/product_sans_italic.ttf -------------------------------------------------------------------------------- /chatview/src/main/java/com/shrikanthravi/chatview/activities/ImageFFActivity.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview.activities; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.transition.TransitionInflater; 6 | import android.view.View; 7 | import android.view.ViewTreeObserver; 8 | import android.view.WindowManager; 9 | 10 | import com.github.chrisbanes.photoview.PhotoView; 11 | import com.shrikanthravi.chatview.R; 12 | import com.squareup.picasso.Picasso; 13 | 14 | public class ImageFFActivity extends AppCompatActivity { 15 | 16 | PhotoView photoView; 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | 21 | if(getSupportActionBar()!=null) { 22 | getSupportActionBar().hide(); 23 | } 24 | 25 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); 26 | setContentView(R.layout.activity_image_ff); 27 | 28 | photoView = findViewById(R.id.photoView); 29 | Picasso.with(getApplicationContext()).load(getIntent().getStringExtra("photoURI")).into(photoView); 30 | getWindow().setSharedElementEnterTransition(TransitionInflater.from(this).inflateTransition(R.transition.image_transition)); 31 | photoView.setTransitionName("photoTransition"); 32 | } 33 | 34 | @Override 35 | public void onBackPressed() { 36 | //To support reverse transitions when user clicks the device back button 37 | supportFinishAfterTransition(); 38 | } 39 | 40 | private void scheduleStartPostponedTransition(final View sharedElement) { 41 | sharedElement.getViewTreeObserver().addOnPreDrawListener( 42 | new ViewTreeObserver.OnPreDrawListener() { 43 | @Override 44 | public boolean onPreDraw() { 45 | sharedElement.getViewTreeObserver().removeOnPreDrawListener(this); 46 | startPostponedEnterTransition(); 47 | return true; 48 | } 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /chatview/src/main/java/com/shrikanthravi/chatview/data/Message.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview.data; 2 | 3 | 4 | import android.net.Uri; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by shrikanthravi on 16/02/18. 10 | */ 11 | 12 | 13 | public class Message { 14 | 15 | 16 | protected String LeftSimpleMessage = "LEFT"; 17 | protected String RightSimpleMessage = "RIGHT"; 18 | protected String LeftSingleImage = "LeftImage"; 19 | protected String RightSingleImage = "RightImage"; 20 | 21 | //Can hold upto 11 images. 22 | protected String LeftMultipleImages = "LeftImages"; 23 | protected String RightMultipleImages = "RightImages"; 24 | 25 | //Single Video 26 | protected String LeftVideo = "LeftVideo"; 27 | protected String RightVideo = "RightVideo"; 28 | 29 | protected String LeftAudio = "LeftAudio"; 30 | protected String RightAudio = "RightAudio"; 31 | 32 | protected long id; 33 | protected MessageType messageType; 34 | protected String type; 35 | protected String body; 36 | protected String time; 37 | protected String status; 38 | protected List imageList; 39 | protected String userName; 40 | protected Uri userIcon; 41 | protected Uri videoUri; 42 | protected Uri audioUri; 43 | protected int indexPosition; 44 | 45 | public enum MessageType{ 46 | LeftSimpleMessage, 47 | RightSimpleImage, 48 | LeftSingleImage, 49 | RightSingleImage, 50 | LeftMultipleImages, 51 | RightMultipleImages, 52 | LeftVideo, 53 | RightVideo, 54 | LeftAudio, 55 | RightAudio 56 | } 57 | 58 | public Message(){ 59 | 60 | } 61 | 62 | public Uri getAudioUri() { 63 | return audioUri; 64 | } 65 | 66 | public void setAudioUri(Uri audioUri) { 67 | this.audioUri = audioUri; 68 | } 69 | 70 | public MessageType getMessageType() { 71 | return messageType; 72 | } 73 | 74 | public void setMessageType(MessageType messageType) { 75 | this.messageType = messageType; 76 | } 77 | 78 | public int getIndexPosition() { 79 | return indexPosition; 80 | } 81 | 82 | public void setIndexPosition(int indexPosition) { 83 | this.indexPosition = indexPosition; 84 | } 85 | 86 | public long getId() { 87 | return id; 88 | } 89 | 90 | public void setId(long id) { 91 | this.id = id; 92 | } 93 | 94 | public String getType() { 95 | return type; 96 | } 97 | 98 | public void setType(String type) { 99 | this.type = type; 100 | } 101 | 102 | public String getBody() { 103 | return body; 104 | } 105 | 106 | public void setBody(String body) { 107 | this.body = body; 108 | } 109 | 110 | public String getTime() { 111 | return time; 112 | } 113 | 114 | public void setTime(String time) { 115 | this.time = time; 116 | } 117 | 118 | public String getStatus() { 119 | return status; 120 | } 121 | 122 | public void setStatus(String status) { 123 | this.status = status; 124 | } 125 | 126 | public List getImageList() { 127 | return imageList; 128 | } 129 | 130 | public void setImageList(List imageList) { 131 | this.imageList = imageList; 132 | } 133 | 134 | public String getUserName() { 135 | return userName; 136 | } 137 | 138 | public void setUserName(String userName) { 139 | this.userName = userName; 140 | } 141 | 142 | public Uri getUserIcon() { 143 | return userIcon; 144 | } 145 | 146 | public void setUserIcon(Uri userIcon) { 147 | this.userIcon = userIcon; 148 | } 149 | 150 | public Uri getVideoUri() { 151 | return videoUri; 152 | } 153 | 154 | public void setVideoUri(Uri videoUri) { 155 | this.videoUri = videoUri; 156 | } 157 | } 158 | 159 | 160 | -------------------------------------------------------------------------------- /chatview/src/main/java/com/shrikanthravi/chatview/data/MessageFilter.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview.data; 2 | 3 | 4 | import android.widget.Filter; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by shrikanthravi on 16/02/18. 11 | */ 12 | 13 | 14 | 15 | class MessageFilter extends Filter { 16 | 17 | private List messageList; 18 | private List filteredMessageList; 19 | private MessageAdapter adapter; 20 | 21 | public MessageFilter(List messageList, MessageAdapter adapter) { 22 | this.adapter = adapter; 23 | this.messageList = messageList; 24 | this.filteredMessageList = new ArrayList(); 25 | } 26 | 27 | @Override 28 | protected FilterResults performFiltering(CharSequence constraint) { 29 | filteredMessageList.clear(); 30 | final FilterResults results = new FilterResults(); 31 | 32 | //here you need to add proper items do filteredMessageList 33 | for (final Message item : messageList) { 34 | if (item.getBody().toLowerCase().trim().contains(constraint.toString().toLowerCase())) { 35 | filteredMessageList.add(item); 36 | } 37 | } 38 | 39 | results.values = filteredMessageList; 40 | results.count = filteredMessageList.size(); 41 | return results; 42 | } 43 | 44 | @Override 45 | protected void publishResults(CharSequence constraint, FilterResults results) { 46 | adapter.setList(filteredMessageList); 47 | adapter.notifyDataSetChanged(); 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /chatview/src/main/java/com/shrikanthravi/chatview/data/VideoPlayer.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview.data; 2 | 3 | import android.content.Context; 4 | import android.graphics.Matrix; 5 | import android.graphics.SurfaceTexture; 6 | import android.media.MediaPlayer; 7 | import android.provider.MediaStore; 8 | import android.util.AttributeSet; 9 | import android.util.Log; 10 | import android.view.Surface; 11 | import android.view.TextureView; 12 | import android.view.View; 13 | 14 | import java.io.IOException; 15 | 16 | import static android.content.ContentValues.TAG; 17 | 18 | /** 19 | * Created by shrikanthravi on 22/02/18. 20 | */ 21 | public class VideoPlayer extends TextureView implements TextureView.SurfaceTextureListener { 22 | 23 | private static String TAG = "VideoPlayer"; 24 | 25 | public enum ScaleType { 26 | CENTER_CROP, TOP, BOTTOM 27 | } 28 | 29 | 30 | /**This flag determines that if current VideoPlayer object is first item of the list if it is first item of list*/ 31 | boolean isFirstListItem; 32 | 33 | boolean isLoaded; 34 | boolean isMpPrepared; 35 | 36 | private float mVideoHeight; 37 | private float mVideoWidth; 38 | 39 | IVideoPreparedListener iVideoPreparedListener; 40 | 41 | Message video; 42 | String url; 43 | MediaPlayer mp; 44 | Surface surface; 45 | SurfaceTexture s; 46 | private ScaleType mScaleType; 47 | 48 | public interface IVideoPreparedListener { 49 | 50 | public void onVideoPrepared(Message video); 51 | } 52 | 53 | public VideoPlayer(Context context) { 54 | super(context); 55 | } 56 | 57 | public VideoPlayer(Context context, AttributeSet attrs) 58 | { 59 | super(context, attrs); 60 | } 61 | 62 | public void loadVideo(String localPath, Message video) { 63 | 64 | this.url = localPath; 65 | this.video = video; 66 | isLoaded = true; 67 | 68 | if (this.isAvailable()) { 69 | prepareVideo(getSurfaceTexture()); 70 | } 71 | 72 | setSurfaceTextureListener(this); 73 | } 74 | 75 | @Override 76 | public void onSurfaceTextureAvailable(final SurfaceTexture surface, int width, int height) { 77 | isMpPrepared = false; 78 | prepareVideo(surface); 79 | } 80 | 81 | @Override 82 | public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { 83 | 84 | } 85 | 86 | @Override 87 | public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { 88 | 89 | if(mp!=null) 90 | { 91 | mp.stop(); 92 | mp.reset(); 93 | mp.release(); 94 | mp = null; 95 | } 96 | 97 | return false; 98 | } 99 | 100 | @Override 101 | public void onSurfaceTextureUpdated(SurfaceTexture surface) { 102 | } 103 | 104 | public void setScaleType(ScaleType scaleType) { 105 | mScaleType = scaleType; 106 | } 107 | 108 | private void updateTextureViewSize() { 109 | float viewWidth = getWidth(); 110 | float viewHeight = getHeight(); 111 | 112 | float scaleX = 1.0f; 113 | float scaleY = 1.0f; 114 | 115 | if (mVideoWidth > viewWidth && mVideoHeight > viewHeight) { 116 | scaleX = mVideoWidth / viewWidth; 117 | scaleY = mVideoHeight / viewHeight; 118 | } else if (mVideoWidth < viewWidth && mVideoHeight < viewHeight) { 119 | scaleY = viewWidth / mVideoWidth; 120 | scaleX = viewHeight / mVideoHeight; 121 | } else if (viewWidth > mVideoWidth) { 122 | scaleY = (viewWidth / mVideoWidth) / (viewHeight / mVideoHeight); 123 | } else if (viewHeight > mVideoHeight) { 124 | scaleX = (viewHeight / mVideoHeight) / (viewWidth / mVideoWidth); 125 | } 126 | 127 | // Calculate pivot points, in our case crop from center 128 | int pivotPointX; 129 | int pivotPointY; 130 | 131 | switch (mScaleType) { 132 | case TOP: 133 | pivotPointX = 0; 134 | pivotPointY = 0; 135 | break; 136 | case BOTTOM: 137 | pivotPointX = (int) (viewWidth); 138 | pivotPointY = (int) (viewHeight); 139 | break; 140 | case CENTER_CROP: 141 | pivotPointX = (int) (viewWidth / 2); 142 | pivotPointY = (int) (viewHeight / 2); 143 | break; 144 | default: 145 | pivotPointX = (int) (viewWidth / 2); 146 | pivotPointY = (int) (viewHeight / 2); 147 | break; 148 | } 149 | 150 | Matrix matrix = new Matrix(); 151 | matrix.setScale(scaleX, scaleY, pivotPointX, pivotPointY); 152 | 153 | setTransform(matrix); 154 | } 155 | 156 | 157 | public void prepareVideo(SurfaceTexture t) 158 | { 159 | 160 | this.surface = new Surface(t); 161 | mp = new MediaPlayer(); 162 | mp.setSurface(this.surface); 163 | 164 | try { 165 | mp.setDataSource(url); 166 | mp.prepareAsync(); 167 | 168 | mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { 169 | public void onPrepared(MediaPlayer mp) { 170 | isMpPrepared = true; 171 | mp.setLooping(true); 172 | mp.setVolume(0,0); 173 | mp.setOnVideoSizeChangedListener( 174 | new MediaPlayer.OnVideoSizeChangedListener() { 175 | @Override 176 | public void onVideoSizeChanged(MediaPlayer mp, int width, int height) { 177 | mVideoWidth = width; 178 | mVideoHeight = height; 179 | updateTextureViewSize(); 180 | } 181 | 182 | }); 183 | //startPlay(); 184 | changePlayState(); 185 | //iVideoPreparedListener.onVideoPrepared(video); 186 | //adjustAspectRatio(VideoPlayer.this,mp.getVideoWidth(),mp.getVideoHeight()); 187 | } 188 | 189 | 190 | }); 191 | } catch (IllegalArgumentException e1) { 192 | e1.printStackTrace(); 193 | } catch (SecurityException e1) { 194 | e1.printStackTrace(); 195 | } catch (IllegalStateException e1) { 196 | e1.printStackTrace(); 197 | } catch (IOException e1) { 198 | e1.printStackTrace(); 199 | } 200 | try { 201 | 202 | } catch (IllegalArgumentException e) { 203 | e.printStackTrace(); 204 | } catch (SecurityException e) { 205 | e.printStackTrace(); 206 | } catch (IllegalStateException e) { 207 | e.printStackTrace(); 208 | } 209 | try { 210 | 211 | } catch (IllegalStateException e) { 212 | e.printStackTrace(); 213 | } 214 | 215 | } 216 | 217 | @Override 218 | protected void onAttachedToWindow() { 219 | super.onAttachedToWindow(); 220 | } 221 | 222 | @Override 223 | protected void onVisibilityChanged(View changedView, int visibility) { 224 | super.onVisibilityChanged(changedView, visibility); 225 | } 226 | 227 | public boolean startPlay() 228 | { 229 | if(mp!=null) 230 | if(!mp.isPlaying()) 231 | { 232 | mp.start(); 233 | return true; 234 | } 235 | 236 | return false; 237 | } 238 | 239 | public void pausePlay() 240 | { 241 | if(mp!=null) 242 | mp.pause(); 243 | } 244 | 245 | public void stopPlay() 246 | { 247 | if(mp!=null) 248 | mp.stop(); 249 | } 250 | 251 | public void changePlayState() 252 | { 253 | if(mp!=null) 254 | { 255 | if(mp.isPlaying()) 256 | mp.pause(); 257 | else 258 | mp.start(); 259 | } 260 | 261 | } 262 | 263 | public void setOnVideoPreparedListener(IVideoPreparedListener iVideoPreparedListener) { 264 | this.iVideoPreparedListener = iVideoPreparedListener; 265 | } 266 | 267 | private void adjustAspectRatio(TextureView m_TextureView,int videoWidth, int videoHeight) { 268 | int viewWidth = m_TextureView.getWidth(); 269 | int viewHeight = m_TextureView.getHeight(); 270 | double aspectRatio = (double) videoHeight / videoWidth; 271 | 272 | int newWidth, newHeight; 273 | if (viewHeight > (int) (viewWidth * aspectRatio)) { 274 | // limited by narrow width; restrict height 275 | newWidth = viewWidth; 276 | newHeight = (int) (viewWidth * aspectRatio); 277 | } else { 278 | // limited by short height; restrict width 279 | newWidth = (int) (viewHeight / aspectRatio); 280 | newHeight = viewHeight; 281 | } 282 | int xoff = (viewWidth - newWidth) / 2; 283 | int yoff = (viewHeight - newHeight) / 2; 284 | Log.v(TAG, "video=" + videoWidth + "x" + videoHeight + 285 | " view=" + viewWidth + "x" + viewHeight + 286 | " newView=" + newWidth + "x" + newHeight + 287 | " off=" + xoff + "," + yoff); 288 | 289 | Matrix txform = new Matrix(); 290 | m_TextureView.getTransform(txform); 291 | txform.setScale((float) newWidth / viewWidth, (float) newHeight / viewHeight); 292 | //txform.postRotate(10); // just for fun 293 | txform.postTranslate(xoff, yoff); 294 | m_TextureView.setTransform(txform); 295 | } 296 | 297 | } 298 | -------------------------------------------------------------------------------- /chatview/src/main/java/com/shrikanthravi/chatview/utils/FontChanger.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview.utils; 2 | 3 | 4 | import android.graphics.Typeface; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | 9 | /** 10 | * Created by shrikanthravi on 16/02/18. 11 | */ 12 | 13 | public class FontChanger { 14 | private Typeface typeface; 15 | 16 | public FontChanger(Typeface typeface){ 17 | this.typeface = typeface; 18 | } 19 | 20 | public void replaceFonts(ViewGroup viewTree){ 21 | View child; 22 | for(int i=0;i 2 | 3 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/girl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/girl.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/girl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/girl1.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/gradient1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/groot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/groot.jpg -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/hodor.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/hodor.jpeg -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/left_iv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/left_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/leonardo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/leonardo.jpg -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/man.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/man1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/man1.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/man2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/man2.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/man3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/man3.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/man4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/man4.png -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/margot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview/src/main/res/drawable/margot.jpg -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/progress_drawable_seekbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/quick_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/right_iv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/right_tv_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/rounded_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /chatview/src/main/res/drawable/video_controller_bg_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/activity_image_ff.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/activity_video_ff.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 15 | 24 | 36 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_audio_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 23 | 24 | 34 | 38 | 47 | 53 | 54 | 58 | 59 | 69 | 70 | 71 | 82 | 83 | 84 | 85 | 86 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_image_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 23 | 33 | 34 | 38 | 47 | 53 | 54 | 55 | 62 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_images_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 18 | 22 | 23 | 33 | 34 | 38 | 47 | 53 | 54 | 61 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_text_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 23 | 24 | 34 | 38 | 47 | 53 | 54 | 67 | 68 | 69 | 70 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_typing_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 21 | 27 | 28 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/left_video_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 23 | 33 | 34 | 38 | 47 | 53 | 54 | 55 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/right_audio_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 21 | 32 | 33 | 39 | 44 | 45 | 49 | 50 | 61 | 62 | 63 | 64 | 65 | 66 | 77 | 78 | 87 | 93 | 94 | 95 | 96 | 97 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/right_image_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 20 | 31 | 32 | 38 | 42 | 49 | 57 | 58 | 59 | 60 | 69 | 75 | 76 | 77 | 78 | 79 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/right_images_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 20 | 32 | 33 | 39 | 43 | 50 | 56 | 57 | 58 | 59 | 68 | 74 | 75 | 76 | 77 | 78 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/right_text_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 21 | 32 | 33 | 39 | 43 | 55 | 56 | 57 | 66 | 72 | 73 | 74 | 75 | 76 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /chatview/src/main/res/layout/right_video_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 20 | 31 | 32 | 38 | 42 | 49 | 55 | 56 | 57 | 58 | 67 | 73 | 74 | 75 | 76 | 77 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /chatview/src/main/res/transition/image_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /chatview/src/main/res/transition/profile_pic_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /chatview/src/main/res/transition/text_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /chatview/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /chatview/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #212121 5 | #e34d1e 6 | #FF28B5A8 7 | #DADADA 8 | #ff7e80 9 | 10 | 11 | #11000000 12 | #22000000 13 | #33000000 14 | #44000000 15 | #55000000 16 | #66000000 17 | #77000000 18 | #88000000 19 | #99000000 20 | #aa000000 21 | #bb000000 22 | #cc000000 23 | #dd000000 24 | #ee000000 25 | #ff000000 26 | 27 | #0D000000 28 | #1A000000 29 | #26000000 30 | #33000000 31 | #40000000 32 | #4D000000 33 | #59000000 34 | #66000000 35 | #73000000 36 | #80000000 37 | #8C000000 38 | #99000000 39 | #A6000000 40 | #B3000000 41 | #BF000000 42 | #cc000000 43 | #D9000000 44 | #E6000000 45 | #F2000000 46 | 47 | 48 | #11ffffff 49 | #22ffffff 50 | #33ffffff 51 | #44ffffff 52 | #55ffffff 53 | #66ffffff 54 | #77ffffff 55 | #88ffffff 56 | #99ffffff 57 | #aaffffff 58 | #bbffffff 59 | #ccffffff 60 | #ddffffff 61 | #eeffffff 62 | #ffffffff 63 | 64 | #0Dffffff 65 | #1Affffff 66 | #26ffffff 67 | #33ffffff 68 | #40ffffff 69 | #4Dffffff 70 | #59ffffff 71 | #66ffffff 72 | #73ffffff 73 | #80ffffff 74 | #8Cffffff 75 | #99ffffff 76 | #A6ffffff 77 | #B3ffffff 78 | #BFffffff 79 | #CCffffff 80 | #D9ffffff 81 | #E6ffffff 82 | #F2ffffff 83 | 84 | -------------------------------------------------------------------------------- /chatview/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17sp 4 | -------------------------------------------------------------------------------- /chatview/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChatView 3 | 4 | -------------------------------------------------------------------------------- /chatview/src/test/java/com/shrikanthravi/chatview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.shrikanthravi.chatview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /chatview_library_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview_library_icon.png -------------------------------------------------------------------------------- /chatview_library_icon_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/chatview_library_icon_1.png -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrikanth7698/ChatView/76c8410ff781a30e5bc3a2542b6c2eb78ad042ab/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Feb 12 16:42:22 IST 2018 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /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 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':chatview' 2 | --------------------------------------------------------------------------------