Skip to content

Commit

Permalink
Merge pull request #12 from RooyeKhat-Media/master
Browse files Browse the repository at this point in the history
Update Matched V 0.6.4
  • Loading branch information
RooyeKhat authored May 30, 2018
2 parents 9a066ad + 980e3bd commit 831344e
Show file tree
Hide file tree
Showing 110 changed files with 11,976 additions and 7,191 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId "net.iGap"
minSdkVersion 15
targetSdkVersion 25
versionCode 61
versionName "0.6.1"
versionCode 64
versionName "0.6.4"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -68,7 +68,7 @@ dependencies {
compile('com.afollestad.material-dialogs:core:0.9.4.5') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
compile('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
transitive = true
}

Expand All @@ -92,7 +92,7 @@ dependencies {
compile 'com.android.support:design:26.0.2'
compile 'com.vicmikhailau:MaskedEditText:1.1.1'
compile 'com.uncopt:android.justified:1.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.5.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
compile 'com.android.support:percent:26.0.2'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3@aar'
compile 'com.android.support:cardview-v7:26.0.2'
Expand All @@ -114,8 +114,8 @@ dependencies {
compile 'me.zhanghai.android.customtabshelper:library:1.0.3'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.4'
compile 'cat.ereza:customactivityoncrash:2.1.0'
compile 'com.github.RooyeKhat-Media.Emoji:emoji-one:0.5.1.Fix2'
compile 'io.realm:android-adapters:2.1.1'
compile 'com.github.RooyeKhat-Media.Emoji:emoji-one:0.5.1.Fix6'
compile 'io.realm:android-adapters:3.0.0'
compile 'org.osmdroid:osmdroid-android:5.6.5'
compile 'io.fotoapparat.fotoapparat:library:1.3.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<uses-feature
android:glEsVersion="0x00020000"
Expand All @@ -54,8 +55,12 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="allowBackup">
<receiver android:name=".module.MusicPlayer$customButtonListener" />
<receiver android:name=".helper.HelperNotificationAndBadge$RemoteActionReceiver" />
<receiver
android:name=".module.CustomButtonListener"
android:exported="false" />
<receiver
android:name=".helper.HelperNotificationAndBadge$RemoteActionReceiver"
android:exported="false" />
<receiver android:name=".module.MyPhonStateService">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
Expand All @@ -70,6 +75,7 @@
android:name=".activities.ActivityEnterPassCode"
android:configChanges="keyboard|orientation|screenSize|locale" />

<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" />
<activity
android:name=".activities.ActivityPopUpNotification"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|locale"
Expand Down Expand Up @@ -237,7 +243,7 @@

<meta-data
android:name="io.fabric.ApiKey"
android:value="Your_Fabric_Key" />
android:value="Your_Fabric_key" />

<!--
The API key for Google Maps-based APIs is defined as a string resource.
Expand Down
25 changes: 23 additions & 2 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 = 17;
public static final int REALM_LATEST_MIGRATION_VERSION = REALM_SCHEMA_VERSION - 1; // 17-1 = 16
public static final int REALM_SCHEMA_VERSION = 18;
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;
public static final int MAX_TEXT_LENGTH = 4096;
Expand Down Expand Up @@ -86,4 +86,25 @@ public class Config {
public static String default_dark_headerTextColor = "#ffffff";
public static String default_dark_progressColor = "#ffffff";

public static void darkThemeColor() {
G.backgroundTheme = "#151515";
G.textTitleTheme = "#ffffff";
G.textSubTheme = "#ffffff";
G.tintImage = "#ffffff";
G.backgroundTheme_2 = "#000000";
G.logLineTheme = "#4b4b4b";
G.voteIconTheme = "#cacaca";
}

public static void lightThemeColor() {
G.backgroundTheme = "#FFFFFF";
G.textTitleTheme = "#000000";
G.textSubTheme = "#bbbbbb";
G.tintImage = "#000000";
G.backgroundTheme_2 = "#f9f9f9";
G.logLineTheme = "#e9e9e9";
G.voteIconTheme = "#696969";

}

}
60 changes: 42 additions & 18 deletions app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.support.multidex.MultiDexApplication;
Expand All @@ -30,7 +32,6 @@
import net.iGap.activities.ActivityCustomError;
import net.iGap.activities.ActivityMain;
import net.iGap.helper.HelperCheckInternetConnection;
import net.iGap.helper.HelperLogMessage;
import net.iGap.helper.HelperNotificationAndBadge;
import net.iGap.interfaces.*;
import net.iGap.module.ChatSendMessageUtil;
Expand Down Expand Up @@ -88,7 +89,6 @@ public class G extends MultiDexApplication {
public static ArrayList<Integer> forcePriorityActionId = new ArrayList<>();
public static HashMap<Integer, String> lookupMap = new HashMap<>();
public static HashMap<String, ArrayList<Object>> requestQueueRelationMap = new HashMap<>();
public static HashMap<Long, HelperLogMessage.StructLog> logMessageUpdatList = new HashMap<>();
public static HashMap<Integer, Integer> priorityActionId = new HashMap<>();
public static Activity currentActivity;
public static FragmentActivity fragmentActivity;
Expand Down Expand Up @@ -298,6 +298,7 @@ public class G extends MultiDexApplication {
public static OnContactsGetList onContactsGetList;
public static OnCallLogClear onCallLogClear;
public static OnMapUsersGet onMapUsersGet;
public static OnPinedMessage onPinedMessage;
public static OnSelectMenu onSelectMenu;
public static OnRemoveFragment onRemoveFragment;
public static OnChatDeleteInRoomList onChatDeleteInRoomList;
Expand All @@ -323,11 +324,13 @@ public class G extends MultiDexApplication {
public static OnGeoGetComment onGeoGetComment;
public static OnMapRegisterState onMapRegisterState;
public static OnMapRegisterStateMain onMapRegisterStateMain;
public static OpenBottomSheetItem openBottomSheetItem;
public static OnUnreadChange onUnreadChange;
public static OnMapClose onMapClose;
public static OnRegistrationInfo onRegistrationInfo;
public static OnGeoCommentResponse onGeoCommentResponse;
public static OnGeoGetConfiguration onGeoGetConfiguration;
public static OnNotifyTime onNotifyTime;
public static ISignalingOffer iSignalingOffer;
public static ISignalingRinging iSignalingRinging;
public static ISignalingAccept iSignalingAccept;
Expand All @@ -348,22 +351,10 @@ public class G extends MultiDexApplication {
public static boolean isRestartActivity = false; // for check passCode
public static boolean isFirstPassCode = true; // for check passCode
public static boolean multiTab = false;
public static boolean isTimeWhole = false;
public static FragmentManager fragmentManager;
private Tracker mTracker;

public static void checkLanguage() {
try {
String selectedLanguage = G.selectedLanguage;
if (selectedLanguage == null) return;
Locale locale = new Locale(selectedLanguage);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public void onCreate() {
Expand All @@ -379,7 +370,6 @@ public void run() {
}
}).start();


context = getApplicationContext();
handler = new Handler();
inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Expand All @@ -389,11 +379,45 @@ public void run() {

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
//MultiDex.install(this);
super.attachBaseContext(updateResources(base));
new MultiDexUtils().getLoadedExternalDexClasses(this);
}

public static Context updateResources(Context baseContext) {
String selectedLanguage = G.selectedLanguage;
if (selectedLanguage == null) {
selectedLanguage = "en";
}

Locale locale = new Locale(selectedLanguage);
Locale.setDefault(locale);

Resources res = baseContext.getResources();
Configuration configuration = res.getConfiguration();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
configuration.setLocale(locale);
} else {
configuration.locale = locale;
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
baseContext = baseContext.createConfigurationContext(configuration);
} else {
res.updateConfiguration(configuration, res.getDisplayMetrics());
}

G.context = baseContext;

return baseContext;
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
updateResources(this);
}

synchronized public Tracker getDefaultTracker() {
if (mTracker == null) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/net/iGap/activities/ActivityCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
Expand All @@ -39,11 +40,14 @@
import net.iGap.interfaces.OnCallLeaveView;
import net.iGap.interfaces.OnGetPermission;
import net.iGap.module.MaterialDesignTextView;
import net.iGap.module.SHP_SETTING;
import net.iGap.viewmodel.ActivityCallViewModel;
import net.iGap.webrtc.WebRTC;

import java.io.IOException;

import static net.iGap.G.context;

public class ActivityCall extends ActivityEnhanced implements OnCallLeaveView {

public static final String USER_ID_STR = "USER_ID";
Expand Down Expand Up @@ -122,6 +126,13 @@ public void onCreate(Bundle savedInstanceState) {
// requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN | LayoutParams.FLAG_KEEP_SCREEN_ON | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKED | LayoutParams.FLAG_TURN_SCREEN_ON);

SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (preferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false)) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
}

super.onCreate(savedInstanceState);

if (isGoingfromApp) {
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/net/iGap/activities/ActivityCustomError.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
package net.iGap.activities;

import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import net.iGap.G;
import net.iGap.R;
import net.iGap.module.SHP_SETTING;

import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
import cat.ereza.customactivityoncrash.config.CaocConfig;

import static net.iGap.G.context;

public class ActivityCustomError extends ActivityEnhanced {

@Override
public void onCreate(Bundle savedInstanceState) {
SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (G.isDarkTheme) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
}
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_custom_error);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/net/iGap/activities/ActivityEnhanced.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onReceive(Context context, Intent intent) {

@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
super.attachBaseContext(CalligraphyContextWrapper.wrap(G.updateResources(newBase)));
}

@Override
Expand All @@ -83,7 +83,7 @@ protected void onResume() {
}

public void onCreate(Bundle savedInstanceState) {
G.checkLanguage();

checkFont();

IntentFilter screenStateFilter = new IntentFilter();
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/net/iGap/activities/ActivityEnterPassCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,33 @@
* All rights reserved.
*/

import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.os.Build;
import android.os.Bundle;

import net.iGap.G;
import net.iGap.R;
import net.iGap.databinding.ActivityEnterPassCodeBinding;
import net.iGap.module.SHP_SETTING;
import net.iGap.viewmodel.ActivityEnterPassCodeViewModel;

import static net.iGap.G.context;

public class ActivityEnterPassCode extends ActivityEnhanced {

private ActivityEnterPassCodeViewModel activityManageSpaceViewModel;

@Override
public void onCreate(Bundle savedInstanceState) {

SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (G.isDarkTheme) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
}

super.onCreate(savedInstanceState);
ActivityEnterPassCodeBinding activityEnterPassCodeBinding = DataBindingUtil.setContentView(this, R.layout.activity_enter_pass_code);
activityManageSpaceViewModel = new ActivityEnterPassCodeViewModel(this, activityEnterPassCodeBinding.getRoot());
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/net/iGap/activities/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public void finishActivity() {
}
}
SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (preferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false)) {
if (G.isDarkTheme) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.databinding.DataBindingUtil;
import android.os.Bundle;

import net.iGap.G;
import net.iGap.R;
import net.iGap.databinding.ActivityManageSpaceBinding;
import net.iGap.libs.rippleeffect.RippleView;
Expand All @@ -18,7 +19,7 @@ public class ActivityManageSpace extends ActivityEnhanced {
public void onCreate(Bundle savedInstanceState) {

SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (preferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false)) {
if (G.isDarkTheme) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
Expand Down
Loading

0 comments on commit 831344e

Please sign in to comment.