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 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RooyeKhat committed Feb 18, 2019
1 parent 6f82447 commit 176d4e6
Show file tree
Hide file tree
Showing 162 changed files with 10,628 additions and 6,024 deletions.
15 changes: 9 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ android {

defaultConfig {
applicationId "net.iGap"
minSdkVersion 15
minSdkVersion 16
targetSdkVersion 27
versionCode 80
versionName "0.9.6"
versionCode 84
versionName "1.0.0"
multiDexEnabled true
useLibrary 'org.apache.http.legacy'
vectorDrawables.useSupportLibrary = true

ndk {
Expand Down Expand Up @@ -71,11 +72,11 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':libwebrtc')
implementation 'org.webrtc:google-webrtc:1.0.23995'
implementation('com.afollestad.material-dialogs:core:0.9.6.0') {
transitive = true
}
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true
}
implementation project(path: ':lvl')
Expand Down Expand Up @@ -136,7 +137,7 @@ dependencies {
}
implementation 'com.github.RooyeKhat-Media:Websocket:1.0.0'
implementation 'com.github.RooyeKhat-Media:MessageProgress:1.0.0'
implementation 'com.github.RooyeKhat-Media:Proto:Build91_Lite'
implementation 'com.github.RooyeKhat-Media:Proto:Build96'
implementation project(':pecpayment-release')
implementation project(':raadcore')
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
Expand All @@ -148,6 +149,8 @@ dependencies {
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'com.google.code.gson:gson:2.8.5'
}

configurations.all {
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-feature
android:glEsVersion="0x00020000"
Expand All @@ -65,7 +66,7 @@
android:name=".module.CustomButtonListener"
android:exported="false" />
<receiver
android:name=".helper.HelperNotificationAndBadge$RemoteActionReceiver"
android:name=".helper.HelperNotification$RemoteActionReceiver"
android:exported="false" />
<receiver android:name=".module.MyPhonStateService">
<intent-filter>
Expand Down Expand Up @@ -260,7 +261,7 @@
<service
android:name="net.iGap.module.AuthenticatorService"
android:exported="true"
android:process=":auth">
>
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
Expand Down Expand Up @@ -329,7 +330,7 @@
<service
android:name=".helper.contact.ContactsSyncAdapterService"
android:exported="true"
android:process=":contacts">
>

<intent-filter>
<action android:name="android.content.SyncAdapter" />
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/net/iGap/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Config {

public static final int ACCEPT = 1;
public static final int REJECT = 0;
public static final int REALM_SCHEMA_VERSION = 23;
public static final int REALM_SCHEMA_VERSION = 26;
public static final int REALM_LATEST_MIGRATION_VERSION = REALM_SCHEMA_VERSION - 1;
public static final int LOOKUP_MAP_RESPONSE_OFFSET = 30000;
public static final int MAX_TEXT_ATTACHMENT_LENGTH = 200;
Expand All @@ -31,6 +31,7 @@ public class Config {
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 long drIgapPeerId = 2297310;

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 Down
9 changes: 7 additions & 2 deletions app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
import android.support.multidex.MultiDexApplication;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.google.firebase.iid.FirebaseInstanceId;
import com.nostra13.universalimageloader.core.ImageLoader;

import net.iGap.activities.ActivityCustomError;
import net.iGap.activities.ActivityMain;
import net.iGap.helper.HelperCheckInternetConnection;
import net.iGap.helper.HelperNotificationAndBadge;
import net.iGap.interfaces.*;
import net.iGap.module.ChatSendMessageUtil;
import net.iGap.module.ChatUpdateStatusUtil;
Expand Down Expand Up @@ -82,7 +83,6 @@ public class G extends MultiDexApplication {
public static Handler handler;
public static long mLastClickTime = SystemClock.elapsedRealtime();
public static LayoutInflater inflater;
public static HelperNotificationAndBadge helperNotificationAndBadge;
public static ConcurrentHashMap<String, RequestWrapper> requestQueueMap = new ConcurrentHashMap<>();
public static List<Long> smsNumbers = new ArrayList<>();
public static AtomicBoolean pullRequestQueueRunned = new AtomicBoolean(false);
Expand Down Expand Up @@ -143,6 +143,7 @@ public class G extends MultiDexApplication {
public static String textSubTheme;
public static String tintImage;
public static String lineBorder;
public static Ipromote ipromote;
public static String menuBackgroundColor;
public static String authorHash;
public static String displayName;
Expand Down Expand Up @@ -258,6 +259,7 @@ public class G extends MultiDexApplication {
public static OnUpdateUserStatusInChangePage onUpdateUserStatusInChangePage;
public static OnLastSeenUpdateTiming onLastSeenUpdateTiming;
public static OnSetAction onSetAction;
public static OnBotClick onBotClick;
public static OnSetActionInRoom onSetActionInRoom;
public static OnUserSessionGetActiveList onUserSessionGetActiveList;
public static OnUserSessionTerminate onUserSessionTerminate;
Expand Down Expand Up @@ -318,6 +320,7 @@ public class G extends MultiDexApplication {
public static OnBackgroundChanged onBackgroundChanged;
public static IClientSearchUserName onClientSearchUserName;
public static OnCallLeaveView onCallLeaveView;
public static OnVideoCallFrame onVideoCallFrame;
public static ICallFinish iCallFinishChat;
public static ICallFinish iCallFinishMain;
public static IMainFinish iMainFinish;
Expand Down Expand Up @@ -361,6 +364,7 @@ public class G extends MultiDexApplication {
public static OnNotifyTime onNotifyTime;
public static OnPayment onPayment;
public static OnMplResult onMplResult;
public static OnVersionCallBack onVersionCallBack;
public static ISignalingOffer iSignalingOffer;
public static ISignalingRinging iSignalingRinging;
public static ISignalingAccept iSignalingAccept;
Expand Down Expand Up @@ -415,6 +419,7 @@ public void run() {
WebBase.apiKey = "5aa7e856ae7fbc00016ac5a01c65909797d94a16a279f46a4abb5faa";

new StartupActions();

}

@Override
Expand Down
119 changes: 100 additions & 19 deletions app/src/main/java/net/iGap/activities/ActivityCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,22 @@
import net.iGap.helper.HelperPermission;
import net.iGap.interfaces.OnCallLeaveView;
import net.iGap.interfaces.OnGetPermission;
import net.iGap.interfaces.OnVideoCallFrame;
import net.iGap.module.MaterialDesignTextView;
import net.iGap.proto.ProtoSignalingOffer;
import net.iGap.viewmodel.ActivityCallViewModel;
import net.iGap.webrtc.WebRTC;

import org.webrtc.EglBase;
import org.webrtc.VideoFrame;

import java.io.IOException;

public class ActivityCall extends ActivityEnhanced implements OnCallLeaveView {
public class ActivityCall extends ActivityEnhanced implements OnCallLeaveView, OnVideoCallFrame {

public static final String USER_ID_STR = "USER_ID";
public static final String INCOMING_CALL_STR = "INCOMING_CALL_STR";
public static final String CALL_TYPE = "CALL_TYPE";
private static final int SENSOR_SENSITIVITY = 4;

//public static TextView txtTimeChat, txtTimerMain;
Expand Down Expand Up @@ -75,6 +81,7 @@ public class ActivityCall extends ActivityEnhanced implements OnCallLeaveView {
private Sensor mProximity;
private ActivityCallViewModel activityCallViewModel;
private ActivityCallBinding activityCallBinding;
private ProtoSignalingOffer.SignalingOffer.Type callTYpe;

/**
* Enables/Disables all child views in a view group.
Expand Down Expand Up @@ -137,37 +144,46 @@ public void onCreate(Bundle savedInstanceState) {

G.isInCall = true;

userId = getIntent().getExtras().getLong(USER_ID_STR);
isIncomingCall = getIntent().getExtras().getBoolean(INCOMING_CALL_STR);
callTYpe = (ProtoSignalingOffer.SignalingOffer.Type) getIntent().getExtras().getSerializable(CALL_TYPE);


try {
HelperPermission.getMicroPhonePermission(this, new OnGetPermission() {
@Override
public void Allow() throws IOException {

if (callTYpe == ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) {

userId = getIntent().getExtras().getLong(USER_ID_STR);
isIncomingCall = getIntent().getExtras().getBoolean(INCOMING_CALL_STR);

//setContentView(R.layout.activity_call);
activityCallBinding = DataBindingUtil.setContentView(ActivityCall.this, R.layout.activity_call);
activityCallViewModel = new ActivityCallViewModel(ActivityCall.this, userId, isIncomingCall, activityCallBinding);
activityCallBinding.setActivityCallViewModel(activityCallViewModel);


initComponent();
//initCallBack();
HelperPermission.getCameraPermission(ActivityCall.this, new OnGetPermission() {
@Override
public void Allow() throws IOException {
init();
}

G.onCallLeaveView = ActivityCall.this;
@Override
public void deny() {
G.isInCall = false;
finish();
if (isIncomingCall) {
WebRTC.getInstance().leaveCall();
}
}
});

if (!isIncomingCall) {
new WebRTC().createOffer(userId);
} else {
init();
}
}

@Override
public void deny() {
G.isInCall = false;
finish();
new WebRTC().leaveCall();
if (isIncomingCall) {
WebRTC.getInstance().leaveCall();
}
}
});
} catch (IOException e) {
Expand All @@ -181,11 +197,36 @@ public void deny() {
onFinishActivity = new OnFinishActivity() {
@Override
public void finishActivity() {

try {
if (callTYpe == ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) {
activityCallBinding.fcrSurfacePeer.release();
activityCallBinding.fcrSurfaceRemote.release();
}
} catch (RuntimeException e) {

}


finish();
}
};
}

private void init() {
WebRTC.getInstance().setCallType(callTYpe);
//setContentView(R.layout.activity_call);
activityCallBinding = DataBindingUtil.setContentView(ActivityCall.this, R.layout.activity_call);
activityCallViewModel = new ActivityCallViewModel(ActivityCall.this, userId, isIncomingCall, activityCallBinding);
activityCallBinding.setActivityCallViewModel(activityCallViewModel);
initComponent();
//initCallBack();
G.onCallLeaveView = ActivityCall.this;
if (!isIncomingCall) {
WebRTC.getInstance().createOffer(userId);
}
}

//***************************************************************************************

@Override
Expand All @@ -206,6 +247,28 @@ public void onLeaveView(String type) {
}

private void initComponent() {

if (callTYpe == ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) {

EglBase rootEglBase = EglBase.create();
activityCallBinding.fcrSurfacePeer.init(rootEglBase.getEglBaseContext(), null);
activityCallBinding.fcrSurfacePeer.setEnableHardwareScaler(true);
activityCallBinding.fcrSurfacePeer.setMirror(true);
activityCallBinding.fcrSurfacePeer.setVisibility(View.VISIBLE);

activityCallBinding.fcrSurfaceRemote.init(rootEglBase.getEglBaseContext(), null);
activityCallBinding.fcrSurfaceRemote.setEnableHardwareScaler(true);
activityCallBinding.fcrSurfaceRemote.setMirror(true);
activityCallBinding.fcrSurfaceRemote.setVisibility(View.VISIBLE);

activityCallBinding.fcrImvBackground.setVisibility(View.GONE);
activityCallBinding.fcrTxtCallType.setText(getResources().getString(R.string.video_calls));

activityCallBinding.fcrBtnSwichCamera.setVisibility(View.VISIBLE);
} else {
activityCallBinding.fcrBtnSwichCamera.setVisibility(View.GONE);
}

verticalSwipe = new VerticalSwipe();
layoutCaller = activityCallBinding.fcrLayoutCaller;

Expand Down Expand Up @@ -316,7 +379,7 @@ private void answer(FrameLayout layoutAnswer, FrameLayout layoutChat) {
layoutAnswer.setVisibility(View.GONE);
layoutChat.setVisibility(View.GONE);

new WebRTC().createAnswer();
WebRTC.getInstance().createAnswer();
cancelRingtone();

btnEndCall.setOnTouchListener(null);
Expand Down Expand Up @@ -453,17 +516,25 @@ private void screenOff() {
@Override
protected void onResume() {
super.onResume();
mSensorManager.registerListener(sensorEventListener, mProximity, SensorManager.SENSOR_DELAY_NORMAL);

if (callTYpe == ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) {
G.onVideoCallFrame = ActivityCall.this;
WebRTC.getInstance().startVideoCapture();
}

mSensorManager.registerListener(sensorEventListener, mProximity, SensorManager.SENSOR_DELAY_NORMAL);
IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);
registerReceiver(headsetPluginReciver, filter);
}

@Override
protected void onPause() {
super.onPause();
if (callTYpe == ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) {
WebRTC.getInstance().pauseVideoCapture();
}
G.onVideoCallFrame = null;
mSensorManager.unregisterListener(sensorEventListener);

unregisterReceiver(headsetPluginReciver);
}

Expand All @@ -479,6 +550,16 @@ private void setUpSwap(View view) {
}
}

@Override
public void onRemoteFrame(VideoFrame videoFrame) {
activityCallBinding.fcrSurfaceRemote.onFrame(videoFrame);
}

@Override
public void onPeerFrame(VideoFrame videoFrame) {
activityCallBinding.fcrSurfacePeer.onFrame(videoFrame);
}

//***************************************************************************************

public interface OnFinishActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.databinding.DataBindingUtil;
import android.databinding.ObservableField;
import android.graphics.Color;
Expand All @@ -35,6 +36,8 @@ public class ActivityEnterPassCode extends ActivityEnhanced {
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
ActivityEnterPassCodeBinding activityEnterPassCodeBinding = DataBindingUtil.setContentView(this, R.layout.activity_enter_pass_code);
activityManageSpaceViewModel = new ActivityEnterPassCodeViewModel(this, activityEnterPassCodeBinding);

Expand Down
Loading

0 comments on commit 176d4e6

Please sign in to comment.