Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Update Matched V 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RooyeKhat committed May 9, 2018
1 parent 029fb17 commit 05a1e83
Show file tree
Hide file tree
Showing 94 changed files with 6,638 additions and 4,982 deletions.
26 changes: 13 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}

dependencies {
classpath 'io.fabric.tools:gradle:1.22.0'
classpath 'io.fabric.tools:gradle:1.25.3'
}
}
apply plugin: 'com.android.application'
Expand All @@ -24,8 +24,8 @@ android {
applicationId "net.iGap"
minSdkVersion 15
targetSdkVersion 25
versionCode 59
versionName "0.5.0"
versionCode 60
versionName "0.6.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -61,9 +61,6 @@ android {

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.mikepenz:fastadapter:3.0.4@aar') {
transitive = true
}
compile project(':messageprogress')
compile project(':proto')
compile project(':websocket')
Expand All @@ -83,10 +80,12 @@ dependencies {
exclude group: 'com.googlecode.mp4parser', module: 'isoparser'
}

compile 'com.mikepenz:fastadapter-commons:3.0.3@aar'
compile 'com.mikepenz:fastadapter-extensions:3.0.3@aar'
compile 'com.mikepenz:materialize:1.0.3@aar'
compile 'com.android.support:multidex:1.0.1'
implementation 'com.mikepenz:fastadapter:3.2.5'
implementation 'com.mikepenz:fastadapter-commons:3.2.5'
implementation 'com.mikepenz:fastadapter-extensions-expandable:3.2.5'
implementation 'com.mikepenz:fastadapter-extensions:3.2.5'

compile 'com.android.support:multidex:1.0.3'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:recyclerview-v7:26.0.2'
Expand All @@ -110,8 +109,8 @@ dependencies {
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.3'
compile 'com.google.zxing:core:3.3.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-analytics:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'me.zhanghai.android.customtabshelper:library:1.0.3'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.4'
compile 'cat.ereza:customactivityoncrash:2.1.0'
Expand All @@ -126,8 +125,9 @@ dependencies {
provided 'com.android.support:support-annotations:26.0.2'
compile group: 'com.github.msarhan', name: 'ummalqura-calendar', version: '1.1.7'
compile 'com.sothree.slidinguppanel:library:3.4.0'
compile 'it.chengdazhi.styleimageview:styleimageview:1.0.4'
compile 'com.github.krokyze:ucropnedit:2.2.2'
implementation 'info.androidhive:imagefilters:1.0.7'
compile 'com.mindorks.android:prdownloader:0.3.0'
}

configurations.all {
Expand Down
2 changes: 0 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# public *;
#}

### TapStream
-keep class com.google.android.gms.ads.identifier.** { *; }

########## My Tricks
-keep class net.iGap.proto.** , com.neovisionaries.ws.client.** { *; }
Expand Down
14 changes: 3 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -90,8 +90,8 @@
<activity
android:name=".activities.ActivityCall"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|locale"
android:launchMode="singleInstance"
android:excludeFromRecents="true">
android:excludeFromRecents="true"
android:launchMode="singleInstance">

<!--
<intent-filter>
Expand Down Expand Up @@ -209,14 +209,6 @@
</intent-filter>
</receiver>

<receiver
android:name="com.tapstream.sdk.ReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

<service android:name=".helper.ServiceContact" />
<service android:name=".module.UploadService" />
<service android:name=".module.MusicPlayer" />
Expand Down
83 changes: 83 additions & 0 deletions app/src/main/assets/filedownloader.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# If you occur exception: 'can't know the size of the download file, and its Transfer-Encoding is not Chunked either',
# but you want to ignore such exception, set true, will deal with it as the case of transfer encoding chunk. default false
#
# If true, will ignore HTTP response header does not has content-length either not chunk transfer
# encoding.
#
# Default false.
http.lenient=false
# The FileDownloadService runs in the separate process ':filedownloader' as default, if you want to
# run the FileDownloadService in the main process, just set true. default false.
process.non-separate=true
# The min buffered so far bytes.
#
# Used for adjudging whether is time to sync the downloaded so far bytes to database and make sure
# sync the downloaded buffer to local file.
#
# More smaller more frequently, then download more slowly, but will more safer in scene of the
# process is killed unexpectedly.
#
# Default 65536, which follow the value in com.android.providers.downloads.Constants.
download.min-progress-step=65536
# The min buffered millisecond.
#
# Used for adjudging whether is time to sync the downloaded so far bytes to database and make sure
# sync the downloaded buffer to local file.
#
# More smaller more frequently, then download more slowly, but will more safer in scene of the
# process is killed unexpectedly.
#
# Default 2000, which follow the value in com.android.providers.downloads.Constants.
download.min-progress-time=2000
# The maximum network thread count for downloading simultaneously.
#
# FileDownloader is designed to download 3 files simultaneously as maximum size as default, and the
# rest of the task is in the FIFO(First In First Out) pending queue.
#
# Because the network resource is limited to one device, it means if FileDownloader start
# downloading tasks unlimited simultaneously, it will be blocked by lack of the network resource,
# and more useless CPU occupy.
#
# The relative efficiency of 3 is higher than others(As Fresco or Picasso do), But for case by case
# FileDownloader is support to configure for this.
#
# Default 3.
# max 12, min 1. If the value more than {@code max} will be replaced with {@code max}; If the value
# less than {@code min} will be replaced with {@code min}.
download.max-network-thread-count=3
# Whether need to pre-allocates the 'content-length' space when start downloading.
#
# FileDownloader is designed to create the file and pre-allocates the 'content-length' space for it
# when start downloading.
#
# Because FileDownloader want to prevent the space is not enough to store coming data in downloading
# state as default.
#
# Default false.
#
file.non-pre-allocation=false
# Whether need to post an broadcast when downloading is completed.
#
# This option is very useful when you download something silent on the background on the filedownloader
# process, and the main process is killed, but you want to do something on the main process when tasks
# are completed downloading on the filedownloader process, so you can set this one to `true`, then
# when a task is completed task, you will receive the broadcast, and the main process will be relaunched
# to handle the broadcast.
#
# If you want to receive such broadcast, you also need to register receiver with
# 'filedownloader.intent.action.completed' action name on 'AndroidManifest.xml'.
#
# You can use FileDownloadBroadcastHandler class to parse the received intent.
#
# Default false.
#
broadcast.completed=false
# Whether you want the first trial connection with HEAD method to request to backend or not.
#
# if this value is true, the first trial connection will with HEAD method instead of GET method and
# then you will reduce 1 byte cost on the response body, but if the backend can't support HEAD
# method you will receive 405 response code and failed to download.
#
# Default false.
#
download.trial-connection-head-method=false
14 changes: 11 additions & 3 deletions app/src/main/java/net/iGap/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class Config {

public static final int ACCEPT = 1;
public static final int REJECT = 0;
public static final int REALM_SCHEMA_VERSION = 16;
public static final int REALM_LATEST_MIGRATION_VERSION = REALM_SCHEMA_VERSION - 1;
public static final int REALM_SCHEMA_VERSION = 17;
public static final int REALM_LATEST_MIGRATION_VERSION = REALM_SCHEMA_VERSION - 1; // 17-1 = 16
public static final int LOOKUP_MAP_RESPONSE_OFFSET = 30000;
public static final int MAX_TEXT_ATTACHMENT_LENGTH = 200;
public static final int MAX_TEXT_LENGTH = 4096;
Expand All @@ -30,6 +30,7 @@ public class Config {
public static final int LIMIT_LOAD_ROOM = 50;
public static final int FAST_START_PAGE_TIME = (int) 20;
public static final int LOW_START_PAGE_TIME = (int) 25;
public static final int PHONE_CONTACT_MAX_COUNT_LIMIT = 9999;

public static final int TIME_OUT_DELAY_MS = (int) (DateUtils.SECOND_IN_MILLIS);
public static final int FAKE_PM_DELAY = (int) (10 * DateUtils.SECOND_IN_MILLIS);
Expand All @@ -46,7 +47,7 @@ public class Config {
public static final int GET_MESSAGE_STATE_TIME_OUT_CHECKING = (int) (DateUtils.SECOND_IN_MILLIS);
public static final int LAST_SEEN_DELAY_CHECKING = (int) (60 * DateUtils.SECOND_IN_MILLIS);
public static final int GET_CONTACT_LIST_TIME_OUT = (int) (60 * DateUtils.SECOND_IN_MILLIS);
public static final int HEART_BEAT_CHECKING_TIME_OUT = (int) (60 * DateUtils.SECOND_IN_MILLIS);
public static final int HEART_BEAT_CHECKING_TIME_OUT = (int) (10 * DateUtils.SECOND_IN_MILLIS);
public static final int UPDATING_TIME_SHOWING = (int) (2 * DateUtils.SECOND_IN_MILLIS);
public static final int CONNECTION_OPEN_TIME_OUT = (int) (20 * DateUtils.SECOND_IN_MILLIS);
public static final int FETCH_CONTACT_TIME_OUT = (int) (5 * DateUtils.SECOND_IN_MILLIS);
Expand Down Expand Up @@ -77,4 +78,11 @@ public class Config {
public static String default_headerTextColor = "#00B0BF";
public static String default_progressColor = "#00B0BF";

public static String default_dark_appBarColor = "#000000";
public static String default_dark_notificationColor = "#000000";
public static String default_dark_toggleButtonColor = "#000000";
public static String default_dark_attachmentColor = "#000000";
public static String default_dark_headerTextColor = "#111111";
public static String default_dark_progressColor = "#ffffff";

}
1 change: 1 addition & 0 deletions app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public class G extends MultiDexApplication {
public static OnReport onReport;
public static OnPhoneContact onPhoneContact;
public static OnContactFetchForServer onContactFetchForServer;
public static OnQueueSendContact onQueueSendContact;
public static OnAudioFocusChangeListener onAudioFocusChangeListener;
public static IDispatchTochEvent dispatchTochEventChat;
public static IOnBackPressed onBackPressedChat;
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/net/iGap/WebSocketClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,19 @@ public static WebSocket getInstance() {
}
}

/**
* detect socket is connected or no
*
* @return true if is connect otherwise return false
*/

public static boolean isConnect() {
if (webSocketClient != null && webSocketClient.isOpen()) {
return true;
}
return false;
}

/**
* check current state of socket for insuring that
* connection established and if socket connection
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/net/iGap/activities/ActivityCrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK && requestCode == AttachFile.request_code_TAKE_PICTURE) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
ImageHelper.correctRotateImage(AttachFile.imagePath, true); //rotate image
uri = Uri.parse(AttachFile.mCurrentPhotoPath);
imgPic.setImageURI(uri);
} else {
Expand Down
13 changes: 5 additions & 8 deletions app/src/main/java/net/iGap/activities/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,10 @@ public void onAppBarLayoutMove(AppBarLayout appBarLayout, int verticalOffset, bo
HelperPermission.getContactPermision(ActivityMain.this, new OnGetPermission() {
@Override
public void Allow() throws IOException {
/**
* set G.isSendContact = false to permitted user
* for import contacts
*/
G.isSendContact = false;
LoginActions.importContact();

if (!G.isSendContact) {
G.isSendContact = true;
LoginActions.importContact();
}
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(SHP_SETTING.KEY_GET_CONTACT, true);
editor.apply();
Expand Down Expand Up @@ -1948,7 +1945,7 @@ private void setDrawerInfo(boolean updateFromServer) {
txtNavName.setText(HelperCalander.convertToUnicodeFarsiNumber(txtNavName.getText().toString()));
}
if (updateFromServer) {
getUserInfo(realmUserInfo);
//getUserInfo(realmUserInfo);
}
setImage();
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/net/iGap/adapter/AdapterChatBackground.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position)
final String path = G.DIR_CHAT_BACKGROUND + "/" + "thumb_" + pf.getCacheId() + "_" + pf.getName();

if (!new File(path).exists()) {
HelperDownloadFile.startDownload(System.currentTimeMillis() + "", pf.getToken(), pf.getCacheId(), pf.getName(), pf.getSmallThumbnail().getSize(), ProtoFileDownload.FileDownload.Selector.SMALL_THUMBNAIL, path, 4, new HelperDownloadFile.UpdateListener() {
HelperDownloadFile.startDownload(System.currentTimeMillis() + "", pf.getToken(), pf.getPublicUrl(), pf.getCacheId(), pf.getName(), pf.getSmallThumbnail().getSize(), ProtoFileDownload.FileDownload.Selector.SMALL_THUMBNAIL, path, 4, new HelperDownloadFile.UpdateListener() {
@Override
public void OnProgress(String mPath, int progress) {
if (progress == 100) {
Expand Down Expand Up @@ -165,7 +165,7 @@ public void run() {
}
});

HelperDownloadFile.startDownload(System.currentTimeMillis() + "", pf.getToken(), pf.getCacheId(), pf.getName(), pf.getSize(), ProtoFileDownload.FileDownload.Selector.FILE, path, 2, new HelperDownloadFile.UpdateListener() {
HelperDownloadFile.startDownload(System.currentTimeMillis() + "", pf.getToken(), pf.getPublicUrl(), pf.getCacheId(), pf.getName(), pf.getSize(), ProtoFileDownload.FileDownload.Selector.FILE, path, 2, new HelperDownloadFile.UpdateListener() {
@Override
public void OnProgress(String mPath, final int progress) {
messageProgress.post(new Runnable() {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/net/iGap/adapter/items/RoomItemA.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
// } else {
// Realm realm1 = Realm.getDefaultInstance();
// RealmResults<RealmRoomMessage> results =
// realm1.where(RealmRoomMessage.class).equalTo(RealmRoomMessageFields.ROOM_ID, mInfo.getId()).findAllSorted(RealmRoomMessageFields.MESSAGE_ID, Sort.DESCENDING);
// realm1.where(RealmRoomMessage.class).equalTo(RealmRoomMessageFields.ROOM_ID, mInfo.getId()).findAll().sort(RealmRoomMessageFields.MESSAGE_ID, Sort.DESCENDING);
// if (!results.isEmpty()) {
// RealmRoomMessage realmRoomMessage = results.first();
// if (realmRoomMessage != null) {
Expand Down Expand Up @@ -391,7 +391,7 @@
//
// private RealmAvatar getLastAvatar(long ownerId) {
// Realm realm = Realm.getDefaultInstance();
// for (RealmAvatar avatar : realm.where(RealmAvatar.class).equalTo(RealmAvatarFields.OWNER_ID, ownerId).findAllSorted(RealmAvatarFields.UID, Sort.DESCENDING)) {
// for (RealmAvatar avatar : realm.where(RealmAvatar.class).equalTo(RealmAvatarFields.OWNER_ID, ownerId).findAll().sort(RealmAvatarFields.UID, Sort.DESCENDING)) {
// if (avatar.getFile() != null) {
// return avatar;
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ private void downLoadThumbnail(final VH holder, final RealmAttachment attachment
if (attachment == null) return;

String token = attachment.getToken();
String url = attachment.getUrl();
String name = attachment.getName();

long size = 0;
Expand All @@ -1376,13 +1377,12 @@ private void downLoadThumbnail(final VH holder, final RealmAttachment attachment

if (token != null && token.length() > 0 && size > 0) {

HelperDownloadFile.startDownload(mMessage.messageID, token, attachment.getCacheId(), name, size, selector, "", 4, new HelperDownloadFile.UpdateListener() {
HelperDownloadFile.startDownload(mMessage.messageID, token, url, attachment.getCacheId(), name, size, selector, "", 4, new HelperDownloadFile.UpdateListener() {
@Override
public void OnProgress(final String path, int progress) {

if (FragmentChat.canUpdateAfterDownload) {
if (progress == 100) {

G.handler.post(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -1421,6 +1421,7 @@ void downLoadFile(final VH holder, final RealmAttachment attachment, int priorit


final String token = attachment.getToken();
final String url = attachment.getUrl();
String name = attachment.getName();
Long size = attachment.getSize();
ProtoFileDownload.FileDownload.Selector selector = ProtoFileDownload.FileDownload.Selector.FILE;
Expand All @@ -1435,7 +1436,7 @@ void downLoadFile(final VH holder, final RealmAttachment attachment, int priorit
progressBar.withDrawable(R.drawable.ic_cancel, false);


HelperDownloadFile.startDownload(mMessage.messageID, token, attachment.getCacheId(), name, size, selector, _path, priority, new HelperDownloadFile.UpdateListener() {
HelperDownloadFile.startDownload(mMessage.messageID, token, url, attachment.getCacheId(), name, size, selector, _path, priority, new HelperDownloadFile.UpdateListener() {
@Override
public void OnProgress(final String path, final int progress) {

Expand All @@ -1445,6 +1446,7 @@ public void OnProgress(final String path, final int progress) {
public void run() {
if (progressBar.getTag() != null && progressBar.getTag().equals(mMessage.messageID)) {
progressBar.withProgress(progress);

if (progress == 100) {

if (messageType == ProtoGlobal.RoomMessageType.AUDIO || messageType == ProtoGlobal.RoomMessageType.AUDIO_TEXT || messageType == ProtoGlobal.RoomMessageType.VOICE) {
Expand All @@ -1469,7 +1471,6 @@ public void OnError(String token) {
@Override
public void run() {
if (progressBar.getTag() != null && progressBar.getTag().equals(mMessage.messageID)) {

progressBar.withProgress(0);
progressBar.withDrawable(R.drawable.ic_download, true);

Expand Down
Loading

0 comments on commit 05a1e83

Please sign in to comment.